diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-07-27 23:00:53 -0400 |
---|---|---|
committer | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2018-07-27 23:00:53 -0400 |
commit | 5c52f866ad36784fd66a6bd74915bfb911915ae7 (patch) | |
tree | d9e14f000a59951b0a8a77c0bb06be1cf53adda8 /gst | |
parent | cc746e336ad75c46080f269cec8b4e90f84a8965 (diff) |
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
Diffstat (limited to 'gst')
-rw-r--r-- | gst/jpegformat/gstjpegparse.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c index 75917f832..17cbec954 100644 --- a/gst/jpegformat/gstjpegparse.c +++ b/gst/jpegformat/gstjpegparse.c @@ -719,6 +719,9 @@ gst_jpeg_parse_pre_push_frame (GstBaseParse * bparse, GstBaseParseFrame * frame) GstJpegParse *parse = GST_JPEG_PARSE_CAST (bparse); 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; if (parse->has_fps && GST_CLOCK_TIME_IS_VALID (parse->next_ts) |