MediaInfoLib  0.7
MediaInfo.h
1 // MediaInfo - All information about media files
2 // Copyright (C) 2002-2012 MediaArea.net SARL, Info@MediaArea.net
3 //
4 // This library is free software: you can redistribute it and/or modify it
5 // under the terms of the GNU Library General Public License as published by
6 // the Free Software Foundation, either version 2 of the License, or
7 // any later version.
8 //
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Library General Public License for more details.
13 //
14 // You should have received a copy of the GNU Library General Public License
15 // along with this library. If not, see <http://www.gnu.org/licenses/>.
16 //
17 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
19 //
20 // Give information about a lot of media files
21 // Dispatch the file to be tested by all containers
22 //
23 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 
25 //---------------------------------------------------------------------------
26 #ifndef MediaInfoH
27 #define MediaInfoH
28 //---------------------------------------------------------------------------
29 
30 //---------------------------------------------------------------------------
31 #include "MediaInfo/MediaInfo_Const.h"
32 //---------------------------------------------------------------------------
33 
34 //---------------------------------------------------------------------------
35 #undef MEDIAINFO_EXP
36 #if defined(_WIN32) && !defined(__MINGW32__) //MinGW32 does not support _declspec
37  #ifdef MEDIAINFO_DLL_EXPORT
38  #define MEDIAINFO_EXP
39  #else
40  #define MEDIAINFO_EXP
41  #endif
42 #else //defined(_WIN32) && !defined(__MINGW32__)
43  #if __GNUC__ >= 4
44  #define MEDIAINFO_EXP __attribute__ ((visibility("default")))
45  #else
46  #define MEDIAINFO_EXP
47  #endif
48 #endif //defined(_WIN32) && !defined(__MINGW32__)
49 
50 #if !defined(__WINDOWS__)
51  #define __stdcall //Supported only on windows
52 #endif
53 //---------------------------------------------------------------------------
54 
55 namespace MediaInfoLib
56 {
57 
58 class File__Analyze;
59 class Internet__Base;
60 
61 //***************************************************************************
64 //***************************************************************************
65 
66 class MEDIAINFO_EXP MediaInfo
67 {
68 public :
69  //Constructor/Destructor
70  MediaInfo ();
71  ~MediaInfo ();
72  //File
78  size_t Open (const String &File_Name);
88  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);
93  size_t Open_Buffer_Init (ZenLib::int64u File_Size=(ZenLib::int64u)-1, ZenLib::int64u File_Offset=0);
105  size_t Open_Buffer_Continue (const ZenLib::int8u* Buffer, size_t Buffer_Size);
110  ZenLib::int64u Open_Buffer_Continue_GoTo_Get ();
113  size_t Open_Buffer_Finalize ();
118  size_t Open_NextPacket ();
123  size_t Save ();
127  void Close ();
128 
129  //General information
133  String Inform (size_t Reserved=0);
134 
135  //Get
144  String Get (stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t InfoKind=Info_Text);
155  String Get (stream_t StreamKind, size_t StreamNumber, const String &Parameter, info_t InfoKind=Info_Text, info_t SearchKind=Info_Name);
156 
157  //Set
168  size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, size_t Parameter, const String &OldValue=String());
179  size_t Set (const String &ToSet, stream_t StreamKind, size_t StreamNumber, const String &Parameter, const String &OldValue=String());
180 
181  //Output_Buffered
186  size_t Output_Buffer_Get (const String &Value);
191  size_t Output_Buffer_Get (size_t Pos);
192 
193  //Info
232  String Option (const String &Option, const String &Value=String());
238  static String Option_Static (const String &Option, const String &Value=String());
246  size_t State_Get ();
250  size_t Count_Get (stream_t StreamKind, size_t StreamNumber=(size_t)-1);
251 
252 private :
253  void* Internal;
254 };
255 
256 } //NameSpace
257 #endif