Loading...
Searching...
No Matches
matroskavideo.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 MATROSKAVIDEO_HPP_
#define MATROSKAVIDEO_HPP_
// *****************************************************************************
#include "exiv2lib_export.h"
// included header files
#include "image.hpp"
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
// *****************************************************************************
// class definitions
// Add MKV to the supported image formats
namespace ImageType {
const int mkv = 21;
}
// Todo: Should be hidden
struct EXIV2LIB_DEPRECATED MatroskaTags {
uint64_t val_;
const char* label_;
bool operator==(uint64_t key) const { return val_ == key; }
}; // struct TagDetails
class EXIV2LIB_DEPRECATED_EXPORT MatroskaVideo : public Image {
public:
MatroskaVideo(BasicIo::AutoPtr io);
void readMetadata();
void writeMetadata();
std::string mimeType() const;
protected:
uint32_t findBlockSize(byte b);
void decodeBlock();
void contentManagement(const MatroskaTags* mt, const byte* buf, long size);
void aspectRatio();
private:
MatroskaVideo(const MatroskaVideo& rhs);
MatroskaVideo& operator=(const MatroskaVideo& rhs);
private:
bool continueTraversing_;
uint64_t height_, width_;
}; // class MatroskaVideo
// *****************************************************************************
// template, inline and free functions
// These could be static private functions on Image subclasses but then
// ImageFactory needs to be made a friend.
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool create);
EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#endif // #ifndef MATROSKAVIDEO_HPP_
Exiv2::BasicIo
An interface for simple binary IO.
Definition basicio.hpp:55
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition basicio.hpp:58
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition image.hpp:78
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition image.hpp:81
Exiv2::MatroskaVideo
Class to access Matroska video files.
Definition matroskavideo.hpp:56
Exiv2::MatroskaVideo::contentManagement
void contentManagement(const MatroskaTags *mt, const byte *buf, long size)
Interpret tag information, and save it in the respective XMP container.
Exiv2::MatroskaVideo::mimeType
std::string mimeType() const
Return the MIME type of the image.
Exiv2::MatroskaVideo::decodeBlock
void decodeBlock()
Check for a valid tag and decode the block at the current IO position. Calls contentManagement() or s...
Exiv2::MatroskaVideo::writeMetadata
void writeMetadata()
Write metadata back to the image.
Exiv2::MatroskaVideo::readMetadata
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Exiv2::MatroskaVideo::MatroskaVideo
MatroskaVideo(BasicIo::AutoPtr io)
Constructor for a Matroska video. Since the constructor can not return a result, callers should check...
Exiv2::MatroskaVideo::aspectRatio
void aspectRatio()
Calculates Aspect Ratio of a video, and stores it in the respective XMP container.
Exiv2::MatroskaVideo::findBlockSize
uint32_t findBlockSize(byte b)
Function used to calulate the size of a block. This information is only stored in one byte....
Exiv2::ImageType::mkv
const int mkv
Treating mkv as an image type>
Definition matroskavideo.hpp:38
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition asfvideo.hpp:36
Exiv2::isMkvType
EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo &iIo, bool advance)
Check if the file iIo is a Matroska Video.
Exiv2::newMkvInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool create)
Create a new MatroskaVideo instance and return an auto-pointer to it. Caller owns the returned object...
Exiv2::MatroskaTags
Helper structure for the Matroska tags lookup table.
Definition matroskavideo.hpp:45
Exiv2::MatroskaTags::val_
uint64_t val_
Tag value.
Definition matroskavideo.hpp:46
Exiv2::MatroskaTags::label_
const char * label_
Translation of the tag value.
Definition matroskavideo.hpp:47
Exiv2::MatroskaTags::operator==
bool operator==(uint64_t key) const
Comparison operator for use with the find template.
Definition matroskavideo.hpp:50