res = gst_pad_push_event (sinkpad, event);
break;
}
+ case GST_EVENT_QOS:
+ {
+ GstQOSType type;
+ gdouble proportion;
+ GstClockTimeDiff diff;
+ GstClockTime timestamp;
+
+ gst_event_parse_qos (event, &type, &proportion, &diff, ×tamp);
+
+ if (GST_CLOCK_TIME_IS_VALID (timestamp) && videorate->rate != 1.0) {
+ GST_OBJECT_LOCK (trans);
+ GST_DEBUG_OBJECT (trans, "Rescaling QoS event taking our rate into"
+ "account. Timestamp: %" GST_TIME_FORMAT " -> %" GST_TIME_FORMAT
+ " - diff %" G_GINT64_FORMAT "-> %" G_GINT64_FORMAT,
+ GST_TIME_ARGS (timestamp),
+ GST_TIME_ARGS (videorate->base_ts + ((timestamp -
+ videorate->base_ts) * videorate->rate)), diff,
+ (GstClockTimeDiff) (diff * videorate->rate));
+
+ if (videorate->segment.rate < 0.0)
+ timestamp =
+ (videorate->segment.stop - videorate->base_ts) -
+ ((videorate->segment.stop - videorate->base_ts -
+ timestamp) * videorate->rate);
+ else
+ timestamp =
+ videorate->base_ts + ((timestamp -
+ videorate->base_ts) * videorate->rate);
+
+ diff *= videorate->rate;
+ GST_OBJECT_UNLOCK (trans);
+
+ gst_event_unref (event);
+ event = gst_event_new_qos (type, proportion, diff, timestamp);
+ }
+ /* Fallthrough */
+ }
default:
res = gst_pad_push_event (sinkpad, event);
break;
'videorate/reverse.variable_to_10fps',
'videorate/change_rate_while_playing',
'videorate/change_rate_reverse_playback',
+ 'videorate/rate_0_5',
+ 'videorate/rate_0_5_with_decoder',
+ 'videorate/rate_2_0',
+ 'videorate/rate_2_0_with_decoder',
]
env = environment()
--- /dev/null
+# Common metadatas to check the videorate element behavior with different
+# framerate specified by previously setting variables with:
+# ```
+# set-global, rate=<test-rate>, decoder=<decoder>
+# ```
+# and then `include, location="check-rate-prop.meta" to setup the test with this
+# file
+
+meta,
+ args = {
+ "videotestsrc pattern=ball animation-mode=frames ! video/x-raw,framerate=30/1,width=320,height=240 $(decoder) videorate name=videorate rate=$(rate) ! fakesink sync=true qos=true",
+ },
+ configs = {
+ "$(validateflow), pad=videorate:sink, buffers-checksum=as-id, ignored-event-types={ tag }",
+ "$(validateflow), pad=videorate:src, buffers-checksum=as-id, ignored-event-types={ tag }",
+ }
+
+crank-clock, expected-time=0.0
+crank-clock, repeat=9
+wait, on-clock=true
+check-position, expected-position=300000000
+stop
\ No newline at end of file
--- /dev/null
+set-globals, rate=(string)"0.5", decoder="!"
+
+include, location="check-rate-prop.meta"
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=1, pts=0:00:00.033333333, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=3, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=4, pts=0:00:00.133333333, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.166666666, dur=0:00:00.033333334
+buffer: content-id=6, pts=0:00:00.200000000, dur=0:00:00.033333333
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=0, pts=0:00:00.033333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=1, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=2, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.133333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=2, pts=0:00:00.166666666, dur=0:00:00.033333334, flags=gap
+buffer: content-id=3, pts=0:00:00.200000000, dur=0:00:00.033333333
+buffer: content-id=3, pts=0:00:00.233333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=4, pts=0:00:00.266666666, dur=0:00:00.033333334
+buffer: content-id=5, pts=0:00:00.300000000, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.333333333, dur=0:00:00.033333333, flags=gap
--- /dev/null
+# Using an encoder/decoder to test QoS handling
+# FIXME: Use a fakevideodec once merged!
+set-globals, rate=(string)"0.5", decoder="! theoraenc ! theoradec !"
+
+include, location="check-rate-prop.meta"
\ No newline at end of file
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)2:4:5:0, framerate=(fraction)30/1;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=1, pts=0:00:00.033333333, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=3, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=4, pts=0:00:00.133333333, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.166666666, dur=0:00:00.033333334
+buffer: content-id=6, pts=0:00:00.200000000, dur=0:00:00.033333333
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)2:4:5:0, framerate=(fraction)30/1;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=0, pts=0:00:00.033333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=1, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=2, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.133333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=2, pts=0:00:00.166666666, dur=0:00:00.033333334, flags=gap
+buffer: content-id=3, pts=0:00:00.200000000, dur=0:00:00.033333333
+buffer: content-id=3, pts=0:00:00.233333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=4, pts=0:00:00.266666666, dur=0:00:00.033333334
+buffer: content-id=5, pts=0:00:00.300000000, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.333333333, dur=0:00:00.033333333, flags=gap
--- /dev/null
+set-globals, rate=(string)"2.0", decoder="!"
+
+include, location="check-rate-prop.meta"
\ No newline at end of file
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=1, pts=0:00:00.033333333, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=3, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=4, pts=0:00:00.133333333, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.166666666, dur=0:00:00.033333334
+buffer: content-id=6, pts=0:00:00.200000000, dur=0:00:00.033333333
+buffer: content-id=7, pts=0:00:00.233333333, dur=0:00:00.033333333
+buffer: content-id=8, pts=0:00:00.266666666, dur=0:00:00.033333334
+buffer: content-id=9, pts=0:00:00.300000000, dur=0:00:00.033333333
+buffer: content-id=10, pts=0:00:00.333333333, dur=0:00:00.033333333
+buffer: content-id=11, pts=0:00:00.366666666, dur=0:00:00.033333334
+buffer: content-id=12, pts=0:00:00.400000000, dur=0:00:00.033333333
+buffer: content-id=13, pts=0:00:00.433333333, dur=0:00:00.033333333
+buffer: content-id=14, pts=0:00:00.466666666, dur=0:00:00.033333334
+buffer: content-id=15, pts=0:00:00.500000000, dur=0:00:00.033333333
+buffer: content-id=16, pts=0:00:00.533333333, dur=0:00:00.033333333
+buffer: content-id=17, pts=0:00:00.566666666, dur=0:00:00.033333334
+buffer: content-id=18, pts=0:00:00.600000000, dur=0:00:00.033333333
+buffer: content-id=19, pts=0:00:00.633333333, dur=0:00:00.033333333
+buffer: content-id=20, pts=0:00:00.666666666, dur=0:00:00.033333334
+buffer: content-id=21, pts=0:00:00.700000000, dur=0:00:00.033333333
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=2, pts=0:00:00.033333333, dur=0:00:00.033333333
+buffer: content-id=4, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=6, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=8, pts=0:00:00.133333333, dur=0:00:00.033333333
+buffer: content-id=10, pts=0:00:00.166666666, dur=0:00:00.033333334
+buffer: content-id=12, pts=0:00:00.200000000, dur=0:00:00.033333333
+buffer: content-id=14, pts=0:00:00.233333333, dur=0:00:00.033333333
+buffer: content-id=16, pts=0:00:00.266666666, dur=0:00:00.033333334
+buffer: content-id=18, pts=0:00:00.300000000, dur=0:00:00.033333333
+buffer: content-id=20, pts=0:00:00.333333333, dur=0:00:00.033333333
--- /dev/null
+# Using an encoder/decoder to test QoS handling
+# FIXME: Use a fakevideodec once merged!
+set-globals, rate=(string)"0.5", decoder="! theoraenc ! theoradec !"
+
+include, location="check-rate-prop.meta"
\ No newline at end of file
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)2:4:5:0, framerate=(fraction)30/1;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=1, pts=0:00:00.033333333, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=3, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=4, pts=0:00:00.133333333, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.166666666, dur=0:00:00.033333334
+buffer: content-id=6, pts=0:00:00.200000000, dur=0:00:00.033333333
--- /dev/null
+event stream-start: GstEventStreamStart, flags=(GstStreamFlags)GST_STREAM_FLAG_NONE, group-id=(uint)1;
+event caps: video/x-raw, format=(string)I420, width=(int)320, height=(int)240, interlace-mode=(string)progressive, multiview-mode=(string)mono, multiview-flags=(GstVideoMultiviewFlagsSet)0:ffffffff:/right-view-first/left-flipped/left-flopped/right-flipped/right-flopped/half-aspect/mixed-mono, pixel-aspect-ratio=(fraction)1/1, chroma-site=(string)jpeg, colorimetry=(string)2:4:5:0, framerate=(fraction)30/1;
+event segment: format=TIME, start=0:00:00.000000000, offset=0:00:00.000000000, stop=none, time=0:00:00.000000000, base=0:00:00.000000000, position=0:00:00.000000000
+buffer: content-id=0, pts=0:00:00.000000000, dur=0:00:00.033333333, flags=discont
+buffer: content-id=0, pts=0:00:00.033333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=1, pts=0:00:00.066666666, dur=0:00:00.033333334
+buffer: content-id=2, pts=0:00:00.100000000, dur=0:00:00.033333333
+buffer: content-id=2, pts=0:00:00.133333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=2, pts=0:00:00.166666666, dur=0:00:00.033333334, flags=gap
+buffer: content-id=3, pts=0:00:00.200000000, dur=0:00:00.033333333
+buffer: content-id=3, pts=0:00:00.233333333, dur=0:00:00.033333333, flags=gap
+buffer: content-id=4, pts=0:00:00.266666666, dur=0:00:00.033333334
+buffer: content-id=5, pts=0:00:00.300000000, dur=0:00:00.033333333
+buffer: content-id=5, pts=0:00:00.333333333, dur=0:00:00.033333333, flags=gap