MediaInfo.h
// MediaInfo - All information about media files
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// Give information about a lot of media files
// Dispatch the file to be tested by all containers
//
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//---------------------------------------------------------------------------
#ifndef MediaInfoH
#define MediaInfoH
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include "MediaInfo/MediaInfo_Const.h"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#undef MEDIAINFO_EXP
#if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
#ifdef MEDIAINFO_DLL_EXPORT
#define MEDIAINFO_EXP
#else
#define MEDIAINFO_EXP
#endif
#else //defined(_WIN32) && !defined(__MINGW32__)
#if __GNUC__ >= 4
#define MEDIAINFO_EXP __attribute__ ((visibility("default")))
#else
#define MEDIAINFO_EXP
#endif
#endif //defined(_WIN32) && !defined(__MINGW32__)
#if !defined(__WINDOWS__)
#define __stdcall //Supported only on windows
#endif
//---------------------------------------------------------------------------
namespace MediaInfoLib
{
class MediaInfo_Internal;
//***************************************************************************
//***************************************************************************
class MEDIAINFO_EXP MediaInfo
{
public :
//Constructor/Destructor
MediaInfo ();
~MediaInfo ();
//File
size_t Open (const String &File_Name);
size_t Open (const ZenLib::int8u* Begin, size_t Begin_Size, const ZenLib::int8u* End=NULL, size_t End_Size=0, ZenLib::int64u File_Size=0);
size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
size_t Open_Buffer_Continue (const ZenLib::int8u* Buffer, size_t Buffer_Size);
ZenLib::int64u Open_Buffer_Continue_GoTo_Get ();
size_t Open_Buffer_Finalize ();
size_t Open_NextPacket ();
size_t Save ();
void Close ();
//General information
String Inform (size_t Reserved=0);
//Get
String Get (stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t InfoKind=Info_Text);
String Get (stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name);
//Set
size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String());
size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String());
//Output_Buffered
size_t Output_Buffer_Get (const String &Value);
size_t Output_Buffer_Get (size_t Pos);
//Info
String Option (const String &Option, const String &Value=String());
static String Option_Static (const String &Option, const String &Value=String());
size_t State_Get ();
size_t Count_Get (stream_t StreamKind, size_t StreamNumber=(size_t)-1);
private :
MediaInfo_Internal* Internal;
//Constructor
MediaInfo (const MediaInfo&); // Prevent copy-construction
MediaInfo& operator=(const MediaInfo&); // Prevent assignment
};
} //NameSpace
#endif
MediaInfoLib::MediaInfo::Get
String Get(stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t InfoKind=Info_Text)
Get a piece of information about a file (parameter is an integer).
MediaInfoLib::MediaInfo::Output_Buffer_Get
size_t Output_Buffer_Get(const String &Value)
Output the written size when "File_Duplicate" option is used.
MediaInfoLib::MediaInfo::Save
size_t Save()
(NOT IMPLEMENTED YET) Save the file
MediaInfoLib::MediaInfo::Close
void Close()
Close a file.
MediaInfoLib::MediaInfo::Set
size_t Set(const String &ToSet, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String())
(NOT IMPLEMENTED YET) Set information about a file (parameter is a string)
MediaInfoLib::MediaInfo::Open_NextPacket
size_t Open_NextPacket()
Read one packet (if "PerPacket" mode is set).
MediaInfoLib::MediaInfo::Inform
String Inform(size_t Reserved=0)
Get all details about a file.
MediaInfoLib::MediaInfo::Option
String Option(const String &Option, const String &Value=String())
MediaInfoLib::MediaInfo::Open_Buffer_Finalize
size_t Open_Buffer_Finalize()
Open a stream (Finalize).
MediaInfoLib::MediaInfo::Open
size_t Open(const String &File_Name)
Open a file.
MediaInfoLib::MediaInfo::Option_Static
static String Option_Static(const String &Option, const String &Value=String())
MediaInfoLib::MediaInfo::Count_Get
size_t Count_Get(stream_t StreamKind, size_t StreamNumber=(size_t) -1)
Count of streams of a stream kind (StreamNumber not filled), or count of piece of information in this...
MediaInfoLib::MediaInfo::State_Get
size_t State_Get()
(NOT IMPLEMENTED YET) Get the state of the library
MediaInfoLib::MediaInfo::Get
String Get(stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name)
Get a piece of information about a file (parameter is a string).
MediaInfoLib::MediaInfo::Open_Buffer_Continue_GoTo_Get
ZenLib::int64u Open_Buffer_Continue_GoTo_Get()
Open a stream (Get the needed file Offset).
MediaInfoLib::MediaInfo::Output_Buffer_Get
size_t Output_Buffer_Get(size_t Pos)
Output the written size when "File_Duplicate" option is used.
MediaInfoLib::MediaInfo::Open
size_t Open(const ZenLib::int8u *Begin, size_t Begin_Size, const ZenLib::int8u *End=NULL, size_t End_Size=0, ZenLib::int64u File_Size=0)
Open a buffer.
MediaInfoLib::MediaInfo::Open_Buffer_Continue
size_t Open_Buffer_Continue(const ZenLib::int8u *Buffer, size_t Buffer_Size)
Open a stream (Continue).
MediaInfoLib::MediaInfo::Set
size_t Set(const String &ToSet, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String())
(NOT IMPLEMENTED YET) Set a piece of information about a file (parameter is an int)
MediaInfoLib::MediaInfo::Open_Buffer_Init
size_t Open_Buffer_Init(ZenLib::int64u File_Size=(ZenLib::int64u) -1, ZenLib::int64u File_Offset=0)
Open a stream (Init).
MediaInfoLib
defined(_WIN32)
Definition MediaInfo_Const.h:24
MediaInfoLib::String
std::basic_string< MediaInfoLib::Char > String
Unicode/Ansi independant string.
Definition MediaInfo_Const.h:125
MediaInfoLib::info_t
info_t
Kind of information.
Definition MediaInfo_Const.h:74
MediaInfoLib::Info_Text
@ Info_Text
InfoKind = Value of parameter.
Definition MediaInfo_Const.h:76
MediaInfoLib::Info_Name
@ Info_Name
InfoKind = Unique name of parameter.
Definition MediaInfo_Const.h:75
MediaInfoLib::stream_t
stream_t
Kinds of Stream.
Definition MediaInfo_Const.h:61