Skip to content

Commit 761f8d6

Browse files
torokati44kinetiknz
authored andcommitted
Make BoxType, BoxHeader, BMFFBox, BoxIter, and read_moov pub
1 parent afa4a66 commit 761f8d6

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

mp4parse/src/lib.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ use std::io::{Read, Take};
3535
mod macros;
3636

3737
mod boxes;
38-
use crate::boxes::{BoxType, FourCC};
38+
pub use crate::boxes::{BoxType, FourCC};
3939

4040
// Unit tests.
4141
#[cfg(test)]
@@ -920,16 +920,16 @@ pub type Result<T, E = Error> = std::result::Result<T, E>;
920920
///
921921
/// See ISOBMFF (ISO 14496-12:2020) § 4.2
922922
#[derive(Debug, Clone, Copy)]
923-
struct BoxHeader {
923+
pub struct BoxHeader {
924924
/// Box type.
925-
name: BoxType,
925+
pub name: BoxType,
926926
/// Size of the box in bytes.
927-
size: u64,
927+
pub size: u64,
928928
/// Offset to the start of the contained data (or header size).
929-
offset: u64,
929+
pub offset: u64,
930930
/// Uuid for extended type.
931931
#[allow(dead_code)] // See https://github.com/mozilla/mp4parse-rust/issues/340
932-
uuid: Option<[u8; 16]>,
932+
pub uuid: Option<[u8; 16]>,
933933
}
934934

935935
impl BoxHeader {
@@ -2130,21 +2130,21 @@ impl Track {
21302130
}
21312131

21322132
/// See ISOBMFF (ISO 14496-12:2020) § 4.2
2133-
struct BMFFBox<'a, T: 'a> {
2134-
head: BoxHeader,
2135-
content: Take<&'a mut T>,
2133+
pub struct BMFFBox<'a, T: 'a> {
2134+
pub head: BoxHeader,
2135+
pub content: Take<&'a mut T>,
21362136
}
21372137

2138-
struct BoxIter<'a, T: 'a> {
2138+
pub struct BoxIter<'a, T: 'a> {
21392139
src: &'a mut T,
21402140
}
21412141

21422142
impl<T: Read> BoxIter<'_, T> {
2143-
fn new(src: &mut T) -> BoxIter<T> {
2143+
pub fn new(src: &mut T) -> BoxIter<T> {
21442144
BoxIter { src }
21452145
}
21462146

2147-
fn next_box(&mut self) -> Result<Option<BMFFBox<T>>> {
2147+
pub fn next_box(&mut self) -> Result<Option<BMFFBox<T>>> {
21482148
let r = read_box_header(self.src);
21492149
match r {
21502150
Ok(h) => Ok(Some(BMFFBox {
@@ -4125,7 +4125,7 @@ fn parse_mvhd<T: Read>(f: &mut BMFFBox<T>) -> Result<Option<MediaTimeScale>> {
41254125
/// Note that despite the spec indicating "exactly one" moov box should exist at
41264126
/// the file container level, we support reading and merging multiple moov boxes
41274127
/// such as with tests/test_case_1185230.mp4.
4128-
fn read_moov<T: Read>(
4128+
pub fn read_moov<T: Read>(
41294129
f: &mut BMFFBox<T>,
41304130
context: Option<MediaContext>,
41314131
strictness: ParseStrictness,

0 commit comments

Comments
 (0)