优化代码

This commit is contained in:
xiongziliang 2021-09-28 22:42:13 +08:00
parent 305d9bc259
commit 7d1b2583e6
2 changed files with 6 additions and 6 deletions

View File

@ -21,8 +21,8 @@ namespace toolkit {
namespace mediakit {
recursive_mutex s_media_source_mtx;
MediaSource::SchemaVhostAppStreamMap s_media_source_map;
static recursive_mutex s_media_source_mtx;
static MediaSource::SchemaVhostAppStreamMap s_media_source_map;
string getOriginTypeString(MediaOriginType type){
#define SWITCH_CASE(type) case MediaOriginType::type : return #type

View File

@ -200,10 +200,10 @@ class MediaSource: public TrackSource, public enable_shared_from_this<MediaSourc
public:
static MediaSource * const NullMediaSource;
using Ptr = std::shared_ptr<MediaSource>;
using StreamMap = unordered_map<string, weak_ptr<MediaSource> >;
using AppStreamMap = unordered_map<string, StreamMap>;
using VhostAppStreamMap = unordered_map<string, AppStreamMap>;
using SchemaVhostAppStreamMap = unordered_map<string, VhostAppStreamMap>;
using StreamMap = unordered_map<string/*strema_id*/, weak_ptr<MediaSource> >;
using AppStreamMap = unordered_map<string/*app*/, StreamMap>;
using VhostAppStreamMap = unordered_map<string/*vhost*/, AppStreamMap>;
using SchemaVhostAppStreamMap = unordered_map<string/*schema*/, VhostAppStreamMap>;
MediaSource(const string &schema, const string &vhost, const string &app, const string &stream_id) ;
virtual ~MediaSource();