Index: gst-ffmpeg-0.10.5/ext/ffmpeg/gstffmpegenc.c =================================================================== --- gst-ffmpeg-0.10.5.orig/ext/ffmpeg/gstffmpegenc.c +++ gst-ffmpeg-0.10.5/ext/ffmpeg/gstffmpegenc.c @@ -284,7 +284,7 @@ gst_ffmpegenc_getcaps (GstPad * pad) GstFFMpegEncClass *oclass = (GstFFMpegEncClass *) G_OBJECT_GET_CLASS (ffmpegenc); AVCodecContext *ctx = NULL; - enum PixelFormat pixfmt; + int i; GstCaps *caps = NULL; GST_DEBUG_OBJECT (ffmpegenc, "getting caps"); @@ -317,7 +317,7 @@ gst_ffmpegenc_getcaps (GstPad * pad) _shut_up_I_am_probing = TRUE; #endif GST_DEBUG_OBJECT (ffmpegenc, "probing caps"); - for (pixfmt = 0; pixfmt < PIX_FMT_NB; pixfmt++) { + for (i = 0; oclass->in_plugin->pix_fmts[i]!=PIX_FMT_NONE; i++) { GstCaps *tmpcaps; /* need to start with a fresh codec_context each time around, since @@ -337,9 +337,8 @@ gst_ffmpegenc_getcaps (GstPad * pad) /* makes it silent */ ctx->strict_std_compliance = -1; - ctx->pix_fmt = pixfmt; - if (gst_ffmpeg_avcodec_open (ctx, oclass->in_plugin) >= 0 && - ctx->pix_fmt == pixfmt) { + ctx->pix_fmt = oclass->in_plugin->pix_fmts[i]; + if (gst_ffmpeg_avcodec_open (ctx, oclass->in_plugin) >= 0) { ctx->width = -1; if (!caps) caps = gst_caps_new_empty ();