"gstffmpeg_sink_mpeg",
"video/mpeg",
"systemstream", GST_PROPS_BOOLEAN(FALSE),
- "mpegversion", GST_PROPS_INT(1),
+ "mpegversion", GST_PROPS_INT(1) /*,
"width", GST_PROPS_INT_RANGE (16, 4096),
- "height", GST_PROPS_INT_RANGE (16, 4096)
+ "height", GST_PROPS_INT_RANGE (16, 4096)*/
),
GST_CAPS_NEW (
"gstffmpeg_sink_jpeg",
return GST_PAD_CONNECT_REFUSED;
}
- /* set caps on src pad based on context.pix_fmt && width/height */
- newcaps = gst_ffmpeg_codecid_to_caps(CODEC_ID_RAWVIDEO,
- &ffmpegdec->context);
- if (!newcaps) {
- GST_DEBUG(GST_CAT_PLUGIN_INFO,
- "Failed to create caps for other end (pix_fmt=%d)",
- ffmpegdec->context.pix_fmt);
- return GST_PAD_CONNECT_REFUSED;
+ if (ffmpegdec->context.width > 0 && ffmpegdec->context.height > 0) {
+ /* set caps on src pad based on context.pix_fmt && width/height */
+ newcaps = gst_ffmpeg_codecid_to_caps(CODEC_ID_RAWVIDEO,
+ &ffmpegdec->context);
+ if (!newcaps) {
+ GST_DEBUG(GST_CAT_PLUGIN_INFO,
+ "Failed to create caps for other end (pix_fmt=%d)",
+ ffmpegdec->context.pix_fmt);
+ return GST_PAD_CONNECT_REFUSED;
+ }
+
+ return gst_pad_try_set_caps(ffmpegdec->srcpad, newcaps);
}
- return gst_pad_try_set_caps(ffmpegdec->srcpad, newcaps);
- /*return GST_PAD_CONNECT_OK;*/
+ return GST_PAD_CONNECT_OK;
}
static void
}
if (video && context) {
- gst_caps_get_int(caps, "width", &context->width);
- gst_caps_get_int(caps, "height", &context->height);
+ if (gst_caps_has_property(caps, "width"))
+ gst_caps_get_int(caps, "width", &context->width);
+ if (gst_caps_has_property(caps, "height"))
+ gst_caps_get_int(caps, "height", &context->height);
/* framerate (context->frame_rate)? but then, we'd need a GstPad* */