module Data.ByteString.IsoBaseFileFormat.Boxes.FileType where
import Data.ByteString.IsoBaseFileFormat.Boxes.Box
instance IsBoxType FileType where
type BoxContent FileType = FileType
toBoxType _ _ = StdType "ftyp"
fileTypeBox :: (ValidBox b FileType)
=> FileType -> Box b FileType
fileTypeBox = closedBox
data FileType =
FileType {majorBrand :: FourCc
,minorVersion :: Word32
,compatibleBrands :: [FourCc]}
instance IsBoxContent FileType where
boxSize (FileType maj _ver comps) = boxSize maj + 4 + sum (boxSize <$> comps)
boxBuilder (FileType maj ver comps) =
boxBuilder maj <> word32BE ver <> mconcat (boxBuilder <$> comps)