зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1314460 - Update rust mp4parse to v0.6.0. r=kinetik
Result of running the update script. MozReview-Commit-ID: 4rqFqaFJ028 --HG-- extra : rebase_source : 011cd38d524e2609e2656a084c2ac920d407488f
This commit is contained in:
Родитель
5c1056e5fa
Коммит
b9e0fc97c3
|
@ -1,9 +1,10 @@
|
|||
[package]
|
||||
name = "mp4parse"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
authors = [
|
||||
"Ralph Giles <giles@mozilla.com>",
|
||||
"Matthew Gregan <kinetik@flim.org>",
|
||||
"Alfredo Yang <ayang@mozilla.com>",
|
||||
]
|
||||
|
||||
description = "Parser for ISO base media file format (mp4)"
|
||||
|
|
|
@ -209,6 +209,7 @@ pub enum SampleEntry {
|
|||
pub struct ES_Descriptor {
|
||||
pub audio_codec: CodecType,
|
||||
pub audio_sample_rate: Option<u32>,
|
||||
pub audio_channel_count: Option<u16>,
|
||||
pub codec_specific_config: Vec<u8>,
|
||||
}
|
||||
|
||||
|
@ -1136,10 +1137,11 @@ fn read_esds<T: Read>(src: &mut BMFFBox<T>) -> Result<ES_Descriptor> {
|
|||
let esds_array = try!(read_buf(src, esds_size as usize));
|
||||
|
||||
// Parsing DecoderConfig descriptor to get the object_profile_indicator
|
||||
// for correct codec type and audio sample rate.
|
||||
let (object_profile_indicator, sample_frequency) = {
|
||||
// for correct codec type, audio sample rate and channel counts.
|
||||
let (object_profile_indicator, sample_frequency, channels) = {
|
||||
let mut object_profile: u8 = 0;
|
||||
let mut sample_frequency = None;
|
||||
let mut channels = None;
|
||||
|
||||
// clone a esds cursor for parsing.
|
||||
let esds = &mut Cursor::new(&esds_array);
|
||||
|
@ -1209,12 +1211,16 @@ fn read_esds<T: Read>(src: &mut BMFFBox<T>) -> Result<ES_Descriptor> {
|
|||
|
||||
let sample_index = (audio_specific_config & 0x07FF) >> 7;
|
||||
|
||||
let channel_counts = (audio_specific_config & 0x007F) >> 3;
|
||||
|
||||
sample_frequency =
|
||||
frequency_table.iter().find(|item| item.0 == sample_index).map(|x| x.1);
|
||||
|
||||
channels = Some(channel_counts);
|
||||
}
|
||||
}
|
||||
|
||||
(object_profile, sample_frequency)
|
||||
(object_profile, sample_frequency, channels)
|
||||
};
|
||||
|
||||
let codec = match object_profile_indicator {
|
||||
|
@ -1230,6 +1236,7 @@ fn read_esds<T: Read>(src: &mut BMFFBox<T>) -> Result<ES_Descriptor> {
|
|||
Ok(ES_Descriptor {
|
||||
audio_codec: codec,
|
||||
audio_sample_rate: sample_frequency,
|
||||
audio_channel_count: channels,
|
||||
codec_specific_config: esds_array,
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
[package]
|
||||
name = "mp4parse_capi"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
authors = [
|
||||
"Ralph Giles <giles@mozilla.com>",
|
||||
"Matthew Gregan <kinetik@flim.org>",
|
||||
"Alfredo Yang <ayang@mozilla.com>",
|
||||
]
|
||||
|
||||
description = "Parser for ISO base media file format (mp4)"
|
||||
|
@ -18,7 +19,7 @@ exclude = [
|
|||
]
|
||||
|
||||
[dependencies]
|
||||
"mp4parse" = {version = "0.5.1", path = "../mp4parse"}
|
||||
"mp4parse" = {version = "0.6.0", path = "../mp4parse"}
|
||||
|
||||
# Somewhat heavy-handed, but we want at least -Z force-overflow-checks=on.
|
||||
[profile.release]
|
||||
|
|
|
@ -447,6 +447,9 @@ pub unsafe extern fn mp4parse_get_track_audio_info(parser: *mut mp4parse_parser,
|
|||
if let Some(rate) = v.audio_sample_rate {
|
||||
(*info).sample_rate = rate;
|
||||
}
|
||||
if let Some(channels) = v.audio_channel_count {
|
||||
(*info).channels = channels;
|
||||
}
|
||||
}
|
||||
AudioCodecSpecific::FLACSpecificBox(ref flac) => {
|
||||
// Return the STREAMINFO metadata block in the codec_specific.
|
||||
|
@ -801,7 +804,7 @@ fn arg_validation_with_data() {
|
|||
|
||||
let mut audio = Default::default();
|
||||
assert_eq!(MP4PARSE_OK, mp4parse_get_track_audio_info(parser, 1, &mut audio));
|
||||
assert_eq!(audio.channels, 2);
|
||||
assert_eq!(audio.channels, 1);
|
||||
assert_eq!(audio.bit_depth, 16);
|
||||
assert_eq!(audio.sample_rate, 48000);
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "gkrust-shared"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"mp4parse_capi 0.5.1",
|
||||
"mp4parse_capi 0.6.0",
|
||||
"nsstring 0.1.0",
|
||||
"rust_url_capi 0.0.1",
|
||||
]
|
||||
|
@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "mp4parse"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
@ -54,9 +54,9 @@ version = "0.1.0"
|
|||
|
||||
[[package]]
|
||||
name = "mp4parse_capi"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"mp4parse 0.5.1",
|
||||
"mp4parse 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
@ -14,7 +14,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
name = "gkrust-shared"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"mp4parse_capi 0.5.1",
|
||||
"mp4parse_capi 0.6.0",
|
||||
"nsstring 0.1.0",
|
||||
"rust_url_capi 0.0.1",
|
||||
]
|
||||
|
@ -41,16 +41,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
|||
|
||||
[[package]]
|
||||
name = "mp4parse"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"byteorder 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mp4parse_capi"
|
||||
version = "0.5.1"
|
||||
version = "0.6.0"
|
||||
dependencies = [
|
||||
"mp4parse 0.5.1",
|
||||
"mp4parse 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
Загрузка…
Ссылка в новой задаче