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
96
//! Crate-local frame and pixel-format types used by `oxideav-mjpeg`.
//!
//! Defined here (rather than reusing `oxideav_core::VideoFrame` /
//! `oxideav_core::frame::VideoPlane` / `oxideav_core::PixelFormat`) so
//! the crate can be built with the default `registry` feature off —
//! i.e. without depending on `oxideav-core` at all. When the
//! `registry` feature is on the [`crate::registry`] module provides
//! `From<MjpegFrame> for oxideav_core::VideoFrame` (and the reverse
//! conversion needed by the encoder side) so the `Decoder`/`Encoder`
//! trait surface still interoperates cleanly.
//!
//! The shape of [`MjpegFrame`] / [`MjpegPlane`] mirrors the
//! `oxideav-core` slim-VideoFrame layout (planes are `(stride, data)`
//! tuples; the frame carries an optional PTS and a `Vec` of planes).
/// One image plane: row-major bytes plus the row stride in bytes.
/// Layout-compatible with `oxideav_core::frame::VideoPlane`.
/// Decoded JPEG / MJPEG frame.
///
/// Layout-compatible with `oxideav_core::VideoFrame` (slim shape: a
/// `Vec<MjpegPlane>` plus an optional PTS).
/// Subset of `oxideav_core::PixelFormat` the JPEG decoder/encoder
/// produces or accepts. Defined here so the standalone build does not
/// need to pull in `oxideav-core`.
///
/// When the `registry` feature is on, [`crate::registry`] provides a
/// `From<MjpegPixelFormat> for oxideav_core::PixelFormat` impl plus
/// the reverse direction so the trait-side `CodecParameters` /
/// `VideoFrame` flow keeps using the framework's canonical type.