From: Thibault Saunier Date: Wed, 14 Sep 2022 18:36:41 +0000 (-0300) Subject: validate: Handle buffer pts/dts/duration in the appsrc-push action X-Git-Tag: 1.22.0~909 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e290e7913ce6f7fe0ce95c725e86521daea7d7d1;p=platform%2Fupstream%2Fgstreamer.git validate: Handle buffer pts/dts/duration in the appsrc-push action Part-of: --- diff --git a/subprojects/gst-devtools/docs/gst-validate-action-types.md b/subprojects/gst-devtools/docs/gst-validate-action-types.md index ca6d20a..9ace43e 100644 --- a/subprojects/gst-devtools/docs/gst-validate-action-types.md +++ b/subprojects/gst-devtools/docs/gst-validate-action-types.md @@ -1080,12 +1080,16 @@ appsrc-push, file-name=(string), target-element-name=(string), [caps=(caps)], + [dts=(GstClockTime)], + [duration=(GstClockTime)], [offset=(uint64)], + [pts=(GstClockTime)], + [segment=((GstStructure)segment,[start=(GstClockTime)][stop=(GstClockTime)][base=(GstClockTime)][offset=(GstClockTime)][time=(GstClockTime)][postion=(GstClockTime)][duration=(GstClockTime)])], [size=(uint64)], [playback-time=(double,string)]; ``` -Queues a buffer in an appsrc. If the pipeline state allows flow of buffers, the next action is not run until the buffer has been pushed. +Queues a sample in an appsrc. If the pipeline state allows flow of buffers, the next action is not run until the buffer has been pushed. * Implementer namespace: core ### Parameters @@ -1104,12 +1108,36 @@ Queues a buffer in an appsrc. If the pipeline state allows flow of buffers, the Default: (null) +* `dts`:(optional): Buffer DTS + + Possible types: `GstClockTime` + + Default: (null) + +* `duration`:(optional): Buffer duration + + Possible types: `GstClockTime` + + Default: (null) + * `offset`:(optional): Offset within the file where the buffer will start Possible types: `uint64` Default: (null) +* `pts`:(optional): Buffer PTS + + Possible types: `GstClockTime` + + Default: (null) + +* `segment`:(optional): The GstSegment to configure as part of the sample + + Possible types: `(GstStructure)segment,[start=(GstClockTime)][stop=(GstClockTime)][base=(GstClockTime)][offset=(GstClockTime)][time=(GstClockTime)][postion=(GstClockTime)][duration=(GstClockTime)]` + + Default: (null) + * `size`:(optional): Number of bytes from the file that will be pushed as a buffer Possible types: `uint64` diff --git a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c index 6b8d461..d0e1646 100644 --- a/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c +++ b/subprojects/gst-devtools/validate/gst/validate/gst-validate-scenario.c @@ -3621,7 +3621,7 @@ _execute_appsrc_push (GstValidateScenario * scenario, GstBuffer *buffer; guint64 offset = 0; guint64 size = 0, read; - gint push_buffer_ret; + gint push_sample_ret; gboolean wait; GFileInfo *finfo = NULL; GFile *f = NULL; @@ -3629,6 +3629,9 @@ _execute_appsrc_push (GstValidateScenario * scenario, GstPad *peer_pad = NULL; GInputStream *stream = NULL; GstValidateExecuteActionReturn res; + GstSegment segment; + GstCaps *caps = NULL; + GstSample *sample; /* We will only wait for the the buffer to be pushed if we are in a state * that allows flow of buffers (>=PAUSED). Otherwise the buffer will just @@ -3675,7 +3678,15 @@ _execute_appsrc_push (GstValidateScenario * scenario, "Could read enough data, only read: %" G_GUINT64_FORMAT, read); buffer = gst_buffer_new_wrapped (file_contents, size); - file_contents = NULL; + gst_validate_action_get_clocktime (scenario, + action, "pts", &GST_BUFFER_PTS (buffer) + ); + gst_validate_action_get_clocktime (scenario, + action, "dts", &GST_BUFFER_DTS (buffer) + ); + gst_validate_action_get_clocktime (scenario, + action, "duration", &GST_BUFFER_DURATION (buffer) + ); { const GValue *caps_value; @@ -7263,6 +7274,24 @@ register_action_types (void) .mandatory = FALSE, .types = "caps" }, + { + .name = "pts", + .description = "Buffer PTS", + .mandatory = FALSE, + .types = "GstClockTime" + }, + { + .name = "dts", + .description = "Buffer DTS", + .mandatory = FALSE, + .types = "GstClockTime" + }, + { + .name = "duration", + .description = "Buffer duration", + .mandatory = FALSE, + .types = "GstClockTime" + }, {NULL} }), "Queues a buffer in an appsrc. If the pipeline state allows flow of buffers, the next action is not run until the buffer has been pushed.",