Exiv2::RiffVideo Class Reference

Class to access RIFF video files. More...

#include <riffvideo.hpp>

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

List of all members.

Public Member Functions

Creators
 RiffVideo (BasicIo::AutoPtr io)
 Constructor for a Riff 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.
const char * printAudioEncoding (uint64_t i)

Protected Member Functions

void decodeBlock ()
 Check for a valid tag and decode the block at the current IO position. Calls tagDecoder() or skips to next tag, if required.
void tagDecoder (Exiv2::DataBuf &buf, unsigned long size)
 Interpret tag information, and call the respective function to save it in the respective XMP container. Decodes a Tag Information and saves it in the respective XMP container, if the block size is small.
void junkHandler (long size)
 Interpret Junk tag information, and save it in the respective XMP container.
void streamHandler (long size)
 Interpret Stream tag information, and save it in the respective XMP container.
void streamFormatHandler (long size)
 Interpret Stream Format tag information, and save it in the respective XMP container.
void aviHeaderTagsHandler (long size)
 Interpret Riff Header tag information, and save it in the respective XMP container.
void listHandler (long size)
 Interpret Riff List tag information, and save it in the respective XMP container.
void streamDataTagHandler (long size)
 Interpret Riff Stream Data tag information, and save it in the respective XMP container.
void infoTagsHandler ()
 Interpret INFO tag information, and save it in the respective XMP container.
void nikonTagsHandler ()
 Interpret Nikon Tags related to Video information, and save it in the respective XMP container.
void odmlTagsHandler ()
 Interpret OpenDML tag information, and save it in the respective XMP container.
void skipListData ()
 Skips Particular Blocks of Metadata List.
void dateTimeOriginal (long size, int i=0)
 Interprets DateTimeOriginal tag or stream name tag information, and save it in the respective XMP container.
double returnSampleRate (Exiv2::DataBuf &buf, long divisor=1)
 Calculates Sample Rate of a particular stream.
void fillAspectRatio (long width=1, long height=1)
 Calculates Aspect Ratio of a video, and stores it in the respective XMP container.
void fillDuration (double frame_rate, long frame_count)
 Calculates Duration of a video, and stores it in the respective XMP container.


Detailed Description

Class to access RIFF video files.

Constructor & Destructor Documentation

Exiv2::RiffVideo::RiffVideo ( BasicIo::AutoPtr  io  ) 

Constructor for a Riff 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::newRiffInstance().


Member Function Documentation

void Exiv2::RiffVideo::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 Exiv2::Image::clearMetadata(), decodeBlock(), Exiv2::Image::io_, Exiv2::isRiffType(), mimeType(), Exiv2::DataBuf::pData_, Exiv2::strError(), and Exiv2::Image::xmpData_.

void Exiv2::RiffVideo::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::RiffVideo::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().

void Exiv2::RiffVideo::tagDecoder ( Exiv2::DataBuf buf,
unsigned long  size 
) [protected]

Interpret tag information, and call the respective function to save it in the respective XMP container. Decodes a Tag Information and saves it in the respective XMP container, if the block size is small.

Parameters:
buf Data buffer which cotains tag ID.
size Size of the data block used to store Tag Information.

References aviHeaderTagsHandler(), dateTimeOriginal(), decodeBlock(), infoTagsHandler(), Exiv2::Image::io_, junkHandler(), nikonTagsHandler(), odmlTagsHandler(), skipListData(), streamDataTagHandler(), streamFormatHandler(), and streamHandler().

Referenced by decodeBlock().

void Exiv2::RiffVideo::junkHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

Pentax Metadata and Tags

References Exiv2::XmpData::add(), EXV_ERROR, Exiv2::getLong(), Exiv2::Image::io_, Exiv2::DataBuf::pData_, Exiv2::XmpTextValue::read(), Exiv2::DataBuf::size_, Exiv2::toString(), and Exiv2::Image::xmpData_.

Referenced by tagDecoder().

void Exiv2::RiffVideo::streamHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

References Exiv2::getULong(), Exiv2::Image::io_, Exiv2::DataBuf::pData_, returnSampleRate(), Exiv2::DataBuf::size_, and Exiv2::Image::xmpData_.

Referenced by tagDecoder().

void Exiv2::RiffVideo::streamFormatHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

References Exiv2::exvGettext(), Exiv2::find(), Exiv2::getULong(), Exiv2::getUShort(), Exiv2::Image::io_, Exiv2::Internal::TagDetails::label_, Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, and Exiv2::Image::xmpData_.

Referenced by tagDecoder().

void Exiv2::RiffVideo::aviHeaderTagsHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

References fillAspectRatio(), fillDuration(), Exiv2::getULong(), Exiv2::Image::io_, Exiv2::DataBuf::pData_, Exiv2::DataBuf::size_, and Exiv2::Image::xmpData_.

Referenced by tagDecoder().

void Exiv2::RiffVideo::listHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

void Exiv2::RiffVideo::streamDataTagHandler ( long  size  )  [protected]

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

Parameters:
size Size of the data block used to store Tag Information.

References Exiv2::Internal::TiffParserWorker::decode(), Exiv2::XmpData::empty(), Exiv2::IptcData::empty(), Exiv2::Image::exifData_, EXV_ERROR, EXV_WARNING, Exiv2::Internal::TiffMapping::findDecoder(), Exiv2::Image::io_, Exiv2::Image::iptcData(), Exiv2::DataBuf::pData_, Exiv2::Internal::Tag::root, Exiv2::DataBuf::size_, and Exiv2::Image::xmpData().

Referenced by tagDecoder().

void Exiv2::RiffVideo::dateTimeOriginal ( long  size,
int  i = 0 
) [protected]

Interprets DateTimeOriginal tag or stream name tag information, and save it in the respective XMP container.

Parameters:
size Size of the data block used to store Tag Information.
i parameter used to overload function

References Exiv2::Image::io_, Exiv2::DataBuf::pData_, and Exiv2::Image::xmpData_.

Referenced by tagDecoder().

double Exiv2::RiffVideo::returnSampleRate ( Exiv2::DataBuf buf,
long  divisor = 1 
) [protected]

Calculates Sample Rate of a particular stream.

Parameters:
buf Data buffer with the dividend.
divisor The Divisor required to calculate sample rate.
Returns:
Return the sample rate of the stream.

References Exiv2::getULong(), and Exiv2::DataBuf::pData_.

Referenced by streamHandler().

void Exiv2::RiffVideo::fillAspectRatio ( long  width = 1,
long  height = 1 
) [protected]

Calculates Aspect Ratio of a video, and stores it in the respective XMP container.

Parameters:
width Width of the video.
height Height of the video.

References Exiv2::Image::xmpData_.

Referenced by aviHeaderTagsHandler().

void Exiv2::RiffVideo::fillDuration ( double  frame_rate,
long  frame_count 
) [protected]

Calculates Duration of a video, and stores it in the respective XMP container.

Parameters:
frame_rate Frame rate of the video.
frame_count Total number of frames present in the video.

References Exiv2::Image::io_, and Exiv2::Image::xmpData_.

Referenced by aviHeaderTagsHandler().


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