mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-20 08:41:07 +00:00
vtdec: Properly scale timestamps for the API and set invalid values
This commit is contained in:
parent
d789246077
commit
e4563ce6cf
1 changed files with 17 additions and 3 deletions
|
@ -455,9 +455,23 @@ cm_sample_buffer_from_gst_buffer (GstVtdec * vtdec, GstBuffer * buf)
|
||||||
goto block_error;
|
goto block_error;
|
||||||
|
|
||||||
/* create a sample buffer, the CoreMedia equivalent of GstBuffer */
|
/* create a sample buffer, the CoreMedia equivalent of GstBuffer */
|
||||||
sample_timing.duration = CMTimeMake (GST_BUFFER_DURATION (buf), 1);
|
if (GST_BUFFER_DURATION_IS_VALID (buf))
|
||||||
sample_timing.presentationTimeStamp = CMTimeMake (GST_BUFFER_PTS (buf), 1);
|
sample_timing.duration = CMTimeMake (GST_BUFFER_DURATION (buf), GST_SECOND);
|
||||||
sample_timing.decodeTimeStamp = CMTimeMake (GST_BUFFER_DTS (buf), 1);
|
else
|
||||||
|
sample_timing.duration = kCMTimeInvalid;
|
||||||
|
|
||||||
|
if (GST_BUFFER_PTS_IS_VALID (buf))
|
||||||
|
sample_timing.presentationTimeStamp =
|
||||||
|
CMTimeMake (GST_BUFFER_PTS (buf), GST_SECOND);
|
||||||
|
else
|
||||||
|
sample_timing.presentationTimeStamp = kCMTimeInvalid;
|
||||||
|
|
||||||
|
if (GST_BUFFER_DTS_IS_VALID (buf))
|
||||||
|
sample_timing.decodeTimeStamp =
|
||||||
|
CMTimeMake (GST_BUFFER_DTS (buf), GST_SECOND);
|
||||||
|
else
|
||||||
|
sample_timing.decodeTimeStamp = kCMTimeInvalid;
|
||||||
|
|
||||||
time_array[0] = sample_timing;
|
time_array[0] = sample_timing;
|
||||||
|
|
||||||
status =
|
status =
|
||||||
|
|
Loading…
Reference in a new issue