MediaInfoLib  0.7
MediaInfo.h
1 // MediaInfo - All information about media files
2 
3 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 //
5 // Give information about a lot of media files
6 // Dispatch the file to be tested by all containers
7 //
8 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9 
10 //---------------------------------------------------------------------------
11 #ifndef MediaInfoH
12 #define MediaInfoH
13 //---------------------------------------------------------------------------
14 
15 //---------------------------------------------------------------------------
16 #include "MediaInfo/MediaInfo_Const.h"
17 //---------------------------------------------------------------------------
18 
19 //---------------------------------------------------------------------------
20 #undef MEDIAINFO_EXP
21 #if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
22  #ifdef MEDIAINFO_DLL_EXPORT
23  #define MEDIAINFO_EXP
24  #else
25  #define MEDIAINFO_EXP
26  #endif
27 #else //defined(_WIN32) && !defined(__MINGW32__)
28  #if __GNUC__ >= 4
29  #define MEDIAINFO_EXP __attribute__ ((visibility("default")))
30  #else
31  #define MEDIAINFO_EXP
32  #endif
33 #endif //defined(_WIN32) && !defined(__MINGW32__)
34 
35 #if !defined(__WINDOWS__)
36  #define __stdcall //Supported only on windows
37 #endif
38 //---------------------------------------------------------------------------
39 
40 namespace MediaInfoLib
41 {
42 
43 class MediaInfo_Internal;
44 
45 //***************************************************************************
48 //***************************************************************************
49 
50 class MEDIAINFO_EXP MediaInfo
51 {
52 public :
53  //Constructor/Destructor
54  MediaInfo ();
55  ~MediaInfo ();
56  //File
62  size_t Open (const String &File_Name);
72  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);
79  size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
91  size_t Open_Buffer_Continue (const ZenLib::int8u* Buffer, size_t Buffer_Size);
96  ZenLib::int64u Open_Buffer_Continue_GoTo_Get ();
106  size_t Open_NextPacket ();
111  size_t Save ();
115  void Close ();
116 
117  //General information
123  String Inform (size_t Reserved=0);
124 
125  //Get
135  String Get (stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t InfoKind=Info_Text);
146  String Get (stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name);
147 
148  //Set
159  size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String());
170  size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String());
171 
172  //Output_Buffered
177  size_t Output_Buffer_Get (const String &Value);
182  size_t Output_Buffer_Get (size_t Pos);
183 
184  //Info
223  String Option (const String &Option, const String &Value=String());
229  static String Option_Static (const String &Option, const String &Value=String());
237  size_t State_Get ();
242  size_t Count_Get (stream_t StreamKind, size_t StreamNumber=(size_t)-1);
243 
244 private :
245  MediaInfo_Internal* Internal;
246 
247  //Constructor
248  MediaInfo (const MediaInfo&); // Prevent copy-construction
249  MediaInfo& operator=(const MediaInfo&); // Prevent assignment
250 };
251 
252 } //NameSpace
253 #endif
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)
size_t Output_Buffer_Get(const String &Value)
Output the written size when "File_Duplicate" option is used.
size_t Save()
(NOT IMPLEMENTED YET) Save the file
void Close()
Close a file.
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)
size_t Open_NextPacket()
Read one packet (if "PerPacket" mode is set)
String Inform(size_t Reserved=0)
Get all details about a file.
String Option(const String &Option, const String &Value=String())
size_t Open_Buffer_Finalize()
Open a stream (Finalize)
size_t Open(const String &File_Name)
Open a file.
static String Option_Static(const String &Option, const String &Value=String())
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...
size_t State_Get()
(NOT IMPLEMENTED YET) Get the state of the library
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)
ZenLib::int64u Open_Buffer_Continue_GoTo_Get()
Open a stream (Get the needed file Offset)
size_t Output_Buffer_Get(size_t Pos)
Output the written size when "File_Duplicate" option is used.
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.
size_t Open_Buffer_Continue(const ZenLib::int8u *Buffer, size_t Buffer_Size)
Open a stream (Continue)
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)
size_t Open_Buffer_Init(ZenLib::int64u File_Size=(ZenLib::int64u) -1, ZenLib::int64u File_Offset=0)
Open a stream (Init)
defined(_WIN32)
std::basic_string< MediaInfoLib::Char > String
Unicode/Ansi independant string.
info_t
Kind of information.
@ Info_Text
InfoKind = Value of parameter.
@ Info_Name
InfoKind = Unique name of parameter.
stream_t
Kinds of Stream.