接口协议适用平台:(Windows&Linux&ARM)

1. 产品概述

EasyPusher是一个RTSP/RTP流媒体音/视频直播推送产品组件,全平台支持,包括Windows/Linux(32 & 64),ARM各平台,Android、iOS。


2. API接口函数定义

2.1 int EasyPusher_Activate(char *license);

函数说明:

激活状态码,推流前调用

参数说明:

license:[IN] 字符串,激活码

2.2 Easy_Pusher_Handle Easy_APICALL EasyPusher_Create();

函数说明:

创建推送句柄,返回为句柄值

参数说明:


2.3 Easy_U32 Easy_APICALL EasyPusher_Release(Easy_Pusher_Handle handle);

函数说明:

释放推送句柄

参数说明:

handle:[IN] 句柄

2.4 Easy_U32 Easy_APICALL EasyPusher_SetEventCallback(Easy_Pusher_Handle handle, EasyPusher_Callback callback, int id, void *userptr);

函数说明:

设置流传输事件回调

参数说明:

handle:[IN] 句柄
_callback:[IN] 回调函数
userptr:传输自定义对象指针

2.5 Easy_U32 Easy_APICALL EasyPusher_StartStream(Easy_Pusher_Handle handle, char serverAddr, Easy_U16 port, char streamName, char username, char password, EASY_MEDIA_INFO_T* pstruStreamInfo, Easy_U32 bufferKSize, Easy_Bool createlogfile );

函数说明:

开始流传输

参数说明:

serverAddr:流媒体服务器地址
port:流媒体端口
streamName:流名称<xxx.sdp>
username/password:推送携带的用户名密码
pstruStreamInfo:推送的媒体定义
bufferKSize:以k为单位的缓冲区大小<512~2048之间,默认512> 
createlogfile:创建日志文件

2.6 Easy_U32 Easy_APICALL EasyPusher_StopStream(Easy_Pusher_Handle handle);

函数说明:

停止流传输

参数说明:


2.7 Easy_U32 Easy_APICALL EasyPusher_PushFrame(Easy_Pusher_Handle handle, EASY_AV_Frame* frame );

函数说明:

推流

参数说明:

frame:具体推送的流媒体帧

2.8 - (void) initCameraWithOutputSize:(CGSize)size;

函数说明:

初始化视频和音频编码器

参数说明:

size:推流的分辨率

2.9 - (void) startCapture;

函数说明:

摄像头开始采集数据

参数说明:


2.10 - (void) startCamera:(NSString *)hostUrl;

函数说明:

开始推流

参数说明:

hostUrl:流地址

2.11 - (void) stopCamera;

函数说明:

停止推流

参数说明:


2.12 - (void) swapFrontAndBackCameras;

函数说明:

切换前后摄像头    

参数说明:


2.13 - (void) swapResolution;

函数说明:

切换分辨率

参数说明:


#