基於live555的rtsp客戶端模塊

</pre><pre name="code" class="html">
基於live555 testRtspClient.cpp 改造, 已經封裝成 dll 模塊,提供了視頻幀回調接口. live555 需要編譯成靜態庫, 請自行編譯,網上很多例子,比較簡單

源碼下載地址:  http://download.csdn.net/detail/mtour/8035591 

通過此模塊能夠獲取到海康攝像機音視頻幀數據


模塊接口定義:


typedef enum VIDEO_TYPE
{
	VIDEO_TYPE_SPS=0,
		VIDEO_TYPE_PPS,
		VIDEO_TYPE_I,
		VIDEO_TYPE_P,
		VIDEO_TYPE_INVAILED=-1
}VIDEO_TYPE;

typedef enum AUDIO_TYPE
{
	AUDIO_TYPE_G711A=0
}AUDIO_TYPE;

#ifdef __cplusplus
extern "C" {  
#endif

typedef int (CALLBACK *LPSreamDataCallBack)(int bVideo, int nType, unsigned char* lpBuf, int nBufSize, LONGLONG llTimeStamp,void* pUser);


RTSP_STREAM_API int RTSP_STREAM_Init();

RTSP_STREAM_API int RTSP_STREAM_Fini();

/*
	return:  open handle   >=0 success ;  <0 failed
*/
RTSP_STREAM_API int RTSP_STREAM_Open(char* sRtspUrl,LPSreamDataCallBack pStreamCB, void* pUserData);

RTSP_STREAM_API int RTSP_STREAM_Close(int nOpenHandle);

注意:

       由於live555 是單線程, rtspClient對象 請不要在自定義線程中進行釋放,否則會導致報錯。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章