summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-08 22:43:06 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-08-08 22:43:06 +0200
commitd181dbd7a0e2fa1613c4312a7e9a6320c6a3933c (patch)
tree4879c66af447f6de8edb34d060da8480f969371b
parentea6a66b5b319832e659ed002dcb0bebe956e7a7c (diff)
ffmpegenc: If an encoder lists the supported pixfmts use them to create the caps
...instead of creating standard caps with all pixfmts. Fixes bug #591038.
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.c2
-rw-r--r--ext/ffmpeg/gstffmpegcodecmap.h10
-rw-r--r--ext/ffmpeg/gstffmpegenc.c4
3 files changed, 12 insertions, 4 deletions
diff --git a/ext/ffmpeg/gstffmpegcodecmap.c b/ext/ffmpeg/gstffmpegcodecmap.c
index cc3eb2d..04e0677 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.c
+++ b/ext/ffmpeg/gstffmpegcodecmap.c
@@ -1471,7 +1471,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
* See below for usefullness
*/
-static GstCaps *
+GstCaps *
gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context,
enum CodecID codec_id)
{
diff --git a/ext/ffmpeg/gstffmpegcodecmap.h b/ext/ffmpeg/gstffmpegcodecmap.h
index 6c60223..f7cfa89 100644
--- a/ext/ffmpeg/gstffmpegcodecmap.h
+++ b/ext/ffmpeg/gstffmpegcodecmap.h
@@ -101,6 +101,16 @@ gst_ffmpeg_caps_with_codectype (enum CodecType type,
GstCaps *
gst_ffmpeg_formatid_to_caps (const gchar *format_name);
+/* Convert a FFMPEG Pixel Format and optional AVCodecContext
+ * to a GstCaps. If the context is ommitted, no fixed values
+ * for video/audio size will be included in the GstCaps
+ *
+ * See below for usefullness
+ */
+
+GstCaps *
+gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context, enum CodecID codec_id);
+
/*
* _formatid_get_codecids () can be used to get the codecIDs
* (CODEC_ID_NONE-terminated list) that fit that specific
diff --git a/ext/ffmpeg/gstffmpegenc.c b/ext/ffmpeg/gstffmpegenc.c
index 1a67db0..db1f5d8 100644
--- a/ext/ffmpeg/gstffmpegenc.c
+++ b/ext/ffmpeg/gstffmpegenc.c
@@ -341,9 +341,7 @@ gst_ffmpegenc_getcaps (GstPad * pad)
}
GST_DEBUG_OBJECT (ffmpegenc,
"Got an official pixfmt [%d], attempting to get caps", pixfmt);
- tmpcaps =
- gst_ffmpeg_codectype_to_caps (oclass->in_plugin->type, NULL,
- oclass->in_plugin->id, TRUE);
+ tmpcaps = gst_ffmpeg_pixfmt_to_caps (pixfmt, NULL, oclass->in_plugin->id);
if (tmpcaps) {
GST_DEBUG_OBJECT (ffmpegenc, "Got caps, breaking out");
if (!caps)