diff options
author | Jan Schmidt <jan@centricular.com> | 2015-04-01 15:46:13 +0300 |
---|---|---|
committer | Jan Schmidt <jan@centricular.com> | 2015-04-03 15:07:04 +0300 |
commit | 3d59b5f814aebbd8297f08826722ba5c00dd3c30 (patch) | |
tree | df9784a2b528d22894975f7858bc6c95b2cf02a7 /tests/check/elements | |
parent | cf54d4cc67e687605aba05e5d184cf381d768593 (diff) |
isomp4: Make non-seekable downstream an error in normal mode
When not in fast-start or fragmented mode, we need to be able
to rewrite the size of the mdat atom, or else the output just
won't be playable - the mdat placeholder with size == 0 will
cover the rest of the file, including any moov atom we write out.
https://bugzilla.gnome.org/show_bug.cgi?id=708808
Diffstat (limited to 'tests/check/elements')
-rw-r--r-- | tests/check/elements/qtmux.c | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/tests/check/elements/qtmux.c b/tests/check/elements/qtmux.c index 105b1e80d..199ff1cba 100644 --- a/tests/check/elements/qtmux.c +++ b/tests/check/elements/qtmux.c @@ -153,8 +153,24 @@ teardown_src_pad (GstPad * srcpad) gst_object_unref (srcpad); } +gboolean downstream_is_seekable; +static gboolean +qtmux_sinkpad_query (GstPad * pad, GstObject * parent, GstQuery * query) +{ + gboolean ret = FALSE; + + if (GST_QUERY_TYPE (query) == GST_QUERY_SEEKING) { + gst_query_set_seeking (query, GST_FORMAT_BYTES, downstream_is_seekable, 0, + -1); + ret = TRUE; + } + + return ret; +} + static GstElement * -setup_qtmux (GstStaticPadTemplate * srctemplate, const gchar * sinkname) +setup_qtmux (GstStaticPadTemplate * srctemplate, const gchar * sinkname, + gboolean seekable) { GstElement *qtmux; @@ -162,6 +178,10 @@ setup_qtmux (GstStaticPadTemplate * srctemplate, const gchar * sinkname) qtmux = gst_check_setup_element ("qtmux"); mysrcpad = setup_src_pad (qtmux, srctemplate, sinkname); mysinkpad = gst_check_setup_sink_pad (qtmux, &sinktemplate); + + downstream_is_seekable = seekable; + gst_pad_set_query_function (mysinkpad, qtmux_sinkpad_query); + gst_pad_set_active (mysrcpad, TRUE); gst_pad_set_active (mysinkpad, TRUE); @@ -195,7 +215,7 @@ check_qtmux_pad (GstStaticPadTemplate * srctemplate, const gchar * sinkname, guint8 data2[4] = "moov"; GstSegment segment; - qtmux = setup_qtmux (srctemplate, sinkname); + qtmux = setup_qtmux (srctemplate, sinkname, TRUE); g_object_set (qtmux, "dts-method", dts_method, NULL); fail_unless (gst_element_set_state (qtmux, GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS, @@ -285,7 +305,7 @@ check_qtmux_pad_fragmented (GstStaticPadTemplate * srctemplate, guint8 data4[4] = "mfra"; GstSegment segment; - qtmux = setup_qtmux (srctemplate, sinkname); + qtmux = setup_qtmux (srctemplate, sinkname, !streamable); g_object_set (qtmux, "dts-method", dts_method, NULL); g_object_set (qtmux, "fragment-duration", 2000, NULL); g_object_set (qtmux, "streamable", streamable, NULL); @@ -515,7 +535,7 @@ GST_END_TEST; GST_START_TEST (test_reuse) { - GstElement *qtmux = setup_qtmux (&srcvideotemplate, "video_%u"); + GstElement *qtmux = setup_qtmux (&srcvideotemplate, "video_%u", TRUE); GstBuffer *inbuffer; GstCaps *caps; GstSegment segment; |