?? hbplaysdk.h
字號:
#ifndef _HBPLAYSDK_H_
#define _HBPLAYSDK_H_
#include "HBxCommon.h"
//#include "windef.h"
//#include "Multimon.H"
#define HBAPI extern"C"
/* *****************************************************************
SDK功能描述:
1. 文件播放功能
a) 支持文件播放、暫停、快速播放、慢速播放、單幀進(jìn)退功能.
b) 支持文件信息獲取、快速定位、碼流信息獲取
c) 支持回調(diào)/文件抓幀、支持解碼時回調(diào)、支持索引回調(diào)
d) 支持overlay、非overlay模式顯示(多窗口顯示),支持局部放大功能
e) 支持音頻播放,音量調(diào)節(jié).
f) 支持文件剪切,支持文件合并.
g) 支持動態(tài)幀率,動態(tài)尺寸播放.
如何支持任意文件的拼接回放?
a) 在建立索引的時刻,校驗(yàn)文件的有效性.
2. 流播放功能
a) 支持實(shí)時流解碼,文件流解碼,支持播放速率調(diào)節(jié).
b) 支持支持回調(diào)/文件抓幀、支持解碼時回調(diào).
c) 支持支持overlay、非overlay模式顯示(多窗口顯示),支持局部放大功能
d) 支持音頻播放,音量調(diào)節(jié).
e) 支持動態(tài)幀率,動態(tài)尺寸播放.
*******************************************************************/
HBAPI BOOL __stdcall HB_PLAY_InitDDraw(HWND hWnd);
HBAPI BOOL __stdcall HB_PLAY_RealeseDDraw();
HBAPI BOOL __stdcall HB_PLAY_OpenFile(long nChl, char *sFile);
HBAPI BOOL __stdcall HB_PLAY_CloseFile(long nChl);
HBAPI BOOL __stdcall HB_PLAY_Play(long nChl, HWND hWnd=NULL);
HBAPI BOOL __stdcall HB_PLAY_Pause(long nChl);
HBAPI BOOL __stdcall HB_PLAY_Stop(long nChl);
HBAPI BOOL __stdcall HB_PLAY_Fast(long nChl);
HBAPI BOOL __stdcall HB_PLAY_Slow(long nChl);
HBAPI BOOL __stdcall HB_PLAY_PlayBySingleFrame(long nChl);
HBAPI BOOL __stdcall HB_PLAY_OneByOne(long nChl);
HBAPI BOOL __stdcall HB_PLAY_PlayBySingleFrameBack(long nChl);
HBAPI BOOL __stdcall HB_PLAY_OneByOneBack(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetFileTime(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetFileFrames(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetFileTotalFrames(long nChl);
HBAPI long __stdcall HB_PLAY_GetPlayedFrames(long nChl);
HBAPI long __stdcall HB_PLAY_GetPlayedFrameNum(long nChl);
HBAPI long __stdcall HB_PLAY_GetCurrFrameNum(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetPlayedTime(long nChl, DWORD dwTime);
HBAPI BOOL __stdcall HB_PLAY_SetPlayPos(long nChl, float dPos);
HBAPI float __stdcall HB_PLAY_GetPlayPos(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetFileEndMsg(long nChl, HWND hWnd, UINT nMsg);
HBAPI BOOL __stdcall HB_PLAY_OpenSound(long nChl);
HBAPI BOOL __stdcall HB_PLAY_PlaySound(long nChl);
HBAPI BOOL __stdcall HB_PLAY_CloseSound(long nChl);
HBAPI BOOL __stdcall HB_PLAY_RefreshPlay(long nChl);
HBAPI BOOL __stdcall HB_PLAY_GetPictureSize(long nChl, long *pWidth, long *pHeight);
HBAPI BOOL __stdcall HB_PLAY_SetDisplayCallBack(long nChl, void (CALLBACK *DisplayCBFun)(long nChl, char *pBuf, long nSize, long nWidth, long hHeight, long nStamp, long nType, long nReserved));
HBAPI BOOL __stdcall HB_PLAY_ConvertToBMPFile(long nChl, char *pBuf, long nSize, long nWidth, long nHeight, long nType, char *sFileName);
HBAPI BOOL __stdcall HB_PLAY_SetDecCallBack(long nChl, void (CALLBACK* DecCBFun)(long nPort, char * pBuf, long nSize, FRAME_INFO * pFrameInfo, long nReserved1, long nReserved2),long nOutFormat=0);
HBAPI BOOL __stdcall HB_PLAY_SetPicQuality(long nChl, BOOL bHighQuality);
HBAPI BOOL __stdcall HB_PLAY_GetPicQuality(long nChl, BOOL *bHighQuality);
HBAPI BOOL __stdcall HB_PLAY_SetVolume(long nChl, WORD nVolume);
HBAPI WORD __stdcall HB_PLAY_GetVolume(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetOverlayMode(long nChl, BOOL bOverlayMode, COLORREF colorKey);
HBAPI DWORD __stdcall HB_PLAY_GetColorKey(long nChl);
HBAPI BOOL __stdcall HB_PLAY_GetOverlayMode(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetPlayTime(long nChl, DWORD dwTime);
HBAPI DWORD __stdcall HB_PLAY_GetPlayTime(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetCurrFrameRate(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetFileHeadLength(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetCurrentFrameNum(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetCurrentFrameNum(long nChl, DWORD dwFrameNum);
HBAPI BOOL __stdcall HB_PLAY_GetKeyFramePos(long nChl, DWORD nValue, DWORD nType, PFRAME_POS pFramePos);
HBAPI BOOL __stdcall HB_PLAY_GetPriorKeyFramePos(long nChl, DWORD nValue, DWORD nType, PFRAME_POS pFramePos);
HBAPI BOOL __stdcall HB_PLAY_GetNextKeyFramePos(long nChl, DWORD nValue, DWORD nType, PFRAME_POS pFramePos);
HBAPI BOOL __stdcall HB_PLAY_SetDisplayRegion(long nChl, DWORD nRegionNum, RECT *pSrcRect, HWND hDestWnd, BOOL bEnable);
HBAPI BOOL __stdcall HB_PLAY_OpenStream(long nChl, char *pFileHeadBuf, DWORD nSize, DWORD nBufPoolSize);
HBAPI BOOL __stdcall HB_PLAY_SetStreamOpenMode(long nChl, DWORD nMode);
HBAPI BOOL __stdcall HB_PLAY_InputData(long nChl, char *pBuf, DWORD nSize, DWORD nDataType=0);
HBAPI BOOL __stdcall HB_PLAY_InputVideoData(long nChl,char * pBuf,DWORD nSize);
HBAPI BOOL __stdcall HB_PLAY_InputAudioData(long nChl,char * pBuf,DWORD nSize);
HBAPI BOOL __stdcall HB_PLAY_CloseStream(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetStreamOpenMode(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetSourceBufferRemain(long nChl);
HBAPI BOOL __stdcall HB_PLAY_ResetSourceBuffer(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetSourceBufferCB(long nChl, DWORD nThreShold,void (CALLBACK * SourceBufCallBack)(long nPort,DWORD nBufSize,DWORD dwUser,void*pResvered),DWORD dwUser,void *pReserved);
HBAPI BOOL __stdcall HB_PLAY_ResetSourceBufFlag(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetMsgWnd(long nChl, HWND hWnd);
HBAPI DWORD __stdcall HB_PLAY_GetLastError(long nChl);
HBAPI DWORD __stdcall HB_PLAY_GetSdkVersion(long nChl);
HBAPI BOOL __stdcall HB_PLAY_SetPlaySpeed(long nChl, long dwSpeed, BOOL bSlow=false);
HBAPI BOOL __stdcall HB_PLAY_SnapShot(long nChl, char *sFile);
HBAPI double __stdcall HB_PLAY_GetDynamicBPS(long nChl);
HBAPI double __stdcall HB_PLAY_GetAverageBPS(long nChl);
// discarded.
HBAPI void __stdcall HB_PLAY_SetSDKThreadPriority(int nPriority, int nChl=-1);
HBAPI void __stdcall HB_PLAY_SetIndexThread(BOOL bEnable, int nPriority, int nChl=-1);
// 設(shè)置是否啟用IndexThread
HBAPI void __stdcall HB_PLAY_EnableIndexThread(BOOL bEnable);
HBAPI BOOL __stdcall HB_PLAY_GetVideoColor(long nChl, long *pBrightness, long *pContrast, long *pSaturation , long *pHue, long nRegnum=0);
HBAPI BOOL __stdcall HB_PLAY_SetVideoColor(long nChl, long nBrightness, long nContrast, long nSaturation , long nHue, long nRegnum=0);
HBAPI BOOL __stdcall HB_PLAY_SearchPicture(char *sInFile, char *sOutFile, DWORD dwPos, BOOL byTimeOrFrame);
HBAPI BOOL __stdcall HB_PLAY_GetIndexInfo(long nChl, BYTE *pBuffer, DWORD *pSize);
HBAPI BOOL __stdcall HB_PLAY_SetIndexInfo(long nChl, BYTE *pBuffer, DWORD nIndexSize);
HBAPI BOOL __stdcall HB_PLAY_SetIndexInfoCallBack(long nChl, void (CALLBACK *IndexCBFunc)(long nChl, long nReserved), long nReserved);
HBAPI BOOL __stdcall HB_PLAY_GetFileStartTime(long nChl, char *pSystemTime);
HBAPI BOOL __stdcall HB_PLAY_SetStreamSpeed(long nChl, int iSpeed, BOOL bFast);
HBAPI void __stdcall HB_PLAY_SetEndlessStream(long nChl, BOOL bEndless);
/*
HBAPI BOOL __stdcall HB_PLAY_ShowKeyFrame( char *sFile, DWORD dwTime, HWND hWnd, FRAME_POS *pFramePos);
HBAPI BOOL __stdcall HB_PLAY_ShowKeyFrameEx( char *sFile, DWORD dwFilePos, HWND hWnd);
HBAPI BOOL __stdcall HB_PLAY_SetFilePos(long nChl, DWORD dwFilePos);
*/
/************************************************************************************************************************
// for zhuan
typedef void* HDRAW;
typedef void* H_WAVE;
HBAPI long __stdcall HB_PLAY_OpenFileEx(char *sFile);
HBAPI void* __stdcall HB_PLAY_DecInit(int width,int height);
HBAPI void* __stdcall HB_PLAY_DecInitEx(int width,int height,int out_fmt);
HBAPI int __stdcall HB_PLAY_DecFrame(void* handle,void* stream,void* image);
HBAPI int __stdcall HB_PLAY_DecFrameEx(void* handle,void* stream,void* image, int quality);
HBAPI void __stdcall HB_PLAY_DecFree(void *handle);
// display
HBAPI HDRAW __stdcall HB_PLAY_InitDirectDraw(long width, long height);
HBAPI BOOL __stdcall HB_PLAY_ShowPicture(void *hdraw,long hwnd, unsigned char *image, long width, long height);
HBAPI BOOL __stdcall HB_PLAY_ShowPictureEx(void *hdraw,unsigned char *image, long width,long height);
HBAPI BOOL __stdcall HB_PLAY_AddWindow(void *hdraw, long hwnd, long x, long y, long cx, long cy);
HBAPI BOOL __stdcall HB_PLAY_DelWindow(void *hdraw, long hwnd);
HBAPI void __stdcall HB_PLAY_RestoreSurface(void *hdraw);
HBAPI void __stdcall HB_PLAY_ReleaseDDraw(void *hdraw);
// audio
HBAPI H_WAVE __stdcall HB_PLAY_WaveOpen();
// 0 <= volume <= 0xffff
HBAPI void __stdcall HB_PLAY_WaveSetVolume(H_WAVE *h, long volume);
HBAPI void __stdcall HB_PLAY_WaveGetVolume(H_WAVE *h, long &volume);
HBAPI BOOL __stdcall HB_PLAY_WaveWrite(H_WAVE *h, char *buff, long size);
HBAPI BOOL __stdcall HB_PLAY_WaveReset(H_WAVE *h);
HBAPI BOOL __stdcall HB_PLAY_WaveClose(H_WAVE *h);
***********************************************************************************************************/
// for 九鼎 Technology
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// 獲取某個時間點(diǎn)之后的關(guān)鍵幀位置和大小: 在HB_PLAY_OpenFile之后調(diào)用
////////////////////////////////////////
// lTime : 時間,單位毫秒
// iFilePos : 關(guān)鍵幀在文件中的起始位置
// iFrameSize : 關(guān)鍵幀的位置
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//
HBAPI BOOL __stdcall HB_PLAY_GetKeyFramePosJD(long nChl, long lTime, long *iFilePos, long *iFrameSize);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
// 獲取下一幀數(shù)據(jù) : 必須在HB_PLAY_GetKeyFramePosJD之后調(diào)用.
//////////////////
// iFilePos : 視頻或音頻幀在文件中的起始位置
// iType : 幀類型: 1表示視頻幀, 2表示音頻幀
//
///////////////////////////////////////////////////////////////////////////////////////////////////////////
//
HBAPI BOOL __stdcall HB_PLAY_GetNextFramePosJD(long nChl, long *iFilePos, long *iFrameSize, long *iType);
// for T1800
// no finished.
HBAPI BOOL __stdcall HB_PLAY_MergeFile(char *filename1, char *filename2);
HBAPI BOOL __stdcall HB_PLAY_MergeFiles(char *file[], int file_num);
HBAPI long __stdcall HB_PLAY_OpenStreamEx(char *pFileHeadBuf, DWORD nSize, DWORD nBufPoolSize);
HBAPI long __stdcall HB_PLAY_OpenFileEx(char *sFile);
#endif // _HBPLAYSDK_H_
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -