Esempio n. 1
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);
        }