You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The top level box types from the mp4box module are public: MoovBox, MoofBox, MdatBox. However, with the exception of EMsgBox, none of the nested types are public. This makes it difficult to initialize these structs.
For example, here's my awful code to fragment a MoovBox:
// We need to create a brand new moov atom for each track.
let mut toov = mp4::MoovBox{
mvhd: moov.mvhd.clone(),
meta: moov.meta.clone(),
mvex: Some(Default::default()),
traks: vec![trak.clone()],
udta: moov.udta.clone(),
};
// TODO someone who knows Rust, please double check that I'm not dumb.
// MvexBox and TrexBox are not exported by the mp4 crate, so we have to construct them using Default.
toov.mvex.as_mut().map(|mvex| {
mvex.trex = Default::default();
mvex.trex.track_id = track_id;
});
If these types didn't derive Default, I'm not even sure that it would be possible to set them. Could you export these nested types, or change the mp4box box so it uses pub instead of pub(crate)?
The text was updated successfully, but these errors were encountered:
Hey there,
The top level box types from the
mp4box
module are public:MoovBox
,MoofBox
,MdatBox
. However, with the exception ofEMsgBox
, none of the nested types are public. This makes it difficult to initialize these structs.For example, here's my awful code to fragment a MoovBox:
If these types didn't derive Default, I'm not even sure that it would be possible to set them. Could you export these nested types, or change the mp4box box so it uses
pub
instead ofpub(crate)
?The text was updated successfully, but these errors were encountered: