#ifdef WIN32
#define DLL_API extern "C" __declspec( dllexport )
#else // Linux ARM 9
#define DLL_API extern "C"
#endif
// 打开
DLL_API
int V_AVIRead_Open( )
{
VFileRead_AVI *pClass = NULL;
pClass = new VFileRead_AVI();
if( !pClass )
return -1;
return (int)pClass;
}
DLL_API
int V_AVIRead_Init( int AHandle, char *ApFilename )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return ( pClass->Init( ApFilename ) );
}
return -1;
}
// 开始
DLL_API
int V_AVIRead_Start( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
pClass->Start( AHandle );
return 1;
}
return -1;
}
//
DLL_API
int V_AVIRead_GetChannelCount( int AHandle, int* AVideoChannels, int* AAudioChannels )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
pClass->GetChannelCount( AVideoChannels, AAudioChannels );
return 1;
}
return -1;
}
//
DLL_API
int V_AVIRead_GetVideoInfo( int AHandle, int AChannelIndex, V_VideoInfo *AVideoInfo )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return pClass->GetVideoInfo( AChannelIndex, AVideoInfo );
}
return -1;
}
//
DLL_API
int V_AVIRead_GetAudioInfo( int AHandle, int AChannelIndex, V_AudioInfo *AAudioInfo )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return pClass->GetAudioInfo( AChannelIndex, AAudioInfo );
}
return -1;
}
// get avi data
DLL_API
int V_AVIRead_GetFrame( int AHandle, int *AnType, int *AnChannels, int *AnKey, char *ApBUffer,
int *AnBufferSize ,unsigned long *AdwExtend )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return pClass->Get_AVIFrame( AHandle, AnType, AnChannels, AnKey, ApBUffer,
AnBufferSize ,AdwExtend );
//return 1;
}
return -1;
}
//获取 time total
DLL_API
unsigned long V_AVIRead_GetTimeCount( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return pClass->GetTimeCount( );
}
return (unsigned long)-1;
}
//获取 time Curren Time
DLL_API
unsigned long V_AVIRead_GetCurrenTime( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
return pClass->GetCurrenTime( );
}
return (unsigned long)-1;
}
//change play time
DLL_API
int V_AVIRead_GotoTime( int AHandle, unsigned long AdwGotoTime )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
pClass->GotoTime( AdwGotoTime );
return 1;
}
return -1;
}
// 暂停
DLL_API
int V_AVIRead_Pause( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
pClass->Pause( AHandle );
return 1;
}
return -1;
}
// 停止
DLL_API
int V_AVIRead_Stop( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
pClass->Stop( AHandle );
return 1;
}
return -1;
}
// 关闭
DLL_API
int V_AVIRead_Close( int AHandle )
{
VFileRead_AVI *pClass = (VFileRead_AVI *)AHandle;
if ( pClass != NULL )
{
delete pClass;
return 1;
}
return -1;
}