pub struct VideoCompositor { /* private fields */ }Expand description
Composites the latest frames from any number of independent input pipelines into one fixed-rate opaque BGRA video stream.
Like crate::elements::AudioMixer, this is a SourceElement, not
a conventional one-input filter: upstream pipelines terminate at the
sinks returned by VideoCompositorHandle::add_source, while this
element’s own pipeline drives output on its independent clock. Input
frame PTS values therefore do not become output PTS; output advances by
one tick in VideoCompositor::time_base for every composed frame.
Implementations§
Source§impl VideoCompositor
impl VideoCompositor
pub fn new( name: impl Into<String>, options: VideoCompositorOptions, ) -> Result<(Self, VideoCompositorHandle), VideoCompositorError>
pub fn format(&self) -> Pixel
pub fn width(&self) -> u32
pub fn height(&self) -> u32
pub fn frame_rate(&self) -> Rational
pub fn time_base(&self) -> Rational
Trait Implementations§
Source§impl Element for VideoCompositor
impl Element for VideoCompositor
Source§fn name(&self) -> Arc<str> ⓘ
fn name(&self) -> Arc<str> ⓘ
Returns a cheap clone (refcount bump, not a deep copy) of this
element’s name —
crate::bus::BusEvent stores names as
Arc<str> for exactly this reason: a hot path like
crate::queue::Queue posting BusEvent::Dropped once per
overflowed buffer shouldn’t pay for a fresh heap allocation every
time it wants to report which element it is.Source§fn element_type(&self) -> ElementType
fn element_type(&self) -> ElementType
See
ElementType.Source§fn pp_log(&self) -> &PpLog
fn pp_log(&self) -> &PpLog
This element’s identity for
crate::bus::Bus::post — same
id/name as Element::name, just already wrapped as the
crate::pp_log::PpLog its pp_info!/pp_warn!/pp_error! macros need. A
stored private field, not built fresh per call, for the same reason
name() returns a cheap Arc<str> clone instead of a fresh String
— see its own docs.Source§fn pp_log_mut(&mut self) -> &mut PpLog
fn pp_log_mut(&mut self) -> &mut PpLog
Mutable access to the same field
Element::pp_log reads — used by
crate::pipeline::ChainBuilder to stamp the owning
crate::pipeline::Pipeline’s id onto every element that
passes through it, via element_pp_log. Not meant to be called
from anywhere else.impl Send for VideoCompositor
Source§impl SourceElement for VideoCompositor
impl SourceElement for VideoCompositor
Source§fn run(&mut self, control: &ControlReceiver, bus: &Bus) -> Result<()>
fn run(&mut self, control: &ControlReceiver, bus: &Bus) -> Result<()>
Drives this source until
Eos (normal completion),
crate::pipeline::Pipeline::finish, or Stop (see
ControlMsg::Stop) — call crate::control::drain_control
once per loop iteration to make control responsive between
blocking reads. Read moreSource§fn seek(&mut self, _target: Duration) -> Result<Duration>
fn seek(&mut self, _target: Duration) -> Result<Duration>
Repositions this source to
target, an absolute position from the
start of the media (e.g. av_seek_frame for
crate::elements::FileDemuxer). Called by
crate::control::drain_control as part of handling
ControlMsg::Seek, before that message is forwarded to the
source’s own pads — so whatever’s read next comes from the new
position by the time downstream elements are told to flush for it. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for VideoCompositor
impl !Sync for VideoCompositor
impl !UnwindSafe for VideoCompositor
impl Freeze for VideoCompositor
impl Unpin for VideoCompositor
impl UnsafeUnpin for VideoCompositor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more