Exiv2
matroskavideo.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 MATROSKAVIDEO_HPP_
28 #define MATROSKAVIDEO_HPP_
29 
30 // *****************************************************************************
31 #include "exiv2lib_export.h"
32 
33 // included header files
34 #include "image.hpp"
35 
36 // *****************************************************************************
37 // namespace extensions
38 namespace Exiv2 {
39 
40 // *****************************************************************************
41 // class definitions
42 
43  // Add MKV to the supported image formats
44  namespace ImageType {
45  const int mkv = 21;
46  }
47 
48  // Todo: Should be hidden
52  struct EXIV2LIB_DEPRECATED MatroskaTags {
53  uint64_t val_;
54  const char* label_;
55 
57  bool operator==(uint64_t key) const { return val_ == key; }
58  }; // struct TagDetails
59 
63  class EXIV2LIB_DEPRECATED_EXPORT MatroskaVideo : public Image {
64  public:
66 
67 
80 
82 
83  void readMetadata();
84  void writeMetadata();
86 
88 
89  std::string mimeType() const;
91 
92  protected:
102  uint32_t findBlockSize(byte b);
107  void decodeBlock();
114  void contentManagement(const MatroskaTags* mt, const byte* buf, long size);
119  void aspectRatio();
120 
121  private:
123 
124  MatroskaVideo(const MatroskaVideo& rhs);
127  MatroskaVideo& operator=(const MatroskaVideo& rhs);
129 
130  private:
132  bool continueTraversing_;
134  uint64_t height_, width_;
135 
136  }; // class MatroskaVideo
137 
138 // *****************************************************************************
139 // template, inline and free functions
140 
141  // These could be static private functions on Image subclasses but then
142  // ImageFactory needs to be made a friend.
148  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newMkvInstance(BasicIo::AutoPtr io, bool create);
149 
151  EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo& iIo, bool advance);
152 
153 } // namespace Exiv2
154 
155 #endif // #ifndef MATROSKAVIDEO_HPP_
An interface for simple binary IO.
Definition: basicio.hpp:55
bool operator==(uint64_t key) const
Comparison operator for use with the find template.
Definition: matroskavideo.hpp:57
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
uint8_t byte
1 byte unsigned integer type.
Definition: types.hpp:105
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< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
Helper structure for the Matroska tags lookup table.
Definition: matroskavideo.hpp:52
IPTC string type.
Definition: types.hpp:147
EXIV2LIB_DEPRECATED_EXPORT bool isMkvType(BasicIo &iIo, bool advance)
Check if the file iIo is a Matroska Video.
const int mkv
Treating mkv as an image type>
Definition: matroskavideo.hpp:45
uint64_t val_
Tag value.
Definition: matroskavideo.hpp:53
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
Class to access Matroska video files.
Definition: matroskavideo.hpp:63
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...
const char * label_
Translation of the tag value.
Definition: matroskavideo.hpp:54