SfxDecoder.h
1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef __SFX__SfxDecoder__MODULE__
#define __SFX__SfxDecoder__MODULE__
#include "SfxDecoder/SfxStreamHandlerInterface.h"
#include "DxDecoderInterface.h"
class SfxDecoder: public DxDecoderInterface
{
public:
SfxDecoder( const DxDecoderConfig * cfg );
virtual ~SfxDecoder();
/**************************************************
* 接口:OpenDecoder
* 功能:打开一个解码器,开始解码
* 参数:const char * uri 解码器数据源,以rtsp://为前
* 缀指定为RTSP流,以gb28181://为前缀指定为国
* 标流,其余则为文件流。
* 返回:成功返回 0, 失败返回 < 0
* 备注:RTSP流或国标流(历史流/实时流)都属于实时流
* 本接口属于异步接口
**************************************************/
virtual int OpenDecoder( const char * uri );
/**************************************************
* 接口:CloseDecoder
* 功能:关闭一个解码器,停止解码
* 参数:无
* 返回:成功返回 0, 失败返回 < 0
* 备注:本接口内部会阻塞直到解码器正常关闭后退出
**************************************************/
virtual int CloseDecoder();
virtual int GetFrameCount();
private:
static sfx_32 sfx_stdcall SfxStreamCallback(
const sfx_void * userPtr,
SfxFrameType type,
const sfx_u8 * buf,
sfx_u32 segLen,
sfx_u32 len,
sfx_u32 timestamp
);
static sfx_32 sfx_stdcall SfxLogDefaultHandler(
const sfx_void * userPtr,
SfxLogLevel level,
const sfx_8 * log,
sfx_u32 logLen
);
private:
SfxStreamHandlerInterface * m_handler;
DxVideoConfig m_video;
DxDecoderConfig m_cfg;
sfx_bool m_bRun;
};
#endif