linphone函数video_stream_event_cb()分析

本文介绍了Linphone视频通话中视频流错误的处理方法。通过设置事件回调函数,可以捕捉到解码错误并采取措施进行恢复,同时还能监听到第一帧视频成功解码的事件。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

linphone_call_init_media_streams(call);

调用:

void linphone_call_init_video_stream(LinphoneCall *call)

调用:

video_stream_set_event_callback(call->videostream,video_stream_event_cb, call);

调用:

#ifdef VIDEO_ENABLED
static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args){
    LinphoneCall* call = (LinphoneCall*) user_pointer;
    switch (event_id) {
        case MS_VIDEO_DECODER_DECODING_ERRORS:
            ms_warning("MS_VIDEO_DECODER_DECODING_ERRORS");
            if (call->videostream && (video_stream_is_decoding_error_to_be_reported(call->videostream, 5000) == TRUE)) {
                video_stream_decoding_error_reported(call->videostream);
                linphone_call_send_vfu_request(call);
            }
            break;
        case MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS:
            ms_message("MS_VIDEO_DECODER_RECOVERED_FROM_ERRORS");
            if (call->videostream) {
                video_stream_decoding_error_recovered(call->videostream);
            }
            break;
        case MS_VIDEO_DECODER_FIRST_IMAGE_DECODED:
            ms_message("First video frame decoded successfully");
            if (call->nextVideoFrameDecoded._func != NULL)
                call->nextVideoFrameDecoded._func(call, call->nextVideoFrameDecoded._user_data);
            break;
        case MS_VIDEO_DECODER_SEND_PLI:
        case MS_VIDEO_DECODER_SEND_SLI:
        case MS_VIDEO_DECODER_SEND_RPSI:
            /* Handled internally by mediastreamer2. */
            break;
        default:
            ms_warning("Unhandled event %i", event_id);
            break;
    }
}
#endif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值