Skip to content

Commit

Permalink
Avoid build warnings in the main code
Browse files Browse the repository at this point in the history
  • Loading branch information
xia-chu committed Mar 30, 2024
1 parent 0602cc0 commit af3ef99
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ if(UNIX)
set(COMPILE_OPTIONS_DEFAULT
"-fPIC"
"-Wall;-Wextra"
"-Wno-unused-function;-Wno-unused-parameter;-Wno-unused-variable"
"-Wno-unused-function;-Wno-unused-parameter;-Wno-unused-variable;-Wno-deprecated-declarations"
"-Wno-error=extra;-Wno-error=missing-field-initializers;-Wno-error=type-limits")

if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
Expand Down
10 changes: 5 additions & 5 deletions api/include/mk_events_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,11 @@ API_EXPORT void API_CALL mk_media_source_find(const char *schema,
void *user_data,
on_mk_media_source_find_cb cb);

API_EXPORT const mk_media_source API_CALL mk_media_source_find2(const char *schema,
const char *vhost,
const char *app,
const char *stream,
int from_mp4);
API_EXPORT mk_media_source API_CALL mk_media_source_find2(const char *schema,
const char *vhost,
const char *app,
const char *stream,
int from_mp4);
//MediaSource::for_each_media()
API_EXPORT void API_CALL mk_media_source_for_each(void *user_data, on_mk_media_source_find_cb cb, const char *schema,
const char *vhost, const char *app, const char *stream);
Expand Down
10 changes: 5 additions & 5 deletions api/source/mk_events_objects.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,11 @@ API_EXPORT void API_CALL mk_media_source_find(const char *schema,
cb(user_data, (mk_media_source)src.get());
}

API_EXPORT const mk_media_source API_CALL mk_media_source_find2(const char *schema,
const char *vhost,
const char *app,
const char *stream,
int from_mp4) {
API_EXPORT mk_media_source API_CALL mk_media_source_find2(const char *schema,
const char *vhost,
const char *app,
const char *stream,
int from_mp4) {
assert(schema && vhost && app && stream);
auto src = MediaSource::find(schema, vhost, app, stream, from_mp4);
return (mk_media_source)src.get();
Expand Down
4 changes: 2 additions & 2 deletions server/WebApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ void installWebApi() {
api_regist("/index/api/deleteRecordDirectory", [](API_ARGS_MAP) {
CHECK_SECRET();
CHECK_ARGS("vhost", "app", "stream", "period");
auto tuple = MediaTuple{allArgs["vhost"], allArgs["app"], allArgs["stream"]};
auto tuple = MediaTuple{allArgs["vhost"], allArgs["app"], allArgs["stream"], ""};
auto record_path = Recorder::getRecordPath(Recorder::type_mp4, tuple, allArgs["customized_path"]);
auto period = allArgs["period"];
record_path = record_path + period + "/";
Expand Down Expand Up @@ -1603,7 +1603,7 @@ void installWebApi() {
api_regist("/index/api/getMP4RecordFile", [](API_ARGS_MAP){
CHECK_SECRET();
CHECK_ARGS("vhost", "app", "stream");
auto tuple = MediaTuple{allArgs["vhost"], allArgs["app"], allArgs["stream"]};
auto tuple = MediaTuple{allArgs["vhost"], allArgs["app"], allArgs["stream"], ""};
auto record_path = Recorder::getRecordPath(Recorder::type_mp4, tuple, allArgs["customized_path"]);
auto period = allArgs["period"];

Expand Down
2 changes: 1 addition & 1 deletion src/Common/MediaSource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ ProtocolOption::ProtocolOption() {
//////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct MediaSourceNull : public MediaSource {
MediaSourceNull() : MediaSource("schema", MediaTuple{"vhost", "app", "stream"}) {};
MediaSourceNull() : MediaSource("schema", MediaTuple{"vhost", "app", "stream", ""}) {};
int readerCount() override { return 0; }
};

Expand Down
2 changes: 1 addition & 1 deletion src/Record/MP4Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ MP4Reader::MP4Reader(const std::string &vhost, const std::string &app, const std

void MP4Reader::setup(const std::string &vhost, const std::string &app, const std::string &stream_id, const std::string &file_path, const ProtocolOption &option, toolkit::EventPoller::Ptr poller) {
//读写文件建议放在后台线程
auto tuple = MediaTuple{vhost, app, stream_id};
auto tuple = MediaTuple{vhost, app, stream_id, ""};
_poller = poller ? std::move(poller) : WorkThreadPool::Instance().getPoller();
_file_path = file_path;
if (_file_path.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion src/Record/MP4Recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool MP4Recorder::inputFrame(const Frame::Ptr &frame) {
//b帧情况下dts时间戳可能回退
_last_dts = MAX(frame->dts(), _last_dts);
}
auto duration = 5; // 默认至少一帧5ms
auto duration = 5u; // 默认至少一帧5ms
if (frame->dts() > 0 && frame->dts() > _last_dts) {
duration = MAX(duration, frame->dts() - _last_dts);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_flv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using namespace mediakit;
class FlvSplitterImp : public FlvSplitter {
public:
FlvSplitterImp() {
_src = std::make_shared<RtmpMediaSourceImp>(MediaTuple{DEFAULT_VHOST, "live", "test"});
_src = std::make_shared<RtmpMediaSourceImp>(MediaTuple{DEFAULT_VHOST, "live", "test", ""});
}
~FlvSplitterImp() override = default;

Expand Down

0 comments on commit af3ef99

Please sign in to comment.