Skip to content

Commit 9d5a713

Browse files
committed
capi: Update enums for new namespacing.
moz-cheddar 0.4.0 added Matthew's patch to namespace enum values, so we no longer have to do that manually.
1 parent 194ed2a commit 9d5a713

File tree

6 files changed

+193
-201
lines changed

6 files changed

+193
-201
lines changed

mp4parse_capi/examples/afl-capi.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,27 @@ fn doit() {
2626
unsafe {
2727
let context = mp4parse_new(&io);
2828
let rv = mp4parse_read(context);
29-
if rv == mp4parse_error::MP4PARSE_OK {
29+
if rv == MP4PARSE::OK {
3030
let count = {
3131
let mut count = 0;
3232
let rv = mp4parse_get_track_count(context, &mut count);
33-
assert_eq!(rv, mp4parse_error::MP4PARSE_OK);
33+
assert_eq!(rv, MP4PARSE::OK);
3434
count
3535
};
3636
for track in 0..count {
3737
let mut info = mp4parse_track_info {
38-
track_type: mp4parse_track_type::MP4PARSE_TRACK_TYPE_VIDEO,
39-
codec: mp4parse_codec::MP4PARSE_CODEC_UNKNOWN,
38+
track_type: MP4PARSE_TRACK_TYPE::VIDEO,
39+
codec: MP4PARSE_CODEC::UNKNOWN,
4040
track_id: 0,
4141
duration: 0,
4242
media_time: 0,
4343
};
4444
let rv = mp4parse_get_track_info(context, track, &mut info);
45-
if rv == mp4parse_error::MP4PARSE_OK {
45+
if rv == MP4PARSE::OK {
4646
println!("track {}: id={} duration={} media_time={}",
4747
track, info.track_id, info.duration, info.media_time);
4848
match info.track_type {
49-
mp4parse_track_type::MP4PARSE_TRACK_TYPE_VIDEO => {
49+
MP4PARSE_TRACK_TYPE::VIDEO => {
5050
let mut video = mp4parse_track_video_info {
5151
display_width: 0,
5252
display_height: 0,
@@ -57,16 +57,16 @@ fn doit() {
5757
protected_data: Default::default(),
5858
};
5959
let rv = mp4parse_get_track_video_info(context, track, &mut video);
60-
if rv == mp4parse_error::MP4PARSE_OK {
60+
if rv == MP4PARSE::OK {
6161
println!(" video: display={}x{} image={}x{}",
6262
video.display_width, video.display_height,
6363
video.image_width, video.image_height);
6464
}
6565
}
66-
mp4parse_track_type::MP4PARSE_TRACK_TYPE_AUDIO => {
66+
MP4PARSE_TRACK_TYPE::AUDIO => {
6767
let mut audio = Default::default();
6868
let rv = mp4parse_get_track_audio_info(context, track, &mut audio);
69-
if rv == mp4parse_error::MP4PARSE_OK {
69+
if rv == MP4PARSE::OK {
7070
println!(" audio: channels={} bit_depth={} sample_rate={}",
7171
audio.channels, audio.bit_depth, audio.sample_rate);
7272
}

mp4parse_capi/examples/test.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void test_arg_validation_with_data(const std::string& filename)
115115
mp4parse_parser *parser = mp4parse_new(&io);
116116
assert(parser != nullptr);
117117

118-
mp4parse_error rv = mp4parse_read(parser);
118+
MP4PARSE rv = mp4parse_read(parser);
119119
assert(rv == MP4PARSE_OK);
120120

121121
uint32_t tracks;
@@ -166,7 +166,7 @@ void test_arg_validation_with_data(const std::string& filename)
166166
fclose(f);
167167
}
168168

169-
const char * tracktype2str(mp4parse_track_type type)
169+
const char * tracktype2str(MP4PARSE_TRACK_TYPE type)
170170
{
171171
switch (type) {
172172
case MP4PARSE_TRACK_TYPE_VIDEO: return "video";
@@ -175,7 +175,7 @@ const char * tracktype2str(mp4parse_track_type type)
175175
return "unknown";
176176
}
177177

178-
const char * errorstring(mp4parse_error error)
178+
const char * errorstring(MP4PARSE error)
179179
{
180180
switch (error) {
181181
case MP4PARSE_OK: return "Ok";
@@ -198,7 +198,7 @@ int32_t read_file(const char* filename)
198198
assert(parser != nullptr);
199199

200200
fprintf(stderr, "Parsing file '%s'.\n", filename);
201-
mp4parse_error rv = mp4parse_read(parser);
201+
MP4PARSE rv = mp4parse_read(parser);
202202
if (rv != MP4PARSE_OK) {
203203
mp4parse_free(parser);
204204
fclose(f);

0 commit comments

Comments
 (0)