Skip to content

Commit 68716fc

Browse files
committed
compiling ffmpeg decoder
1 parent 317756e commit 68716fc

3 files changed

Lines changed: 495 additions & 638 deletions

File tree

‎nokhwa-core/src/codec.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub trait Codec {
1818

1919
/// # Errors
2020
/// Errors are decoder specific.
21-
fn set_config(&mut self, config: Self::Config) -> Result<(), NokhwaError>;
21+
fn set_config(&mut self, config: &Self::Config) -> Result<(), NokhwaError>;
2222

2323
/// # Errors
2424
/// Errors are decoder specific.

‎nokhwa-core/src/pixel_destination.rs‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
use std::fmt::{Display, Formatter};
2-
use image::Pixel;
31
use crate::image::NonFloatScalarWidth;
2+
use image::Pixel;
3+
use std::fmt::{Display, Formatter};
44

55
#[derive(Copy, Clone, Debug, PartialOrd, PartialEq)]
66
pub enum PixelDestination {
@@ -19,6 +19,21 @@ pub enum PixelDestination {
1919
}
2020

2121
impl PixelDestination {
22+
pub const ALL: &'static [PixelDestination] = &[
23+
PixelDestination::Rgb8,
24+
PixelDestination::Rgba8,
25+
PixelDestination::Rgb16,
26+
PixelDestination::Rgba16,
27+
PixelDestination::Bgr8,
28+
PixelDestination::Bgra8,
29+
PixelDestination::Bgr16,
30+
PixelDestination::Bgra16,
31+
PixelDestination::Luma8,
32+
PixelDestination::LumaA8,
33+
PixelDestination::Luma16,
34+
PixelDestination::LumaA16,
35+
];
36+
2237
#[must_use]
2338
pub fn get_by_pixel<P>() -> Option<Self>
2439
where
@@ -55,7 +70,7 @@ impl PixelDestination {
5570
1 => Some(PixelDestination::LumaA8),
5671
2 => Some(PixelDestination::LumaA16),
5772
_ => None,
58-
}
73+
},
5974
_ => None,
6075
}
6176
}

0 commit comments

Comments
 (0)