pub struct LevelSpecification { /* private fields */ }Implementations§
Source§impl LevelSpecification
impl LevelSpecification
Sourcepub fn id(&self) -> Level
pub fn id(&self) -> Level
Examples found in repository?
examples/select.rs (line 12)
2pub fn main() {
3 // Find the level that supports 1920x1080 resolution at 60fps.
4 let level = LevelSelector::new()
5 .width(1920)
6 .height(1080)
7 .framerate(60.0)
8 .tier(Tier::Main)
9 .profile(Profile::Main)
10 .select();
11
12 println!("Level: {:?}", level.unwrap().id());
13
14 // Sometimes you are bound to the what the hardware encoder supports.
15 // You can define the clamp to search within a range.
16 // In this case, we are looking for a level that supports 3840x2160 resolution at 60fps.
17 let level = LevelSelector::new()
18 .width(3840)
19 .height(2160)
20 .framerate(60.0)
21 .tier(Tier::Main)
22 .profile(Profile::Main)
23 // Clamping between L4 and L5.2
24 .clamp(Level::L4, Level::L5_2)
25 .select();
26
27 println!("Level: {:?}", level.unwrap().id());
28}pub fn max_luma_sample_rate(&self) -> u64
pub fn max_luma_picture_size(&self) -> u32
pub fn max_bit_rate(&self, profile: Profile, tier: Tier) -> Option<u64>
pub fn max_decoder_picture_buffer_size(&self, width: u32, height: u32) -> u32
Trait Implementations§
Source§impl Clone for LevelSpecification
impl Clone for LevelSpecification
Source§fn clone(&self) -> LevelSpecification
fn clone(&self) -> LevelSpecification
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for LevelSpecification
Auto Trait Implementations§
impl Freeze for LevelSpecification
impl RefUnwindSafe for LevelSpecification
impl Send for LevelSpecification
impl Sync for LevelSpecification
impl Unpin for LevelSpecification
impl UnsafeUnpin for LevelSpecification
impl UnwindSafe for LevelSpecification
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