public override void ReadBlock(FlvContext context) { this.Start = context.CurrentPostion; var br = context.Reader; var byts = br.ReadBytes(10); this.Header = new TagHeader(byts); this.Size += 11; }
public override void ReadBlock(FlvContext context) { var br = context.Reader; this.Start = context.CurrentPostion; this.Size = 4; this.PreTagSize = br.ReadBytes(4).ToUInt32(false); context.CurrentPostion += 4; }
public override void ReadBlock(FlvContext context) { var br = context.Reader; this.Start = context.CurrentPostion; this.Signature = new string(br.ReadChars(3)); this.Version = Convert.ToInt32(br.ReadByte()).ToString(CultureInfo.InvariantCulture); var byt = br.ReadByte(); this.Reserve5 = byt & 0xF8; this.HasAudio = (byt & 0x04) > 0; this.Reserve7 = byt & 0x02; this.HasVideo = (byt & 0x01) > 0; this.Size = BitConverter.ToUInt32(br.ReadBytes(4).Reverse().ToArray(), 0); context.CurrentPostion += this.Size; }
public override void ReadBlock(FlvContext context) { this.Start = context.CurrentPostion; var br = context.Reader; this.Tags = new List<FlvTag>(); var flag = true; while (br.BaseStream.Position < br.BaseStream.Length) { if (flag) { var tagSizeBlock = new TagSizeBlock(); tagSizeBlock.ReadBlock(context); this.Size = this.Size + tagSizeBlock.Size + tagSizeBlock.PreTagSize; } else { var key = br.ReadByte(); var tag = this.GetTag(key); tag.ReadBlock(context); this.Tags.Add(tag); } flag = !flag; } }
public FlvInfo(Stream stream) { context = new FlvContext(stream); Analyze(false); }
public FlvInfo(string path) { context = new FlvContext(path); Analyze(true); }
public MetaData(FlvContext context, uint size) { this.size = size; this.offset = 0; this.Values = new List<KeyValuePair<string, object>>(); var br = context.Reader; this.AddElement(ReadElement(br).ToString(), ReadElement(br));//读完onMetaData //while (offset < size) //{ // var byts = br.ReadBytes(3); // if (byts[0] == 0 && byts[1] == 0 && byts[2] == 9) // { // offset += 3; // break; // } // br.BaseStream.Seek(-3, SeekOrigin.Current); // AddElement("#" + offset, ReadElement(br)); //} }