Commit 91b5e3f5 authored by Ronald S. Bultje's avatar Ronald S. Bultje

ext/ffmpeg/: Add encode property to codec mapper, so we can get better-fitting...

ext/ffmpeg/: Add encode property to codec mapper, so we can get better-fitting caps. Also use this everywhere. ;). La...

Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect),
(gst_ffmpegenc_register):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_register):
Add encode property to codec mapper, so we can get better-fitting
caps. Also use this everywhere. ;). Lastly, add some new codecIDs
to our list of recognized ones.
parent 24b45f60
2004-03-14 Ronald Bultje <rbultje@ronald.bitfreak.net>
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps):
* ext/ffmpeg/gstffmpegcodecmap.h:
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_chain),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_add),
(gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_connect),
(gst_ffmpegenc_register):
* ext/ffmpeg/gstffmpegmux.c: (gst_ffmpegmux_register):
Add encode property to codec mapper, so we can get better-fitting
caps. Also use this everywhere. ;). Lastly, add some new codecIDs
to our list of recognized ones.
2004-03-12 Thomas Vander Stichele <thomas at apestaart dot org>
* gst-libs/ext/ffmpeg/.pc/applied-patches:
......
This diff is collapsed.
......@@ -33,7 +33,8 @@
GstCaps *
gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
AVCodecContext *context);
AVCodecContext *context,
gboolean encode);
/* _codectype_to_caps () gets the GstCaps that belongs to
* a certain CodecType for a pad with uncompressed data.
......
......@@ -392,6 +392,7 @@ gst_ffmpegdec_chain (GstPad *pad,
(int16_t *) GST_BUFFER_DATA (outbuf),
&have_data,
data, size);
if (have_data) {
GST_BUFFER_SIZE (outbuf) = have_data;
GST_BUFFER_DURATION (outbuf) = (have_data * GST_SECOND) /
......@@ -498,7 +499,7 @@ gst_ffmpegdec_register (GstPlugin *plugin)
}
/* first make sure we've got a supported type */
sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL);
sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
srccaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
if (!sinkcaps || !srccaps)
goto next;
......
......@@ -504,7 +504,7 @@ gst_ffmpegdemux_add (GstFFMpegDemux *demux,
demux->srcpads[stream->index] = pad;
/* get caps that belongs to this stream */
caps = gst_ffmpeg_codecid_to_caps (stream->codec.codec_id, &stream->codec);
caps = gst_ffmpeg_codecid_to_caps (stream->codec.codec_id, &stream->codec, TRUE);
gst_pad_set_explicit_caps (pad, caps);
gst_element_add_pad (GST_ELEMENT (demux), pad);
......@@ -701,7 +701,7 @@ gst_ffmpegdemux_register (GstPlugin *plugin)
videosrccaps = gst_caps_new_empty ();
for (in_codec = first_avcodec; in_codec != NULL;
in_codec = in_codec->next) {
GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL);
GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL, TRUE);
if (!temp) {
continue;
}
......
......@@ -343,7 +343,7 @@ gst_ffmpegenc_connect (GstPad *pad,
/* try to set this caps on the other side */
other_caps = gst_ffmpeg_codecid_to_caps (oclass->in_plugin->id,
ffmpegenc->context);
ffmpegenc->context, TRUE);
if (!other_caps) {
avcodec_close (ffmpegenc->context);
GST_DEBUG ("Unsupported codec - no caps found");
......@@ -638,7 +638,7 @@ gst_ffmpegenc_register (GstPlugin *plugin)
}
/* first make sure we've got a supported type */
srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL);
srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE);
sinkcaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
if (!sinkcaps || !srccaps)
goto next;
......
......@@ -488,7 +488,7 @@ gst_ffmpegmux_register (GstPlugin *plugin)
videosinkcaps = gst_caps_new_empty ();
for (in_codec = first_avcodec; in_codec != NULL;
in_codec = in_codec->next) {
GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL);
GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL, TRUE);
if (!temp) {
continue;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment