Exiv2
quicktimevideo.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 QUICKTIMEVIDEO_HPP
28 #define QUICKTIMEVIDEO_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 qtime to the supported image formats
45  namespace ImageType {
46  const int qtime = 22;
47  }
48 
52  class EXIV2LIB_DEPRECATED_EXPORT QuickTimeVideo:public Image
53  {
54  public:
56 
57 
70 
72 
73  void readMetadata();
74  void writeMetadata();
76 
78 
81 
82  protected:
87  void decodeBlock();
96  void tagDecoder(Exiv2::DataBuf & buf, unsigned long size);
97 
98  private:
104  void fileTypeDecoder(unsigned long size);
110  void mediaHeaderDecoder(unsigned long size);
116  void videoHeaderDecoder(unsigned long size);
122  void movieHeaderDecoder(unsigned long size);
128  void trackHeaderDecoder(unsigned long size);
134  void handlerDecoder(unsigned long size);
139  void multipleEntriesDecoder();
145  void sampleDesc(unsigned long size);
150  void imageDescDecoder();
156  void userDataDecoder(unsigned long size);
162  void previewTagDecoder(unsigned long size);
168  void keysTagDecoder(unsigned long size);
174  void trackApertureTagDecoder(unsigned long size);
180  void NikonTagsDecoder(unsigned long size);
186  void CameraTagsDecoder(unsigned long size);
191  void audioDescDecoder();
196  void timeToSampleDecoder();
201  void setMediaStream();
207  void discard(unsigned long size);
212  void aspectRatio();
213 
214  private:
216 
217  QuickTimeVideo(const QuickTimeVideo& rhs);
220  QuickTimeVideo& operator=(const QuickTimeVideo& rhs);
222 
223  private:
225  uint64_t timeScale_;
227  int currentStream_;
229  bool continueTraversing_;
231  uint64_t height_, width_;
232 
233  }; //QuickTimeVideo End
234 
235 // *****************************************************************************
236 // template, inline and free functions
237 
238  // These could be static private functions on Image subclasses but then
239  // ImageFactory needs to be made a friend.
245  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newQTimeInstance(BasicIo::AutoPtr io, bool create);
246 
248  EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo& iIo, bool advance);
249 
250 } // namespace Exiv2
251 
252 #endif // QUICKTIMEVIDEO_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 QuickTime video files.
Definition: quicktimevideo.hpp:53
void tagDecoder(Exiv2::DataBuf &buf, unsigned long size)
Interpret tag information, and call the respective function to save it in the respective XMP containe...
std::string mimeType() const
Return the MIME type of the image.
void writeMetadata()
Write metadata back to the image.
QuickTimeVideo(BasicIo::AutoPtr io)
Constructor for a QuickTime video. Since the constructor can not return a result, callers should chec...
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
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 qtime
Treating qtime as an image type>
Definition: quicktimevideo.hpp:46
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
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...
@ string
IPTC string type.
Definition: types.hpp:147
EXIV2LIB_DEPRECATED_EXPORT bool isQTimeType(BasicIo &iIo, bool advance)
Check if the file iIo is a Quick Time Video.