Exiv2
Loading...
Searching...
No Matches
riffvideo.hpp
Go to the documentation of this file.
1// ***************************************************************** -*- C++ -*-
2/*
3 * Copyright (C) 2004-2018 Exiv2 authors
4 * This program is part of the Exiv2 distribution.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
19 */
27#ifndef RIFFVIDEO_HPP
28#define RIFFVIDEO_HPP
29
30// *****************************************************************************
31#include "exiv2lib_export.h"
32
33// included header files
34#include "exif.hpp"
35#include "image.hpp"
36
37// *****************************************************************************
38// namespace extensions
39namespace Exiv2 {
40
41// *****************************************************************************
42// class definitions
43
44 // Add RIFF to the supported image formats
45 namespace ImageType {
46 const int riff = 20;
47 }
48
52 class EXIV2LIB_DEPRECATED_EXPORT RiffVideo:public Image
53 {
54 public:
56
57
70
72
73 void printStructure(std::ostream& out, PrintStructureOption option,int depth);
77
79
80 std::string mimeType() const;
81 const char* printAudioEncoding(uint64_t i);
83
84 protected:
98 void tagDecoder(Exiv2::DataBuf& buf, unsigned long size);
104 void junkHandler(long size);
110 void streamHandler(long size);
116 void streamFormatHandler(long size);
122 void aviHeaderTagsHandler(long size);
128 void listHandler(long size);
134 void streamDataTagHandler(long size);
158 void dateTimeOriginal(long size, int i = 0);
165 double returnSampleRate(Exiv2::DataBuf& buf, long divisor = 1);
172 void fillAspectRatio(long width = 1,long height = 1);
179 void fillDuration(double frame_rate, long frame_count);
180
181 private:
183
184
185 RiffVideo(const RiffVideo& rhs);
187 RiffVideo& operator=(const RiffVideo& rhs);
188 bool equalsRiffTag(Exiv2::DataBuf& buf ,const char* str);
190
191 private:
192 const static int RIFF_TAG_SIZE;
193 const static char* RIFF_CHUNK_HEADER_ICCP;
194 const static char* RIFF_CHUNK_HEADER_EXIF;
195 const static char* RIFF_CHUNK_HEADER_XMP;
197 bool continueTraversing_;
199 int streamType_;
200
201 }; //Class RiffVideo
202
203// *****************************************************************************
204// template, inline and free functions
205
206 // These could be static private functions on Image subclasses but then
207 // ImageFactory needs to be made a friend.
213 EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool create);
214
216 EXIV2LIB_DEPRECATED_EXPORT bool isRiffType(BasicIo& iIo, bool advance);
217
218} // namespace Exiv2
219
220#endif // RIFFVIDEO_HPP
An interface for simple binary IO.
Definition basicio.hpp:55
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition basicio.hpp:58
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:204
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition image.hpp:81
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition image.hpp:84
Class to access RIFF video files.
Definition riffvideo.hpp:53
void skipListData()
Skips Particular Blocks of Metadata List.
void aviHeaderTagsHandler(long size)
Interpret Riff Header 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 listHandler(long size)
Interpret Riff List tag information, and save 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.
void tagDecoder(Exiv2::DataBuf &buf, unsigned long size)
Interpret tag information, and call the respective function to save it in the respective XMP containe...
void nikonTagsHandler()
Interpret Nikon Tags related to Video information, and save it in the respective XMP container.
void printStructure(std::ostream &out, PrintStructureOption option, int depth)
Print out the structure of image file.
void odmlTagsHandler()
Interpret OpenDML tag information, and save it in the respective XMP container.
void dateTimeOriginal(long size, int i=0)
Interprets DateTimeOriginal tag or stream name tag information, and save it in the respective XMP con...
void junkHandler(long size)
Interpret Junk tag information, and save it in the respective XMP container.
void writeMetadata()
Write metadata back to the image.
RiffVideo(BasicIo::AutoPtr io)
Constructor for a Riff video. Since the constructor can not return a result, callers should check the...
std::string mimeType() const
Return the MIME type of the image.
void fillAspectRatio(long width=1, long height=1)
Calculates Aspect Ratio of a video, and stores it in the respective XMP container.
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
double returnSampleRate(Exiv2::DataBuf &buf, long divisor=1)
Calculates Sample Rate of a particular stream.
void streamHandler(long size)
Interpret Stream 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 decodeBlock()
Check for a valid tag and decode the block at the current IO position. Calls tagDecoder() or skips to...
Encoding and decoding of Exif data.
const int riff
Treating riff as an image type>
Definition riffvideo.hpp:46
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
PrintStructureOption
Options for printStructure.
Definition image.hpp:67
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool create)
Create a new RiffVideo instance and return an auto-pointer to it. Caller owns the returned object and...
EXIV2LIB_DEPRECATED_EXPORT bool isRiffType(BasicIo &iIo, bool advance)
Check if the file iIo is a Riff Video.