Exiv2
|
Class to access RIFF video files. More...
#include <riffvideo.hpp>
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. More... | |
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. More... | |
void | writeMetadata () |
Write metadata back to the image. More... | |
Accessors | |
std::string | mimeType () const |
Return the MIME type of the image. More... | |
const char * | printAudioEncoding (uint64_t i) |
![]() | |
Image (int imageType, uint16_t supportedMetadata, BasicIo::AutoPtr io) | |
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that owns an IO instance. See subclass constructor doc. | |
virtual | ~Image () |
Virtual Destructor. | |
virtual void | setExifData (const ExifData &exifData) |
Assign new Exif data. The new Exif data is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearExifData () |
Erase any buffered Exif data. Exif data is not removed from the actual image until the writeMetadata() method is called. | |
virtual void | setIptcData (const IptcData &iptcData) |
Assign new IPTC data. The new IPTC data is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearIptcData () |
Erase any buffered IPTC data. IPTC data is not removed from the actual image until the writeMetadata() method is called. | |
virtual void | setXmpPacket (const std::string &xmpPacket) |
Assign a raw XMP packet. The new XMP packet is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearXmpPacket () |
Erase the buffered XMP packet. XMP data is not removed from the actual image until the writeMetadata() method is called. More... | |
virtual void | setXmpData (const XmpData &xmpData) |
Assign new XMP data. The new XMP data is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearXmpData () |
Erase any buffered XMP data. XMP data is not removed from the actual image until the writeMetadata() method is called. More... | |
virtual void | setComment (const std::string &comment) |
Set the image comment. The new comment is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearComment () |
Erase any buffered comment. Comment is not removed from the actual image until the writeMetadata() method is called. | |
virtual void | setMetadata (const Image &image) |
Copy all existing metadata from source Image. The data is copied into internal buffers and is not written to the image until the writeMetadata() method is called. More... | |
virtual void | clearMetadata () |
Erase all buffered metadata. Metadata is not removed from the actual image until the writeMetadata() method is called. | |
virtual ExifData & | exifData () |
Returns an ExifData instance containing currently buffered Exif data. More... | |
virtual IptcData & | iptcData () |
Returns an IptcData instance containing currently buffered IPTC data. More... | |
virtual XmpData & | xmpData () |
Returns an XmpData instance containing currently buffered XMP data. More... | |
virtual std::string & | xmpPacket () |
Return a modifiable reference to the raw XMP packet. | |
void | writeXmpFromPacket (bool flag) |
Determine the source when writing XMP. More... | |
void | setByteOrder (ByteOrder byteOrder) |
Set the byte order to encode the Exif metadata in. More... | |
ByteOrder | byteOrder () const |
Return the byte order in which the Exif metadata of the image is encoded. Initially, it is not set (invalidByteOrder). | |
bool | good () const |
Check if the Image instance is valid. Use after object construction. More... | |
virtual int | pixelWidth () const |
Return the pixel width of the image. | |
virtual int | pixelHeight () const |
Return the pixel height of the image. | |
virtual const ExifData & | exifData () const |
Returns an ExifData instance containing currently buffered Exif data. More... | |
virtual const IptcData & | iptcData () const |
Returns an IptcData instance containing currently buffered IPTC data. More... | |
virtual const XmpData & | xmpData () const |
Returns an XmpData instance containing currently buffered XMP data. More... | |
virtual std::string | comment () const |
Return a copy of the image comment. May be an empty string. | |
virtual const std::string & | xmpPacket () const |
Return the raw XMP packet as a string. | |
virtual BasicIo & | io () const |
Return a reference to the BasicIo instance being used for Io. More... | |
AccessMode | checkMode (MetadataId metadataId) const |
Returns the access mode, i.e., the metadata functions, which this image supports for the metadata type metadataId. More... | |
bool | supportsMetadata (MetadataId metadataId) const |
Check if image supports a particular type of metadata. This method is deprecated. Use checkMode() instead. | |
bool | writeXmpFromPacket () const |
Return the flag indicating the source when writing XMP metadata. | |
const NativePreviewList & | nativePreviews () const |
Return list of native previews. This is meant to be used only by the PreviewManager. | |
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. More... | |
void | junkHandler (long size) |
Interpret Junk tag information, and save it in the respective XMP container. More... | |
void | streamHandler (long size) |
Interpret Stream tag information, and save it in the respective XMP container. More... | |
void | streamFormatHandler (long size) |
Interpret Stream Format tag information, and save it in the respective XMP container. More... | |
void | aviHeaderTagsHandler (long size) |
Interpret Riff Header tag information, and save it in the respective XMP container. More... | |
void | listHandler (long size) |
Interpret Riff List tag information, and save it in the respective XMP container. More... | |
void | streamDataTagHandler (long size) |
Interpret Riff Stream Data tag information, and save it in the respective XMP container. More... | |
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. More... | |
double | returnSampleRate (Exiv2::DataBuf &buf, long divisor=1) |
Calculates Sample Rate of a particular stream. More... | |
void | fillAspectRatio (long width=1, long height=1) |
Calculates Aspect Ratio of a video, and stores it in the respective XMP container. More... | |
void | fillDuration (double frame_rate, long frame_count) |
Calculates Duration of a video, and stores it in the respective XMP container. More... | |
Additional Inherited Members | |
![]() | |
typedef std::auto_ptr< Image > | AutoPtr |
Image auto_ptr type. | |
![]() | |
BasicIo::AutoPtr | io_ |
Image data IO pointer. | |
ExifData | exifData_ |
Exif data container. | |
IptcData | iptcData_ |
IPTC data container. | |
XmpData | xmpData_ |
XMP data container. | |
std::string | comment_ |
User comment. | |
std::string | xmpPacket_ |
XMP packet. | |
int | pixelWidth_ |
image pixel width | |
int | pixelHeight_ |
image pixel height | |
NativePreviewList | nativePreviews_ |
list of native previews | |
Class to access RIFF video files.
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.
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. |
|
protected |
Interpret Riff Header tag information, and save it in the respective XMP container.
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().
|
protected |
Interprets DateTimeOriginal tag or stream name tag information, and save it in the respective XMP container.
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().
|
protected |
Calculates Aspect Ratio of a video, and stores it in the respective XMP container.
width | Width of the video. |
height | Height of the video. |
References Exiv2::Image::xmpData_.
Referenced by aviHeaderTagsHandler().
|
protected |
Calculates Duration of a video, and stores it in the respective XMP container.
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().
|
protected |
Interpret Junk tag information, and save it in the respective XMP container.
size | Size of the data block used to store Tag Information. |
Pentax Metadata and Tags
References Exiv2::XmpData::add(), Exiv2::Internal::equalsRiffTag(), EXV_ERROR, Exiv2::getLong(), Exiv2::Image::io_, Exiv2::DataBuf::pData_, Exiv2::XmpTextValue::read(), Exiv2::toString(), and Exiv2::Image::xmpData_.
Referenced by tagDecoder().
|
protected |
Interpret Riff List tag information, and save it in the respective XMP container.
size | Size of the data block used to store Tag Information. |
|
virtual |
Return the MIME type of the image.
Implements Exiv2::Image.
Referenced by 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.
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_.
|
protected |
Calculates Sample Rate of a particular stream.
buf | Data buffer with the dividend. |
divisor | The Divisor required to calculate sample rate. |
References Exiv2::getULong(), and Exiv2::DataBuf::pData_.
Referenced by streamHandler().
|
protected |
Interpret Riff Stream Data tag information, and save it in the respective XMP container.
size | Size of the data block used to store Tag Information. |
References Exiv2::Internal::TiffParserWorker::decode(), Exiv2::XmpData::empty(), Exiv2::IptcData::empty(), Exiv2::Internal::equalsRiffTag(), 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().
|
protected |
Interpret Stream Format tag information, and save it in the respective XMP container.
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().
|
protected |
Interpret Stream tag information, and save it in the respective XMP container.
size | Size of the data block used to store Tag Information. |
References Exiv2::Internal::equalsRiffTag(), Exiv2::getULong(), Exiv2::Image::io_, Exiv2::DataBuf::pData_, returnSampleRate(), Exiv2::DataBuf::size_, and Exiv2::Image::xmpData_.
Referenced by tagDecoder().
|
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.
buf | Data buffer which cotains tag ID. |
size | Size of the data block used to store Tag Information. |
References aviHeaderTagsHandler(), dateTimeOriginal(), decodeBlock(), Exiv2::Internal::equalsRiffTag(), infoTagsHandler(), Exiv2::Image::io_, junkHandler(), nikonTagsHandler(), odmlTagsHandler(), skipListData(), streamDataTagHandler(), streamFormatHandler(), and streamHandler().
Referenced by decodeBlock().
|
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.
Error | if the operation fails |
Implements Exiv2::Image.