mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
jpegparse: Generate timestamp if framerate is known
This change allow setting timestamp on streams that would otherwise have no timestamp. This is useful to make a video from bunch of JPEG files. An example of such pipeline would be: gst-launch-1.0 multifilesrc location=%05d.jpeg caps=image/jpeg,framerate=30/1 \ ! jpegparse ! fakesink silent=0 -v
This commit is contained in:
parent
cc746e336a
commit
5c52f866ad
1 changed files with 3 additions and 0 deletions
|
@ -719,6 +719,9 @@ gst_jpeg_parse_pre_push_frame (GstBaseParse * bparse, GstBaseParseFrame * frame)
|
||||||
GstJpegParse *parse = GST_JPEG_PARSE_CAST (bparse);
|
GstJpegParse *parse = GST_JPEG_PARSE_CAST (bparse);
|
||||||
GstBuffer *outbuf = frame->buffer;
|
GstBuffer *outbuf = frame->buffer;
|
||||||
|
|
||||||
|
if (parse->has_fps && !GST_CLOCK_TIME_IS_VALID (parse->next_ts))
|
||||||
|
parse->next_ts = bparse->segment.start;
|
||||||
|
|
||||||
GST_BUFFER_TIMESTAMP (outbuf) = parse->next_ts;
|
GST_BUFFER_TIMESTAMP (outbuf) = parse->next_ts;
|
||||||
|
|
||||||
if (parse->has_fps && GST_CLOCK_TIME_IS_VALID (parse->next_ts)
|
if (parse->has_fps && GST_CLOCK_TIME_IS_VALID (parse->next_ts)
|
||||||
|
|
Loading…
Reference in a new issue