diff options
author | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:58:15 +0100 |
---|---|---|
committer | Derek Buitenhuis <derek.buitenhuis@gmail.com> | 2016-04-10 20:59:55 +0100 |
commit | 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994 (patch) | |
tree | 0c2ec8349ff1763d5f48454b8b9f26374dbd80b0 /libavformat/wtvdec.c | |
parent | 60b75186b2c878b6257b43c8fcc0b1356ada218e (diff) | |
parent | 9200514ad8717c63f82101dc394f4378854325bf (diff) | |
download | ffmpeg-6f69f7a8bf6a0d013985578df2ef42ee6b1c7994.tar.gz |
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
* commit '9200514ad8717c63f82101dc394f4378854325bf':
lavf: replace AVStream.codec with AVStream.codecpar
This has been a HUGE effort from:
- Derek Buitenhuis <derek.buitenhuis@gmail.com>
- Hendrik Leppkes <h.leppkes@gmail.com>
- wm4 <nfxjfg@googlemail.com>
- Clément Bœsch <clement@stupeflix.com>
- James Almer <jamrial@gmail.com>
- Michael Niedermayer <michael@niedermayer.cc>
- Rostislav Pehlivanov <atomnuker@gmail.com>
Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat/wtvdec.c')
-rw-r--r-- | libavformat/wtvdec.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c index 1c3aa26f4a..39547f092c 100644 --- a/libavformat/wtvdec.c +++ b/libavformat/wtvdec.c @@ -447,8 +447,8 @@ static void get_attachment(AVFormatContext *s, AVIOContext *pb, int length) if (!st) goto done; av_dict_set(&st->metadata, "title", description, 0); - st->codec->codec_type = AVMEDIA_TYPE_VIDEO; - st->codec->codec_id = AV_CODEC_ID_MJPEG; + st->codecpar->codec_type = AVMEDIA_TYPE_VIDEO; + st->codecpar->codec_id = AV_CODEC_ID_MJPEG; st->id = -1; ret = av_get_packet(pb, &st->attached_pic, filesize); if (ret < 0) @@ -565,7 +565,7 @@ static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st) AVIOContext *pb = wtv->pb; avio_skip(pb, 72); // picture aspect ratio is unreliable - st->codec->codec_tag = ff_get_bmp_header(pb, st, NULL); + st->codecpar->codec_tag = ff_get_bmp_header(pb, st, NULL); return 72 + 40; } @@ -576,23 +576,23 @@ static int parse_videoinfoheader2(AVFormatContext *s, AVStream *st) static void parse_mpeg1waveformatex(AVStream *st) { /* fwHeadLayer */ - switch (AV_RL16(st->codec->extradata)) { - case 0x0001 : st->codec->codec_id = AV_CODEC_ID_MP1; break; - case 0x0002 : st->codec->codec_id = AV_CODEC_ID_MP2; break; - case 0x0004 : st->codec->codec_id = AV_CODEC_ID_MP3; break; + switch (AV_RL16(st->codecpar->extradata)) { + case 0x0001 : st->codecpar->codec_id = AV_CODEC_ID_MP1; break; + case 0x0002 : st->codecpar->codec_id = AV_CODEC_ID_MP2; break; + case 0x0004 : st->codecpar->codec_id = AV_CODEC_ID_MP3; break; } - st->codec->bit_rate = AV_RL32(st->codec->extradata + 2); /* dwHeadBitrate */ + st->codecpar->bit_rate = AV_RL32(st->codecpar->extradata + 2); /* dwHeadBitrate */ /* dwHeadMode */ - switch (AV_RL16(st->codec->extradata + 6)) { + switch (AV_RL16(st->codecpar->extradata + 6)) { case 1 : case 2 : - case 4 : st->codec->channels = 2; - st->codec->channel_layout = AV_CH_LAYOUT_STEREO; + case 4 : st->codecpar->channels = 2; + st->codecpar->channel_layout = AV_CH_LAYOUT_STEREO; break; - case 8 : st->codec->channels = 1; - st->codec->channel_layout = AV_CH_LAYOUT_MONO; + case 8 : st->codecpar->channels = 1; + st->codecpar->channel_layout = AV_CH_LAYOUT_MONO; break; } } @@ -605,9 +605,9 @@ static void parse_mpeg1waveformatex(AVStream *st) static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int codec_type) { if (st) { - if (st->codec->extradata) { - av_freep(&st->codec->extradata); - st->codec->extradata_size = 0; + if (st->codecpar->extradata) { + av_freep(&st->codecpar->extradata); + st->codecpar->extradata_size = 0; } } else { WtvStream *wst = av_mallocz(sizeof(WtvStream)); @@ -621,7 +621,7 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code st->id = sid; st->priv_data = wst; } - st->codec->codec_type = codec_type; + st->codecpar->codec_type = codec_type; st->need_parsing = AVSTREAM_PARSE_FULL; avpriv_set_pts_info(st, 64, 1, 10000000); return st; @@ -666,7 +666,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, if (!st) return NULL; if (!ff_guidcmp(formattype, ff_format_waveformatex)) { - int ret = ff_get_wav_header(s, pb, st->codec, size, 0); + int ret = ff_get_wav_header(s, pb, st->codecpar, size, 0); if (ret < 0) return NULL; } else { @@ -676,15 +676,15 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, } if (!memcmp(subtype + 4, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12)) { - st->codec->codec_id = ff_wav_codec_get_id(AV_RL32(subtype), st->codec->bits_per_coded_sample); + st->codecpar->codec_id = ff_wav_codec_get_id(AV_RL32(subtype), st->codecpar->bits_per_coded_sample); } else if (!ff_guidcmp(subtype, mediasubtype_mpeg1payload)) { - if (st->codec->extradata && st->codec->extradata_size >= 22) + if (st->codecpar->extradata && st->codecpar->extradata_size >= 22) parse_mpeg1waveformatex(st); else av_log(s, AV_LOG_WARNING, "MPEG1WAVEFORMATEX underflow\n"); } else { - st->codec->codec_id = ff_codec_guid_get_id(ff_codec_wav_guids, subtype); - if (st->codec->codec_id == AV_CODEC_ID_NONE) + st->codecpar->codec_id = ff_codec_guid_get_id(ff_codec_wav_guids, subtype); + if (st->codecpar->codec_id == AV_CODEC_ID_NONE) av_log(s, AV_LOG_WARNING, "unknown subtype:"FF_PRI_GUID"\n", FF_ARG_GUID(subtype)); } return st; @@ -706,11 +706,11 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, } if (!memcmp(subtype + 4, (const uint8_t[]){FF_MEDIASUBTYPE_BASE_GUID}, 12)) { - st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(subtype)); + st->codecpar->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(subtype)); } else { - st->codec->codec_id = ff_codec_guid_get_id(ff_video_guids, subtype); + st->codecpar->codec_id = ff_codec_guid_get_id(ff_video_guids, subtype); } - if (st->codec->codec_id == AV_CODEC_ID_NONE) + if (st->codecpar->codec_id == AV_CODEC_ID_NONE) av_log(s, AV_LOG_WARNING, "unknown subtype:"FF_PRI_GUID"\n", FF_ARG_GUID(subtype)); return st; } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_pes) && @@ -721,7 +721,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, if (ff_guidcmp(formattype, ff_format_none)) av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype)); avio_skip(pb, size); - st->codec->codec_id = AV_CODEC_ID_DVB_SUBTITLE; + st->codecpar->codec_id = AV_CODEC_ID_DVB_SUBTITLE; return st; } else if (!ff_guidcmp(mediatype, mediatype_mstvcaption) && (!ff_guidcmp(subtype, mediasubtype_teletext) || !ff_guidcmp(subtype, mediasubtype_dtvccdata))) { @@ -731,7 +731,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid, if (ff_guidcmp(formattype, ff_format_none)) av_log(s, AV_LOG_WARNING, "unknown formattype:"FF_PRI_GUID"\n", FF_ARG_GUID(formattype)); avio_skip(pb, size); - st->codec->codec_id = !ff_guidcmp(subtype, mediasubtype_teletext) ? AV_CODEC_ID_DVB_TELETEXT : AV_CODEC_ID_EIA_608; + st->codecpar->codec_id = !ff_guidcmp(subtype, mediasubtype_teletext) ? AV_CODEC_ID_DVB_TELETEXT : AV_CODEC_ID_EIA_608; return st; } else if (!ff_guidcmp(mediatype, mediatype_mpeg2_sections) && !ff_guidcmp(subtype, mediasubtype_mpeg2_sections)) { |