mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-09-03 18:23:49 +00:00
dav1ddec: Set output frame duration via the codec frame
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/2190>
This commit is contained in:
parent
9012099e62
commit
2166befce7
1 changed files with 5 additions and 10 deletions
|
@ -544,6 +544,11 @@ impl Dav1dDec {
|
||||||
|
|
||||||
drop(state_guard);
|
drop(state_guard);
|
||||||
|
|
||||||
|
let duration = pic.duration() as u64;
|
||||||
|
if duration > 0 {
|
||||||
|
codec_frame.set_duration(gst::ClockTime::from_nseconds(duration));
|
||||||
|
}
|
||||||
|
|
||||||
if forward_buffer {
|
if forward_buffer {
|
||||||
// SAFETY: The frame is still write-mapped in dav1d but won't be modified
|
// SAFETY: The frame is still write-mapped in dav1d but won't be modified
|
||||||
// anymore. We don't have a way to atomically re-map it read-only.
|
// anymore. We don't have a way to atomically re-map it read-only.
|
||||||
|
@ -553,11 +558,6 @@ impl Dav1dDec {
|
||||||
let in_vframe_ptr = in_vframe.as_ptr();
|
let in_vframe_ptr = in_vframe.as_ptr();
|
||||||
let buffer_ptr = (*in_vframe_ptr).buffer;
|
let buffer_ptr = (*in_vframe_ptr).buffer;
|
||||||
|
|
||||||
let duration = pic.duration() as u64;
|
|
||||||
if duration > 0 {
|
|
||||||
(*buffer_ptr).duration = duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
let codec_frame_ptr = codec_frame.to_glib_none().0;
|
let codec_frame_ptr = codec_frame.to_glib_none().0;
|
||||||
gst::ffi::gst_mini_object_ref(buffer_ptr as *mut _);
|
gst::ffi::gst_mini_object_ref(buffer_ptr as *mut _);
|
||||||
(*codec_frame_ptr).output_buffer = buffer_ptr;
|
(*codec_frame_ptr).output_buffer = buffer_ptr;
|
||||||
|
@ -569,11 +569,6 @@ impl Dav1dDec {
|
||||||
.output_buffer_mut()
|
.output_buffer_mut()
|
||||||
.expect("output_buffer is set");
|
.expect("output_buffer is set");
|
||||||
|
|
||||||
let duration = pic.duration() as u64;
|
|
||||||
if duration > 0 {
|
|
||||||
mut_buffer.set_duration(duration.nseconds());
|
|
||||||
}
|
|
||||||
|
|
||||||
gst::trace!(
|
gst::trace!(
|
||||||
gst::CAT_PERFORMANCE,
|
gst::CAT_PERFORMANCE,
|
||||||
imp = self,
|
imp = self,
|
||||||
|
|
Loading…
Reference in a new issue