Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Branch cumulative commit #3446

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Branch cumulative commit #3446

wants to merge 8 commits into from

Conversation

baiyfcu
Copy link
Member

@baiyfcu baiyfcu commented Apr 7, 2024

集成使用ZLM时,修复几处潜在崩溃BUG,添加rtp server自定义app,完善字符串转码支持windos和linux

* @param stream_id 该端口绑定的流id
* @return
*/
API_EXPORT mk_rtp_server API_CALL mk_rtp_server_create(uint16_t port, int tcp_mode, const char *stream_id);
API_EXPORT mk_rtp_server API_CALL mk_rtp_server_create(uint16_t port, int tcp_mode, const char *app_name, const char *stream_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议新增mk_rtp_server_create2接口 保持api兼容

@@ -302,6 +302,8 @@ void RtspUrl::setup(bool is_ssl, const string &url, const string &user, const st
}

static void inline checkHost(std::string &host) {
if (host.size() == 0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上{} 吧

#else
#include <iconv.h>
// 将 GB2312 编码的字符串转换为 UTF-8 编码
char *gb2312_to_utf8(const char *gb2312_string) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议返回std::string

@@ -63,6 +63,8 @@ void MP4Demuxer::onVideoTrack(uint32_t track, uint8_t object, int width, int hei
}
video->setIndex(track);
_tracks.emplace(track, video);
if (_on_track_callback)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上{}

@@ -75,6 +77,8 @@ void MP4Demuxer::onAudioTrack(uint32_t track, uint8_t object, int channel_count,
}
audio->setIndex(track);
_tracks.emplace(track, audio);
if (_on_track_callback)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上{}

_rtcp_sock = std::move(rtcp_sock);
_app_name = app_name;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

加上std::move()

@@ -119,6 +120,10 @@ class RtcpHelper: public std::enable_shared_from_this<RtcpHelper> {
}
}

string getAppName() { return _app_name; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以改成 const std::string& getAppName() const

@@ -119,6 +120,10 @@ class RtcpHelper: public std::enable_shared_from_this<RtcpHelper> {
}
}

string getAppName() { return _app_name; }

string getStreamId() { return _stream_id; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以改成 const std::string& getStreamId() const

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants