-
Notifications
You must be signed in to change notification settings - Fork 64
Parsing sinf box for enca/encv track #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -228,6 +228,7 @@ pub struct AudioSampleEntry { | |||
pub samplesize: u16, | |||
pub samplerate: u32, | |||
pub codec_specific: AudioCodecSpecific, | |||
pub protect_info: Option<ProtectionSchemeInfoBox>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this abbreviation is helpful. Please call this field protection_info
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -242,6 +243,7 @@ pub struct VideoSampleEntry { | |||
pub width: u16, | |||
pub height: u16, | |||
pub codec_specific: VideoCodecSpecific, | |||
pub protect_info: Option<ProtectionSchemeInfoBox>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'protection_info` here, likewise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
BoxType::OpusSampleEntry => CodecType::Opus, | ||
BoxType::ProtectedAudioSampleEntry => CodecType::EncryptedAudio, | ||
_ => CodecType::Unknown, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't mention why you're removing this. I can see this might be dead code, in that Unknown
is the default and FLAC
, Opus
, and AAC
settings were added elsewhere with the esds parsing in #38. But please confirm it is dead code.
In general, cleanup like this is better in a separate commit so it's clear why the change was made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is dead code. I'll separate that to another commit next time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
BoxType::OriginalFormatBox => { | ||
let frma = read_frma(&mut b)?; | ||
sinf.code_name = frma; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have the cenc
spec, but 14496-12 says the OriginalFormatBox
is required. Can we reject streams without one here? We don't seem to check later whether this is what we expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
// We only need tenc box in schi box so far. | ||
let schi_tenc = read_schi(&mut b)?; | ||
sinf.tenc = schi_tenc; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we depend on the tenc
data? If so we should probably also reject streams with a sinf
without an schi
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
BoxType::OpusSampleEntry => CodecType::Opus, | ||
BoxType::ProtectedAudioSampleEntry => CodecType::EncryptedAudio, | ||
_ => CodecType::Unknown, | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok.
Parsing schi, tenc, sinf and frma boxes for https://bugzilla.mozilla.org/show_bug.cgi?id=1320026.