diff options
author | Tim-Philipp Müller <tim@centricular.net> | 2013-04-30 10:01:29 +0100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.net> | 2013-04-30 10:04:23 +0100 |
commit | 62ac56668a0f56d29b8a954e441a2f694d137b5f (patch) | |
tree | d3315fcf8fb519d50d52ebd9d7997551805a660e /ext | |
parent | 06b8ac10cee85c5c304ca320997aa8f44295a66f (diff) |
x264enc: output byte-stream if downstream has ANY caps
It's what people expect when they pipe the output to
filesink or into a tcp connection or pipe.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/x264/gstx264enc.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c index 0f5b9d3e..b04a9479 100644 --- a/ext/x264/gstx264enc.c +++ b/ext/x264/gstx264enc.c @@ -1582,6 +1582,7 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc, { GstX264Enc *encoder = GST_X264_ENC (video_enc); GstVideoInfo *info = &state->info; + GstCaps *template_caps; GstCaps *allowed_caps = NULL; gboolean level_ok = TRUE; @@ -1613,9 +1614,16 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc, encoder->peer_intra_profile = FALSE; encoder->peer_level = NULL; + template_caps = gst_static_pad_template_get_caps (&src_factory); allowed_caps = gst_pad_get_allowed_caps (GST_VIDEO_ENCODER_SRC_PAD (encoder)); - if (allowed_caps) { + /* Output byte-stream if downstream has ANY caps, it's what people expect, + * and it makes more sense too */ + if (allowed_caps == template_caps) { + GST_INFO_OBJECT (encoder, + "downstream has ANY caps, outputting byte-stream"); + encoder->current_byte_stream = GST_X264_ENC_STREAM_FORMAT_BYTE_STREAM; + } else if (allowed_caps) { GstStructure *s; const gchar *profile; const gchar *level; @@ -1706,6 +1714,8 @@ gst_x264_enc_set_format (GstVideoEncoder * video_enc, gst_caps_unref (allowed_caps); } + gst_caps_unref (template_caps); + if (!level_ok) return FALSE; |