Loading...
Searching...
No Matches
quicktimevideo.hpp
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2021 Exiv2 authors
* This program is part of the Exiv2 distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
#ifndef QUICKTIMEVIDEO_HPP_
#define QUICKTIMEVIDEO_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "exif.hpp"
#include "image.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class definitions
class EXIV2API QuickTimeVideo : public Image {
public:
explicit QuickTimeVideo(BasicIo::UniquePtr io, size_t max_recursion_depth = 1000);
void readMetadata() override;
void writeMetadata() override;
[[nodiscard]] std::string mimeType() const override;
protected:
void decodeBlock(size_t recursion_depth, std::string const& entered_from = "");
void tagDecoder(Exiv2::DataBuf& buf, size_t size, size_t recursion_depth);
private:
void fileTypeDecoder(size_t size);
void mediaHeaderDecoder(size_t size);
void videoHeaderDecoder(size_t size);
void movieHeaderDecoder(size_t size);
void trackHeaderDecoder(size_t size);
void handlerDecoder(size_t size);
void multipleEntriesDecoder(size_t recursion_depth);
void sampleDesc(size_t size);
void imageDescDecoder();
void userDataDecoder(size_t size, size_t recursion_depth);
void previewTagDecoder(size_t size);
void keysTagDecoder(size_t size);
void trackApertureTagDecoder(size_t size);
void NikonTagsDecoder(size_t size);
void CameraTagsDecoder(size_t size);
void audioDescDecoder();
void timeToSampleDecoder();
void setMediaStream();
void discard(size_t size);
uint64_t mvhdTimeScale_ = 0;
uint64_t mdhdTimeScale_ = 0;
int currentStream_ = 0;
bool continueTraversing_ = false;
uint64_t height_ = 0;
uint64_t width_ = 0;
const size_t max_recursion_depth_;
}; // QuickTimeVideo End
// *****************************************************************************
// template, inline and free functions
// These could be static private functions on Image subclasses but then
// ImageFactory needs to be made a friend.
EXIV2API Image::UniquePtr newQTimeInstance(BasicIo::UniquePtr io, bool create);
EXIV2API bool isQTimeType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#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