Skip to content

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

Merged
merged 2 commits into from
Dec 13, 2016

Conversation

alfredoyang
Copy link
Contributor

Parsing schi, tenc, sinf and frma boxes for https://bugzilla.mozilla.org/show_bug.cgi?id=1320026.

@@ -228,6 +228,7 @@ pub struct AudioSampleEntry {
pub samplesize: u16,
pub samplerate: u32,
pub codec_specific: AudioCodecSpecific,
pub protect_info: Option<ProtectionSchemeInfoBox>,
Copy link
Contributor

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.

Copy link
Contributor Author

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>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'protection_info` here, likewise.

Copy link
Contributor Author

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,
};
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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;
},
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Copy link
Contributor Author

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;
},
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

Copy link
Contributor

@rillian rillian left a 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,
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@rillian rillian merged commit 4e876e4 into mozilla:master Dec 13, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants