mk_media_stop_send_rtp支持关闭单路流

This commit is contained in:
ziyue 2021-06-16 10:36:53 +08:00
parent 14d70426ed
commit d67060e97b
2 changed files with 6 additions and 5 deletions

View File

@ -179,7 +179,7 @@ API_EXPORT void API_CALL mk_media_set_on_regist(mk_media ctx, on_mk_media_source
typedef on_mk_media_source_send_rtp_result on_mk_media_send_rtp_result; typedef on_mk_media_source_send_rtp_result on_mk_media_send_rtp_result;
/** /**
* ps-rtp流 * ps-rtp流(ssrc区分多路)
* @param ctx * @param ctx
* @param dst_url ip或域名 * @param dst_url ip或域名
* @param dst_port * @param dst_port
@ -191,11 +191,12 @@ typedef on_mk_media_source_send_rtp_result on_mk_media_send_rtp_result;
API_EXPORT void API_CALL mk_media_start_send_rtp(mk_media ctx, const char *dst_url, uint16_t dst_port, const char *ssrc, int is_udp, on_mk_media_send_rtp_result cb, void *user_data); API_EXPORT void API_CALL mk_media_start_send_rtp(mk_media ctx, const char *dst_url, uint16_t dst_port, const char *ssrc, int is_udp, on_mk_media_send_rtp_result cb, void *user_data);
/** /**
* ps-rtp发送 * ps-rtp发送
* @param ctx * @param ctx
* @param ssrc rtp的ssrc10null或空字符串rtp推流
* @return 10 * @return 10
*/ */
API_EXPORT int API_CALL mk_media_stop_send_rtp(mk_media ctx); API_EXPORT int API_CALL mk_media_stop_send_rtp(mk_media ctx, const char *ssrc);
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -200,9 +200,9 @@ API_EXPORT void API_CALL mk_media_start_send_rtp(mk_media ctx, const char *dst_u
}); });
} }
API_EXPORT int API_CALL mk_media_stop_send_rtp(mk_media ctx){ API_EXPORT int API_CALL mk_media_stop_send_rtp(mk_media ctx, const char *ssrc){
assert(ctx); assert(ctx);
MediaHelper::Ptr *obj = (MediaHelper::Ptr *) ctx; MediaHelper::Ptr *obj = (MediaHelper::Ptr *) ctx;
//sender参数无用 //sender参数无用
return (*obj)->getChannel()->stopSendRtp(*MediaSource::NullMediaSource, ""); return (*obj)->getChannel()->stopSendRtp(*MediaSource::NullMediaSource, ssrc ? ssrc : "");
} }