mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-25 08:38:21 +00:00
tests: update for query API changes
This commit is contained in:
parent
99742dc57e
commit
6248fefaa5
4 changed files with 29 additions and 64 deletions
|
@ -603,7 +603,6 @@ GST_START_TEST (test_position)
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
GstStateChangeReturn ret;
|
GstStateChangeReturn ret;
|
||||||
gboolean qret;
|
gboolean qret;
|
||||||
GstFormat qformat;
|
|
||||||
gint64 qcur;
|
gint64 qcur;
|
||||||
GstBuffer *buffer;
|
GstBuffer *buffer;
|
||||||
GstFlowReturn fret;
|
GstFlowReturn fret;
|
||||||
|
@ -627,16 +626,14 @@ GST_START_TEST (test_position)
|
||||||
fail_if (sinkpad == NULL);
|
fail_if (sinkpad == NULL);
|
||||||
|
|
||||||
/* do position query, this should fail, we have nothing received yet */
|
/* do position query, this should fail, we have nothing received yet */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
ret = gst_element_set_state (pipeline, GST_STATE_READY);
|
ret = gst_element_set_state (pipeline, GST_STATE_READY);
|
||||||
fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
|
fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
|
||||||
|
|
||||||
/* do position query, this should fail, we have nothing received yet */
|
/* do position query, this should fail, we have nothing received yet */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
/* make pipeline and element ready to accept data */
|
/* make pipeline and element ready to accept data */
|
||||||
|
@ -644,8 +641,7 @@ GST_START_TEST (test_position)
|
||||||
fail_unless (ret == GST_STATE_CHANGE_ASYNC);
|
fail_unless (ret == GST_STATE_CHANGE_ASYNC);
|
||||||
|
|
||||||
/* do position query, this should fail, we have nothing received yet */
|
/* do position query, this should fail, we have nothing received yet */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
/* send segment, this should work */
|
/* send segment, this should work */
|
||||||
|
@ -665,8 +661,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* FIXME, do position query, this should succeed with the time value from the
|
/* FIXME, do position query, this should succeed with the time value from the
|
||||||
* segment. */
|
* segment. */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 1 * GST_SECOND);
|
fail_unless (qcur == 1 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -686,8 +681,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* do position query, this should succeed with the time value from the
|
/* do position query, this should succeed with the time value from the
|
||||||
* segment. */
|
* segment. */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 1 * GST_SECOND);
|
fail_unless (qcur == 1 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -706,8 +700,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* do position query, this should succeed with the time value from the
|
/* do position query, this should succeed with the time value from the
|
||||||
* segment before the flush. */
|
* segment before the flush. */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 1 * GST_SECOND);
|
fail_unless (qcur == 1 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -721,8 +714,7 @@ GST_START_TEST (test_position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do position query, this should fail, the segment is flushed */
|
/* do position query, this should fail, the segment is flushed */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
/* send segment, this should work */
|
/* send segment, this should work */
|
||||||
|
@ -756,8 +748,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* do position query, this should succeed with the time value from the
|
/* do position query, this should succeed with the time value from the
|
||||||
* segment. */
|
* segment. */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 1 * GST_SECOND);
|
fail_unless (qcur == 1 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -766,8 +757,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* position now is increasing but never exceeds the boundaries of the segment */
|
/* position now is increasing but never exceeds the boundaries of the segment */
|
||||||
for (i = 0; i < 5; i++) {
|
for (i = 0; i < 5; i++) {
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
GST_DEBUG ("position %" GST_TIME_FORMAT, GST_TIME_ARGS (qcur));
|
GST_DEBUG ("position %" GST_TIME_FORMAT, GST_TIME_ARGS (qcur));
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur >= 1 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
fail_unless (qcur >= 1 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
||||||
|
@ -780,8 +770,7 @@ GST_START_TEST (test_position)
|
||||||
|
|
||||||
/* after rendering the position must be bigger then the stream_time of the
|
/* after rendering the position must be bigger then the stream_time of the
|
||||||
* buffer */
|
* buffer */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur >= 2 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
fail_unless (qcur >= 2 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -795,8 +784,7 @@ GST_START_TEST (test_position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* this should now just report the stream time of the last buffer */
|
/* this should now just report the stream time of the last buffer */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 2 * GST_SECOND);
|
fail_unless (qcur == 2 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -809,8 +797,7 @@ GST_START_TEST (test_position)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do position query, this should fail, the segment is flushed */
|
/* do position query, this should fail, the segment is flushed */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
/* send segment, this should work */
|
/* send segment, this should work */
|
||||||
|
@ -849,8 +836,7 @@ GST_START_TEST (test_position)
|
||||||
/* do position query, this should succeed with the stream time of the buffer
|
/* do position query, this should succeed with the stream time of the buffer
|
||||||
* against the clock. Since the buffer is synced against the clock, the time
|
* against the clock. Since the buffer is synced against the clock, the time
|
||||||
* should be at least the stream time of the buffer. */
|
* should be at least the stream time of the buffer. */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur >= 2 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
fail_unless (qcur >= 2 * GST_SECOND && qcur <= 3 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -858,8 +844,7 @@ GST_START_TEST (test_position)
|
||||||
* against the segment */
|
* against the segment */
|
||||||
g_usleep (2 * G_USEC_PER_SEC);
|
g_usleep (2 * G_USEC_PER_SEC);
|
||||||
|
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur == 3 * GST_SECOND);
|
fail_unless (qcur == 3 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -871,8 +856,7 @@ GST_START_TEST (test_position)
|
||||||
/* we report the time of the last start of the buffer. This is slightly
|
/* we report the time of the last start of the buffer. This is slightly
|
||||||
* incorrect, we should report the exact time when we paused but there is no
|
* incorrect, we should report the exact time when we paused but there is no
|
||||||
* record of that anywhere */
|
* record of that anywhere */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == TRUE);
|
fail_unless (qret == TRUE);
|
||||||
fail_unless (qcur >= 4 * GST_SECOND);
|
fail_unless (qcur >= 4 * GST_SECOND);
|
||||||
|
|
||||||
|
@ -880,14 +864,12 @@ GST_START_TEST (test_position)
|
||||||
fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
|
fail_unless (ret == GST_STATE_CHANGE_SUCCESS);
|
||||||
|
|
||||||
/* fails again because we are in the wrong state */
|
/* fails again because we are in the wrong state */
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
gst_element_set_state (pipeline, GST_STATE_NULL);
|
gst_element_set_state (pipeline, GST_STATE_NULL);
|
||||||
|
|
||||||
qformat = GST_FORMAT_TIME;
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &qcur);
|
||||||
qret = gst_element_query_position (sink, &qformat, &qcur);
|
|
||||||
fail_unless (qret == FALSE);
|
fail_unless (qret == FALSE);
|
||||||
|
|
||||||
gst_object_unref (sinkpad);
|
gst_object_unref (sinkpad);
|
||||||
|
|
|
@ -65,19 +65,17 @@ cleanup_filesink (GstElement * filesink)
|
||||||
/* this queries via the element vfunc, which is currently not implemented */
|
/* this queries via the element vfunc, which is currently not implemented */
|
||||||
#define CHECK_QUERY_POSITION(filesink,format,position) \
|
#define CHECK_QUERY_POSITION(filesink,format,position) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
GstFormat fmt = format; \
|
|
||||||
gint64 pos; \
|
gint64 pos; \
|
||||||
fail_unless (gst_element_query_position (filesink, &fmt, &pos)); \
|
fail_unless (gst_element_query_position (filesink, format, &pos)); \
|
||||||
fail_unless_equals_int (pos, position); \
|
fail_unless_equals_int (pos, position); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
#else
|
#else
|
||||||
#define CHECK_QUERY_POSITION(filesink,format,position) \
|
#define CHECK_QUERY_POSITION(filesink,format,position) \
|
||||||
G_STMT_START { \
|
G_STMT_START { \
|
||||||
GstFormat fmt = format; \
|
|
||||||
GstPad *pad; \
|
GstPad *pad; \
|
||||||
gint64 pos; \
|
gint64 pos; \
|
||||||
pad = gst_element_get_static_pad (filesink, "sink"); \
|
pad = gst_element_get_static_pad (filesink, "sink"); \
|
||||||
fail_unless (gst_pad_query_position (pad, &fmt, &pos)); \
|
fail_unless (gst_pad_query_position (pad, format, &pos)); \
|
||||||
fail_unless_equals_int (pos, position); \
|
fail_unless_equals_int (pos, position); \
|
||||||
gst_object_unref (pad); \
|
gst_object_unref (pad); \
|
||||||
} G_STMT_END
|
} G_STMT_END
|
||||||
|
|
|
@ -1000,15 +1000,13 @@ static GstBusSyncReply
|
||||||
async_done_func (GstBus * bus, GstMessage * msg, GstElement * sink)
|
async_done_func (GstBus * bus, GstMessage * msg, GstElement * sink)
|
||||||
{
|
{
|
||||||
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
||||||
GstFormat format;
|
|
||||||
gint64 position;
|
gint64 position;
|
||||||
|
|
||||||
GST_DEBUG ("we have ASYNC_DONE now");
|
GST_DEBUG ("we have ASYNC_DONE now");
|
||||||
fail_unless (have_preroll == TRUE, "no preroll buffer received");
|
fail_unless (have_preroll == TRUE, "no preroll buffer received");
|
||||||
|
|
||||||
/* get the position now */
|
/* get the position now */
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
|
|
||||||
GST_DEBUG ("we have position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
GST_DEBUG ("we have position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
||||||
|
|
||||||
|
@ -1052,7 +1050,6 @@ GST_START_TEST (test_async_done)
|
||||||
GstFlowReturn res;
|
GstFlowReturn res;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
GstFormat format;
|
|
||||||
gint64 position;
|
gint64 position;
|
||||||
gboolean qret;
|
gboolean qret;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
@ -1085,9 +1082,8 @@ GST_START_TEST (test_async_done)
|
||||||
|
|
||||||
/* We have not yet received any buffers so we are still in the READY state,
|
/* We have not yet received any buffers so we are still in the READY state,
|
||||||
* the position is therefore still not queryable. */
|
* the position is therefore still not queryable. */
|
||||||
format = GST_FORMAT_TIME;
|
|
||||||
position = -1;
|
position = -1;
|
||||||
qret = gst_element_query_position (sink, &format, &position);
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
fail_unless (qret == TRUE, "position wrong");
|
fail_unless (qret == TRUE, "position wrong");
|
||||||
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
||||||
|
|
||||||
|
@ -1111,8 +1107,7 @@ GST_START_TEST (test_async_done)
|
||||||
fail_unless (res == GST_FLOW_OK, "no OK flow return");
|
fail_unless (res == GST_FLOW_OK, "no OK flow return");
|
||||||
|
|
||||||
/* check if position is still 10 seconds */
|
/* check if position is still 10 seconds */
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
GST_DEBUG ("first buffer position %" GST_TIME_FORMAT,
|
GST_DEBUG ("first buffer position %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (position));
|
GST_TIME_ARGS (position));
|
||||||
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
||||||
|
@ -1130,8 +1125,7 @@ GST_START_TEST (test_async_done)
|
||||||
/* check if position is still 10 seconds. This is racy because the above
|
/* check if position is still 10 seconds. This is racy because the above
|
||||||
* thread might not yet have started the push, because of the above sleep,
|
* thread might not yet have started the push, because of the above sleep,
|
||||||
* this is very unlikely, though. */
|
* this is very unlikely, though. */
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
GST_DEBUG ("second buffer position %" GST_TIME_FORMAT,
|
GST_DEBUG ("second buffer position %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (position));
|
GST_TIME_ARGS (position));
|
||||||
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
||||||
|
@ -1146,8 +1140,7 @@ GST_START_TEST (test_async_done)
|
||||||
GST_DEBUG ("joining thread");
|
GST_DEBUG ("joining thread");
|
||||||
g_thread_join (thread);
|
g_thread_join (thread);
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
GST_DEBUG ("last buffer position %" GST_TIME_FORMAT,
|
GST_DEBUG ("last buffer position %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (position));
|
GST_TIME_ARGS (position));
|
||||||
fail_unless (position == 310 * GST_SECOND, "position is wrong");
|
fail_unless (position == 310 * GST_SECOND, "position is wrong");
|
||||||
|
@ -1166,14 +1159,12 @@ static GstBusSyncReply
|
||||||
async_done_eos_func (GstBus * bus, GstMessage * msg, GstElement * sink)
|
async_done_eos_func (GstBus * bus, GstMessage * msg, GstElement * sink)
|
||||||
{
|
{
|
||||||
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ASYNC_DONE) {
|
||||||
GstFormat format;
|
|
||||||
gint64 position;
|
gint64 position;
|
||||||
|
|
||||||
GST_DEBUG ("we have ASYNC_DONE now");
|
GST_DEBUG ("we have ASYNC_DONE now");
|
||||||
|
|
||||||
/* get the position now */
|
/* get the position now */
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
|
|
||||||
GST_DEBUG ("we have position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
GST_DEBUG ("we have position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
||||||
|
|
||||||
|
@ -1196,7 +1187,6 @@ GST_START_TEST (test_async_done_eos)
|
||||||
GstPad *sinkpad;
|
GstPad *sinkpad;
|
||||||
gboolean res;
|
gboolean res;
|
||||||
GstBus *bus;
|
GstBus *bus;
|
||||||
GstFormat format;
|
|
||||||
gint64 position;
|
gint64 position;
|
||||||
gboolean qret;
|
gboolean qret;
|
||||||
GstSegment segment;
|
GstSegment segment;
|
||||||
|
@ -1224,9 +1214,8 @@ GST_START_TEST (test_async_done_eos)
|
||||||
|
|
||||||
/* We have not yet received any buffers so we are still in the READY state,
|
/* We have not yet received any buffers so we are still in the READY state,
|
||||||
* the position is therefore still not queryable. */
|
* the position is therefore still not queryable. */
|
||||||
format = GST_FORMAT_TIME;
|
|
||||||
position = -1;
|
position = -1;
|
||||||
qret = gst_element_query_position (sink, &format, &position);
|
qret = gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
fail_unless (qret == TRUE, "position wrong");
|
fail_unless (qret == TRUE, "position wrong");
|
||||||
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
||||||
|
|
||||||
|
@ -1239,8 +1228,7 @@ GST_START_TEST (test_async_done_eos)
|
||||||
fail_unless (res == TRUE, "no TRUE return");
|
fail_unless (res == TRUE, "no TRUE return");
|
||||||
|
|
||||||
/* check if position is still 10 seconds */
|
/* check if position is still 10 seconds */
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (sink, GST_FORMAT_TIME, &position);
|
||||||
gst_element_query_position (sink, &format, &position);
|
|
||||||
GST_DEBUG ("EOS position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
GST_DEBUG ("EOS position %" GST_TIME_FORMAT, GST_TIME_ARGS (position));
|
||||||
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
fail_unless (position == 10 * GST_SECOND, "position is wrong");
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,6 @@ int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
GstElement *bin, *videotestsrc, *appsink;
|
GstElement *bin, *videotestsrc, *appsink;
|
||||||
GstFormat format;
|
|
||||||
gint64 pos;
|
gint64 pos;
|
||||||
|
|
||||||
gst_init (&argc, &argv);
|
gst_init (&argc, &argv);
|
||||||
|
@ -133,8 +132,7 @@ main (int argc, char *argv[])
|
||||||
/* wait for step to really complete */
|
/* wait for step to really complete */
|
||||||
gst_element_get_state (bin, NULL, NULL, -1);
|
gst_element_get_state (bin, NULL, NULL, -1);
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (bin, GST_FORMAT_TIME, &pos);
|
||||||
gst_element_query_position (bin, &format, &pos);
|
|
||||||
g_message ("stepped two frames, now at %" GST_TIME_FORMAT,
|
g_message ("stepped two frames, now at %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (pos));
|
GST_TIME_ARGS (pos));
|
||||||
|
|
||||||
|
@ -150,8 +148,7 @@ main (int argc, char *argv[])
|
||||||
/* wait for step to really complete */
|
/* wait for step to really complete */
|
||||||
gst_element_get_state (bin, NULL, NULL, -1);
|
gst_element_get_state (bin, NULL, NULL, -1);
|
||||||
|
|
||||||
format = GST_FORMAT_TIME;
|
gst_element_query_position (bin, GST_FORMAT_TIME, &pos);
|
||||||
gst_element_query_position (bin, &format, &pos);
|
|
||||||
g_message ("stepped 120ms frames, now at %" GST_TIME_FORMAT,
|
g_message ("stepped 120ms frames, now at %" GST_TIME_FORMAT,
|
||||||
GST_TIME_ARGS (pos));
|
GST_TIME_ARGS (pos));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue