55 lines
1.7 KiB
Go
55 lines
1.7 KiB
Go
// Copyright 2024 Martin Riedl
|
||
//
|
||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
// you may not use this file except in compliance with the License.
|
||
// You may obtain a copy of the License at
|
||
//
|
||
// http://www.apache.org/licenses/LICENSE-2.0
|
||
//
|
||
// Unless required by applicable law or agreed to in writing, software
|
||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
// See the License for the specific language governing permissions and
|
||
// limitations under the License.
|
||
|
||
package gomp4
|
||
|
||
// MovieExtendsBox Movie Extends Box struct
|
||
//
|
||
// 8.8.1 Movie Extends Box
|
||
//
|
||
// Box Type: ‘mvex’
|
||
// Container: Movie Box (‘moov’)
|
||
// Mandatory: No
|
||
// Quantity: Zero or one
|
||
//
|
||
// This box warns readers that there might be Movie Fragment Boxes in this file. To know of all samples in
|
||
// the tracks, these Movie Fragment Boxes must be found and scanned in order, and their information
|
||
// logically added to that found in the Movie Box.
|
||
type MovieExtendsBox struct {
|
||
*Box
|
||
ChildBoxes []any
|
||
}
|
||
|
||
// BoxTypeMovieExtends Movie Extends Box
|
||
const BoxTypeMovieExtends = "mvex"
|
||
|
||
func init() {
|
||
BoxDefinitions = append(BoxDefinitions, BoxDefinition{
|
||
Type: BoxTypeMovieExtends,
|
||
ParentTypes: []string{BoxTypeMovie},
|
||
Parser: ParseMovieExtendsBox,
|
||
})
|
||
}
|
||
|
||
// ParseMovieExtendsBox creates a new movie extends box struct based on bytes
|
||
func ParseMovieExtendsBox(parser *Parser, filePosition uint64, headerSize uint32, content []byte) (any, error) {
|
||
box := &MovieExtendsBox{
|
||
Box: &Box{filePosition, headerSize},
|
||
}
|
||
|
||
// parse child boxes
|
||
var err error
|
||
box.ChildBoxes, err = box.parseChildBoxes(parser, BoxTypeMovieExtends, filePosition, content)
|
||
return box, err
|
||
}
|