[FFmpeg-cvslog] ffmpeg: improve data stream support
Anshul Maheshwari
git at videolan.org
Fri Jan 16 02:59:24 CET 2015
ffmpeg | branch: master | Anshul Maheshwari <anshul.ffmpeg at gmail.com> | Fri Jan 16 02:19:01 2015 +0100| [bb0344dc5582829253cc300a94fab29fb1f63f40] | committer: Michael Niedermayer
ffmpeg: improve data stream support
This adds data codec/stream handling where previously there was only
audio/video/subtitles
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bb0344dc5582829253cc300a94fab29fb1f63f40
---
ffmpeg.c | 2 ++
ffmpeg_opt.c | 5 +++++
2 files changed, 7 insertions(+)
diff --git a/ffmpeg.c b/ffmpeg.c
index c283c96..2a9fe43 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2911,6 +2911,8 @@ static int transcode_init(void)
enc_ctx->height = input_streams[ost->source_index]->st->codec->height;
}
break;
+ case AVMEDIA_TYPE_DATA:
+ break;
default:
abort();
break;
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 5c4df8c..a0c977b 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -804,6 +804,7 @@ static int open_input_file(OptionsContext *o, const char *filename)
char * video_codec_name = NULL;
char * audio_codec_name = NULL;
char *subtitle_codec_name = NULL;
+ char * data_codec_name = NULL;
int scan_all_pmts_set = 0;
if (o->format) {
@@ -864,6 +865,8 @@ static int open_input_file(OptionsContext *o, const char *filename)
find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0)->id : AV_CODEC_ID_NONE;
ic->subtitle_codec_id= subtitle_codec_name ?
find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0)->id : AV_CODEC_ID_NONE;
+ ic->data_codec_id = data_codec_name ?
+ find_codec_or_die(data_codec_name, AVMEDIA_TYPE_DATA, 0)->id : AV_CODEC_ID_NONE;
if (video_codec_name)
av_format_set_video_codec (ic, find_codec_or_die(video_codec_name , AVMEDIA_TYPE_VIDEO , 0));
@@ -871,6 +874,8 @@ static int open_input_file(OptionsContext *o, const char *filename)
av_format_set_audio_codec (ic, find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0));
if (subtitle_codec_name)
av_format_set_subtitle_codec(ic, find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0));
+ if (data_codec_name)
+ av_format_set_data_codec(ic, find_codec_or_die(data_codec_name, AVMEDIA_TYPE_DATA, 0));
ic->flags |= AVFMT_FLAG_NONBLOCK;
ic->interrupt_callback = int_cb;
More information about the ffmpeg-cvslog
mailing list