Commit d181dbd7 authored by Sebastian Dröge's avatar Sebastian Dröge

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.
parent ea6a66b5
......@@ -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)
{
......
......@@ -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
......
......@@ -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)
......
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