文档

lv_on_push_streaming_cmd_cb

更新时间:
一键部署

调用该接口,在建立直播播放链接或本地录像播放链接期间,发送控制类命令,例如发送I帧命令。

该接口为回调函数。

接口详情

typedef int (*lv_on_push_streaming_cmd_cb)(const lv_device_auth_s *auth, const lv_on_push_stream_cmd_param_s *param);

参数

类型

说明

auth

lv_device_auth_s *

设备认证信息。

param

const lv_on_push_stream_cmd_param_s *

附加参数,如本地录像播放的暂停命令。

示例代码

说明

示例代码仅供参考,完整内容,请参见SDK中的实际代码。

//Demo中定义了回调函数on_push_streaming_cmd_cb,作为lv_on_push_streaming_cmd_cb的实现//Demo中定义了回调函数stopPushStreamingCallback,作为lv_start_push_streaming_cb的实现
lv_on_push_streaming_cmd_cb = on_push_streaming_cmd_cb;

static int on_push_streaming_cmd_cb(const lv_device_auth_s *auth, const lv_on_push_stream_cmd_param_s *param) {
    printf("on_push_streaming_cmd_cb service_id:%d, cmd:%d %d\n", param->common.service_id, param->common.cmd_type, param->seek.timestamp);

    DummyIpcMediaParam ipc_param = {0};
    ipc_param.service_id = param->common.service_id;
    if (param->common.cmd_type == LV_LIVE_REQUEST_I_FRAME) {
        //对于直播,需要强制生成一个I帧
    } else if (param->common.cmd_type == LV_STORAGE_RECORD_SEEK) {
        //本地录像播放定位到某一段
    } else if (param->common.cmd_type == LV_STORAGE_RECORD_PAUSE) {
        //本地录像播放暂停推流
    } else if (param->common.cmd_type == LV_STORAGE_RECORD_UNPAUSE) {
        //本地录像播放恢复推流
    } else if (param->common.cmd_type == LV_STORAGE_RECORD_START) {
        //本地录像播放开始推流
    } else if (param->common.cmd_type == LV_STORAGE_RECORD_SET_PARAM) {
         //本地录像播放倍速推流
    }

    return 0;
}
  • 本页导读 (1)
文档反馈