Bug 1419627 - Update mp4parse-rust to cbindgen version. r=rillian
authorMatthew Gregan <kinetik@flim.org>
Wed, 22 Nov 2017 15:18:00 +1300
changeset 393252 987eb1eb9b47cf5df71caedec28552211ceeb796
parent 393251 7beea3063907269c70c04ad030b65fb1712169df
child 393253 6286ca9b5067a317c812a473fd583ebafc3229b7
push id55872
push usermgregan@mozilla.com
push dateThu, 23 Nov 2017 00:45:54 +0000
treeherderautoland@987eb1eb9b47 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1419627
milestone59.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1419627 - Update mp4parse-rust to cbindgen version. r=rillian MozReview-Commit-ID: CJwg8isx8Jk
media/mp4parse-rust/mp4parse-cargo.patch
media/mp4parse-rust/mp4parse.h
media/mp4parse-rust/mp4parse/Cargo.toml
media/mp4parse-rust/mp4parse_capi/Cargo.toml
media/mp4parse-rust/mp4parse_capi/build.rs
media/mp4parse-rust/mp4parse_capi/src/lib.rs
media/mp4parse-rust/update-rust.sh
toolkit/library/gtest/rust/Cargo.lock
toolkit/library/rust/Cargo.lock
--- a/media/mp4parse-rust/mp4parse-cargo.patch
+++ b/media/mp4parse-rust/mp4parse-cargo.patch
@@ -25,33 +25,31 @@ index ff9422c..814c4c6 100644
 -fuzz = ["afl", "afl-plugin", "abort_on_panic"]
  # Somewhat heavy-handed, but we want at least -Z force-overflow-checks=on.
  [profile.release]
  debug-assertions = true
 diff --git a/media/libstagefright/binding/mp4parse_capi/Cargo.toml b/media/libstagefright/binding/mp4parse_capi/Cargo.toml
 index a30e045..a965f06 100644
 --- a/media/libstagefright/binding/mp4parse_capi/Cargo.toml
 +++ b/media/libstagefright/binding/mp4parse_capi/Cargo.toml
-@@ -18,22 +18,13 @@ exclude = [
+@@ -18,20 +18,13 @@ exclude = [
    "*.mp4",
  ]
 
--build = "build.rs"
--
 -[badges]
 -travis-ci = { repository = "https://github.com/mozilla/mp4parse-rust" }
 +build = false
 
  [dependencies]
  byteorder = "1.0.0"
 
  # To enable fallible memory allocation, add 'features = ["mp4parse_fallible"]'
  # in mp4parse brace.
--mp4parse = {version = "0.8.0", path = "../mp4parse"}
-+mp4parse = {version = "0.8.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
+-mp4parse = {version = "0.9.0", path = "../mp4parse"}
++mp4parse = {version = "0.9.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
  num-traits = "0.1.37"
 
 -[build-dependencies]
--moz-cheddar = "0.4.0"
+-cbindgen = "0.1.30"
 -
 -[features]
 -fuzz = ["mp4parse/fuzz"]
 -
--- a/media/mp4parse-rust/mp4parse.h
+++ b/media/mp4parse-rust/mp4parse.h
@@ -1,160 +1,193 @@
-
-#ifndef cheddar_generated_mp4parse_h
-#define cheddar_generated_mp4parse_h
-
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
+#ifndef MP4PARSE_CAPI_H
+#define MP4PARSE_CAPI_H
+
+// THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
+
 #include <stdint.h>
+#include <stdlib.h>
 #include <stdbool.h>
 
-// THIS FILE IS AUTOGENERATED BY mp4parse-rust/build.rs - DO NOT EDIT
-
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+typedef enum {
+  MP4PARSE_CODEC_UNKNOWN = 0,
+  MP4PARSE_CODEC_AAC = 1,
+  MP4PARSE_CODEC_FLAC = 2,
+  MP4PARSE_CODEC_OPUS = 3,
+  MP4PARSE_CODEC_AVC = 4,
+  MP4PARSE_CODEC_VP9 = 5,
+  MP4PARSE_CODEC_MP3 = 6,
+  MP4PARSE_CODEC_MP4V = 7,
+  MP4PARSE_CODEC_JPEG = 8,
+  MP4PARSE_CODEC_AC3 = 9,
+  MP4PARSE_CODEC_EC3 = 10,
+} Mp4parseCodec;
 
-typedef enum mp4parse_status {
-	mp4parse_status_OK = 0,
-	mp4parse_status_BAD_ARG = 1,
-	mp4parse_status_INVALID = 2,
-	mp4parse_status_UNSUPPORTED = 3,
-	mp4parse_status_EOF = 4,
-	mp4parse_status_IO = 5,
-	mp4parse_status_OOM = 6,
-} mp4parse_status;
+typedef enum {
+  MP4PARSE_STATUS_OK = 0,
+  MP4PARSE_STATUS_BAD_ARG = 1,
+  MP4PARSE_STATUS_INVALID = 2,
+  MP4PARSE_STATUS_UNSUPPORTED = 3,
+  MP4PARSE_STATUS_EOF = 4,
+  MP4PARSE_STATUS_IO = 5,
+  MP4PARSE_STATUS_OOM = 6,
+} Mp4parseStatus;
 
-typedef enum mp4parse_track_type {
-	mp4parse_track_type_VIDEO = 0,
-	mp4parse_track_type_AUDIO = 1,
-} mp4parse_track_type;
+typedef enum {
+  MP4PARSE_TRACK_TYPE_VIDEO = 0,
+  MP4PARSE_TRACK_TYPE_AUDIO = 1,
+} Mp4parseTrackType;
+
+struct Mp4parseParser;
+typedef struct Mp4parseParser Mp4parseParser;
+
+typedef struct {
+  uint64_t fragment_duration;
+} Mp4parseFragmentInfo;
 
-typedef enum mp4parse_codec {
-	mp4parse_codec_UNKNOWN,
-	mp4parse_codec_AAC,
-	mp4parse_codec_FLAC,
-	mp4parse_codec_OPUS,
-	mp4parse_codec_AVC,
-	mp4parse_codec_VP9,
-	mp4parse_codec_MP3,
-	mp4parse_codec_MP4V,
-	mp4parse_codec_JPEG,
-	mp4parse_codec_AC3,
-	mp4parse_codec_EC3,
-} mp4parse_codec;
+typedef struct {
+  uint64_t start_offset;
+  uint64_t end_offset;
+  int64_t start_composition;
+  int64_t end_composition;
+  int64_t start_decode;
+  bool sync;
+} Mp4parseIndice;
+
+typedef struct {
+  uint32_t length;
+  const uint8_t *data;
+  const Mp4parseIndice *indices;
+} Mp4parseByteData;
+
+typedef struct {
+  Mp4parseByteData data;
+} Mp4parsePsshInfo;
 
-typedef struct mp4parse_track_info {
-	mp4parse_track_type track_type;
-	mp4parse_codec codec;
-	uint32_t track_id;
-	uint64_t duration;
-	int64_t media_time;
-} mp4parse_track_info;
+typedef struct {
+  uint32_t is_encrypted;
+  uint8_t iv_size;
+  Mp4parseByteData kid;
+} Mp4parseSinfInfo;
 
-typedef struct mp4parse_indice {
-	uint64_t start_offset;
-	uint64_t end_offset;
-	int64_t start_composition;
-	int64_t end_composition;
-	int64_t start_decode;
-	bool sync;
-} mp4parse_indice;
+typedef struct {
+  uint16_t channels;
+  uint16_t bit_depth;
+  uint32_t sample_rate;
+  uint16_t profile;
+  Mp4parseByteData codec_specific_config;
+  Mp4parseByteData extra_data;
+  Mp4parseSinfInfo protected_data;
+} Mp4parseTrackAudioInfo;
+
+typedef struct {
+  Mp4parseTrackType track_type;
+  Mp4parseCodec codec;
+  uint32_t track_id;
+  uint64_t duration;
+  int64_t media_time;
+} Mp4parseTrackInfo;
 
-typedef struct mp4parse_byte_data {
-	uint32_t length;
-	uint8_t const* data;
-	mp4parse_indice const* indices;
-} mp4parse_byte_data;
+typedef struct {
+  uint32_t display_width;
+  uint32_t display_height;
+  uint16_t image_width;
+  uint16_t image_height;
+  uint16_t rotation;
+  Mp4parseByteData extra_data;
+  Mp4parseSinfInfo protected_data;
+} Mp4parseTrackVideoInfo;
 
-typedef struct mp4parse_pssh_info {
-	mp4parse_byte_data data;
-} mp4parse_pssh_info;
+typedef struct {
+  intptr_t (*read)(uint8_t*, size_t, void*);
+  void *userdata;
+} Mp4parseIo;
 
-typedef struct mp4parse_sinf_info {
-	uint32_t is_encrypted;
-	uint8_t iv_size;
-	mp4parse_byte_data kid;
-} mp4parse_sinf_info;
+// THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
+
+/*
+ * Free an `Mp4parseParser*` allocated by `mp4parse_new()`.
+ */
+void mp4parse_free(Mp4parseParser *parser);
 
-typedef struct mp4parse_track_audio_info {
-	uint16_t channels;
-	uint16_t bit_depth;
-	uint32_t sample_rate;
-	uint16_t profile;
-	mp4parse_byte_data codec_specific_config;
-	mp4parse_byte_data extra_data;
-	mp4parse_sinf_info protected_data;
-} mp4parse_track_audio_info;
+/*
+ * Fill the supplied `Mp4parseFragmentInfo` with metadata from fragmented file.
+ */
+Mp4parseStatus mp4parse_get_fragment_info(Mp4parseParser *parser, Mp4parseFragmentInfo *info);
+
+Mp4parseStatus mp4parse_get_indice_table(Mp4parseParser *parser,
+                                         uint32_t track_id,
+                                         Mp4parseByteData *indices);
 
-typedef struct mp4parse_track_video_info {
-	uint32_t display_width;
-	uint32_t display_height;
-	uint16_t image_width;
-	uint16_t image_height;
-	uint16_t rotation;
-	mp4parse_byte_data extra_data;
-	mp4parse_sinf_info protected_data;
-} mp4parse_track_video_info;
+/*
+ * Get 'pssh' system id and 'pssh' box content for eme playback.
+ *
+ * The data format of the `info` struct passed to gecko is:
+ *
+ * - system id (16 byte uuid)
+ * - pssh box size (32-bit native endian)
+ * - pssh box content (including header)
+ */
+Mp4parseStatus mp4parse_get_pssh_info(Mp4parseParser *parser, Mp4parsePsshInfo *info);
 
-typedef struct mp4parse_fragment_info {
-	uint64_t fragment_duration;
-} mp4parse_fragment_info;
+/*
+ * Fill the supplied `Mp4parseTrackAudioInfo` with metadata for `track`.
+ */
+Mp4parseStatus mp4parse_get_track_audio_info(Mp4parseParser *parser,
+                                             uint32_t track_index,
+                                             Mp4parseTrackAudioInfo *info);
+
+/*
+ * Return the number of tracks parsed by previous `mp4parse_read()` call.
+ */
+Mp4parseStatus mp4parse_get_track_count(const Mp4parseParser *parser, uint32_t *count);
 
-typedef struct mp4parse_parser mp4parse_parser;
-
-typedef struct mp4parse_io {
-	intptr_t (*read)(uint8_t* buffer, uintptr_t size, void* userdata);
-	void* userdata;
-} mp4parse_io;
+/*
+ * Fill the supplied `Mp4parseTrackInfo` with metadata for `track`.
+ */
+Mp4parseStatus mp4parse_get_track_info(Mp4parseParser *parser,
+                                       uint32_t track_index,
+                                       Mp4parseTrackInfo *info);
 
-/// Allocate an `mp4parse_parser*` to read from the supplied `mp4parse_io`.
-mp4parse_parser* mp4parse_new(mp4parse_io const* io);
+/*
+ * Fill the supplied `Mp4parseTrackVideoInfo` with metadata for `track`.
+ */
+Mp4parseStatus mp4parse_get_track_video_info(Mp4parseParser *parser,
+                                             uint32_t track_index,
+                                             Mp4parseTrackVideoInfo *info);
 
-/// Free an `mp4parse_parser*` allocated by `mp4parse_new()`.
-void mp4parse_free(mp4parse_parser* parser);
+/*
+ * A fragmented file needs mvex table and contains no data in stts, stsc, and stco boxes.
+ */
+Mp4parseStatus mp4parse_is_fragmented(Mp4parseParser *parser,
+                                      uint32_t track_id,
+                                      uint8_t *fragmented);
 
-/// Enable `mp4_parser` log.
+/*
+ * Enable `mp4_parser` log.
+ */
 void mp4parse_log(bool enable);
 
-/// Run the `mp4parse_parser*` allocated by `mp4parse_new()` until EOF or error.
-mp4parse_status mp4parse_read(mp4parse_parser* parser);
-
-/// Return the number of tracks parsed by previous `mp4parse_read()` call.
-mp4parse_status mp4parse_get_track_count(mp4parse_parser const* parser, uint32_t* count);
-
-/// Fill the supplied `mp4parse_track_info` with metadata for `track`.
-mp4parse_status mp4parse_get_track_info(mp4parse_parser* parser, uint32_t track_index, mp4parse_track_info* info);
-
-/// Fill the supplied `mp4parse_track_audio_info` with metadata for `track`.
-mp4parse_status mp4parse_get_track_audio_info(mp4parse_parser* parser, uint32_t track_index, mp4parse_track_audio_info* info);
-
-/// Fill the supplied `mp4parse_track_video_info` with metadata for `track`.
-mp4parse_status mp4parse_get_track_video_info(mp4parse_parser* parser, uint32_t track_index, mp4parse_track_video_info* info);
-
-mp4parse_status mp4parse_get_indice_table(mp4parse_parser* parser, uint32_t track_id, mp4parse_byte_data* indices);
+/*
+ * Allocate an `Mp4parseParser*` to read from the supplied `Mp4parseIo`.
+ */
+Mp4parseParser *mp4parse_new(const Mp4parseIo *io);
 
-/// Fill the supplied `mp4parse_fragment_info` with metadata from fragmented file.
-mp4parse_status mp4parse_get_fragment_info(mp4parse_parser* parser, mp4parse_fragment_info* info);
-
-/// A fragmented file needs mvex table and contains no data in stts, stsc, and stco boxes.
-mp4parse_status mp4parse_is_fragmented(mp4parse_parser* parser, uint32_t track_id, uint8_t* fragmented);
+/*
+ * Run the `Mp4parseParser*` allocated by `mp4parse_new()` until EOF or error.
+ */
+Mp4parseStatus mp4parse_read(Mp4parseParser *parser);
 
-/// Get 'pssh' system id and 'pssh' box content for eme playback.
-///
-/// The data format of the `info` struct passed to gecko is:
-///
-/// - system id (16 byte uuid)
-/// - pssh box size (32-bit native endian)
-/// - pssh box content (including header)
-mp4parse_status mp4parse_get_pssh_info(mp4parse_parser* parser, mp4parse_pssh_info* info);
+// THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT
 
-
+#endif /* MP4PARSE_CAPI_H */
 
 #ifdef __cplusplus
-}
+} /* extern "C" */
 #endif
-
-
-#endif
--- a/media/mp4parse-rust/mp4parse/Cargo.toml
+++ b/media/mp4parse-rust/mp4parse/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
 name = "mp4parse"
-version = "0.8.0"
+version = "0.9.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)"
 documentation = "https://docs.rs/mp4parse/"
--- a/media/mp4parse-rust/mp4parse_capi/Cargo.toml
+++ b/media/mp4parse-rust/mp4parse_capi/Cargo.toml
@@ -1,11 +1,11 @@
 [package]
 name = "mp4parse_capi"
-version = "0.8.0"
+version = "0.9.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)"
 documentation = "https://docs.rs/mp4parse_capi/"
@@ -20,11 +20,11 @@ exclude = [
 
 build = false
 
 [dependencies]
 byteorder = "1.0.0"
 
 # To enable fallible memory allocation, add 'features = ["mp4parse_fallible"]'
 # in mp4parse brace.
-mp4parse = {version = "0.8.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
+mp4parse = {version = "0.9.0", path = "../mp4parse", features = ["mp4parse_fallible"]}
 num-traits = "0.1.37"
 
--- a/media/mp4parse-rust/mp4parse_capi/build.rs
+++ b/media/mp4parse-rust/mp4parse_capi/build.rs
@@ -1,12 +1,39 @@
-extern crate cheddar;
+extern crate cbindgen;
+
+use cbindgen::{Config, RenameRule};
 
 fn main() {
+    let crate_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
+
     println!("cargo:rerun-if-changed=src/lib.rs");
+
+    let config = {
+        let mut c: Config = Default::default();
+        c.header = Some(r##"
+// This Source Code Form is subject to the terms of the Mozilla Public
+// License, v. 2.0. If a copy of the MPL was not distributed with this
+// file, You can obtain one at https://mozilla.org/MPL/2.0/.
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+"##.trim().into());
+        c.trailer = Some(r##"
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+"##.trim().into());
+        c.include_guard = Some("MP4PARSE_CAPI_H".to_owned());
+        c.autogen_warning = Some(
+            "// THIS FILE IS AUTOGENERATED BY mp4parse_capi/build.rs - DO NOT EDIT".to_owned(),
+        );
+        c.language = cbindgen::Language::C;
+        c.enumeration.rename_variants = Some(RenameRule::QualifiedScreamingSnakeCase);
+        c
+    };
+
     // Generate mp4parse.h.
-    cheddar::Cheddar::new().expect("could not read manifest")
-        .insert_code("// THIS FILE IS AUTOGENERATED BY mp4parse-rust/build.rs - DO NOT EDIT\n\n")
-        .insert_code("// This Source Code Form is subject to the terms of the Mozilla Public\n")
-        .insert_code("// License, v. 2.0. If a copy of the MPL was not distributed with this\n")
-        .insert_code("// file, You can obtain one at https://mozilla.org/MPL/2.0/.")
-        .run_build("include/mp4parse.h");
+    cbindgen::generate_with_config(&crate_dir, config)
+        .expect("Could not generate header")
+        .write_to_file("include/mp4parse.h");
 }
--- a/media/mp4parse-rust/mp4parse_capi/src/lib.rs
+++ b/media/mp4parse-rust/mp4parse_capi/src/lib.rs
@@ -13,24 +13,24 @@
 //!    let mut buf = unsafe { std::slice::from_raw_parts_mut(buf, size) };
 //!    match input.read(&mut buf) {
 //!        Ok(n) => n as isize,
 //!        Err(_) => -1,
 //!    }
 //! }
 //!
 //! let mut file = std::fs::File::open("../mp4parse/tests/minimal.mp4").unwrap();
-//! let io = mp4parse_capi::mp4parse_io {
+//! let io = mp4parse_capi::Mp4parseIo {
 //!     read: Some(buf_read),
 //!     userdata: &mut file as *mut _ as *mut std::os::raw::c_void
 //! };
 //! unsafe {
 //!     let parser = mp4parse_capi::mp4parse_new(&io);
 //!     let rv = mp4parse_capi::mp4parse_read(parser);
-//!     assert_eq!(rv, mp4parse_capi::mp4parse_status::OK);
+//!     assert_eq!(rv, mp4parse_capi::Mp4parseStatus::Ok);
 //!     mp4parse_capi::mp4parse_free(parser);
 //! }
 //! ```
 
 // This Source Code Form is subject to the terms of the Mozilla Public
 // License, v. 2.0. If a copy of the MPL was not distributed with this
 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
 
@@ -55,314 +55,307 @@ use mp4parse::MediaTimeScale;
 use mp4parse::MediaScaledTime;
 use mp4parse::TrackTimeScale;
 use mp4parse::TrackScaledTime;
 use mp4parse::serialize_opus_header;
 use mp4parse::CodecType;
 use mp4parse::Track;
 use mp4parse::vec_push;
 
-#[allow(non_camel_case_types)]
 #[repr(C)]
 #[derive(PartialEq, Debug)]
-pub enum mp4parse_status {
-    OK = 0,
-    BAD_ARG = 1,
-    INVALID = 2,
-    UNSUPPORTED = 3,
-    EOF = 4,
-    IO = 5,
-    OOM = 6,
+pub enum Mp4parseStatus {
+    Ok = 0,
+    BadArg = 1,
+    Invalid = 2,
+    Unsupported = 3,
+    Eof = 4,
+    Io = 5,
+    Oom = 6,
+}
+
+#[repr(C)]
+#[derive(PartialEq, Debug)]
+pub enum Mp4parseTrackType {
+    Video = 0,
+    Audio = 1,
+}
+
+impl Default for Mp4parseTrackType {
+    fn default() -> Self { Mp4parseTrackType::Video }
 }
 
 #[allow(non_camel_case_types)]
 #[repr(C)]
 #[derive(PartialEq, Debug)]
-pub enum mp4parse_track_type {
-    VIDEO = 0,
-    AUDIO = 1,
-}
-
-impl Default for mp4parse_track_type {
-    fn default() -> Self { mp4parse_track_type::VIDEO }
+pub enum Mp4parseCodec {
+    Unknown,
+    Aac,
+    Flac,
+    Opus,
+    Avc,
+    Vp9,
+    Mp3,
+    Mp4v,
+    Jpeg,   // for QT JPEG atom in video track
+    Ac3,
+    Ec3,
 }
 
-#[allow(non_camel_case_types)]
-#[repr(C)]
-#[derive(PartialEq, Debug)]
-pub enum mp4parse_codec {
-    UNKNOWN,
-    AAC,
-    FLAC,
-    OPUS,
-    AVC,
-    VP9,
-    MP3,
-    MP4V,
-    JPEG,   // for QT JPEG atom in video track
-    AC3,
-    EC3,
-}
-
-impl Default for mp4parse_codec {
-    fn default() -> Self { mp4parse_codec::UNKNOWN }
+impl Default for Mp4parseCodec {
+    fn default() -> Self { Mp4parseCodec::Unknown }
 }
 
 #[repr(C)]
 #[derive(Default, Debug)]
-pub struct mp4parse_track_info {
-    pub track_type: mp4parse_track_type,
-    pub codec: mp4parse_codec,
+pub struct Mp4parseTrackInfo {
+    pub track_type: Mp4parseTrackType,
+    pub codec: Mp4parseCodec,
     pub track_id: u32,
     pub duration: u64,
     pub media_time: i64, // wants to be u64? understand how elst adjustment works
     // TODO(kinetik): include crypto guff
 }
 
 #[repr(C)]
 #[derive(Default, Debug, PartialEq)]
-pub struct mp4parse_indice {
+pub struct Mp4parseIndice {
     pub start_offset: u64,
     pub end_offset: u64,
     pub start_composition: i64,
     pub end_composition: i64,
     pub start_decode: i64,
     pub sync: bool,
 }
 
 #[repr(C)]
 #[derive(Debug)]
-pub struct mp4parse_byte_data {
+pub struct Mp4parseByteData {
     pub length: u32,
     // cheddar can't handle generic type, so it needs to be multiple data types here.
     pub data: *const u8,
-    pub indices: *const mp4parse_indice,
+    pub indices: *const Mp4parseIndice,
 }
 
-impl Default for mp4parse_byte_data {
+impl Default for Mp4parseByteData {
     fn default() -> Self {
-        mp4parse_byte_data {
+        Self {
             length: 0,
             data: std::ptr::null(),
             indices: std::ptr::null(),
         }
     }
 }
 
-impl mp4parse_byte_data {
+impl Mp4parseByteData {
     fn set_data(&mut self, data: &[u8]) {
         self.length = data.len() as u32;
         self.data = data.as_ptr();
     }
-    fn set_indices(&mut self, data: &[mp4parse_indice]) {
+
+    fn set_indices(&mut self, data: &[Mp4parseIndice]) {
         self.length = data.len() as u32;
         self.indices = data.as_ptr();
     }
 }
 
 #[repr(C)]
 #[derive(Default)]
-pub struct mp4parse_pssh_info {
-    pub data: mp4parse_byte_data,
+pub struct Mp4parsePsshInfo {
+    pub data: Mp4parseByteData,
 }
 
 #[repr(C)]
 #[derive(Default, Debug)]
-pub struct mp4parse_sinf_info {
+pub struct Mp4parseSinfInfo {
     pub is_encrypted: u32,
     pub iv_size: u8,
-    pub kid: mp4parse_byte_data,
+    pub kid: Mp4parseByteData,
 }
 
 #[repr(C)]
 #[derive(Default, Debug)]
-pub struct mp4parse_track_audio_info {
+pub struct Mp4parseTrackAudioInfo {
     pub channels: u16,
     pub bit_depth: u16,
     pub sample_rate: u32,
     pub profile: u16,
-    pub codec_specific_config: mp4parse_byte_data,
-    pub extra_data: mp4parse_byte_data,
-    pub protected_data: mp4parse_sinf_info,
+    pub codec_specific_config: Mp4parseByteData,
+    pub extra_data: Mp4parseByteData,
+    pub protected_data: Mp4parseSinfInfo,
 }
 
 #[repr(C)]
 #[derive(Default, Debug)]
-pub struct mp4parse_track_video_info {
+pub struct Mp4parseTrackVideoInfo {
     pub display_width: u32,
     pub display_height: u32,
     pub image_width: u16,
     pub image_height: u16,
     pub rotation: u16,
-    pub extra_data: mp4parse_byte_data,
-    pub protected_data: mp4parse_sinf_info,
+    pub extra_data: Mp4parseByteData,
+    pub protected_data: Mp4parseSinfInfo,
 }
 
 #[repr(C)]
 #[derive(Default, Debug)]
-pub struct mp4parse_fragment_info {
+pub struct Mp4parseFragmentInfo {
     pub fragment_duration: u64,
     // TODO:
     // info in trex box.
 }
 
-// Even though mp4parse_parser is opaque to C, rusty-cheddar won't let us
-// use more than one member, so we introduce *another* wrapper.
-struct Wrap {
+pub struct Mp4parseParser {
     context: MediaContext,
-    io: mp4parse_io,
+    io: Mp4parseIo,
     poisoned: bool,
     opus_header: HashMap<u32, Vec<u8>>,
     pssh_data: Vec<u8>,
-    sample_table: HashMap<u32, Vec<mp4parse_indice>>,
+    sample_table: HashMap<u32, Vec<Mp4parseIndice>>,
 }
 
-#[repr(C)]
-#[allow(non_camel_case_types)]
-pub struct mp4parse_parser(Wrap);
-
-impl mp4parse_parser {
+impl Mp4parseParser {
     fn context(&self) -> &MediaContext {
-        &self.0.context
+        &self.context
     }
 
     fn context_mut(&mut self) -> &mut MediaContext {
-        &mut self.0.context
+        &mut self.context
     }
 
-    fn io_mut(&mut self) -> &mut mp4parse_io {
-        &mut self.0.io
+    fn io_mut(&mut self) -> &mut Mp4parseIo {
+        &mut self.io
     }
 
     fn poisoned(&self) -> bool {
-        self.0.poisoned
+        self.poisoned
     }
 
     fn set_poisoned(&mut self, poisoned: bool) {
-        self.0.poisoned = poisoned;
+        self.poisoned = poisoned;
     }
 
     fn opus_header_mut(&mut self) -> &mut HashMap<u32, Vec<u8>> {
-        &mut self.0.opus_header
+        &mut self.opus_header
     }
 
     fn pssh_data_mut(&mut self) -> &mut Vec<u8> {
-        &mut self.0.pssh_data
+        &mut self.pssh_data
     }
 
-    fn sample_table_mut(&mut self) -> &mut HashMap<u32, Vec<mp4parse_indice>> {
-        &mut self.0.sample_table
+    fn sample_table_mut(&mut self) -> &mut HashMap<u32, Vec<Mp4parseIndice>> {
+        &mut self.sample_table
     }
 }
 
 #[repr(C)]
 #[derive(Clone)]
-pub struct mp4parse_io {
+pub struct Mp4parseIo {
     pub read: Option<extern fn(buffer: *mut u8, size: usize, userdata: *mut std::os::raw::c_void) -> isize>,
     pub userdata: *mut std::os::raw::c_void,
 }
 
-impl Read for mp4parse_io {
+impl Read for Mp4parseIo {
     fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {
         if buf.len() > isize::max_value() as usize {
-            return Err(std::io::Error::new(std::io::ErrorKind::Other, "buf length overflow in mp4parse_io Read impl"));
+            return Err(std::io::Error::new(std::io::ErrorKind::Other, "buf length overflow in Mp4parseIo Read impl"));
         }
         let rv = self.read.unwrap()(buf.as_mut_ptr(), buf.len(), self.userdata);
         if rv >= 0 {
             Ok(rv as usize)
         } else {
-            Err(std::io::Error::new(std::io::ErrorKind::Other, "I/O error in mp4parse_io Read impl"))
+            Err(std::io::Error::new(std::io::ErrorKind::Other, "I/O error in Mp4parseIo Read impl"))
         }
     }
 }
 
 // C API wrapper functions.
 
-/// Allocate an `mp4parse_parser*` to read from the supplied `mp4parse_io`.
+/// Allocate an `Mp4parseParser*` to read from the supplied `Mp4parseIo`.
 #[no_mangle]
-pub unsafe extern fn mp4parse_new(io: *const mp4parse_io) -> *mut mp4parse_parser {
+pub unsafe extern fn mp4parse_new(io: *const Mp4parseIo) -> *mut Mp4parseParser {
     if io.is_null() || (*io).userdata.is_null() {
         return std::ptr::null_mut();
     }
     if (*io).read.is_none() {
         return std::ptr::null_mut();
     }
-    let parser = Box::new(mp4parse_parser(Wrap {
+    let parser = Box::new(Mp4parseParser {
         context: MediaContext::new(),
         io: (*io).clone(),
         poisoned: false,
         opus_header: HashMap::new(),
         pssh_data: Vec::new(),
         sample_table: HashMap::new(),
-    }));
+    });
 
     Box::into_raw(parser)
 }
 
-/// Free an `mp4parse_parser*` allocated by `mp4parse_new()`.
+/// Free an `Mp4parseParser*` allocated by `mp4parse_new()`.
 #[no_mangle]
-pub unsafe extern fn mp4parse_free(parser: *mut mp4parse_parser) {
+pub unsafe extern fn mp4parse_free(parser: *mut Mp4parseParser) {
     assert!(!parser.is_null());
     let _ = Box::from_raw(parser);
 }
 
 /// Enable `mp4_parser` log.
 #[no_mangle]
 pub unsafe extern fn mp4parse_log(enable: bool) {
     mp4parse::set_debug_mode(enable);
 }
 
-/// Run the `mp4parse_parser*` allocated by `mp4parse_new()` until EOF or error.
+/// Run the `Mp4parseParser*` allocated by `mp4parse_new()` until EOF or error.
 #[no_mangle]
-pub unsafe extern fn mp4parse_read(parser: *mut mp4parse_parser) -> mp4parse_status {
+pub unsafe extern fn mp4parse_read(parser: *mut Mp4parseParser) -> Mp4parseStatus {
     // Validate arguments from C.
     if parser.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     let context = (*parser).context_mut();
     let io = (*parser).io_mut();
 
     let r = read_mp4(io, context);
     match r {
-        Ok(_) => mp4parse_status::OK,
+        Ok(_) => Mp4parseStatus::Ok,
         Err(Error::NoMoov) | Err(Error::InvalidData(_)) => {
             // Block further calls. We've probable lost sync.
             (*parser).set_poisoned(true);
-            mp4parse_status::INVALID
+            Mp4parseStatus::Invalid
         }
-        Err(Error::Unsupported(_)) => mp4parse_status::UNSUPPORTED,
-        Err(Error::UnexpectedEOF) => mp4parse_status::EOF,
+        Err(Error::Unsupported(_)) => Mp4parseStatus::Unsupported,
+        Err(Error::UnexpectedEOF) => Mp4parseStatus::Eof,
         Err(Error::Io(_)) => {
             // Block further calls after a read failure.
             // Getting std::io::ErrorKind::UnexpectedEof is normal
             // but our From trait implementation should have converted
             // those to our Error::UnexpectedEOF variant.
             (*parser).set_poisoned(true);
-            mp4parse_status::IO
+            Mp4parseStatus::Io
         },
-        Err(Error::OutOfMemory) => mp4parse_status::OOM,
+        Err(Error::OutOfMemory) => Mp4parseStatus::Oom,
     }
 }
 
 /// Return the number of tracks parsed by previous `mp4parse_read()` call.
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_track_count(parser: *const mp4parse_parser, count: *mut u32) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_track_count(parser: *const Mp4parseParser, count: *mut u32) -> Mp4parseStatus {
     // Validate arguments from C.
     if parser.is_null() || count.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
     let context = (*parser).context();
 
     // Make sure the track count fits in a u32.
     if context.tracks.len() > u32::max_value() as usize {
-        return mp4parse_status::INVALID;
+        return Mp4parseStatus::Invalid;
     }
     *count = context.tracks.len() as u32;
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
 /// Calculate numerator * scale / denominator, if possible.
 ///
 /// Applying the associativity of integer arithmetic, we divide first
 /// and add the remainder after multiplying each term separately
 /// to preserve precision while leaving more headroom. That is,
 /// (n * s) / d is split into floor(n / d) * s + (n % d) * s / d.
@@ -392,148 +385,148 @@ fn media_time_to_us(time: MediaScaledTim
 
 fn track_time_to_us<T>(time: TrackScaledTime<T>, scale: TrackTimeScale<T>) -> Option<T>
     where T: PrimInt + Zero {
     assert_eq!(time.1, scale.1);
     let microseconds_per_second = 1000000;
     rational_scale::<T, u64>(time.0, scale.0, microseconds_per_second)
 }
 
-/// Fill the supplied `mp4parse_track_info` with metadata for `track`.
+/// Fill the supplied `Mp4parseTrackInfo` with metadata for `track`.
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_track_info(parser: *mut mp4parse_parser, track_index: u32, info: *mut mp4parse_track_info) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_track_info(parser: *mut Mp4parseParser, track_index: u32, info: *mut Mp4parseTrackInfo) -> Mp4parseStatus {
     if parser.is_null() || info.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *info = Default::default();
 
     let context = (*parser).context_mut();
     let track_index: usize = track_index as usize;
-    let info: &mut mp4parse_track_info = &mut *info;
+    let info: &mut Mp4parseTrackInfo = &mut *info;
 
     if track_index >= context.tracks.len() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     info.track_type = match context.tracks[track_index].track_type {
-        TrackType::Video => mp4parse_track_type::VIDEO,
-        TrackType::Audio => mp4parse_track_type::AUDIO,
-        TrackType::Unknown => return mp4parse_status::UNSUPPORTED,
+        TrackType::Video => Mp4parseTrackType::Video,
+        TrackType::Audio => Mp4parseTrackType::Audio,
+        TrackType::Unknown => return Mp4parseStatus::Unsupported,
     };
 
     // Return UNKNOWN for unsupported format.
     info.codec = match context.tracks[track_index].data {
         Some(SampleEntry::Audio(ref audio)) => match audio.codec_specific {
             AudioCodecSpecific::OpusSpecificBox(_) =>
-                mp4parse_codec::OPUS,
+                Mp4parseCodec::Opus,
             AudioCodecSpecific::FLACSpecificBox(_) =>
-                mp4parse_codec::FLAC,
+                Mp4parseCodec::Flac,
             AudioCodecSpecific::ES_Descriptor(ref esds) if esds.audio_codec == CodecType::AAC =>
-                mp4parse_codec::AAC,
+                Mp4parseCodec::Aac,
             AudioCodecSpecific::ES_Descriptor(ref esds) if esds.audio_codec == CodecType::MP3 =>
-                mp4parse_codec::MP3,
+                Mp4parseCodec::Mp3,
             AudioCodecSpecific::ES_Descriptor(_) | AudioCodecSpecific::LPCM =>
-                mp4parse_codec::UNKNOWN,
+                Mp4parseCodec::Unknown,
             AudioCodecSpecific::MP3 =>
-                mp4parse_codec::MP3,
+                Mp4parseCodec::Mp3,
         },
         Some(SampleEntry::Video(ref video)) => match video.codec_specific {
             VideoCodecSpecific::VPxConfig(_) =>
-                mp4parse_codec::VP9,
+                Mp4parseCodec::Vp9,
             VideoCodecSpecific::AVCConfig(_) =>
-                mp4parse_codec::AVC,
+                Mp4parseCodec::Avc,
             VideoCodecSpecific::ESDSConfig(_) => // MP4V (14496-2) video is unsupported.
-                mp4parse_codec::UNKNOWN,
+                Mp4parseCodec::Unknown,
         },
-        _ => mp4parse_codec::UNKNOWN,
+        _ => Mp4parseCodec::Unknown,
     };
 
     let track = &context.tracks[track_index];
 
     if let (Some(track_timescale),
             Some(context_timescale)) = (track.timescale,
                                         context.timescale) {
         let media_time =
             match track.media_time.map_or(Some(0), |media_time| {
                     track_time_to_us(media_time, track_timescale) }) {
                 Some(time) => time as i64,
-                None => return mp4parse_status::INVALID,
+                None => return Mp4parseStatus::Invalid,
             };
         let empty_duration =
             match track.empty_duration.map_or(Some(0), |empty_duration| {
                     media_time_to_us(empty_duration, context_timescale) }) {
                 Some(time) => time as i64,
-                None => return mp4parse_status::INVALID,
+                None => return Mp4parseStatus::Invalid,
             };
         info.media_time = media_time - empty_duration;
 
         if let Some(track_duration) = track.duration {
             match track_time_to_us(track_duration, track_timescale) {
                 Some(duration) => info.duration = duration,
-                None => return mp4parse_status::INVALID,
+                None => return Mp4parseStatus::Invalid,
             }
         } else {
             // Duration unknown; stagefright returns 0 for this.
             info.duration = 0
         }
     } else {
-        return mp4parse_status::INVALID
+        return Mp4parseStatus::Invalid
     }
 
     info.track_id = match track.track_id {
         Some(track_id) => track_id,
-        None => return mp4parse_status::INVALID,
+        None => return Mp4parseStatus::Invalid,
     };
 
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
-/// Fill the supplied `mp4parse_track_audio_info` with metadata for `track`.
+/// Fill the supplied `Mp4parseTrackAudioInfo` with metadata for `track`.
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_track_audio_info(parser: *mut mp4parse_parser, track_index: u32, info: *mut mp4parse_track_audio_info) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_track_audio_info(parser: *mut Mp4parseParser, track_index: u32, info: *mut Mp4parseTrackAudioInfo) -> Mp4parseStatus {
     if parser.is_null() || info.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *info = Default::default();
 
     let context = (*parser).context_mut();
 
     if track_index as usize >= context.tracks.len() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     let track = &context.tracks[track_index as usize];
 
     match track.track_type {
         TrackType::Audio => {}
-        _ => return mp4parse_status::INVALID,
+        _ => return Mp4parseStatus::Invalid,
     };
 
     let audio = match track.data {
         Some(ref data) => data,
-        None => return mp4parse_status::INVALID,
+        None => return Mp4parseStatus::Invalid,
     };
 
     let audio = match *audio {
         SampleEntry::Audio(ref x) => x,
-        _ => return mp4parse_status::INVALID,
+        _ => return Mp4parseStatus::Invalid,
     };
 
     (*info).channels = audio.channelcount as u16;
     (*info).bit_depth = audio.samplesize;
     (*info).sample_rate = audio.samplerate as u32;
 
     match audio.codec_specific {
         AudioCodecSpecific::ES_Descriptor(ref v) => {
             if v.codec_esds.len() > std::u32::MAX as usize {
-                return mp4parse_status::INVALID;
+                return Mp4parseStatus::Invalid;
             }
             (*info).extra_data.length = v.codec_esds.len() as u32;
             (*info).extra_data.data = v.codec_esds.as_ptr();
             (*info).codec_specific_config.length = v.decoder_specific_data.len() as u32;
             (*info).codec_specific_config.data = v.decoder_specific_data.as_ptr();
             if let Some(rate) = v.audio_sample_rate {
                 (*info).sample_rate = rate;
             }
@@ -543,33 +536,33 @@ pub unsafe extern fn mp4parse_get_track_
             if let Some(profile) = v.audio_object_type {
                 (*info).profile = profile;
             }
         }
         AudioCodecSpecific::FLACSpecificBox(ref flac) => {
             // Return the STREAMINFO metadata block in the codec_specific.
             let streaminfo = &flac.blocks[0];
             if streaminfo.block_type != 0 || streaminfo.data.len() != 34 {
-                return mp4parse_status::INVALID;
+                return Mp4parseStatus::Invalid;
             }
             (*info).extra_data.length = streaminfo.data.len() as u32;
             (*info).extra_data.data = streaminfo.data.as_ptr();
         }
         AudioCodecSpecific::OpusSpecificBox(ref opus) => {
             let mut v = Vec::new();
             match serialize_opus_header(opus, &mut v) {
                 Err(_) => {
-                    return mp4parse_status::INVALID;
+                    return Mp4parseStatus::Invalid;
                 }
                 Ok(_) => {
                     let header = (*parser).opus_header_mut();
                     header.insert(track_index, v);
                     if let Some(v) = header.get(&track_index) {
                         if v.len() > std::u32::MAX as usize {
-                            return mp4parse_status::INVALID;
+                            return Mp4parseStatus::Invalid;
                         }
                         (*info).extra_data.length = v.len() as u32;
                         (*info).extra_data.data = v.as_ptr();
                     }
                 }
             }
         }
         AudioCodecSpecific::MP3 | AudioCodecSpecific::LPCM => (),
@@ -578,65 +571,65 @@ pub unsafe extern fn mp4parse_get_track_
     if let Some(p) = audio.protection_info.iter().find(|sinf| sinf.tenc.is_some()) {
         if let Some(ref tenc) = p.tenc {
             (*info).protected_data.is_encrypted = tenc.is_encrypted;
             (*info).protected_data.iv_size = tenc.iv_size;
             (*info).protected_data.kid.set_data(&(tenc.kid));
         }
     }
 
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
-/// Fill the supplied `mp4parse_track_video_info` with metadata for `track`.
+/// Fill the supplied `Mp4parseTrackVideoInfo` with metadata for `track`.
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_track_video_info(parser: *mut mp4parse_parser, track_index: u32, info: *mut mp4parse_track_video_info) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_track_video_info(parser: *mut Mp4parseParser, track_index: u32, info: *mut Mp4parseTrackVideoInfo) -> Mp4parseStatus {
     if parser.is_null() || info.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *info = Default::default();
 
     let context = (*parser).context_mut();
 
     if track_index as usize >= context.tracks.len() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     let track = &context.tracks[track_index as usize];
 
     match track.track_type {
         TrackType::Video => {}
-        _ => return mp4parse_status::INVALID,
+        _ => return Mp4parseStatus::Invalid,
     };
 
     let video = match track.data {
         Some(ref data) => data,
-        None => return mp4parse_status::INVALID,
+        None => return Mp4parseStatus::Invalid,
     };
 
     let video = match *video {
         SampleEntry::Video(ref x) => x,
-        _ => return mp4parse_status::INVALID,
+        _ => return Mp4parseStatus::Invalid,
     };
 
     if let Some(ref tkhd) = track.tkhd {
         (*info).display_width = tkhd.width >> 16; // 16.16 fixed point
         (*info).display_height = tkhd.height >> 16; // 16.16 fixed point
         let matrix = (tkhd.matrix.a >> 16, tkhd.matrix.b >> 16,
                       tkhd.matrix.c >> 16, tkhd.matrix.d >> 16);
         (*info).rotation = match matrix {
             ( 0,  1, -1,  0) => 90, // rotate 90 degrees
             (-1,  0,  0, -1) => 180, // rotate 180 degrees
             ( 0, -1,  1,  0) => 270, // rotate 270 degrees
             _ => 0,
         };
     } else {
-        return mp4parse_status::INVALID;
+        return Mp4parseStatus::Invalid;
     }
     (*info).image_width = video.width;
     (*info).image_height = video.height;
 
     match video.codec_specific {
         VideoCodecSpecific::AVCConfig(ref data) | VideoCodecSpecific::ESDSConfig(ref data) => {
           (*info).extra_data.set_data(data);
         },
@@ -646,39 +639,39 @@ pub unsafe extern fn mp4parse_get_track_
     if let Some(p) = video.protection_info.iter().find(|sinf| sinf.tenc.is_some()) {
         if let Some(ref tenc) = p.tenc {
             (*info).protected_data.is_encrypted = tenc.is_encrypted;
             (*info).protected_data.iv_size = tenc.iv_size;
             (*info).protected_data.kid.set_data(&(tenc.kid));
         }
     }
 
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_indice_table(parser: *mut mp4parse_parser, track_id: u32, indices: *mut mp4parse_byte_data) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_indice_table(parser: *mut Mp4parseParser, track_id: u32, indices: *mut Mp4parseByteData) -> Mp4parseStatus {
     if parser.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *indices = Default::default();
 
     let context = (*parser).context();
     let tracks = &context.tracks;
     let track = match tracks.iter().find(|track| track.track_id == Some(track_id)) {
         Some(t) => t,
-        _ => return mp4parse_status::INVALID,
+        _ => return Mp4parseStatus::Invalid,
     };
 
     let index_table = (*parser).sample_table_mut();
     if let Some(v) = index_table.get(&track_id) {
         (*indices).set_indices(v);
-        return mp4parse_status::OK;
+        return Mp4parseStatus::Ok;
     }
 
     let media_time = match (&track.media_time, &track.timescale) {
         (&Some(t), &Some(s)) => {
             track_time_to_us(t, s).map(|v| v as i64)
         },
         _ => None,
     };
@@ -698,20 +691,20 @@ pub unsafe extern fn mp4parse_get_indice
         (Some(e), None) => e,
         (None, Some(m)) => m,
         _ => 0,
     };
 
     if let Some(v) = create_sample_table(track, offset_time) {
         (*indices).set_indices(&v);
         index_table.insert(track_id, v);
-        return mp4parse_status::OK;
+        return Mp4parseStatus::Ok;
     }
 
-    mp4parse_status::INVALID
+    Mp4parseStatus::Invalid
 }
 
 // Convert a 'ctts' compact table to full table by iterator,
 // (sample_with_the_same_offset_count, offset) => (offset), (offset), (offset) ...
 //
 // For example:
 // (2, 10), (4, 9) into (10, 10, 9, 9, 9, 9) by calling next_offset_time().
 struct TimeOffsetIterator<'a> {
@@ -854,17 +847,17 @@ impl<'a> Iterator for SampleToChunkItera
                     self.chunks.next()
                 })
             });
 
         has_chunk.map_or(None, |id| { Some((id, self.sample_count)) })
     }
 }
 
-fn create_sample_table(track: &Track, track_offset_time: i64) -> Option<Vec<mp4parse_indice>> {
+fn create_sample_table(track: &Track, track_offset_time: i64) -> Option<Vec<Mp4parseIndice>> {
     let timescale = match track.timescale {
         Some(ref t) => TrackTimeScale::<i64>(t.0 as i64, t.1),
         _ => TrackTimeScale::<i64>(0, 0),
     };
 
     let (stsc, stco, stsz, stts) =
         match (&track.stsc, &track.stco, &track.stsz, &track.stts) {
             (&Some(ref a), &Some(ref b), &Some(ref c), &Some(ref d)) => (a, b, c, d),
@@ -903,17 +896,17 @@ fn create_sample_table(track: &Track, tr
                 (t, _) if t > 0 => start_offset + t as u64,
                 _ => 0,
             };
             if end_offset == 0 {
                 return None;
             }
             cur_position = end_offset;
 
-            let res = vec_push(&mut sample_table, mp4parse_indice {
+            let res = vec_push(&mut sample_table, Mp4parseIndice {
                 start_offset: start_offset,
                 end_offset: end_offset,
                 start_composition: 0,
                 end_composition: 0,
                 start_decode: 0,
                 sync: !has_sync_table,
             });
             if res.is_err() {
@@ -1011,111 +1004,111 @@ fn create_sample_table(track: &Track, tr
             let sample = &mut sample_table[current_index];
             sample.end_composition = next_start_composition_time;
         }
     }
 
     Some(sample_table)
 }
 
-/// Fill the supplied `mp4parse_fragment_info` with metadata from fragmented file.
+/// Fill the supplied `Mp4parseFragmentInfo` with metadata from fragmented file.
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_fragment_info(parser: *mut mp4parse_parser, info: *mut mp4parse_fragment_info) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_fragment_info(parser: *mut Mp4parseParser, info: *mut Mp4parseFragmentInfo) -> Mp4parseStatus {
     if parser.is_null() || info.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *info = Default::default();
 
     let context = (*parser).context();
-    let info: &mut mp4parse_fragment_info = &mut *info;
+    let info: &mut Mp4parseFragmentInfo = &mut *info;
 
     info.fragment_duration = 0;
 
     let duration = match context.mvex {
         Some(ref mvex) => mvex.fragment_duration,
-        None => return mp4parse_status::INVALID,
+        None => return Mp4parseStatus::Invalid,
     };
 
     if let (Some(time), Some(scale)) = (duration, context.timescale) {
         info.fragment_duration = match media_time_to_us(time, scale) {
             Some(time_us) => time_us as u64,
-            None => return mp4parse_status::INVALID,
+            None => return Mp4parseStatus::Invalid,
         }
     }
 
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
 /// A fragmented file needs mvex table and contains no data in stts, stsc, and stco boxes.
 #[no_mangle]
-pub unsafe extern fn mp4parse_is_fragmented(parser: *mut mp4parse_parser, track_id: u32, fragmented: *mut u8) -> mp4parse_status {
+pub unsafe extern fn mp4parse_is_fragmented(parser: *mut Mp4parseParser, track_id: u32, fragmented: *mut u8) -> Mp4parseStatus {
     if parser.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     let context = (*parser).context_mut();
     let tracks = &context.tracks;
     (*fragmented) = false as u8;
 
     if context.mvex.is_none() {
-        return mp4parse_status::OK;
+        return Mp4parseStatus::Ok;
     }
 
     // check sample tables.
     let mut iter = tracks.iter();
-    iter.find(|track| track.track_id == Some(track_id)).map_or(mp4parse_status::BAD_ARG, |track| {
+    iter.find(|track| track.track_id == Some(track_id)).map_or(Mp4parseStatus::BadArg, |track| {
         match (&track.stsc, &track.stco, &track.stts) {
             (&Some(ref stsc), &Some(ref stco), &Some(ref stts))
                 if stsc.samples.is_empty() && stco.offsets.is_empty() && stts.samples.is_empty() => (*fragmented) = true as u8,
             _ => {},
         };
-        mp4parse_status::OK
+        Mp4parseStatus::Ok
     })
 }
 
 /// Get 'pssh' system id and 'pssh' box content for eme playback.
 ///
 /// The data format of the `info` struct passed to gecko is:
 ///
 /// - system id (16 byte uuid)
 /// - pssh box size (32-bit native endian)
 /// - pssh box content (including header)
 #[no_mangle]
-pub unsafe extern fn mp4parse_get_pssh_info(parser: *mut mp4parse_parser, info: *mut mp4parse_pssh_info) -> mp4parse_status {
+pub unsafe extern fn mp4parse_get_pssh_info(parser: *mut Mp4parseParser, info: *mut Mp4parsePsshInfo) -> Mp4parseStatus {
     if parser.is_null() || info.is_null() || (*parser).poisoned() {
-        return mp4parse_status::BAD_ARG;
+        return Mp4parseStatus::BadArg;
     }
 
     // Initialize fields to default values to ensure all fields are always valid.
     *info = Default::default();
 
     let context = (*parser).context_mut();
     let pssh_data = (*parser).pssh_data_mut();
-    let info: &mut mp4parse_pssh_info = &mut *info;
+    let info: &mut Mp4parsePsshInfo = &mut *info;
 
     pssh_data.clear();
     for pssh in &context.psshs {
         let content_len = pssh.box_content.len();
         if content_len > std::u32::MAX as usize {
-            return mp4parse_status::INVALID;
+            return Mp4parseStatus::Invalid;
         }
         let mut data_len = Vec::new();
         if data_len.write_u32::<byteorder::NativeEndian>(content_len as u32).is_err() {
-            return mp4parse_status::IO;
+            return Mp4parseStatus::Io;
         }
         pssh_data.extend_from_slice(pssh.system_id.as_slice());
         pssh_data.extend_from_slice(data_len.as_slice());
         pssh_data.extend_from_slice(pssh.box_content.as_slice());
     }
 
     info.data.set_data(pssh_data);
 
-    mp4parse_status::OK
+    Mp4parseStatus::Ok
 }
 
 #[cfg(test)]
 extern fn panic_read(_: *mut u8, _: usize, _: *mut std::os::raw::c_void) -> isize {
     panic!("panic_read shouldn't be called in these tests");
 }
 
 #[cfg(test)]
@@ -1132,17 +1125,17 @@ extern fn valid_read(buf: *mut u8, size:
         Ok(n) => n as isize,
         Err(_) => -1,
     }
 }
 
 #[test]
 fn new_parser() {
     let mut dummy_value: u32 = 42;
-    let io = mp4parse_io {
+    let io = Mp4parseIo {
         read: Some(panic_read),
         userdata: &mut dummy_value as *mut _ as *mut std::os::raw::c_void,
     };
     unsafe {
         let parser = mp4parse_new(&io);
         assert!(!parser.is_null());
         mp4parse_free(parser);
     }
@@ -1156,237 +1149,238 @@ fn free_null_parser() {
     }
 }
 
 #[test]
 fn get_track_count_null_parser() {
     unsafe {
         let mut count: u32 = 0;
         let rv = mp4parse_get_track_count(std::ptr::null(), std::ptr::null_mut());
-        assert_eq!(rv, mp4parse_status::BAD_ARG);
+        assert_eq!(rv, Mp4parseStatus::BadArg);
         let rv = mp4parse_get_track_count(std::ptr::null(), &mut count);
-        assert_eq!(rv, mp4parse_status::BAD_ARG);
+        assert_eq!(rv, Mp4parseStatus::BadArg);
     }
 }
 
 #[test]
 fn arg_validation() {
     unsafe {
-        // Passing a null mp4parse_io is an error.
+        // Passing a null Mp4parseIo is an error.
         let parser = mp4parse_new(std::ptr::null());
         assert!(parser.is_null());
 
         let null_mut: *mut std::os::raw::c_void = std::ptr::null_mut();
 
-        // Passing an mp4parse_io with null members is an error.
-        let io = mp4parse_io { read: None,
+        // Passing an Mp4parseIo with null members is an error.
+        let io = Mp4parseIo { read: None,
                                userdata: null_mut };
         let parser = mp4parse_new(&io);
         assert!(parser.is_null());
 
-        let io = mp4parse_io { read: Some(panic_read),
+        let io = Mp4parseIo { read: Some(panic_read),
                                userdata: null_mut };
         let parser = mp4parse_new(&io);
         assert!(parser.is_null());
 
         let mut dummy_value = 42;
-        let io = mp4parse_io {
+        let io = Mp4parseIo {
             read: None,
             userdata: &mut dummy_value as *mut _ as *mut std::os::raw::c_void,
         };
         let parser = mp4parse_new(&io);
         assert!(parser.is_null());
 
-        // Passing a null mp4parse_parser is an error.
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_read(std::ptr::null_mut()));
+        // Passing a null Mp4parseParser is an error.
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_read(std::ptr::null_mut()));
 
-        let mut dummy_info = mp4parse_track_info {
-            track_type: mp4parse_track_type::VIDEO,
-            codec: mp4parse_codec::UNKNOWN,
+        let mut dummy_info = Mp4parseTrackInfo {
+            track_type: Mp4parseTrackType::Video,
+            codec: Mp4parseCodec::Unknown,
             track_id: 0,
             duration: 0,
             media_time: 0,
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_info(std::ptr::null_mut(), 0, &mut dummy_info));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_info(std::ptr::null_mut(), 0, &mut dummy_info));
 
-        let mut dummy_video = mp4parse_track_video_info {
+        let mut dummy_video = Mp4parseTrackVideoInfo {
             display_width: 0,
             display_height: 0,
             image_width: 0,
             image_height: 0,
             rotation: 0,
-            extra_data: mp4parse_byte_data::default(),
+            extra_data: Mp4parseByteData::default(),
             protected_data: Default::default(),
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_video_info(std::ptr::null_mut(), 0, &mut dummy_video));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_video_info(std::ptr::null_mut(), 0, &mut dummy_video));
 
         let mut dummy_audio = Default::default();
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_audio_info(std::ptr::null_mut(), 0, &mut dummy_audio));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_audio_info(std::ptr::null_mut(), 0, &mut dummy_audio));
     }
 }
 
 #[test]
 fn arg_validation_with_parser() {
     unsafe {
         let mut dummy_value = 42;
-        let io = mp4parse_io {
+        let io = Mp4parseIo {
             read: Some(error_read),
             userdata: &mut dummy_value as *mut _ as *mut std::os::raw::c_void,
         };
         let parser = mp4parse_new(&io);
         assert!(!parser.is_null());
 
-        // Our mp4parse_io read should simply fail with an error.
-        assert_eq!(mp4parse_status::IO, mp4parse_read(parser));
+        // Our Mp4parseIo read should simply fail with an error.
+        assert_eq!(Mp4parseStatus::Io, mp4parse_read(parser));
 
         // The parser is now poisoned and unusable.
-        assert_eq!(mp4parse_status::BAD_ARG,  mp4parse_read(parser));
+        assert_eq!(Mp4parseStatus::BadArg,  mp4parse_read(parser));
 
         // Null info pointers are an error.
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_info(parser, 0, std::ptr::null_mut()));
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_video_info(parser, 0, std::ptr::null_mut()));
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_audio_info(parser, 0, std::ptr::null_mut()));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_info(parser, 0, std::ptr::null_mut()));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_video_info(parser, 0, std::ptr::null_mut()));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_audio_info(parser, 0, std::ptr::null_mut()));
 
-        let mut dummy_info = mp4parse_track_info {
-            track_type: mp4parse_track_type::VIDEO,
-            codec: mp4parse_codec::UNKNOWN,
+        let mut dummy_info = Mp4parseTrackInfo {
+            track_type: Mp4parseTrackType::Video,
+            codec: Mp4parseCodec::Unknown,
             track_id: 0,
             duration: 0,
             media_time: 0,
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_info(parser, 0, &mut dummy_info));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_info(parser, 0, &mut dummy_info));
 
-        let mut dummy_video = mp4parse_track_video_info {
+        let mut dummy_video = Mp4parseTrackVideoInfo {
             display_width: 0,
             display_height: 0,
             image_width: 0,
             image_height: 0,
             rotation: 0,
-            extra_data: mp4parse_byte_data::default(),
+            extra_data: Mp4parseByteData::default(),
             protected_data: Default::default(),
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_video_info(parser, 0, &mut dummy_video));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_video_info(parser, 0, &mut dummy_video));
 
         let mut dummy_audio = Default::default();
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_audio_info(parser, 0, &mut dummy_audio));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_audio_info(parser, 0, &mut dummy_audio));
 
         mp4parse_free(parser);
     }
 }
 
 #[test]
 fn get_track_count_poisoned_parser() {
     unsafe {
         let mut dummy_value = 42;
-        let io = mp4parse_io {
+        let io = Mp4parseIo {
             read: Some(error_read),
             userdata: &mut dummy_value as *mut _ as *mut std::os::raw::c_void,
         };
         let parser = mp4parse_new(&io);
         assert!(!parser.is_null());
 
-        // Our mp4parse_io read should simply fail with an error.
-        assert_eq!(mp4parse_status::IO, mp4parse_read(parser));
+        // Our Mp4parseIo read should simply fail with an error.
+        assert_eq!(Mp4parseStatus::Io, mp4parse_read(parser));
 
         let mut count: u32 = 0;
         let rv = mp4parse_get_track_count(parser, &mut count);
-        assert_eq!(rv, mp4parse_status::BAD_ARG);
+        assert_eq!(rv, Mp4parseStatus::BadArg);
 
         mp4parse_free(parser);
     }
 }
 
 #[test]
 fn arg_validation_with_data() {
     unsafe {
         let mut file = std::fs::File::open("../mp4parse/tests/minimal.mp4").unwrap();
-        let io = mp4parse_io { read: Some(valid_read),
+        let io = Mp4parseIo { read: Some(valid_read),
                                userdata: &mut file as *mut _ as *mut std::os::raw::c_void };
         let parser = mp4parse_new(&io);
         assert!(!parser.is_null());
 
-        assert_eq!(mp4parse_status::OK, mp4parse_read(parser));
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_read(parser));
 
         let mut count: u32 = 0;
-        assert_eq!(mp4parse_status::OK, mp4parse_get_track_count(parser, &mut count));
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_get_track_count(parser, &mut count));
         assert_eq!(2, count);
 
-        let mut info = mp4parse_track_info {
-            track_type: mp4parse_track_type::VIDEO,
-            codec: mp4parse_codec::UNKNOWN,
+        let mut info = Mp4parseTrackInfo {
+            track_type: Mp4parseTrackType::Video,
+            codec: Mp4parseCodec::Unknown,
             track_id: 0,
             duration: 0,
             media_time: 0,
         };
-        assert_eq!(mp4parse_status::OK, mp4parse_get_track_info(parser, 0, &mut info));
-        assert_eq!(info.track_type, mp4parse_track_type::VIDEO);
-        assert_eq!(info.codec, mp4parse_codec::AVC);
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_get_track_info(parser, 0, &mut info));
+        assert_eq!(info.track_type, Mp4parseTrackType::Video);
+        assert_eq!(info.codec, Mp4parseCodec::Avc);
         assert_eq!(info.track_id, 1);
         assert_eq!(info.duration, 40000);
         assert_eq!(info.media_time, 0);
 
-        assert_eq!(mp4parse_status::OK, mp4parse_get_track_info(parser, 1, &mut info));
-        assert_eq!(info.track_type, mp4parse_track_type::AUDIO);
-        assert_eq!(info.codec, mp4parse_codec::AAC);
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_get_track_info(parser, 1, &mut info));
+        assert_eq!(info.track_type, Mp4parseTrackType::Audio);
+        assert_eq!(info.codec, Mp4parseCodec::Aac);
         assert_eq!(info.track_id, 2);
         assert_eq!(info.duration, 61333);
         assert_eq!(info.media_time, 21333);
 
-        let mut video = mp4parse_track_video_info {
+        let mut video = Mp4parseTrackVideoInfo {
             display_width: 0,
             display_height: 0,
             image_width: 0,
             image_height: 0,
             rotation: 0,
-            extra_data: mp4parse_byte_data::default(),
+            extra_data: Mp4parseByteData::default(),
             protected_data: Default::default(),
         };
-        assert_eq!(mp4parse_status::OK, mp4parse_get_track_video_info(parser, 0, &mut video));
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_get_track_video_info(parser, 0, &mut video));
         assert_eq!(video.display_width, 320);
         assert_eq!(video.display_height, 240);
         assert_eq!(video.image_width, 320);
         assert_eq!(video.image_height, 240);
 
         let mut audio = Default::default();
-        assert_eq!(mp4parse_status::OK, mp4parse_get_track_audio_info(parser, 1, &mut audio));
+        assert_eq!(Mp4parseStatus::Ok, mp4parse_get_track_audio_info(parser, 1, &mut audio));
         assert_eq!(audio.channels, 1);
         assert_eq!(audio.bit_depth, 16);
         assert_eq!(audio.sample_rate, 48000);
 
         // Test with an invalid track number.
-        let mut info = mp4parse_track_info {
-            track_type: mp4parse_track_type::VIDEO,
-            codec: mp4parse_codec::UNKNOWN,
+        let mut info = Mp4parseTrackInfo {
+            track_type: Mp4parseTrackType::Video,
+            codec: Mp4parseCodec::Unknown,
             track_id: 0,
             duration: 0,
             media_time: 0,
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_info(parser, 3, &mut info));
-        assert_eq!(info.track_type, mp4parse_track_type::VIDEO);
-        assert_eq!(info.codec, mp4parse_codec::UNKNOWN);
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_info(parser, 3, &mut info));
+        assert_eq!(info.track_type, Mp4parseTrackType::Video);
+        assert_eq!(info.codec, Mp4parseCodec::Unknown);
         assert_eq!(info.track_id, 0);
         assert_eq!(info.duration, 0);
         assert_eq!(info.media_time, 0);
 
-        let mut video = mp4parse_track_video_info { display_width: 0,
-                                                    display_height: 0,
-                                                    image_width: 0,
-                                                    image_height: 0,
-                                                    rotation: 0,
-                                                    extra_data: mp4parse_byte_data::default(),
-                                                    protected_data: Default::default(),
+        let mut video = Mp4parseTrackVideoInfo {
+            display_width: 0,
+            display_height: 0,
+            image_width: 0,
+            image_height: 0,
+            rotation: 0,
+            extra_data: Mp4parseByteData::default(),
+            protected_data: Default::default(),
         };
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_video_info(parser, 3, &mut video));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_video_info(parser, 3, &mut video));
         assert_eq!(video.display_width, 0);
         assert_eq!(video.display_height, 0);
         assert_eq!(video.image_width, 0);
         assert_eq!(video.image_height, 0);
 
         let mut audio = Default::default();
-        assert_eq!(mp4parse_status::BAD_ARG, mp4parse_get_track_audio_info(parser, 3, &mut audio));
+        assert_eq!(Mp4parseStatus::BadArg, mp4parse_get_track_audio_info(parser, 3, &mut audio));
         assert_eq!(audio.channels, 0);
         assert_eq!(audio.bit_depth, 0);
         assert_eq!(audio.sample_rate, 0);
 
         mp4parse_free(parser);
     }
 }
 
--- a/media/mp4parse-rust/update-rust.sh
+++ b/media/mp4parse-rust/update-rust.sh
@@ -1,13 +1,13 @@
 #!/bin/sh -e
 # Script to update mp4parse-rust sources to latest upstream
 
 # Default version.
-VER=0f39f07145522019638c3f051720b6a8ae26448f
+VER=d129e35848895220bae98084c17a7425a3369e0e
 
 # Accept version or commit from the command line.
 if test -n "$1"; then
   VER=$1
 fi
 
 echo "Fetching sources..."
 rm -rf _upstream
--- a/toolkit/library/gtest/rust/Cargo.lock
+++ b/toolkit/library/gtest/rust/Cargo.lock
@@ -557,17 +557,17 @@ dependencies = [
  "cubeb 0.3.0",
  "cubeb-backend 0.2.0",
  "cubeb-core 0.1.0",
  "cubeb-pulse 0.0.1",
  "encoding_c 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "encoding_glue 0.1.0",
  "geckoservo 0.0.1",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mp4parse_capi 0.8.0",
+ "mp4parse_capi 0.9.0",
  "netwerk_helper 0.0.1",
  "nserror 0.1.0",
  "nsstring 0.1.0",
  "rust_url_capi 0.0.1",
  "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "u2fhid 0.1.0",
  "webrender_bindings 0.1.0",
 ]
@@ -801,34 +801,34 @@ dependencies = [
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse"
-version = "0.8.0"
+version = "0.9.0"
 dependencies = [
  "bitreader 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "mp4parse_fallible 0.0.1",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse-gtest"
 version = "0.1.0"
 
 [[package]]
 name = "mp4parse_capi"
-version = "0.8.0"
+version = "0.9.0"
 dependencies = [
  "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "mp4parse 0.8.0",
+ "mp4parse 0.9.0",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse_fallible"
 version = "0.0.1"
 
 [[package]]
--- a/toolkit/library/rust/Cargo.lock
+++ b/toolkit/library/rust/Cargo.lock
@@ -556,17 +556,17 @@ dependencies = [
  "cubeb 0.3.0",
  "cubeb-backend 0.2.0",
  "cubeb-core 0.1.0",
  "cubeb-pulse 0.0.1",
  "encoding_c 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "encoding_glue 0.1.0",
  "geckoservo 0.0.1",
  "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
- "mp4parse_capi 0.8.0",
+ "mp4parse_capi 0.9.0",
  "netwerk_helper 0.0.1",
  "nserror 0.1.0",
  "nsstring 0.1.0",
  "rust_url_capi 0.0.1",
  "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)",
  "u2fhid 0.1.0",
  "webrender_bindings 0.1.0",
 ]
@@ -800,30 +800,30 @@ dependencies = [
  "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
  "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
  "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse"
-version = "0.8.0"
+version = "0.9.0"
 dependencies = [
  "bitreader 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "mp4parse_fallible 0.0.1",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse_capi"
-version = "0.8.0"
+version = "0.9.0"
 dependencies = [
  "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "mp4parse 0.8.0",
+ "mp4parse 0.9.0",
  "num-traits 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "mp4parse_fallible"
 version = "0.0.1"
 
 [[package]]