package senc

import "41.neocities.org/sofia/senc"

Index

Types

type Box

type Box struct {
	BoxHeader     sofia.BoxHeader
	FullBoxHeader sofia.FullBoxHeader
	SampleCount   uint32
	Sample        []Sample
}

ISO/IEC 23001-7

if the version of the SampleEncryptionBox is 0 and the flag senc_use_subsamples is set, UseSubSampleEncryption is set to 1

aligned(8) class SampleEncryptionBox extends FullBox(
   'senc', version, flags
) {
   unsigned int(32) sample_count;
   {
      unsigned int(Per_Sample_IV_Size*8) InitializationVector;
      if (UseSubSampleEncryption) {
         unsigned int(16) subsample_count;
         {
            unsigned int(16) BytesOfClearData;
            unsigned int(32) BytesOfProtectedData;
         } [subsample_count ]
      }
   }[ sample_count ]
}

func (*Box) Append

func (b *Box) Append(buf []byte) ([]byte, error)

func (*Box) Read

func (b *Box) Read(buf []byte) error

type Sample

type Sample struct {
	InitializationVector uint64
	SubsampleCount       uint16
	Subsample            []Subsample
	// contains filtered or unexported fields
}

func (*Sample) Append

func (s *Sample) Append(buf []byte) ([]byte, error)

func (*Sample) Decode

func (s *Sample) Decode(buf []byte) (int, error)

func (*Sample) DecryptCenc

func (s *Sample) DecryptCenc(text, key []byte) error

github.com/Eyevinn/mp4ff/blob/v0.40.2/mp4/crypto.go#L101

type Subsample

type Subsample struct {
	BytesOfClearData     uint16
	BytesOfProtectedData uint32
}

func (Subsample) Append

func (s Subsample) Append(buf []byte) ([]byte, error)

func (*Subsample) Decode

func (s *Subsample) Decode(buf []byte) (int, error)