1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
//! Core types and traits for `OxiMedia`.
//!
//! `oximedia-core` provides the foundational types and traits used throughout
//! the `OxiMedia` multimedia framework. This includes:
//!
//! - **Types**: Rational numbers, timestamps, pixel/sample formats, codec IDs
//! - **Traits**: Decoder and demuxer interfaces
//! - **Error handling**: Unified error type with patent violation detection
//! - **Memory management**: Buffer pools for zero-copy operations
//! - **HDR support**: HDR metadata, transfer functions, color primaries, and conversions
//!
//! # Green List Only
//!
//! `OxiMedia` only supports patent-free codecs:
//!
//! | Video | Audio | Subtitle |
//! |-------|-------|----------|
//! | AV1 | Opus | `WebVTT` |
//! | VP9 | Vorbis| ASS/SSA |
//! | VP8 | FLAC | SRT |
//! | Theora| PCM | |
//!
//! Attempting to use patent-encumbered codecs (H.264, H.265, AAC, etc.)
//! will result in a [`PatentViolation`](error::OxiError::PatentViolation) error.
//!
//! # Example
//!
//! ```
//! use oximedia_core::types::{Rational, Timestamp, PixelFormat, CodecId};
//! use oximedia_core::error::OxiResult;
//!
//! fn example() -> OxiResult<()> {
//! // Create a timestamp at 1 second with millisecond precision
//! let ts = Timestamp::new(1000, Rational::new(1, 1000));
//! assert!((ts.to_seconds() - 1.0).abs() < f64::EPSILON);
//!
//! // Check codec properties
//! let codec = CodecId::Av1;
//! assert!(codec.is_video());
//!
//! // Check pixel format properties
//! let format = PixelFormat::Yuv420p;
//! assert!(format.is_planar());
//! assert_eq!(format.plane_count(), 3);
//!
//! Ok(())
//! }
//! ```
// Re-export commonly used items at crate root
pub use ;
pub use ;
/// Initialises the OxiMedia WASM module.
///
/// Sets up panic hooks for better error messages in the browser console.
/// Called from `oximedia-wasm` init function.