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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
//! Stream-based I/O pipeline.
//!
//! Two muxer families live here:
//!
//! 1. **Bidirectional PES streams** (`disc`, `mkv`, `m2ts`, `network`,
//! `stdio`, `null`) implement the [`crate::pes::Stream`] interface:
//! read a format → PES frames, or write PES frames → a format.
//! 2. **Write-only sequential-sink muxers** (`fmp4`, `hevc`,
//! `m2ts_mux`) consume PES frames and write a container to a
//! `SequentialSink`; they do not implement the read loop below.
//!
//! The bidirectional family is driven like this:
//!
//! ```text
//! let mut input = input("iso://Disc.iso", &opts)?;
//! let title = input.info().clone();
//! let mut output = output("mkv://Movie.mkv", &title)?;
//! while let Ok(Some(frame)) = input.read() {
//! output.write(&frame)?;
//! }
//! output.finish()?;
//! ```
//!
//! For disc→ISO (raw sector copy), use `Disc::copy()` instead.
// Public modules — types here are intentionally part of the consumable API.
// Internal-only modules. Every reference is via `crate::mux::…` /
// `super::…` from inside the crate; nothing in the downstream crates or
// integration tests imports them and lib.rs re-exports nothing from
// them, so they are not part of the stable public API.
//
// `#[allow(dead_code)]`: narrowing these from `pub` to `pub(crate)`
// surfaces a handful of helpers/accessors that were only ever reachable
// as (unused) public API — e.g. the MPEG-2 resolution/frame-rate
// accessors and an alternate `DemuxThread` spawn path. They are kept as
// part of the parser/demux surface and covered by unit tests; allow the
// dead-code lint rather than delete still-relevant scaffolding.
pub
pub
// Internal modules — implementation details. Their *types* are re-exported
// where appropriate (`MkvStream`, `M2tsStream`, etc. surface from `lib.rs`),
// but the module paths themselves are not part of the API. Pre-0.13 these
// were `pub`, leaking low-level EBML primitives, TS muxer internals, and
// network/stdio implementations that no external caller had business
// reaching for.
pub
pub
/// FMKV metadata header (used by `M2tsStream` / `NetworkStream` / `StdioStream`
/// to round-trip codec_privates that don't fit inside the underlying format).
/// Exposed for integration tests that exercise the wire format directly.
// ── Sequential-sink muxers ──────────────────────────────────────────────────
//
// Container muxers that consume PES frames and write to a
// `SequentialSink`. They are NOT the bidirectional `MkvStream` /
// `M2tsStream` (which round-trip via the `Stream` trait + BD-TS
// framing); these are write-only and sequential.
//
// `pub(crate)`: these have no external callers and are not re-exported
// from lib.rs. `fmp4` is an explicit STUB (`Fmp4Mux::write_video`
// accumulates and discards) — shipping it as `pub` would lock a
// half-built type into the v1.0 stability contract via the
// `libfreemkv::mux::fmp4::Fmp4Mux` path. `m2ts_mux` is the plain
// MPEG-TS sequential muxer and `hevc` is its Annex-B helper; both are
// staged scaffolding for the sink split and are not yet wired into a
// live pipeline (the production paths use `tsmux` / `mkv`).
// `#[allow(dead_code)]`: retained intentionally until the sink split
// lands; they are exercised by their own unit tests. If any becomes a
// public muxer, re-export its concrete type from lib.rs instead.
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub
pub use DiscStream;
pub use M2tsStream;
pub use MkvStream;
pub use NetworkStream;
pub use NullStream;
pub use PipelinedPesStream;
pub use build_iso_pipeline;
pub use ;
pub use StdioStream;
use ;
/// Combined `Write + Seek` for sinks accepted by the MKV muxer.
///
/// Matroska's `SeekHead`, `Cues`, and `Cluster` size fields are written with
/// placeholder values during streaming and updated in-place at finalization,
/// so the output sink must support seeking. Provided as a single trait
/// alias so callers don't have to repeat `Write + Seek` everywhere; the
/// blanket impl below opts every `T: Write + Seek` in automatically
/// (`File`, `BufWriter<File>`, `Cursor<Vec<u8>>`).