Skip to content

Commit

Permalink
调整codec相关工具函数可见性,修复代码编译报错
Browse files Browse the repository at this point in the history
  • Loading branch information
baiyfcu committed Jan 10, 2024
1 parent eaded20 commit 45b48c1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ext-codec/H264.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace toolkit;

namespace mediakit {

static bool getAVCInfo(const char *sps, size_t sps_len, int &iVideoWidth, int &iVideoHeight, float &iVideoFps) {
bool getAVCInfo(const char *sps, size_t sps_len, int &iVideoWidth, int &iVideoHeight, float &iVideoFps) {
if (sps_len < 4) {
return false;
}
Expand Down
3 changes: 2 additions & 1 deletion ext-codec/H264.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ namespace mediakit{

void splitH264(const char *ptr, size_t len, size_t prefix, const std::function<void(const char *, size_t, size_t)> &cb);
size_t prefixSize(const char *ptr, size_t len);
bool getAVCInfo(const char *sps, size_t sps_len, int &iVideoWidth, int &iVideoHeight, float &iVideoFps);

template<typename Parent>
template <typename Parent>
class H264FrameHelper : public Parent{
public:
friend class FrameImp;
Expand Down
3 changes: 2 additions & 1 deletion ext-codec/H265.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
#define H265_TYPE(v) (((uint8_t)(v) >> 1) & 0x3f)

namespace mediakit {
bool getHEVCInfo(const char *vps, size_t vps_len, const char *sps, size_t sps_len, int &iVideoWidth, int &iVideoHeight, float &iVideoFps);

template<typename Parent>
template <typename Parent>
class H265FrameHelper : public Parent{
public:
friend class FrameImp;
Expand Down
6 changes: 4 additions & 2 deletions server/WebApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ Value makeMediaSourceJson(MediaSource &media){
}

#if defined(ENABLE_RTPPROXY)
uint16_t local_port, const string &app, const string &stream_id, int tcp_mode, const string &local_ip, bool re_use_port, uint32_t ssrc, bool only_audio,
uint16_t openRtpServer(
uint16_t local_port, const string &app, const string &stream_id, int tcp_mode, const string &local_ip, bool re_use_port, uint32_t ssrc, bool only_audio,
bool multiplex) {
lock_guard<recursive_mutex> lck(s_rtpServerMapMtx);
if (s_rtpServerMap.find(stream_id) != s_rtpServerMap.end()) {
Expand Down Expand Up @@ -1211,6 +1212,7 @@ void installWebApi() {
api_regist("/index/api/openRtpServerMultiplex", [](API_ARGS_MAP) {
CHECK_SECRET();
CHECK_ARGS("port", "stream_id");
auto app = allArgs["app"];
auto stream_id = allArgs["stream_id"];
auto tcp_mode = allArgs["tcp_mode"].as<int>();
if (allArgs["enable_tcp"].as<int>() && !tcp_mode) {
Expand All @@ -1219,7 +1221,7 @@ void installWebApi() {
}

auto port = openRtpServer(
allArgs["port"], stream_id, tcp_mode, "::", true, 0, allArgs["only_audio"].as<bool>(),true);
allArgs["port"], app, stream_id, tcp_mode, "::", true, 0, allArgs["only_audio"].as<bool>(),true);
if (port == 0) {
throw InvalidArgsException("该stream_id已存在");
}
Expand Down

0 comments on commit 45b48c1

Please sign in to comment.