mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2024-12-27 20:40:31 +00:00
rav1enc/gifenc: Add VideoMeta to the supported metas in propose_allocation()
This commit is contained in:
parent
fe0075ad15
commit
01a551f2ac
2 changed files with 20 additions and 2 deletions
|
@ -274,6 +274,15 @@ impl VideoEncoderImpl for GifEnc {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &Self::Type,
|
||||
mut query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
query.add_allocation_meta::<gst_video::VideoMeta>(None);
|
||||
self.parent_propose_allocation(element, query)
|
||||
}
|
||||
|
||||
fn set_format(
|
||||
&self,
|
||||
element: &Self::Type,
|
||||
|
@ -456,8 +465,8 @@ impl GifEnc {
|
|||
/// tightly packed rgb(a) buffer, ready for consumption by the gif encoder.
|
||||
fn tightly_packed_framebuffer(frame: &gst_video::VideoFrameRef<&gst::BufferRef>) -> Vec<u8> {
|
||||
assert_eq!(frame.n_planes(), 1); // RGB and RGBA are tightly packed
|
||||
let line_size = (frame.info().width() * frame.n_components()) as usize;
|
||||
let line_stride = frame.info().stride()[0] as usize;
|
||||
let line_size = (frame.width() * frame.n_components()) as usize;
|
||||
let line_stride = frame.plane_stride()[0] as usize;
|
||||
let mut raw_frame: Vec<u8> = Vec::with_capacity(line_size * frame.info().height() as usize);
|
||||
|
||||
// copy gstreamer frame to tightly packed rgb(a) frame.
|
||||
|
|
|
@ -484,6 +484,15 @@ impl VideoEncoderImpl for Rav1Enc {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn propose_allocation(
|
||||
&self,
|
||||
element: &Self::Type,
|
||||
mut query: gst::query::Allocation<&mut gst::QueryRef>,
|
||||
) -> Result<(), gst::ErrorMessage> {
|
||||
query.add_allocation_meta::<gst_video::VideoMeta>(None);
|
||||
self.parent_propose_allocation(element, query)
|
||||
}
|
||||
|
||||
// For the colorimetry mapping below
|
||||
#[allow(clippy::wildcard_in_or_patterns)]
|
||||
fn set_format(
|
||||
|
|
Loading…
Reference in a new issue