public void AddOneSample(StreamDataBlockInfo data)
 {
     IndependentAndDisposableSample sample = new IndependentAndDisposableSample();
       sample.SampleHasRedundancy = 0;
       switch (data.SliceType)
       {
     case SliceType.WMA: // audio
     case SliceType.MP4A:
     case SliceType.AAC:
       sample.SampleDependsOn = 2;
       sample.SampleIsDependedOn = 2;
       break;
     case SliceType.IFrame:
       sample.SampleIsDependedOn = 1;
       sample.SampleDependsOn = 2;
       break;
     case SliceType.DFrame:
       sample.SampleIsDependedOn = 1;
       sample.SampleDependsOn = 1;
       break;
     default:
       throw new Exception("Invalid sample type, cannot add to independent and disposable sample");
       }
       this.Samples.Add(sample);
 }
Пример #2
0
        public void AddOneSample(StreamDataBlockInfo data)
        {
            IndependentAndDisposableSample sample = new IndependentAndDisposableSample();

            sample.SampleHasRedundancy = 0;
            switch (data.SliceType)
            {
            case SliceType.WMA: // audio
            case SliceType.MP4A:
            case SliceType.AAC:
                sample.SampleDependsOn    = 2;
                sample.SampleIsDependedOn = 2;
                break;

            case SliceType.IFrame:
                sample.SampleIsDependedOn = 1;
                sample.SampleDependsOn    = 2;
                break;

            case SliceType.DFrame:
                sample.SampleIsDependedOn = 1;
                sample.SampleDependsOn    = 1;
                break;

            default:
                throw new Exception("Invalid sample type, cannot add to independent and disposable sample");
            }
            this.Samples.Add(sample);
        }
Пример #3
0
 public override void Write(BoxWriter writer)
 {
     using (new SizeCalculator(this, writer)) {
         base.Write(writer);
         for (int i = 0; i < this.m_numSamples; i++)
         {
             IndependentAndDisposableSample item = Samples[i];
             item.Write(writer);
         }
     }
 }
 public override void Read(BoxReader reader)
 {
     using (new SizeChecker(this, reader))
     {
         base.Read(reader);
         for (int i = 0; i < this.m_numSamples; i++)
         {
             IndependentAndDisposableSample item = new IndependentAndDisposableSample();
             item.Read(reader);
             this.Samples.Add(item);
         }
     }
 }
Пример #5
0
 public override void Read(BoxReader reader)
 {
     using (new SizeChecker(this, reader))
     {
         base.Read(reader);
         for (int i = 0; i < this.m_numSamples; i++)
         {
             IndependentAndDisposableSample item = new IndependentAndDisposableSample();
             item.Read(reader);
             this.Samples.Add(item);
         }
     }
 }