@@ -3072,4 +3072,56 @@ mp4lib.boxes.TfrfBox.prototype.read = function(data, pos, end) {
30723072 return this . localPos ;
30733073} ;
30743074
3075+ // --------------------------- subs -----------------------------
3076+ mp4lib . boxes . SubSampleInformationBox = function ( size ) {
3077+ mp4lib . boxes . FullBox . call ( this , 'subs' , size ) ;
3078+ } ;
3079+
3080+ mp4lib . boxes . SubSampleInformationBox . prototype = Object . create ( mp4lib . boxes . FullBox . prototype ) ;
3081+ mp4lib . boxes . SubSampleInformationBox . prototype . constructor = mp4lib . boxes . SubSampleInformationBox ;
3082+
3083+ mp4lib . boxes . SubSampleInformationBox . prototype . computeLength = function ( ) {
3084+ mp4lib . boxes . FullBox . prototype . computeLength . call ( this ) ;
3085+ // To Define if needed
3086+ } ;
3087+
3088+ mp4lib . boxes . SubSampleInformationBox . prototype . read = function ( data , pos , end ) {
3089+ mp4lib . boxes . FullBox . prototype . read . call ( this , data , pos , end ) ;
3090+ var i = 0 ,
3091+ j = 0 ,
3092+ struct = { } ,
3093+ subSampleStruct = { } ;
3094+
3095+ this . entry_count = this . _readData ( data , mp4lib . fields . FIELD_UINT32 ) ;
3096+ this . entry = [ ] ;
3097+ for ( i = 0 ; i < this . entry_count ; i ++ ) {
3098+ struct = { } ;
3099+ struct . sample_delta = this . _readData ( data , mp4lib . fields . FIELD_UINT32 ) ;
3100+ struct . subsample_count = this . _readData ( data , mp4lib . fields . FIELD_UINT16 ) ;
3101+ if ( struct . subsample_count > 0 ) {
3102+ struct . subSampleEntries = [ ] ;
3103+ for ( j = 0 ; j < struct . subsample_count ; j ++ ) {
3104+ subSampleStruct = { } ;
3105+ if ( this . version === 1 ) {
3106+ subSampleStruct . subsample_size = this . _readData ( data , mp4lib . fields . FIELD_UINT32 ) ;
3107+ } else {
3108+ subSampleStruct . subsample_size = this . _readData ( data , mp4lib . fields . FIELD_UINT16 ) ;
3109+ }
3110+ subSampleStruct . subsample_priority = this . _readData ( data , mp4lib . fields . FIELD_UINT8 ) ;
3111+ subSampleStruct . discardable = this . _readData ( data , mp4lib . fields . FIELD_UINT8 ) ;
3112+ subSampleStruct . reserved = this . _readData ( data , mp4lib . fields . FIELD_UINT32 ) ;
3113+ struct . subSampleEntries . push ( subSampleStruct ) ;
3114+ }
3115+ }
3116+ this . entry . push ( struct ) ;
3117+ }
3118+
3119+ return this . localPos ;
3120+ } ;
3121+
3122+ mp4lib . boxes . SubSampleInformationBox . prototype . write = function ( data , pos ) {
3123+ mp4lib . boxes . FullBox . prototype . write . call ( this , data , pos ) ;
3124+ // To Define if needed
3125+ } ;
3126+
30753127mp4lib . registerTypeBoxes ( ) ;
0 commit comments