本文整理汇总了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;
}
}
}
示例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); ;
}
示例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);
}
示例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);
}
示例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();
}
示例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);
}
示例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();
}
}
示例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);
}
示例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;
}
示例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();
}
示例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 ();
}
示例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.");
}
}
示例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 ();
}
示例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);
}
示例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);
*/
}