pub struct HevcEncoder { /* private fields */ }Expand description
One software HEVC session for one capture.
Implementations§
Source§impl HevcEncoder
impl HevcEncoder
Sourcepub fn new(settings: &RustCaptureSettings, rgba: bool) -> Result<Self, String>
pub fn new(settings: &RustCaptureSettings, rgba: bool) -> Result<Self, String>
Open a session on host frames; rgba names the byte order they arrive in.
pub fn codec(&self) -> Codec
pub fn is_fullcolor(&self) -> bool
Sourcepub fn is_full_range(&self) -> bool
pub fn is_full_range(&self) -> bool
The software 4:4:4 of x264’s kind signals full range.
pub fn last_reference(&self) -> Reference
Sourcepub fn holds_quantizer(&self) -> bool
pub fn holds_quantizer(&self) -> bool
Whether hold_quantizer holds a frame at its quantizer: x265 at a constant rate factor,
kvazaar never. At a constant rate x265’s rate control moves a forced quantizer back to
what its buffer affords (a key frame held at 18 came out 23.2 kB at 26.6 dB at 8 Mbit/s
1080p), and a fresh session whose buffer is the key frame’s budget plans it from a
fraction of that buffer (102.5 kB at 34 dB where the budget was 250 kB and the picture
before it 53.9 dB), so a constant-rate session holds none.
Sourcepub fn last_quality(&self) -> Option<u32>
pub fn last_quality(&self) -> Option<u32>
The quality index (HEVC’s quantizer) the rate control last coded a frame at, held frames aside.
Sourcepub fn last_size(&self) -> Option<usize>
pub fn last_size(&self) -> Option<usize>
The bytes of the last frame the rate control coded, held frames aside.
Sourcepub fn invalidate_reference(&mut self, _frame_id: u16) -> bool
pub fn invalidate_reference(&mut self, _frame_id: u16) -> bool
The library keeps its reference lists to itself: refused, so the caller codes a key frame.
Sourcepub fn hold_quantizer(&mut self, crf: u32)
pub fn hold_quantizer(&mut self, crf: u32)
Encode the next frame at the quantizer the quality index crf selects, leaving the
session’s own quality for the frame after: the cleanup of a still screen, at a constant
rate factor, where x265 takes it as the frame’s forced quantizer. A constant-rate session
codes the frame under its rate control (holds_quantizer). kvazaar takes no quantizer
but the one it opens at, and a re-open for the frame would need another to come back,
each a key frame, so it codes the frame at its own.
Sourcepub fn reconfigure_rate(
&mut self,
settings: &RustCaptureSettings,
) -> Result<(), String>
pub fn reconfigure_rate( &mut self, settings: &RustCaptureSettings, ) -> Result<(), String>
Re-open the encoder when a rate or frame-rate setting changed: neither library’s rate control takes a new target while it runs.
Trait Implementations§
impl Send for HevcEncoder
Auto Trait Implementations§
impl !Sync for HevcEncoder
impl Freeze for HevcEncoder
impl RefUnwindSafe for HevcEncoder
impl Unpin for HevcEncoder
impl UnsafeUnpin for HevcEncoder
impl UnwindSafe for HevcEncoder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more