mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-06 10:57:50 +08:00
支持webrtc推流
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
Some checks are pending
Android / build (push) Waiting to run
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Docker / build (push) Waiting to run
Linux / build (push) Waiting to run
macOS / build (push) Waiting to run
Windows / build (push) Waiting to run
This commit is contained in:
parent
3fb43c5fef
commit
c82dd75054
@ -64,7 +64,8 @@ void API_CALL on_mk_push_event_func(void *user_data,int err_code,const char *err
|
|||||||
void API_CALL on_mk_media_source_regist_func(void *user_data, mk_media_source sender, int regist){
|
void API_CALL on_mk_media_source_regist_func(void *user_data, mk_media_source sender, int regist){
|
||||||
Context *ctx = (Context *) user_data;
|
Context *ctx = (Context *) user_data;
|
||||||
const char *schema = mk_media_source_get_schema(sender);
|
const char *schema = mk_media_source_get_schema(sender);
|
||||||
if (strncmp(schema, ctx->push_url, strlen(schema)) == 0) {
|
if (strncmp(schema, ctx->push_url, strlen(schema)) == 0 ||
|
||||||
|
(!strncmp(ctx->push_url, "webrtc", 5) && !strcmp(schema, "rtsp")) ) {
|
||||||
// 判断是否为推流协议相关的流注册或注销事件 [AUTO-TRANSLATED:00a88a17]
|
// 判断是否为推流协议相关的流注册或注销事件 [AUTO-TRANSLATED:00a88a17]
|
||||||
// Determine if it is a stream registration or deregistration event related to the streaming protocol
|
// Determine if it is a stream registration or deregistration event related to the streaming protocol
|
||||||
release_pusher(&(ctx->pusher));
|
release_pusher(&(ctx->pusher));
|
||||||
|
|||||||
@ -42,6 +42,9 @@ int domain(const string &file, const string &url) {
|
|||||||
// 根据url获取媒体协议类型,注意大小写 [AUTO-TRANSLATED:3cd6622a]
|
// 根据url获取媒体协议类型,注意大小写 [AUTO-TRANSLATED:3cd6622a]
|
||||||
// Get the media protocol type based on the URL, note the case
|
// Get the media protocol type based on the URL, note the case
|
||||||
auto schema = strToLower(findSubString(url.data(), nullptr, "://").substr(0, 4));
|
auto schema = strToLower(findSubString(url.data(), nullptr, "://").substr(0, 4));
|
||||||
|
if (schema == "webr") {
|
||||||
|
schema = "rtsp";
|
||||||
|
}
|
||||||
|
|
||||||
// 只开启推流协议对应的转协议 [AUTO-TRANSLATED:1c4975ae]
|
// 只开启推流协议对应的转协议 [AUTO-TRANSLATED:1c4975ae]
|
||||||
// Only enable the protocol conversion corresponding to the push protocol
|
// Only enable the protocol conversion corresponding to the push protocol
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user