Tag Parser: TagParser::Mpeg4Descriptor Class Reference

Tag Parser 12.5.3 C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags

Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Friends | List of all members
TagParser::Mpeg4Descriptor Class Reference

The Mpeg4Descriptor class helps to parse MPEG-4 descriptors. More...

`#include <mpeg4descriptor.h>`

Inheritance diagram for TagParser::Mpeg4Descriptor:
[legend]
Collaboration diagram for TagParser::Mpeg4Descriptor:
[legend]

## Public Member Functions
| Mpeg4Descriptor (ContainerType &container, std::uint64_t startOffset, std::uint64_t maxSize)
| Constructs a new top level descriptor with the specified container at the specified startOffset and with the specified maxSize.
std::string | idToString () const
| Converts the specified atom ID to a printable string.
bool | isParent () const
| Returns an indication whether the descriptor contains sub descriptors.
bool | isPadding () const
| Returns always false for MPEG-4 descriptors.
std::uint64_t | firstChildOffset () const
| Returns the offset of the first child (relative to the start offset of this descriptor).
Public Member Functions inherited from TagParser::GenericFileElement< Mpeg4Descriptor >
| GenericFileElement (ContainerType &container, std::uint64_t startOffset)
GenericFileElement & | operator= (const GenericFileElement &other)=delete
ContainerType & | container ()
| Returns the related container.
std::iostream & | stream ()
| Returns the related stream.
CppUtilities::BinaryReader & | reader ()
| Returns the related BinaryReader.
CppUtilities::BinaryWriter & | writer ()
| Returns the related BinaryWriter.
std::uint64_t | startOffset () const
| Returns the start offset in the related stream.
std::uint64_t | relativeStartOffset () const
| Returns the offset of the element in its parent or - if it is a top-level element - in the related stream.
const IdentifierType & | id () const
| Returns the element ID.
std::string | idToString () const
| Returns a printable string representation of the element ID.
std::uint32_t | idLength () const
| Returns the length of the id denotation in byte.
std::uint32_t | headerSize () const
| Returns the header size of the element in byte.
DataSizeType | dataSize () const
| Returns the data size of the element in byte.
std::uint32_t | sizeLength () const
| Returns the length of the size denotation of the element in byte.
std::uint64_t | dataOffset () const
| Returns the data offset of the element in the related stream.
std::uint64_t | totalSize () const
| Returns the total size of the element.
std::uint64_t | endOffset () const
| Returns the offset of the first byte which doesn't belong to this element anymore.
std::uint64_t | maxTotalSize () const
| Returns maximum total size.
std::uint8_t | level () const
| Returns how deep the element is nested (0 for top-level elements, 1 for children of top-level elements, ...).
Mpeg4Descriptor * | parent ()
| Returns the parent of the element.
Mpeg4Descriptor * | nextSibling ()
| Returns the next sibling of the element.
Mpeg4Descriptor * | firstChild ()
| Returns the first child of the element.
Mpeg4Descriptor * | lastChild ()
| Returns the last child of the element.
Mpeg4Descriptor * | subelementByPath (Diagnostics &diag, IdType item)
| Returns the sub element for the specified path.
Mpeg4Descriptor * | childById (const IdentifierType &id, Diagnostics &diag)
| Returns the first child with the specified id.
Mpeg4Descriptor * | siblingById (const IdentifierType &id, Diagnostics &diag)
| Returns the first sibling with the specified id.
Mpeg4Descriptor * | siblingByIdIncludingThis (const IdentifierType &id, Diagnostics &diag)
| Returns the first sibling with the specified id or the current instance if its ID equals id.
bool | isParent () const
| Returns an indication whether this instance is a parent element.
bool | isPadding () const
| Returns an indication whether this instance is a padding element.
std::uint64_t | firstChildOffset () const
| Returns the offset of the first child (relative to the start offset of this element).
bool | isParsed () const
| Returns an indication whether this instance has been parsed yet.
void | clear ()
| Clears the status of the element.
void | parse (Diagnostics &diag)
| Parses the header information of the element which is read from the related stream at the start offset.
void | reparse (Diagnostics &diag)
| Parses the header information of the element which is read from the related stream at the start offset.
void | validateSubsequentElementStructure (Diagnostics &diag, std::uint64_t *paddingSize=nullptr, AbortableProgressFeedback *progress=nullptr)
| Parses (see parse()) this and all subsequent elements.
void | copyHeader (TargetStream &targetStream, Diagnostics &diag, AbortableProgressFeedback *progress)
| Writes the header information of the element to the specified targetStream.
void | copyWithoutChilds (TargetStream &targetStream, Diagnostics &diag, AbortableProgressFeedback *progress)
| Writes the element without its children to the specified targetStream.
void | copyEntirely (TargetStream &targetStream, Diagnostics &diag, AbortableProgressFeedback *progress)
| Writes the entire element including all children to the specified targetStream.
void | makeBuffer ()
| Buffers the element (header and data).
void | discardBuffer ()
| Discards buffered data.
void | copyBuffer (TargetStream &targetStream)
| Copies buffered data to targetStream.
void | copyPreferablyFromBuffer (TargetStream &targetStream, Diagnostics &diag, AbortableProgressFeedback *progress)
| Copies buffered data to targetStream if data has been buffered; copies from input stream otherwise.
const std::unique_ptr< char[]> & | buffer ()
| Returns buffered data.
Mpeg4Descriptor * | denoteFirstChild (std::uint32_t offset)
| Denotes the first child to start at the specified offset (relative to the start offset of this descriptor).

## Protected Member Functions
| Mpeg4Descriptor (Mpeg4Descriptor &parent, std::uint64_t startOffset)
| Constructs a new sub level descriptor with the specified parent at the specified startOffset.
void | internalParse (Diagnostics &diag)
| Parses the MPEG-4 descriptor.

## Friends
class | GenericFileElement< Mpeg4Descriptor >

## Additional Inherited Members
Public Types inherited from TagParser::GenericFileElement< Mpeg4Descriptor >
using | ContainerType
| Specifies the type of the corresponding container.
using | IdentifierType
| Specifies the type used to store identifiers.
using | DataSizeType
| Specifies the type used to store data sizes.
Static Public Member Functions inherited from TagParser::GenericFileElement< Mpeg4Descriptor >
static constexpr std::uint32_t | maximumIdLengthSupported ()
| Returns the maximum id length supported by the class in byte.
static constexpr std::uint32_t | maximumSizeLengthSupported ()
| Returns the maximum size length supported by the class in byte.
static constexpr std::uint8_t | minimumElementSize ()
| Returns the minimum element size.
Protected Attributes inherited from TagParser::GenericFileElement< Mpeg4Descriptor >
IdentifierType | m_id
std::uint64_t | m_startOffset
std::uint64_t | m_maxSize
DataSizeType | m_dataSize
std::uint32_t | m_idLength
std::uint32_t | m_sizeLength
Mpeg4Descriptor * | m_parent
std::unique_ptr< Mpeg4Descriptor > | m_nextSibling
std::unique_ptr< Mpeg4Descriptor > | m_firstChild
std::unique_ptr< char[]> | m_buffer
bool | m_sizeUnknown

## Detailed Description

The Mpeg4Descriptor class helps to parse MPEG-4 descriptors.

Definition at line 31 of file mpeg4descriptor.h.

## Constructor & Destructor Documentation

## ◆ Mpeg4Descriptor() [1/2]

TagParser::Mpeg4Descriptor::Mpeg4Descriptor | ( | ContainerType & | container,
|  | std::uint64_t | startOffset,
|  | std::uint64_t | maxSize )

Constructs a new top level descriptor with the specified container at the specified startOffset and with the specified maxSize.

Definition at line 23 of file mpeg4descriptor.cpp.

## ◆ Mpeg4Descriptor() [2/2]

TagParser::Mpeg4Descriptor::Mpeg4Descriptor | ( | Mpeg4Descriptor & | parent,
|  | std::uint64_t | startOffset )
| protected

Constructs a new sub level descriptor with the specified parent at the specified startOffset.

Definition at line 31 of file mpeg4descriptor.cpp.

## Member Function Documentation

## ◆ firstChildOffset()

std::uint64_t TagParser::Mpeg4Descriptor::firstChildOffset | ( |  | ) | const
| inline

Returns the offset of the first child (relative to the start offset of this descriptor).

Remarks
  The first child must be denoted (via denoteFirstChild()).

Definition at line 74 of file mpeg4descriptor.h.

## ◆ idToString()

std::string TagParser::Mpeg4Descriptor::idToString | ( |  | ) | const

Converts the specified atom ID to a printable string.

Definition at line 47 of file mpeg4descriptor.cpp.

## ◆ internalParse()

void TagParser::Mpeg4Descriptor::internalParse | ( | Diagnostics & | diag | ) |
| protected

Parses the MPEG-4 descriptor.

Remarks
  Does not detect the first child.

Definition at line 56 of file mpeg4descriptor.cpp.

## ◆ isPadding()

bool TagParser::Mpeg4Descriptor::isPadding | ( |  | ) | const
| inline

Returns always false for MPEG-4 descriptors.

Definition at line 64 of file mpeg4descriptor.h.

## ◆ isParent()

bool TagParser::Mpeg4Descriptor::isParent | ( |  | ) | const
| inline

Returns an indication whether the descriptor contains sub descriptors.

Remarks
  Returns true if a first child has been denoted (via denoteFirstChild()).

Definition at line 56 of file mpeg4descriptor.h.

## Friends And Related Symbol Documentation

## ◆ GenericFileElement< Mpeg4Descriptor >

friend class GenericFileElement< Mpeg4Descriptor >
| friend

Definition at line 25 of file mpeg4descriptor.h.

The documentation for this class was generated from the following files:

- mp4/mpeg4descriptor.h
- mp4/mpeg4descriptor.cpp