当前位置: 首页>>代码示例>>C#>>正文


C# Mpeg4.BoxHeader类代码示例

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


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


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