Exiv2
riffvideo.hpp
1 // ***************************************************************** -*- C++ -*-
2 /*
3  * Copyright (C) 2004-2021 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  */
20 #ifndef RIFFVIDEO_HPP
21 #define RIFFVIDEO_HPP
22 
23 // *****************************************************************************
24 #include "exiv2lib_export.h"
25 
26 // included header files
27 #include "exif.hpp"
28 #include "image.hpp"
29 
30 // *****************************************************************************
31 // namespace extensions
32 namespace Exiv2 {
33 
34 // *****************************************************************************
35 // class definitions
36 
37  // Add RIFF to the supported image formats
38  namespace ImageType {
39  const int riff = 20;
40  }
41 
45  class EXIV2LIB_DEPRECATED_EXPORT RiffVideo:public Image
46  {
47  public:
49 
50 
63 
65 
66  void printStructure(std::ostream& out, PrintStructureOption option,int depth);
67  void readMetadata();
68  void writeMetadata();
70 
72 
73  std::string mimeType() const;
74  const char* printAudioEncoding(uint64_t i);
76 
77  protected:
82  void decodeBlock();
91  void tagDecoder(Exiv2::DataBuf& buf, unsigned long size);
97  void junkHandler(long size);
103  void streamHandler(long size);
109  void streamFormatHandler(long size);
115  void aviHeaderTagsHandler(long size);
121  void listHandler(long size);
127  void streamDataTagHandler(long size);
132  void infoTagsHandler();
137  void nikonTagsHandler();
142  void odmlTagsHandler();
144  void skipListData();
151  void dateTimeOriginal(long size, int i = 0);
158  double returnSampleRate(Exiv2::DataBuf& buf, long divisor = 1);
165  void fillAspectRatio(long width = 1,long height = 1);
172  void fillDuration(double frame_rate, long frame_count);
173 
174  private:
176 
177  RiffVideo(const RiffVideo& rhs);
180  RiffVideo& operator=(const RiffVideo& rhs);
181  bool equalsRiffTag(Exiv2::DataBuf& buf ,const char* str);
183 
184  private:
185  const static int RIFF_TAG_SIZE;
186  const static char* RIFF_CHUNK_HEADER_ICCP;
187  const static char* RIFF_CHUNK_HEADER_EXIF;
188  const static char* RIFF_CHUNK_HEADER_XMP;
190  bool continueTraversing_;
192  int streamType_;
193 
194  }; //Class RiffVideo
195 
196 // *****************************************************************************
197 // template, inline and free functions
198 
199  // These could be static private functions on Image subclasses but then
200  // ImageFactory needs to be made a friend.
206  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newRiffInstance(BasicIo::AutoPtr io, bool create);
207 
209  EXIV2LIB_DEPRECATED_EXPORT bool isRiffType(BasicIo& iIo, bool advance);
210 
211 } // namespace Exiv2
212 
213 #endif // RIFFVIDEO_HPP
An interface for simple binary IO.
Definition: basicio.hpp:55
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:193
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:78
PrintStructureOption
Options for printStructure.
Definition: image.hpp:64
Class to access RIFF video files.
Definition: riffvideo.hpp:45
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
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.
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Encoding and decoding of Exif data.
EXIV2API ExifData::const_iterator dateTimeOriginal(const ExifData &ed)
Return the date and time when the original image data was generated.
Definition: easyaccess.cpp:186
const int riff
Treating riff as an image type>
Definition: riffvideo.hpp:39