-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
309 additions
and
13 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#[cfg(feature = "objc2")] | ||
use objc2::encode::{Encode, Encoding, RefEncode}; | ||
|
||
/// Directives for the decompression session and the video decoder, passed into | ||
/// decodeFlags parameter of VTDecompressionSessionDecodeFrame. | ||
/// | ||
/// | ||
/// With the kVTDecodeFrame_EnableAsynchronousDecompression bit clear, the video decoder | ||
/// is compelled to emit every frame before it returns. With the bit set, the decoder may | ||
/// process frames asynchronously, but it is not compelled to do so. | ||
/// | ||
/// A hint to the decompression session and video decoder that a CVImageBuffer should not | ||
/// be emitted for this frame. NULL will be returned instead. | ||
/// | ||
/// A hint to the video decoder that it would be OK to use a low-power mode that can not decode faster than 1x realtime. | ||
/// | ||
/// With the kVTDecodeFrame_EnableTemporalProcessing bit clear, the video decoder should emit | ||
/// every frame once that frame's decoding is done -- frames may not be delayed indefinitely. With | ||
/// the bit set, it is legal for the decoder to delay frames indefinitely -- at least | ||
/// until VTDecompressionSessionFinishDelayedFrames or VTDecompressionSessionInvalidate is called. | ||
/// | ||
/// See also [Apple's documentation](https://developer.apple.com/documentation/videotoolbox/vtdecodeframeflags?language=objc) | ||
// NS_OPTIONS | ||
#[repr(transparent)] | ||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)] | ||
pub struct VTDecodeFrameFlags(pub u32); | ||
bitflags::bitflags! { | ||
impl VTDecodeFrameFlags: u32 { | ||
#[doc(alias = "kVTDecodeFrame_EnableAsynchronousDecompression")] | ||
const Frame_EnableAsynchronousDecompression = 1<<0; | ||
#[doc(alias = "kVTDecodeFrame_DoNotOutputFrame")] | ||
const Frame_DoNotOutputFrame = 1<<1; | ||
#[doc(alias = "kVTDecodeFrame_1xRealTimePlayback")] | ||
const Frame_1xRealTimePlayback = 1<<2; | ||
#[doc(alias = "kVTDecodeFrame_EnableTemporalProcessing")] | ||
const Frame_EnableTemporalProcessing = 1<<3; | ||
} | ||
} | ||
|
||
#[cfg(feature = "objc2")] | ||
unsafe impl Encode for VTDecodeFrameFlags { | ||
const ENCODING: Encoding = u32::ENCODING; | ||
} | ||
|
||
#[cfg(feature = "objc2")] | ||
unsafe impl RefEncode for VTDecodeFrameFlags { | ||
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING); | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//! # Bindings to the `VideoToolbox` framework | ||
//! | ||
//! See [Apple's docs][apple-doc] and [the general docs on framework crates][framework-crates] for more information. | ||
//! | ||
//! [apple-doc]: https://developer.apple.com/documentation/videotoolbox/ | ||
//! [framework-crates]: https://docs.rs/objc2/latest/objc2/topics/about_generated/index.html | ||
#![no_std] | ||
#![cfg_attr(docsrs, feature(doc_auto_cfg))] | ||
// Update in Cargo.toml as well. | ||
#![doc(html_root_url = "https://docs.rs/objc2-video-toolbox/0.2.2")] | ||
|
||
#[cfg(feature = "alloc")] | ||
extern crate alloc; | ||
|
||
#[cfg(feature = "std")] | ||
extern crate std; | ||
|
||
#[cfg(feature = "VTErrors")] | ||
mod errors; | ||
mod generated; | ||
#[cfg(feature = "VTErrors")] | ||
pub use self::errors::VTDecodeFrameFlags; | ||
#[allow(unused_imports, unreachable_pub)] | ||
pub use self::generated::*; | ||
|
||
// MacTypes.h | ||
#[allow(dead_code)] | ||
pub(crate) type Boolean = u8; | ||
#[allow(dead_code)] | ||
pub(crate) type OSStatus = i32; |
12 changes: 12 additions & 0 deletions
12
framework-crates/objc2-video-toolbox/translation-config.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
framework = "VideoToolbox" | ||
crate = "objc2-video-toolbox" | ||
required-crates = ["objc2-core-foundation"] | ||
custom-lib-rs = true | ||
macos = "10.8" | ||
maccatalyst = "13.0" | ||
ios = "6.0" | ||
tvos = "10.2" | ||
visionos = "1.0" | ||
|
||
# Wrongly renamed (Swift's renaming algorithm is insufficient) | ||
enum.VTDecodeFrameFlags.skipped = true |
Submodule generated
updated
20 files
+43 −0 | VideoToolbox/VTBase.rs | |
+1,491 −0 | VideoToolbox/VTCompressionProperties.rs | |
+488 −0 | VideoToolbox/VTCompressionSession.rs | |
+503 −0 | VideoToolbox/VTDecompressionProperties.rs | |
+530 −0 | VideoToolbox/VTDecompressionSession.rs | |
+160 −0 | VideoToolbox/VTErrors.rs | |
+160 −0 | VideoToolbox/VTFrameSilo.rs | |
+114 −0 | VideoToolbox/VTHDRPerFrameMetadataGenerationSession.rs | |
+74 −0 | VideoToolbox/VTMultiPassStorage.rs | |
+57 −0 | VideoToolbox/VTPixelRotationProperties.rs | |
+95 −0 | VideoToolbox/VTPixelRotationSession.rs | |
+143 −0 | VideoToolbox/VTPixelTransferProperties.rs | |
+96 −0 | VideoToolbox/VTPixelTransferSession.rs | |
+17 −0 | VideoToolbox/VTProfessionalVideoWorkflow.rs | |
+23 −0 | VideoToolbox/VTRAWProcessingProperties.rs | |
+341 −0 | VideoToolbox/VTRAWProcessingSession.rs | |
+161 −0 | VideoToolbox/VTSession.rs | |
+142 −0 | VideoToolbox/VTUtilities.rs | |
+103 −0 | VideoToolbox/VTVideoEncoderList.rs | |
+1,006 −0 | VideoToolbox/mod.rs |