Esempio n. 1
0
 public PiffProtectedVideoSampleEntry(PiffVideoManifest video, Guid keyId)
 {
     Width            = video.Width;
     Height           = video.Height;
     Scheme           = PiffProtectionSchemeInformation.CreateVideo(video.CodecId, keyId);
     AvcConfiguration = new PiffAvcConfiguration(video.CodecId, video.CodecData);
 }
Esempio n. 2
0
        public PiffProtectedAudioSampleEntry(PiffAudioManifest audio, Guid keyId)
        {
            if (audio.Channels != 2)
            {
                throw new ArgumentException("AudioSampleEntry must have 2 channels.");
            }

            if (audio.CodecId != "AACL")
            {
                throw new ArgumentException($"Cannot process codec '{audio.CodecId}', only 'AACL' is supported.");
            }

            ChannelCount      = audio.Channels;
            SampleSize        = audio.BitsPerSample;
            SampleRate        = ((uint)audio.SamplingRate) << 16;
            Scheme            = PiffProtectionSchemeInformation.CreateAudio(audio.CodecId, keyId);
            StreamDescription = PiffElementaryStreamDescription.Create(
                audio.CodecId, 0, audio.BitRate, BufferSize, audio.CodecData);
        }