private StreamPropertiesObject GetStreamProperty(AsfObject asfObject, int streamID)
        {
            StreamPropertiesObject streamProperty = asfObject as StreamPropertiesObject;

            if (streamProperty != null && streamProperty.StreamNumber == streamID)
            {
                return(streamProperty);
            }

            foreach (AsfObject child in asfObject.Children)
            {
                streamProperty = GetStreamProperty(child, streamID);

                if (streamProperty != null && streamProperty.StreamNumber == streamID)
                {
                    return(streamProperty);
                }
            }
            return(streamProperty);
        }
        private void AddPayload(IDataBlockBuilder dataBlockBuilder, IDictionary <byte, ICodecStreamBuilder> codecStreamBuilders, Payload payload, CodecListObject codecList, AsfObject asfObject)
        {
            if (payload.Streams == null || payload.Streams.Count == 0)
            {
                return;
            }

            byte streamNumber = payload.StreamNumber;

            if (codecStreamBuilders.ContainsKey(streamNumber))
            {
                ICodecStreamBuilder codecStreamBuilder = codecStreamBuilders[streamNumber];

                foreach (IDataPacket streamData in payload.Streams)
                {
                    codecStreamBuilder.Data = codecStreamBuilder.Data.Append(streamData);
                }
            }
            else
            {
                StreamPropertiesObject streamProperty = GetStreamProperty(asfObject, streamNumber);

                ICodecStreamBuilder codecStreamBuilder = dataBlockBuilder.AddCodecStream();
                codecStreamBuilder.Name = GetCodecStreamName(streamNumber, streamProperty, codecList);
                // The DataFormat will be set by the codec detector (if one exists)
                //codecStreamBuilder.DataFormat = GetDataFormat(streamProperty);
                codecStreamBuilder.Data = GetStreamData(streamProperty, payload.Streams[0]);
                for (int streamIndex = 1; streamIndex < payload.Streams.Count; streamIndex++)
                {
                    codecStreamBuilder.Data = codecStreamBuilder.Data.Append(payload.Streams[streamIndex]);
                }
                codecStreamBuilder.AbsoluteStartOffset = codecStreamBuilder.Data.StartOffset;

                codecStreamBuilders.Add(streamNumber, codecStreamBuilder);
            }
        }
 public DataObjectWithoutStart(AsfObject previousObject)
     : base(previousObject, AsfObjectName.DataObjectWithoutStart)
 {
     _dataPackets = new List <DataPacket>();
 }
Example #4
0
 public StreamPropertiesObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.StreamPropertiesObject)
 {
 }
 public HeaderExtensionObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.HeaderExtensionObject)
 {
 }
 public MarkerObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.MarkerObject)
 {
 }
Example #7
0
 public ExtendedStreamPropertiesObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.ExtendedStreamPropertiesObject)
 {
 }
 public BandwidthSharingObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.BandwidthSharingObject)
 {
 }
 public BitrateMutualExclusionObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.BitrateMutualExclusionObject)
 {
 }
 public IndexObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.IndexObject)
 {
 }
 public MediaObjectIndexObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.MediaObjectIndexObject)
 {
 }
 public SimpleIndexObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.SimpleIndexObject)
 {
 }
 public ContentBrandingObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.ContentBrandingObject)
 {
 }
 public ExtendedContentDescriptionObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.ExtendedContentDescriptionObject)
 {
 }
Example #15
0
 public AdvancedMutualExclusionObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.AdvancedMutualExclusionObject)
 {
 }
 internal CodecStream(AsfObject root)
 {
     _root = root;
 }
 public ScriptCommandObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.ScriptCommandObject)
 {
 }
Example #18
0
 public GroupMutualExclusionObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.GroupMutualExclusionObject)
 {
 }
Example #19
0
 public MetadataObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.MetadataObject)
 {
 }
Example #20
0
 public CodecListObject(AsfObject previousObject)
     : base(previousObject, AsfObjectName.CodecListObject)
 {
     CodecNames = new Dictionary <CodecType, string>();
 }