@@ -141,7 +141,7 @@ pub struct mp4parse_track_audio_info {
141
141
// TODO(kinetik):
142
142
// int32_t profile;
143
143
// int32_t extended_profile; // check types
144
- codec_specific_config : mp4parse_byte_data ,
144
+ pub codec_specific_config : mp4parse_byte_data ,
145
145
}
146
146
147
147
#[ repr( C ) ]
@@ -150,9 +150,7 @@ pub struct mp4parse_track_video_info {
150
150
pub display_height : u32 ,
151
151
pub image_width : u16 ,
152
152
pub image_height : u16 ,
153
- // TODO(kinetik):
154
- // extra_data
155
- // codec_specific_config
153
+ pub extra_data : mp4parse_byte_data ,
156
154
}
157
155
158
156
#[ repr( C ) ]
@@ -547,6 +545,13 @@ pub unsafe extern fn mp4parse_get_track_video_info(parser: *mut mp4parse_parser,
547
545
( * info) . image_width = video. width ;
548
546
( * info) . image_height = video. height ;
549
547
548
+ match video. codec_specific {
549
+ VideoCodecSpecific :: AVCConfig ( ref avc) => {
550
+ ( * info) . extra_data . set_data ( avc) ;
551
+ } ,
552
+ _ => { } ,
553
+ }
554
+
550
555
MP4PARSE_OK
551
556
}
552
557
@@ -737,6 +742,7 @@ fn arg_validation() {
737
742
display_height : 0 ,
738
743
image_width : 0 ,
739
744
image_height : 0 ,
745
+ extra_data : mp4parse_byte_data:: default ( ) ,
740
746
} ;
741
747
assert_eq ! ( MP4PARSE_ERROR_BADARG , mp4parse_get_track_video_info( std:: ptr:: null_mut( ) , 0 , & mut dummy_video) ) ;
742
748
@@ -781,6 +787,7 @@ fn arg_validation_with_parser() {
781
787
display_height : 0 ,
782
788
image_width : 0 ,
783
789
image_height : 0 ,
790
+ extra_data : mp4parse_byte_data:: default ( ) ,
784
791
} ;
785
792
assert_eq ! ( MP4PARSE_ERROR_BADARG , mp4parse_get_track_video_info( parser, 0 , & mut dummy_video) ) ;
786
793
@@ -852,6 +859,7 @@ fn arg_validation_with_data() {
852
859
display_height : 0 ,
853
860
image_width : 0 ,
854
861
image_height : 0 ,
862
+ extra_data : mp4parse_byte_data:: default ( ) ,
855
863
} ;
856
864
assert_eq ! ( MP4PARSE_OK , mp4parse_get_track_video_info( parser, 0 , & mut video) ) ;
857
865
assert_eq ! ( video. display_width, 320 ) ;
@@ -883,7 +891,8 @@ fn arg_validation_with_data() {
883
891
let mut video = mp4parse_track_video_info { display_width : 0 ,
884
892
display_height : 0 ,
885
893
image_width : 0 ,
886
- image_height : 0 } ;
894
+ image_height : 0 ,
895
+ extra_data : mp4parse_byte_data:: default ( ) , } ;
887
896
assert_eq ! ( MP4PARSE_ERROR_BADARG , mp4parse_get_track_video_info( parser, 3 , & mut video) ) ;
888
897
assert_eq ! ( video. display_width, 0 ) ;
889
898
assert_eq ! ( video. display_height, 0 ) ;
0 commit comments