Exiv2
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
39 namespace 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);
74  void readMetadata();
75  void writeMetadata();
77 
79 
80  std::string mimeType() const;
81  const char* printAudioEncoding(uint64_t i);
83 
84  protected:
89  void decodeBlock();
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);
139  void infoTagsHandler();
144  void nikonTagsHandler();
149  void odmlTagsHandler();
151  void skipListData();
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  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< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
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
PrintStructureOption
Options for printStructure.
Definition: image.hpp:67
Class to access RIFF video files.
Definition: riffvideo.hpp:52
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.
IPTC string type.
Definition: types.hpp:147
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.
const int riff
Treating riff as an image type>
Definition: riffvideo.hpp:46