Exiv2::MatroskaVideo Class Reference

Class to access Matroska video files. More...

#include <matroskavideo.hpp>

Inheritance diagram for Exiv2::MatroskaVideo:
[legend]
Collaboration diagram for Exiv2::MatroskaVideo:
[legend]

List of all members.

Public Member Functions

Creators
 MatroskaVideo (BasicIo::AutoPtr io)
 Constructor for a Matroska video. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.
Manipulators
void readMetadata ()
 Read all metadata supported by a specific image format from the image. Before this method is called, the image metadata will be cleared.
void writeMetadata ()
 Write metadata back to the image.
Accessors
std::string mimeType () const
 Return the MIME type of the image.

Protected Member Functions

uint32_t findBlockSize (byte b)
 Function used to calulate the size of a block. This information is only stored in one byte. The size of the block is calculated by counting the number of leading zeros in the binary code of the byte. Size = (No. of leading zeros + 1) bytes.
void decodeBlock ()
 Check for a valid tag and decode the block at the current IO position. Calls contentManagement() or skips to next tag, if required.
void contentManagement (const MatroskaTags *mt, const byte *buf, long size)
 Interpret tag information, and save it in the respective XMP container.
void aspectRatio ()
 Calculates Aspect Ratio of a video, and stores it in the respective XMP container.


Detailed Description

Class to access Matroska video files.

Constructor & Destructor Documentation

Exiv2::MatroskaVideo::MatroskaVideo ( BasicIo::AutoPtr  io  ) 

Constructor for a Matroska video. Since the constructor can not return a result, callers should check the good() method after object construction to determine success or failure.

Parameters:
io An auto-pointer that owns a BasicIo instance used for reading and writing image metadata. Important: The constructor takes ownership of the passed in BasicIo instance through the auto-pointer. Callers should not continue to use the BasicIo instance after it is passed to this method. Use the Image::io() method to get a temporary reference.

Referenced by Exiv2::newMkvInstance().


Member Function Documentation

void Exiv2::MatroskaVideo::readMetadata (  )  [virtual]

Read all metadata supported by a specific image format from the image. Before this method is called, the image metadata will be cleared.

This method returns success even if no metadata is found in the image. Callers must therefore check the size of individual metadata types before accessing the data.

Exceptions:
Error if opening or reading of the file fails or the image data is not valid (does not look like data of the specific image type).

Implements Exiv2::Image.

References aspectRatio(), Exiv2::Image::clearMetadata(), decodeBlock(), Exiv2::Image::io_, Exiv2::isMkvType(), mimeType(), Exiv2::strError(), and Exiv2::Image::xmpData_.

void Exiv2::MatroskaVideo::writeMetadata (  )  [virtual]

Write metadata back to the image.

All existing metadata sections in the image are either created, replaced, or erased. If values for a given metadata type have been assigned, a section for that metadata type will either be created or replaced. If no values have been assigned to a given metadata type, any exists section for that metadata type will be removed from the image.

Exceptions:
Error if the operation fails

Implements Exiv2::Image.

std::string Exiv2::MatroskaVideo::mimeType (  )  const [virtual]

Return the MIME type of the image.

Note:
For each supported image format, the library knows only one MIME type. This may not be the most specific MIME type for that format. In particular, several RAW formats are variants of the TIFF format with the same magic as TIFF itself. Class TiffImage handles most of them and thus they all have MIME type "image/tiff", although a more specific MIME type may exist (e.g., "image/x-nikon-nef").

Implements Exiv2::Image.

Referenced by readMetadata().

uint32_t Exiv2::MatroskaVideo::findBlockSize ( byte  b  )  [protected]

Function used to calulate the size of a block. This information is only stored in one byte. The size of the block is calculated by counting the number of leading zeros in the binary code of the byte. Size = (No. of leading zeros + 1) bytes.

Parameters:
b The byte, which stores the information to calculate the size
Returns:
Return the size of the block.

Referenced by decodeBlock().

void Exiv2::MatroskaVideo::contentManagement ( const MatroskaTags mt,
const byte buf,
long  size 
) [protected]

Interpret tag information, and save it in the respective XMP container.

Parameters:
mt Pointer to current tag,
buf Pointer to the memory area with the tag information.
size Size of buf.

References Exiv2::find(), Exiv2::getDouble(), Exiv2::getFloat(), Exiv2::MatroskaTags::label_, Exiv2::MatroskaTags::val_, and Exiv2::Image::xmpData_.

Referenced by decodeBlock().


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

Generated on Tue May 12 10:32:11 2015 for Exiv2 by  doxygen 1.5.6