优化代码

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 { namespace mediakit {
recursive_mutex s_media_source_mtx; static recursive_mutex s_media_source_mtx;
MediaSource::SchemaVhostAppStreamMap s_media_source_map; static MediaSource::SchemaVhostAppStreamMap s_media_source_map;
string getOriginTypeString(MediaOriginType type){ string getOriginTypeString(MediaOriginType type){
#define SWITCH_CASE(type) case MediaOriginType::type : return #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: public:
static MediaSource * const NullMediaSource; static MediaSource * const NullMediaSource;
using Ptr = std::shared_ptr<MediaSource>; using Ptr = std::shared_ptr<MediaSource>;
using StreamMap = unordered_map<string, weak_ptr<MediaSource> >; using StreamMap = unordered_map<string/*strema_id*/, weak_ptr<MediaSource> >;
using AppStreamMap = unordered_map<string, StreamMap>; using AppStreamMap = unordered_map<string/*app*/, StreamMap>;
using VhostAppStreamMap = unordered_map<string, AppStreamMap>; using VhostAppStreamMap = unordered_map<string/*vhost*/, AppStreamMap>;
using SchemaVhostAppStreamMap = unordered_map<string, VhostAppStreamMap>; using SchemaVhostAppStreamMap = unordered_map<string/*schema*/, VhostAppStreamMap>;
MediaSource(const string &schema, const string &vhost, const string &app, const string &stream_id) ; MediaSource(const string &schema, const string &vhost, const string &app, const string &stream_id) ;
virtual ~MediaSource(); virtual ~MediaSource();