• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Mpeg4.BoxHeader类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中TagLib.Mpeg4.BoxHeader的典型用法代码示例。如果您正苦于以下问题:C# BoxHeader类的具体用法?C# BoxHeader怎么用?C# BoxHeader使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BoxHeader类属于TagLib.Mpeg4命名空间,在下文中一共展示了BoxHeader类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ParseBoxHeaders

 private void ParseBoxHeaders(long start, long end, List<BoxHeader> parents)
 {
     BoxHeader header;
     for (long i = start; i < end; i += header.TotalBoxSize)
     {
         header = new BoxHeader(this.file, i);
         if ((this.moov_tree == null) && (header.BoxType == BoxType.Moov))
         {
             List<BoxHeader> list = AddParent(parents, header);
             this.moov_tree = list.ToArray();
             this.ParseBoxHeaders(header.HeaderSize + i, header.TotalBoxSize + i, list);
         }
         else if (((header.BoxType == BoxType.Mdia) || (header.BoxType == BoxType.Minf)) || ((header.BoxType == BoxType.Stbl) || (header.BoxType == BoxType.Trak)))
         {
             this.ParseBoxHeaders(header.HeaderSize + i, header.TotalBoxSize + i, AddParent(parents, header));
         }
         else if ((this.udta_tree == null) && (header.BoxType == BoxType.Udta))
         {
             this.udta_tree = AddParent(parents, header).ToArray();
         }
         else if (header.BoxType == BoxType.Mdat)
         {
             this.mdat_start = i;
             this.mdat_end = i + header.TotalBoxSize;
         }
         if (header.TotalBoxSize == 0)
         {
             break;
         }
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:31,代码来源:FileParser.cs


示例2: AppleAdditionalInfoBox

 /// <summary>
 ///    Constructs and initializes a new instance of <see
 ///    cref="AppleAdditionalInfoBox" /> with a provided header
 ///    and handler by reading the contents from a specified
 ///    file.
 /// </summary>
 /// <param name="header">
 ///    A <see cref="BoxHeader" /> object containing the header
 ///    to use for the new instance.
 /// </param>
 /// <param name="file">
 ///    A <see cref="TagLib.File" /> object to read the contents
 ///    of the box from.
 /// </param>
 /// <param name="handler">
 ///    A <see cref="IsoHandlerBox" /> object containing the
 ///    handler that applies to the new instance.
 /// </param>
 /// <exception cref="ArgumentNullException">
 ///    <paramref name="file" /> is <see langword="null" />.
 /// </exception>
 public AppleAdditionalInfoBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler)
     : base(header, file, handler)
 {
     // We do not care what is in this custom data section
     // see: https://developer.apple.com/library/mac/#documentation/QuickTime/QTFF/QTFFChap2/qtff2.html
     Data = file.ReadBlock(DataSize > 0 ? DataSize : 0); ;
 }
开发者ID:samueldjack,项目名称:taglib-sharp,代码行数:28,代码来源:AppleAdditionalInfoBox.cs


示例3: AppleItemListBox

 public AppleItemListBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     this.children = base.LoadChildren(file);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:8,代码来源:AppleItemListBox.cs


示例4: UnknownBox

 public UnknownBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     this.data = base.LoadData(file);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:8,代码来源:UnknownBox.cs


示例5: IsoSampleEntry

 public IsoSampleEntry(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     file.Seek(base.DataPosition + 6L);
     this.data_reference_index = file.ReadBlock(2).ToUShort();
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:9,代码来源:IsoSampleEntry.cs


示例6: IsoSampleDescriptionBox

 public IsoSampleDescriptionBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     this.entry_count = file.ReadBlock(4).ToUInt();
     this.children = base.LoadChildren(file);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:9,代码来源:IsoSampleDescriptionBox.cs


示例7: IsoChunkOffsetBox

 public IsoChunkOffsetBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     ByteVector vector = file.ReadBlock(base.DataSize);
     this.offsets = new uint[vector.Mid(0, 4).ToUInt()];
     for (int i = 0; i < this.offsets.Length; i++)
     {
         this.offsets[i] = vector.Mid(4 + (i * 4), 4).ToUInt();
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:9,代码来源:IsoChunkOffsetBox.cs


示例8: IsoSampleTableBox

        /// <summary>
        ///    Constructs and initializes a new instance of <see
        ///    cref="IsoSampleTableBox" /> with a provided header and
        ///    handler by reading the contents from a specified file.
        /// </summary>
        /// <param name="header">
        ///    A <see cref="BoxHeader" /> object containing the header
        ///    to use for the new instance.
        /// </param>
        /// <param name="file">
        ///    A <see cref="TagLib.File" /> object to read the contents
        ///    of the box from.
        /// </param>
        /// <param name="handler">
        ///    A <see cref="IsoHandlerBox" /> object containing the
        ///    handler that applies to the new instance.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///    <paramref name="file" /> is <see langword="null" />.
        /// </exception>
        public IsoSampleTableBox(BoxHeader header, TagLib.File file,
            IsoHandlerBox handler)
            : base(header, handler)
        {
            if (file == null)
                throw new ArgumentNullException ("file");

            children = LoadChildren (file);
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:29,代码来源:IsoSampleTableBox.cs


示例9: AddParent

 private static List<BoxHeader> AddParent(List<BoxHeader> parents, BoxHeader current)
 {
     List<BoxHeader> list = new List<BoxHeader>();
     if (parents != null)
     {
         list.AddRange(parents);
     }
     list.Add(current);
     return list;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:10,代码来源:FileParser.cs


示例10: FullBox

 protected FullBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     file.Seek(base.DataPosition);
     ByteVector vector = file.ReadBlock(4);
     this.version = vector[0];
     this.flags = vector.Mid(1, 3).ToUInt();
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:11,代码来源:FullBox.cs


示例11: FullBox

        /// <summary>
        ///    Constructs and initializes a new instance of <see
        ///    cref="FullBox" /> with a provided header and handler by
        ///    reading the contents from a specified file.
        /// </summary>
        /// <param name="header">
        ///    A <see cref="BoxHeader" /> object containing the header
        ///    to use for the new instance.
        /// </param>
        /// <param name="file">
        ///    A <see cref="TagLib.File" /> object to read the contents
        ///    of the box from.
        /// </param>
        /// <param name="handler">
        ///    A <see cref="IsoHandlerBox" /> object containing the
        ///    handler that applies to the new instance.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///    <paramref name="file" /> is <see langword="null" />.
        /// </exception>
        protected FullBox(BoxHeader header, TagLib.File file,
            IsoHandlerBox handler)
            : base(header, handler)
        {
            if (file == null)
                throw new ArgumentNullException ("file");

            file.Seek (base.DataPosition);
            ByteVector header_data = file.ReadBlock (4);
            version = header_data [0];
            flags = header_data.Mid (1, 3).ToUInt ();
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:32,代码来源:FullBox.cs


示例12: FileParser

 public FileParser(TagLib.File file)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     this.file = file;
     this.first_header = new BoxHeader(file, 0L);
     if (this.first_header.BoxType != "ftyp")
     {
         throw new CorruptFileException("File does not start with 'ftyp' box.");
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:13,代码来源:FileParser.cs


示例13: IsoChunkOffsetBox

		/// <summary>
		///    Constructs and initializes a new instance of <see
		///    cref="IsoChunkOffsetBox" /> with a provided header and
		///    handler by reading the contents from a specified file.
		/// </summary>
		/// <param name="header">
		///    A <see cref="BoxHeader" /> object containing the header
		///    to use for the new instance.
		/// </param>
		/// <param name="file">
		///    A <see cref="TagLib.File" /> object to read the contents
		///    of the box from.
		/// </param>
		/// <param name="handler">
		///    A <see cref="IsoHandlerBox" /> object containing the
		///    handler that applies to the new instance.
		/// </param>
		public IsoChunkOffsetBox (BoxHeader header, TagLib.File file,
		                          IsoHandlerBox handler)
			: base (header, file, handler)
		{
			ByteVector box_data = file.ReadBlock (DataSize);
			
			offsets = new uint [(int)
				box_data.Mid (0, 4).ToUInt ()];
			
			for (int i = 0; i < offsets.Length; i ++)
				offsets [i] = box_data.Mid (4 + i * 4,
					4).ToUInt ();
		}
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:30,代码来源:IsoChunkOffsetBox.cs


示例14: IsoAudioSampleEntry

 public IsoAudioSampleEntry(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     file.Seek(base.DataPosition + 8L);
     this.channel_count = file.ReadBlock(2).ToUShort();
     this.sample_size = file.ReadBlock(2).ToUShort();
     file.Seek(base.DataPosition + 0x10L);
     this.sample_rate = file.ReadBlock(4).ToUInt();
     this.children = base.LoadChildren(file);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:13,代码来源:IsoAudioSampleEntry.cs


示例15: IsoVisualSampleEntry

		/*
		/// <summary>
		///    Contains the children of the box.
		/// </summary>
		private BoxList children;
		*/
		
		#endregion
		
		
		
		#region Constructors
		
		/// <summary>
		///    Constructs and initializes a new instance of <see
		///    cref="IsoVisualSampleEntry" /> with a provided header and
		///    handler by reading the contents from a specified file.
		/// </summary>
		/// <param name="header">
		///    A <see cref="BoxHeader" /> object containing the header
		///    to use for the new instance.
		/// </param>
		/// <param name="file">
		///    A <see cref="TagLib.File" /> object to read the contents
		///    of the box from.
		/// </param>
		/// <param name="handler">
		///    A <see cref="IsoHandlerBox" /> object containing the
		///    handler that applies to the new instance.
		/// </param>
		/// <exception cref="ArgumentNullException">
		///    <paramref name="file" /> is <see langword="null" />.
		/// </exception>
		public IsoVisualSampleEntry (BoxHeader header, TagLib.File file,
		                             IsoHandlerBox handler)
			: base (header, file, handler)
		{
			file.Seek (base.DataPosition + 16);
			width = file.ReadBlock (2).ToUShort ();
			height = file.ReadBlock (2).ToUShort ();
			
			/*
			TODO: What are the children anyway?
			children = LoadChildren (file);
			*/
		}
开发者ID:JohnThomson,项目名称:taglib-sharp,代码行数:46,代码来源:IsoVisualSampleEntry.cs


示例16: IsoHandlerBox

        /// <summary>
        ///    Constructs and initializes a new instance of <see
        ///    cref="IsoHandlerBox" /> with a provided header and
        ///    handler by reading the contents from a specified file.
        /// </summary>
        /// <param name="header">
        ///    A <see cref="BoxHeader" /> object containing the header
        ///    to use for the new instance.
        /// </param>
        /// <param name="file">
        ///    A <see cref="TagLib.File" /> object to read the contents
        ///    of the box from.
        /// </param>
        /// <param name="handler">
        ///    A <see cref="IsoHandlerBox" /> object containing the
        ///    handler that applies to the new instance.
        /// </param>
        /// <exception cref="ArgumentNullException">
        ///    <paramref name="file" /> is <see langword="null" />.
        /// </exception>
        public IsoHandlerBox(BoxHeader header, TagLib.File file,
            IsoHandlerBox handler)
            : base(header, file, handler)
        {
            if (file == null)
                throw new System.ArgumentNullException ("file");

            file.Seek (DataPosition + 4);
            ByteVector box_data = file.ReadBlock (DataSize - 4);
            handler_type = box_data.Mid (0, 4);

            int end = box_data.Find ((byte) 0, 16);
            if (end < 16)
                end = box_data.Count;
            name = box_data.ToString (StringType.UTF8, 16, end - 16);
        }
开发者ID:sanyaade-embedded-systems,项目名称:MPTagThat,代码行数:36,代码来源:IsoHandlerBox.cs


示例17: IsoHandlerBox

 public IsoHandlerBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     file.Seek(this.DataPosition + 4L);
     ByteVector vector = file.ReadBlock(base.DataSize - 4);
     this.handler_type = vector.Mid(0, 4);
     int count = vector.Find(0, 0x10);
     if (count < 0x10)
     {
         count = vector.Count;
     }
     this.name = vector.ToString(StringType.UTF8, 0x10, count - 0x10);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:16,代码来源:IsoHandlerBox.cs


示例18: AppleElementaryStreamDescriptor

 public AppleElementaryStreamDescriptor(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     int offset = 0;
     ByteVector data = file.ReadBlock(base.DataSize);
     this.decoder_config = new ByteVector();
     if (data[offset++] == 3)
     {
         if (ReadLength(data, ref offset) < 20)
         {
             throw new CorruptFileException("Insufficient data present.");
         }
         this.es_id = data.Mid(offset, 2).ToUShort();
         offset += 2;
         this.stream_priority = data[offset++];
     }
     else
     {
         this.es_id = data.Mid(offset, 2).ToUShort();
         offset += 2;
     }
     if (data[offset++] != 4)
     {
         throw new CorruptFileException("Could not identify decoder configuration descriptor.");
     }
     if (ReadLength(data, ref offset) < 15)
     {
         throw new CorruptFileException("Could not read data. Too small.");
     }
     this.object_type_id = data[offset++];
     this.stream_type = data[offset++];
     this.buffer_size_db = data.Mid(offset, 3).ToUInt();
     offset += 3;
     this.max_bitrate = data.Mid(offset, 4).ToUInt();
     offset += 4;
     this.average_bitrate = data.Mid(offset, 4).ToUInt();
     offset += 4;
     if (data[offset++] != 5)
     {
         throw new CorruptFileException("Could not identify decoder specific descriptor.");
     }
     uint num2 = ReadLength(data, ref offset);
     this.decoder_config = data.Mid(offset, (int) num2);
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:43,代码来源:AppleElementaryStreamDescriptor.cs


示例19: IsoMovieHeaderBox

 public IsoMovieHeaderBox(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     ByteVector vector;
     if (file == null)
     {
         throw new ArgumentNullException("file");
     }
     int dataSize = base.DataSize;
     if (base.Version == 1)
     {
         vector = file.ReadBlock(Math.Min(0x1c, dataSize));
         if (vector.Count >= 8)
         {
             this.creation_time = vector.Mid(0, 8).ToULong();
         }
         if (vector.Count >= 0x10)
         {
             this.modification_time = vector.Mid(8, 8).ToULong();
         }
         if (vector.Count >= 20)
         {
             this.timescale = vector.Mid(0x10, 4).ToUInt();
         }
         if (vector.Count >= 0x1c)
         {
             this.duration = vector.Mid(20, 8).ToULong();
         }
         dataSize -= 0x1c;
     }
     else
     {
         vector = file.ReadBlock(Math.Min(0x10, dataSize));
         if (vector.Count >= 4)
         {
             this.creation_time = vector.Mid(0, 4).ToUInt();
         }
         if (vector.Count >= 8)
         {
             this.modification_time = vector.Mid(4, 4).ToUInt();
         }
         if (vector.Count >= 12)
         {
             this.timescale = vector.Mid(8, 4).ToUInt();
         }
         if (vector.Count >= 0x10)
         {
             this.duration = vector.Mid(12, 4).ToUInt();
         }
         dataSize -= 0x10;
     }
     vector = file.ReadBlock(Math.Min(6, dataSize));
     if (vector.Count >= 4)
     {
         this.rate = vector.Mid(0, 4).ToUInt();
     }
     if (vector.Count >= 6)
     {
         this.volume = vector.Mid(4, 2).ToUShort();
     }
     file.Seek(file.Tell + 70L);
     dataSize -= 0x4c;
     vector = file.ReadBlock(Math.Min(4, dataSize));
     if (vector.Count >= 4)
     {
         this.next_track_id = vector.Mid(0, 4).ToUInt();
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:67,代码来源:IsoMovieHeaderBox.cs


示例20: IsoVisualSampleEntry

 public IsoVisualSampleEntry(BoxHeader header, TagLib.File file, IsoHandlerBox handler) : base(header, file, handler)
 {
     file.Seek(base.DataPosition + 0x10L);
     this.width = file.ReadBlock(2).ToUShort();
     this.height = file.ReadBlock(2).ToUShort();
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:6,代码来源:IsoVisualSampleEntry.cs



注:本文中的TagLib.Mpeg4.BoxHeader类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# SimpleSqlRepository.SqlStatement类代码示例发布时间:2022-05-26
下一篇:
C# DB.User类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap