You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
Merge commit 'eeadcdfd1a6f3089b6bf6e194d6ece8d3f113123'
* commit 'eeadcdfd1a6f3089b6bf6e194d6ece8d3f113123':
LucasArts SMUSH demuxer
Conflicts:
Changelog
doc/general.texi
libavformat/smush.c
libavformat/version.h
See: bef8fd7099
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -279,6 +279,7 @@ version 1.0:
|
|||||||
- showwaves and showspectrum filter
|
- showwaves and showspectrum filter
|
||||||
- LucasArts SMUSH SANM playback support
|
- LucasArts SMUSH SANM playback support
|
||||||
- LucasArts SMUSH VIMA audio decoder (ADPCM)
|
- LucasArts SMUSH VIMA audio decoder (ADPCM)
|
||||||
|
- LucasArts SMUSH demuxer
|
||||||
- SAMI, RealText and SubViewer demuxers and decoders
|
- SAMI, RealText and SubViewer demuxers and decoders
|
||||||
- Heart Of Darkness PAF playback support
|
- Heart Of Darkness PAF playback support
|
||||||
- iec61883 device
|
- iec61883 device
|
||||||
|
@@ -20,11 +20,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "libavutil/intreadwrite.h"
|
#include "libavutil/intreadwrite.h"
|
||||||
#include "avformat.h"
|
|
||||||
#include "internal.h"
|
|
||||||
#include "avio.h"
|
|
||||||
|
|
||||||
typedef struct {
|
#include "avformat.h"
|
||||||
|
#include "avio.h"
|
||||||
|
#include "internal.h"
|
||||||
|
|
||||||
|
typedef struct SMUSHContext {
|
||||||
int version;
|
int version;
|
||||||
int audio_stream_index;
|
int audio_stream_index;
|
||||||
int video_stream_index;
|
int video_stream_index;
|
||||||
@@ -65,6 +66,8 @@ static int smush_read_header(AVFormatContext *ctx)
|
|||||||
smush->version = 0;
|
smush->version = 0;
|
||||||
subversion = avio_rl16(pb);
|
subversion = avio_rl16(pb);
|
||||||
nframes = avio_rl16(pb);
|
nframes = avio_rl16(pb);
|
||||||
|
if (!nframes)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
avio_skip(pb, 2); // skip pad
|
avio_skip(pb, 2); // skip pad
|
||||||
|
|
||||||
@@ -83,6 +86,9 @@ static int smush_read_header(AVFormatContext *ctx)
|
|||||||
smush->version = 1;
|
smush->version = 1;
|
||||||
subversion = avio_rl16(pb);
|
subversion = avio_rl16(pb);
|
||||||
nframes = avio_rl32(pb);
|
nframes = avio_rl32(pb);
|
||||||
|
if (!nframes)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
avio_skip(pb, 2); // skip pad
|
avio_skip(pb, 2); // skip pad
|
||||||
width = avio_rl16(pb);
|
width = avio_rl16(pb);
|
||||||
height = avio_rl16(pb);
|
height = avio_rl16(pb);
|
||||||
@@ -106,7 +112,13 @@ static int smush_read_header(AVFormatContext *ctx)
|
|||||||
case MKBETAG('W', 'a', 'v', 'e'):
|
case MKBETAG('W', 'a', 'v', 'e'):
|
||||||
got_audio = 1;
|
got_audio = 1;
|
||||||
sample_rate = avio_rl32(pb);
|
sample_rate = avio_rl32(pb);
|
||||||
|
if (!sample_rate)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
channels = avio_rl32(pb);
|
channels = avio_rl32(pb);
|
||||||
|
if (!channels)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
avio_skip(pb, chunk_size - 8);
|
avio_skip(pb, chunk_size - 8);
|
||||||
read += chunk_size;
|
read += chunk_size;
|
||||||
break;
|
break;
|
||||||
@@ -133,17 +145,18 @@ static int smush_read_header(AVFormatContext *ctx)
|
|||||||
|
|
||||||
smush->video_stream_index = vst->index;
|
smush->video_stream_index = vst->index;
|
||||||
|
|
||||||
|
avpriv_set_pts_info(vst, 64, 1, 15);
|
||||||
|
|
||||||
vst->start_time = 0;
|
vst->start_time = 0;
|
||||||
vst->duration =
|
vst->duration =
|
||||||
vst->nb_frames = nframes;
|
vst->nb_frames = nframes;
|
||||||
|
vst->avg_frame_rate = av_inv_q(vst->time_base);
|
||||||
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||||
vst->codec->codec_id = AV_CODEC_ID_SANM;
|
vst->codec->codec_id = AV_CODEC_ID_SANM;
|
||||||
vst->codec->codec_tag = 0;
|
vst->codec->codec_tag = 0;
|
||||||
vst->codec->width = width;
|
vst->codec->width = width;
|
||||||
vst->codec->height = height;
|
vst->codec->height = height;
|
||||||
|
|
||||||
avpriv_set_pts_info(vst, 64, 66667, 1000000);
|
|
||||||
|
|
||||||
if (!smush->version) {
|
if (!smush->version) {
|
||||||
if (ff_alloc_extradata(vst->codec, 1024 + 2))
|
if (ff_alloc_extradata(vst->codec, 1024 + 2))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -162,7 +175,7 @@ static int smush_read_header(AVFormatContext *ctx)
|
|||||||
|
|
||||||
ast->start_time = 0;
|
ast->start_time = 0;
|
||||||
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||||
ast->codec->codec_id = AV_CODEC_ID_VIMA;
|
ast->codec->codec_id = AV_CODEC_ID_ADPCM_VIMA;
|
||||||
ast->codec->codec_tag = 0;
|
ast->codec->codec_tag = 0;
|
||||||
ast->codec->sample_rate = sample_rate;
|
ast->codec->sample_rate = sample_rate;
|
||||||
ast->codec->channels = channels;
|
ast->codec->channels = channels;
|
||||||
@@ -178,6 +191,7 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
|
|||||||
SMUSHContext *smush = ctx->priv_data;
|
SMUSHContext *smush = ctx->priv_data;
|
||||||
AVIOContext *pb = ctx->pb;
|
AVIOContext *pb = ctx->pb;
|
||||||
int done = 0;
|
int done = 0;
|
||||||
|
int ret;
|
||||||
|
|
||||||
while (!done) {
|
while (!done) {
|
||||||
uint32_t sig, size;
|
uint32_t sig, size;
|
||||||
@@ -192,15 +206,15 @@ static int smush_read_packet(AVFormatContext *ctx, AVPacket *pkt)
|
|||||||
case MKBETAG('F', 'R', 'M', 'E'):
|
case MKBETAG('F', 'R', 'M', 'E'):
|
||||||
if (smush->version)
|
if (smush->version)
|
||||||
break;
|
break;
|
||||||
if (av_get_packet(pb, pkt, size) < 0)
|
if ((ret = av_get_packet(pb, pkt, size)) < 0)
|
||||||
return AVERROR(EIO);
|
return ret;
|
||||||
|
|
||||||
pkt->stream_index = smush->video_stream_index;
|
pkt->stream_index = smush->video_stream_index;
|
||||||
done = 1;
|
done = 1;
|
||||||
break;
|
break;
|
||||||
case MKBETAG('B', 'l', '1', '6'):
|
case MKBETAG('B', 'l', '1', '6'):
|
||||||
if (av_get_packet(pb, pkt, size) < 0)
|
if ((ret = av_get_packet(pb, pkt, size)) < 0)
|
||||||
return AVERROR(EIO);
|
return ret;
|
||||||
|
|
||||||
pkt->stream_index = smush->video_stream_index;
|
pkt->stream_index = smush->video_stream_index;
|
||||||
pkt->duration = 1;
|
pkt->duration = 1;
|
||||||
|
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_MAJOR 55
|
#define LIBAVFORMAT_VERSION_MAJOR 55
|
||||||
#define LIBAVFORMAT_VERSION_MINOR 36
|
#define LIBAVFORMAT_VERSION_MINOR 36
|
||||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
#define LIBAVFORMAT_VERSION_MICRO 102
|
||||||
|
|
||||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||||
LIBAVFORMAT_VERSION_MINOR, \
|
LIBAVFORMAT_VERSION_MINOR, \
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#tb 0: 66667/1000000
|
#tb 0: 1/15
|
||||||
0, 0, 0, 1, 921600, 0x00000000
|
0, 0, 0, 1, 921600, 0x00000000
|
||||||
0, 1, 1, 1, 921600, 0x00000000
|
0, 1, 1, 1, 921600, 0x00000000
|
||||||
0, 2, 2, 1, 921600, 0x00000000
|
0, 2, 2, 1, 921600, 0x00000000
|
||||||
|
Reference in New Issue
Block a user