00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00056 #if !defined( IFCAccessAdaptor_H )
00057 #define IFCAccessAdaptor_H
00058
00059 #if defined( WIN32 )
00060 #if defined(FC_DLL_EXPORT)
00061 #define FCExport __declspec(dllexport)
00062 #elif defined(FC_LINK_STATIC)
00063 #define FCExport
00064 #else
00065 #define FCExport __declspec(dllimport)
00066 #endif
00067 #pragma warning(disable : 4251)
00068 #pragma warning(disable : 4275)
00069 #else
00070 #define FCExport
00071 #endif
00072
00073 #define IFC_ACCESS_ENTRY_PROC "IFCCreateAccessAdaptor"
00074 #define STRING_VALUE_BUFFER_LEN 128
00075
00076 class IFCAccessContext;
00077 class IFCStreamInfo;
00078 class IFCAccess;
00079 class IFCAccessAdaptor;
00080
00081 #ifdef __cplusplus
00082 extern "C" {
00083 #endif
00084
00096 extern int FCExport IFCCreateAccessAdaptor(IFCAccessContext* pServer, IFCAccessAdaptor*& pAdaptor);
00097
00098 #ifdef __cplusplus
00099 }
00100 #endif
00101
00106 class FCExport IFCAccessAdaptor
00107 {
00108 public:
00109 inline virtual ~IFCAccessAdaptor() {}
00110
00124 virtual void getVersion( int& iMajor, int& iMinor, int& iMicro ) const = 0;
00125
00130 virtual const char* getDescription() const = 0;
00131
00141 virtual void onAccess( IFCAccess* pAccess ) = 0;
00142 };
00143
00148 class FCExport IFCAccessContext
00149 {
00150 public:
00154 enum enStats {
00155 eTOTAL_CONNECTED,
00156 eBYTES_IN,
00157 eBYTES_OUT
00158 };
00159
00160 inline virtual ~IFCAccessContext() {}
00161
00170 virtual const char* getVersion() const = 0;
00171
00178 virtual const char* getDescription() const = 0;
00179
00196 virtual bool getStats(enStats stat, char *strValue, int& iValueLen) const = 0;
00197 };
00198
00205 namespace fms_access
00206 {
00207
00208 static const char* FLD_REFERRER = "c-referrer";
00209 static const char* FLD_USER_AGENT = "c-user-agent";
00210 static const char* FLD_SERVER_URI = "s-uri";
00211 static const char* FLD_CLIENT_IP = "c-ip";
00212 static const char* FLD_CLIENT_PROTO = "c-proto";
00213 static const char* FLD_READ_ACCESS = "readAccess";
00214 static const char* FLD_WRITE_ACCESS = "writeAccess";
00215 static const char* FLD_READ_LOCK = "readAccessLock";
00216 static const char* FLD_WRITE_LOCK = "writeAccessLock";
00217 static const char* FLD_AUDIO_SAMPLE_ACCESS = "audioSampleAccess";
00218 static const char* FLD_VIDEO_SAMPLE_ACCESS = "videoSampleAccess";
00219 static const char* FLD_AUDIO_SAMPLE_LOCK = "audioSampleAccessLock";
00220 static const char* FLD_VIDEO_SAMPLE_LOCK = "videoSampleAccessLock";
00221 }
00222
00223
00236 class FCExport IFCAccess
00237 {
00238 public:
00239
00241
00242 enum Type { CONNECT };
00243
00248 virtual Type getType() const = 0;
00249
00270 virtual const char* getValue( const char* sName ) = 0;
00271
00287 virtual bool setValue( const char* sName, const char* sValue ) = 0;
00288
00301 virtual bool setReadAccess( const char* sReadAccess, bool bLockAccess = true ) = 0;
00302
00315 virtual bool setWriteAccess( const char* sWriteAccess, bool bLockAccess = true ) = 0;
00316
00323 virtual void accept() = 0;
00324
00335 virtual void reject( const char* sReason ) = 0;
00336
00345 virtual void redirect( const char* sUri, const char* sReason ) = 0;
00346 };
00347
00350 #endif // !defined( IFCAccessAdaptor_H )