Esempio n. 1
0
        /// <summary>
        /// to push new raw data from any source, pass the data in here
        /// </summary>
        /// <param name="data"></param>
        public bool AddRaw(byte[] data)
        {
            //assume it's Mpeg TS for now...
            var ts = new TsPacket(data);

            if (!ts.IsValid)
            {
                //int i = 0;
                return(false);//not valid TS packet!
            }

            if (data.Length > TsPacket.PacketLength)
            {
                var chunk = new TsChunk(data);
                var packs = chunk.GetTsPackets();

                foreach (var p in packs)
                {
                    if (p.IsValid)
                    {
                        AddTsPacket(p);
                    }
                }
            }
            else
            {
                return(AddTsPacket(ts));
            }

            return(true);
        }
Esempio n. 2
0
 /// <summary>
 /// allows re-use of this object w/o call to new.
 /// </summary>
 /// <param name="rawData"></param>
 public void Reinit(byte[] rawData)
 {
     data = new TsChunk(rawData); 
 }
Esempio n. 3
0
 public TsPacket(byte[] rawData)
 {
     data = new TsChunk( rawData);
 }
Esempio n. 4
0
 internal TsPacket(TsChunk segment)
 {
     data = segment;
 }
Esempio n. 5
0
        private TsChunk data;//from parent TsPacket

        internal AdaptationField(TsPacket parent)
        {
            data = parent.data;
        }
Esempio n. 6
0
        private TsChunk data;//from parent TsPacket

        internal AdaptationField(TsPacket parent)
        {
            data = parent.data;
        }
Esempio n. 7
0
        /// <summary>
        /// to push new raw data from any source, pass the data in here
        /// </summary>
        /// <param name="data"></param>
        public bool AddRaw(byte[] data)
        {
            //assume it's Mpeg TS for now...
            var ts = new TsPacket(data);

            if (!ts.IsValid)
            {
                //int i = 0;
                return false;//not valid TS packet!
            }

            if (data.Length > TsPacket.PacketLength)
            {
                var chunk = new TsChunk(data);
                var packs = chunk.GetTsPackets();

                foreach (var p in packs)
                    if(p.IsValid)
                        AddTsPacket(p);
            }
            else
                return AddTsPacket(ts);

            return true;
        }
Esempio n. 8
0
 /// <summary>
 /// allows re-use of this object w/o call to new.
 /// </summary>
 /// <param name="rawData"></param>
 public void Reinit(byte[] rawData)
 {
     data = new TsChunk(rawData);
 }
Esempio n. 9
0
 public TsPacket(byte[] rawData)
 {
     data = new TsChunk(rawData);
 }
Esempio n. 10
0
 internal TsPacket(TsChunk segment)
 {
     data = segment;
 }