Exiv2
quicktimevideo.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 QUICKTIMEVIDEO_HPP
21 #define QUICKTIMEVIDEO_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 qtime to the supported image formats
38  namespace ImageType {
39  const int qtime = 22;
40  }
41 
45  class EXIV2LIB_DEPRECATED_EXPORT QuickTimeVideo:public Image
46  {
47  public:
49 
50 
63 
65 
66  void readMetadata();
67  void writeMetadata();
69 
71 
72  std::string mimeType() const;
74 
75  protected:
80  void decodeBlock();
89  void tagDecoder(Exiv2::DataBuf & buf, unsigned long size);
90 
91  private:
97  void fileTypeDecoder(unsigned long size);
103  void mediaHeaderDecoder(unsigned long size);
109  void videoHeaderDecoder(unsigned long size);
115  void movieHeaderDecoder(unsigned long size);
121  void trackHeaderDecoder(unsigned long size);
127  void handlerDecoder(unsigned long size);
132  void multipleEntriesDecoder();
138  void sampleDesc(unsigned long size);
143  void imageDescDecoder();
149  void userDataDecoder(unsigned long size);
155  void previewTagDecoder(unsigned long size);
161  void keysTagDecoder(unsigned long size);
167  void trackApertureTagDecoder(unsigned long size);
173  void NikonTagsDecoder(unsigned long size);
179  void CameraTagsDecoder(unsigned long size);
184  void audioDescDecoder();
189  void timeToSampleDecoder();
194  void setMediaStream();
200  void discard(unsigned long size);
205  void aspectRatio();
206 
207  private:
209 
210  QuickTimeVideo(const QuickTimeVideo& rhs);
213  QuickTimeVideo& operator=(const QuickTimeVideo& rhs);
215 
216  private:
218  uint64_t timeScale_;
220  int currentStream_;
222  bool continueTraversing_;
224  uint64_t height_, width_;
225 
226  }; //QuickTimeVideo End
227 
228 // *****************************************************************************
229 // template, inline and free functions
230 
231  // These could be static private functions on Image subclasses but then
232  // ImageFactory needs to be made a friend.
238  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool create);
239 
241  EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo& iIo, bool advance);
242 
243 } // namespace Exiv2
244 
245 #endif // QUICKTIMEVIDEO_HPP
An interface for simple binary IO.
Definition: basicio.hpp:55
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:81
EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo &iIo, bool advance)
Check if the file iIo is a Quick Time Video.
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
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
const int qtime
Treating qtime as an image type>
Definition: quicktimevideo.hpp:39
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool create)
Create a new QuicktimeVideo instance and return an auto-pointer to it. Caller owns the returned objec...
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Class to access QuickTime video files.
Definition: quicktimevideo.hpp:45
Encoding and decoding of Exif data.