Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename externalunknown -> external #172

Open
wants to merge 3 commits into
base: 0.10
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions nokhwa-bindings-macos/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ mod internal {
AVCaptureDeviceType::WideAngle,
AVCaptureDeviceType::Telephoto,
AVCaptureDeviceType::TrueDepth,
AVCaptureDeviceType::ExternalUnknown,
AVCaptureDeviceType::External,
])?
.devices())
}
Expand Down Expand Up @@ -546,7 +546,7 @@ mod internal {
UltraWide,
Telephoto,
TrueDepth,
ExternalUnknown,
External,
}

impl From<AVCaptureDeviceType> for *mut Object {
Expand All @@ -571,8 +571,8 @@ mod internal {
AVCaptureDeviceType::TrueDepth => {
str_to_nsstr("AVCaptureDeviceTypeBuiltInTrueDepthCamera")
}
AVCaptureDeviceType::ExternalUnknown => {
str_to_nsstr("AVCaptureDeviceTypeExternalUnknown")
AVCaptureDeviceType::External => {
str_to_nsstr("AVCaptureDeviceTypeExternal")
}
}
}
Expand Down Expand Up @@ -812,7 +812,7 @@ mod internal {
AVCaptureDeviceDiscoverySession::new(vec![
AVCaptureDeviceType::UltraWide,
AVCaptureDeviceType::Telephoto,
AVCaptureDeviceType::ExternalUnknown,
AVCaptureDeviceType::External,
AVCaptureDeviceType::Dual,
AVCaptureDeviceType::DualWide,
AVCaptureDeviceType::Triple,
Expand Down
2 changes: 1 addition & 1 deletion nokhwa-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ default-features = false
optional = true

[dependencies.mozjpeg]
version = "0.9"
version = "0.10"
optional = true

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion nokhwa-core/src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use crate::{
pixel_format::FormatDecoder,
types::{FrameFormat, Resolution},
};
use bytes::{Buf, Bytes};
use bytes::{Bytes};
use image::ImageBuffer;

/// A buffer returned by a camera to accommodate custom decoding.
Expand Down
8 changes: 4 additions & 4 deletions nokhwa-core/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1501,9 +1501,9 @@ pub fn mjpeg_to_rgb(data: &[u8], rgba: bool) -> Result<Vec<u8>, NokhwaError> {
}
};

let scanlines_res: Option<Vec<u8>> = jpeg_decompress.read_scanlines_flat();
let scanlines_res: Option<Vec<u8>> = jpeg_decompress.read_scanlines().ok();
// assert!(jpeg_decompress.finish_decompress());
if !jpeg_decompress.finish_decompress() {
if !jpeg_decompress.finish().is_ok() {
return Err(NokhwaError::ProcessFrameError {
src: FrameFormat::MJPEG,
destination: "RGB888".to_string(),
Expand Down Expand Up @@ -1573,9 +1573,9 @@ pub fn buf_mjpeg_to_rgb(data: &[u8], dest: &mut [u8], rgba: bool) -> Result<(),
});
}

jpeg_decompress.read_scanlines_flat_into(dest);
let _ = jpeg_decompress.read_scanlines_into(dest);
// assert!(jpeg_decompress.finish_decompress());
if !jpeg_decompress.finish_decompress() {
if !jpeg_decompress.finish().is_ok() {
return Err(NokhwaError::ProcessFrameError {
src: FrameFormat::MJPEG,
destination: "RGB888".to_string(),
Expand Down