基于live555的rtsp客户端模块

来源:互联网 发布:小黄鸡peeper软件下载 编辑:程序博客网 时间:2024/05/29 16:20

</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 __cplusplusextern "C" {  #endiftypedef 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对象 请不要在自定义线程中进行释放,否则会导致报错。


0 0
原创粉丝点击