| Exiv2

Loading...
Searching...
No Matches
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
40 class EXIV2API QuickTimeVideo : public Image {
41 public:
43
44
55 explicit QuickTimeVideo(BasicIo::UniquePtr io, size_t max_recursion_depth = 1000);
57
59
60 void readMetadata() override;
61 void writeMetadata() override;
63
65
66 [[nodiscard]] std::string mimeType() const override;
68
69 protected:
74 void decodeBlock(size_t recursion_depth, std::string const& entered_from = "");
83 void tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth);
84
85 private:
91 void fileTypeDecoder(size_t size);
97 void mediaHeaderDecoder(size_t size);
103 void videoHeaderDecoder(size_t size);
109 void movieHeaderDecoder(size_t size);
115 void trackHeaderDecoder(size_t size);
121 void handlerDecoder(size_t size);
126 void multipleEntriesDecoder(size_t recursion_depth);
132 void sampleDesc(size_t size);
137 void imageDescDecoder();
143 void userDataDecoder(size_t size, size_t recursion_depth);
149 void previewTagDecoder(size_t size);
155 void keysTagDecoder(size_t size);
161 void trackApertureTagDecoder(size_t size);
167 void NikonTagsDecoder(size_t size);
173 void CameraTagsDecoder(size_t size);
178 void audioDescDecoder();
183 void timeToSampleDecoder();
188 void setMediaStream();
194 void discard(size_t size);
195
197 uint64_t mvhdTimeScale_ = 0;
199 uint64_t mdhdTimeScale_ = 0;
201 int currentStream_ = 0;
203 bool continueTraversing_ = false;
205 uint64_t height_ = 0;
206 uint64_t width_ = 0;
208 const size_t max_recursion_depth_;
209
210}; // QuickTimeVideo End
211
212// *****************************************************************************
213// template, inline and free functions
214
215// These could be static private functions on Image subclasses but then
216// ImageFactory needs to be made a friend.
222EXIV2API Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool create);
223
225EXIV2API bool isQTimeType(BasicIo& iIo, bool advance);
226
227} // namespace Exiv2
228
229#endif // QUICKTIMEVIDEO_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition basicio.hpp:35
Exiv2::BasicIo::UniquePtr
std::unique_ptr< BasicIo > UniquePtr
BasicIo auto_ptr type.
Definition basicio.hpp:38
Exiv2::Image::Image
Image(ImageType type, uint16_t supportedMetadata, BasicIo::UniquePtr io)
Constructor taking the image type, a bitmap of the supported metadata types and an auto-pointer that ...
Definition image.cpp:132
Exiv2::Image::io
virtual BasicIo & io() const
Return a reference to the BasicIo instance being used for Io.
Definition image.cpp:696
Exiv2::Image::UniquePtr
std::unique_ptr< Image > UniquePtr
Image auto_ptr type.
Definition image.hpp:53
Exiv2::QuickTimeVideo::decodeBlock
void decodeBlock(size_t recursion_depth, std::string const &entered_from="")
Check for a valid tag and decode the block at the current IO position. Calls tagDecoder() or skips to...
Definition quicktimevideo.cpp:581
Exiv2::QuickTimeVideo::writeMetadata
void writeMetadata() override
Write metadata back to the image.
Definition quicktimevideo.cpp:553
Exiv2::QuickTimeVideo::mimeType
std::string mimeType() const override
Return the MIME type of the image.
Definition quicktimevideo.cpp:549
Exiv2::QuickTimeVideo::tagDecoder
void tagDecoder(Exiv2::DataBuf &buf, size_t size, size_t recursion_depth)
Interpret tag information, and call the respective function to save it in the respective XMP containe...
Definition quicktimevideo.cpp:633
Exiv2::QuickTimeVideo::readMetadata
void readMetadata() override
Read all metadata supported by a specific image format from the image. Before this method is called,...
Definition quicktimevideo.cpp:556
Exiv2::QuickTimeVideo::QuickTimeVideo
QuickTimeVideo(BasicIo::UniquePtr io, size_t max_recursion_depth=1000)
Constructor for a QuickTime video. Since the constructor can not return a result, callers should chec...
Definition quicktimevideo.cpp:541
exif.hpp
Encoding and decoding of Exif data.
Exiv2
Class CrwImage to access Canon CRW images. References: The Canon RAW (CRW) File Format by Phil Harv...
Definition asfvideo.hpp:15
Exiv2::newQTimeInstance
EXIV2API Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool create)
Create a new QuicktimeVideo instance and return an auto-pointer to it. Caller owns the returned objec...
Definition quicktimevideo.cpp:1603
Exiv2::isQTimeType
EXIV2API bool isQTimeType(BasicIo &iIo, bool advance)
Check if the file iIo is a Quick Time Video.
Definition quicktimevideo.cpp:1611
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition types.hpp:124