Exiv2
asfvideo.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 ASFVIDEO_HPP
28 #define ASFVIDEO_HPP
29 
30 // *****************************************************************************
31 #include "exiv2lib_export.h"
32 
33 // included header files
34 #include "image.hpp"
35 
36 namespace Exiv2 {
37 
38 // *****************************************************************************
39 // class definitions
40 
41  // Add ASF to the supported image formats
42  namespace ImageType {
43  const int asf = 24;
44  }
45 
49  class EXIV2LIB_DEPRECATED_EXPORT AsfVideo:public Image
50  {
51  public:
53 
54 
67 
69 
70  void readMetadata();
71  void writeMetadata();
73 
75 
78 
79  protected:
84  void decodeBlock();
93  void tagDecoder(const Internal::TagVocabulary* tv, uint64_t size);
108  void codecList();
114  void contentDescription(uint64_t size);
120  void extendedStreamProperties(uint64_t size);
126  void headerExtension(uint64_t size);
134  void metadataHandler(int meta = 1);
139  void aspectRatio();
140 
141  private:
143 
144  AsfVideo(const AsfVideo& rhs);
147  AsfVideo& operator=(const AsfVideo& rhs);
149 
150  private:
152  bool continueTraversing_;
154  uint64_t localPosition_;
156  int streamNumber_;
158  uint64_t height_, width_;
159 
160  }; //Class AsfVideo
161 
162 // *****************************************************************************
163 // template, inline and free functions
164 
165  // These could be static private functions on Image subclasses but then
166  // ImageFactory needs to be made a friend.
172  EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newAsfInstance(BasicIo::AutoPtr io, bool create);
173 
175  EXIV2LIB_DEPRECATED_EXPORT bool isAsfType(BasicIo& iIo, bool advance);
176 
177 } // namespace Exiv2
178 
179 #endif // #ifndef ASFVIDEO_HPP_
Exiv2::Internal::TagDetails
Helper structure for lookup tables for translations of numeric tag values to human readable labels.
Definition: tags_int.hpp:189
Exiv2::AsfVideo::decodeBlock
void decodeBlock()
Check for a valid tag and decode the block at the current IO position. Calls tagDecoder() or skips to...
Exiv2::DataBuf::pData_
byte * pData_
Pointer to the buffer, 0 if none has been allocated.
Definition: types.hpp:269
Exiv2::AsfVideo::mimeType
std::string mimeType() const
Return the MIME type of the image.
Exiv2::RiffVideo
Class to access RIFF video files.
Definition: riffvideo.hpp:53
Exiv2::AsfVideo::headerExtension
void headerExtension(uint64_t size)
Interpret Header_Extension tag information, and save it in the respective XMP container.
types.hpp
Type definitions for Exiv2 and related functionality.
Exiv2::isAsfType
EXIV2LIB_DEPRECATED_EXPORT bool isAsfType(BasicIo &iIo, bool advance)
Check if the file iIo is a Windows Asf Video.
Exiv2::exvGettext
EXIV2API const char * exvGettext(const char *str)
Translate a string using the gettext framework. This wrapper hides all the implementation details fro...
Definition: types.cpp:576
Exiv2::Value::create
static AutoPtr create(TypeId typeId)
A (simple) factory to create a Value type.
Definition: value.cpp:100
Exiv2::strError
EXIV2API std::string strError()
Return a system error message and the error code (errno). See strerror(3).
Definition: futils.cpp:356
Exiv2::Internal::TagVocabulary
Helper structure for lookup tables for translations of controlled vocabulary strings to their descrip...
Definition: tags_int.hpp:210
asfvideo.hpp
An Image subclass to support ASF video files.
Exiv2::XmpKey
Concrete keys for XMP metadata.
Definition: properties.hpp:242
Exiv2::AsfVideo
Class to access ASF video files.
Definition: asfvideo.hpp:50
Exiv2::AsfVideo::fileProperties
void fileProperties()
Interpret File_Properties tag information, and save it in the respective XMP container.
Exiv2::ImageType::asf
const int asf
Treating asf as an image type>
Definition: asfvideo.hpp:43
Exiv2::convertStringCharset
EXIV2API bool convertStringCharset(std::string &str, const char *from, const char *to)
Convert character encoding of str from from to to. If the function succeeds, str contains the result ...
Definition: convert.cpp:1348
riffvideo.hpp
An Image subclass to support RIFF video files.
Exiv2::DataBuf
Utility class containing a character array. All it does is to take care of memory allocation and dele...
Definition: types.hpp:204
Exiv2::DataBuf::size_
long size_
The current size of the buffer.
Definition: types.hpp:271
Exiv2::AsfVideo::writeMetadata
void writeMetadata()
Write metadata back to the image.
Exiv2::Internal::TagDetails::label_
const char * label_
Translation of the tag value.
Definition: tags_int.hpp:191
Exiv2::AsfVideo::aspectRatio
void aspectRatio()
Calculates Aspect Ratio of a video, and stores it in the respective XMP container.
Exiv2::find
const T * find(T(&src)[N], const K &key)
Find an element that matches key in the array src.
Definition: types.hpp:508
Exiv2::newAsfInstance
EXIV2LIB_DEPRECATED_EXPORT Image::AutoPtr newAsfInstance(BasicIo::AutoPtr io, bool create)
Create a new AsfVideo instance and return an auto-pointer to it. Caller owns the returned object and ...
Exiv2::AsfVideo::codecList
void codecList()
Interpret Codec_List tag information, and save it in the respective XMP container.
Exiv2
Provides classes and functions to encode and decode Exif and Iptc data. The libexiv2 API consists of ...
Definition: asfvideo.hpp:36
convert.hpp
Exif and IPTC conversions to and from XMP.
image.hpp
Exiv2::AsfVideo::streamProperties
void streamProperties()
Interpret Stream_Properties tag information, and save it in the respective XMP container.
Exiv2::AsfVideo::metadataHandler
void metadataHandler(int meta=1)
Interpret Metadata, Extended_Content_Description, Metadata_Library tag information,...
Exiv2::getUShort
EXIV2API uint16_t getUShort(const byte *buf, ByteOrder byteOrder)
Read a 2 byte unsigned short value from the data buffer.
Definition: types.cpp:278
Exiv2::Internal
Contains internal objects which are not published and are not part of the libexiv2 API.
Definition: slice.hpp:40
Exiv2::AsfVideo::readMetadata
void readMetadata()
Read all metadata supported by a specific image format from the image. Before this method is called,...
Exiv2::Image::AutoPtr
std::auto_ptr< Image > AutoPtr
Image auto_ptr type.
Definition: image.hpp:84
Exiv2::AsfVideo::AsfVideo
AsfVideo(BasicIo::AutoPtr io)
Constructor for a ASF video. Since the constructor can not return a result, callers should check the ...
tags_int.hpp
Internal Exif tag and type information.
Exiv2::BasicIo::AutoPtr
std::auto_ptr< BasicIo > AutoPtr
BasicIo auto_ptr type.
Definition: basicio.hpp:58
Exiv2::Error
BasicError< char > Error
Error class used for exceptions (std::string based)
Definition: error.hpp:323
Exiv2::AsfVideo::tagDecoder
void tagDecoder(const Internal::TagVocabulary *tv, uint64_t size)
Interpret tag information, and call the respective function to save it in the respective XMP containe...
tags.hpp
Exif tag and type information.
Exiv2::Internal::TagVocabulary::label_
const char * label_
Description of the vocabulary string.
Definition: tags_int.hpp:212
Exiv2::string
@ string
IPTC string type.
Definition: types.hpp:147
Exiv2::AsfVideo::extendedStreamProperties
void extendedStreamProperties(uint64_t size)
Interpret Extended_Stream_Properties tag information, and save it in the respective XMP container.
EXV_ERROR
#define EXV_ERROR
Shorthand for a temp error log message object and return its ostringstream.
Definition: error.hpp:150
Exiv2::xmpSeq
@ xmpSeq
XMP sequence type.
Definition: types.hpp:155
Exiv2::toString
std::string toString(const T &arg)
Utility function to convert the argument of any type to a string.
Definition: types.hpp:521
Exiv2::BasicIo
An interface for simple binary IO.
Definition: basicio.hpp:55
Exiv2::AsfVideo::contentDescription
void contentDescription(uint64_t size)
Interpret Content_Description tag information, and save it in the respective XMP container.
Exiv2::Image
Abstract base class defining the interface for an image. This is the top-level interface to the Exiv2...
Definition: image.hpp:81
futils.hpp
Basic file utility functions required by Exiv2.
Exiv2::Value::AutoPtr
std::auto_ptr< Value > AutoPtr
Shortcut for a Value auto pointer.
Definition: value.hpp:63
Exiv2::getULong
EXIV2API uint32_t getULong(const byte *buf, ByteOrder byteOrder)
Read a 4 byte unsigned long value from the data buffer.
Definition: types.cpp:283
error.hpp
Error class for exceptions, log message class.