mp4录制支持作为观看者参与播放人数统计 (#1880)

This commit is contained in:
Dw9
2022-08-16 11:47:24 +08:00
committed by GitHub
parent c19fa29e75
commit 30984d2076
7 changed files with 17 additions and 1 deletions

View File

@@ -26,14 +26,15 @@ ProtocolOption::ProtocolOption() {
GET_CONFIG(bool, s_to_mp4, General::kPublishToMP4);
GET_CONFIG(bool, s_enabel_audio, General::kEnableAudio);
GET_CONFIG(bool, s_add_mute_audio, General::kAddMuteAudio);
GET_CONFIG(bool, s_mp4_as_player, Record::kMP4AsPlayer);
GET_CONFIG(uint32_t, s_continue_push_ms, General::kContinuePushMS);
enable_hls = s_to_hls;
enable_mp4 = s_to_mp4;
enable_audio = s_enabel_audio;
add_mute_audio = s_add_mute_audio;
continue_push_ms = s_continue_push_ms;
mp4_as_player = s_mp4_as_player;
}
static std::shared_ptr<MediaSinkInterface> makeRecorder(MediaSource &sender, const vector<Track::Ptr> &tracks, Recorder::type type, const string &custom_path, size_t max_second){
@@ -75,6 +76,7 @@ static string getTrackInfoStr(const TrackSource *track_src){
}
MultiMediaSourceMuxer::MultiMediaSourceMuxer(const string &vhost, const string &app, const string &stream, float dur_sec, const ProtocolOption &option) {
_option = option;
_get_origin_url = [this, vhost, app, stream]() {
auto ret = getOriginUrl(*MediaSource::NullMediaSource);
if (!ret.empty()) {
@@ -146,6 +148,7 @@ int MultiMediaSourceMuxer::totalReaderCount() const {
#if defined(ENABLE_MP4)
(_fmp4 ? _fmp4->readerCount() : 0) +
#endif
(_mp4 ? _option.mp4_as_player : 0) +
(hls ? hls->readerCount() : 0);
#if defined(ENABLE_RTPPROXY)