module Data.ByteString.IsoBaseFileFormat.Boxes.MovieHeader where
import Data.ByteString.IsoBaseFileFormat.Boxes.Box
import Data.ByteString.IsoBaseFileFormat.Boxes.BoxFields
import Data.ByteString.IsoBaseFileFormat.Boxes.FullBox
import Data.ByteString.IsoBaseFileFormat.Boxes.Time
movieHeader
:: (KnownNat version, ValidBox brand (MovieHeader version))
=> MovieHeader version -> Box brand (MovieHeader version)
movieHeader = closedFullBox Default 0
data MovieHeader (version :: Nat) where
MovieHeader ::
KnownNat version =>
Timing version
:+ Template (I32 "rate") 0x00010000
:+ Template (I16 "volume") 0x0100
:+ Constant (I16 "reserved") 0
:+ Constant (I32Arr "reserved" 2) '[0,0]
:+ Template (I32Arr "matrix" 9)
'[65536, 0, 0, 0, 65536, 0, 0, 0, 1073741824]
:+ Template (U32Arr "pre_defined" 6) '[0,0,0,0,0,0]
:+ Template (U32 "next_track_ID") 0xFFFFFFFF
-> MovieHeader version
type MovieHeaderTimesV0 = MovieHeaderTimes (Scalar Word32)
type MovieHeaderTimesV1 = MovieHeaderTimes (Scalar Word64)
type MovieHeaderTimes uint =
uint "creation_time"
:+ uint "modification_time"
:+ TimeScale
:+ uint "duration"
instance IsBoxContent (MovieHeader version) where
boxSize (MovieHeader c) = boxSize c
boxBuilder (MovieHeader c) = boxBuilder c
instance KnownNat version => IsBoxType (MovieHeader version) where
toBoxType _ _ = StdType "mvhd"
type BoxContent (MovieHeader version) = FullBox version (MovieHeader version)