module Data.ByteString.IsoBaseFileFormat.Brands.Dash
(Dash, SingleTrackInit(..), mkSingleTrackInit, module X) where
import Data.ByteString.IsoBaseFileFormat.Boxes as X
import Data.Kind (Type, Constraint)
import Control.Lens
data Dash (version :: Nat)
instance KnownNat v => IsBrand (Dash v) where
type GetVersion (Dash v) = v
type BoxLayout (Dash v) =
'[OM_ FileType,
OM Movie
'[OM_ (MovieHeader v),
SM Track
'[OM_ (TrackHeader v),
OM Media
'[OM_ (MediaHeader v), OM_ Handler,
OM MediaInformation '[OO_ SpecificMediaHeader]]]],
SO_ Skip]
data SingleTrackInit =
SingleTrackInit {_mvhd :: MovieHeader 0
,_tkhd :: TrackHeader 0
,_mdhd :: MediaHeader 0
,_hdlr :: Handler
,_xmhd :: SpecificMediaHeader}
makeLenses ''SingleTrackInit
mkSingleTrackInit
:: SingleTrackInit -> MediaFile (Dash 0)
mkSingleTrackInit doc =
MediaFile $
fileTypeBox (FileType "iso5" 0 ["isom","iso5","dash","mp42"]) :|
movie (movieHeader (doc ^. mvhd) :|
track (trackHeader (doc ^. tkhd) :|
media (mediaHeader (doc ^. mdhd) :. handler (doc ^. hdlr) :|
mediaInformation $:
specificMediaHeader (doc ^. xmhd))))