Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: webrtc/media/base/videobroadcaster.h

Issue 1765423005: Change VideoRtpReceiver to create remote VideoTrack and VideoTrackSource. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Fixed up the comments. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/videotracksource.cc ('k') | webrtc/media/base/videobroadcaster.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/base/videobroadcaster.h
diff --git a/webrtc/media/base/videobroadcaster.h b/webrtc/media/base/videobroadcaster.h
index 89c9f3dd49cbfbab58d11c6078c34606306d7ecb..b4227eaba6f314fe65f73492be7ae5d1b43ea4c8 100644
--- a/webrtc/media/base/videobroadcaster.h
+++ b/webrtc/media/base/videobroadcaster.h
@@ -14,6 +14,7 @@
#include <utility>
#include <vector>
+#include "webrtc/base/criticalsection.h"
#include "webrtc/base/thread_checker.h"
#include "webrtc/media/base/videoframe.h"
#include "webrtc/media/base/videosinkinterface.h"
@@ -21,6 +22,12 @@
namespace rtc {
+// VideoBroadcaster broadcast video frames to sinks and combines
+// VideoSinkWants from its sinks. It does that by implementing
+// rtc::VideoSourceInterface and rtc::VideoSinkInterface.
+// Sinks must be added and removed on one and only one thread.
+// Video frames can be broadcasted on any thread. I.e VideoBroadcaster::OnFrame
+// can be called on any thread.
class VideoBroadcaster : public VideoSourceInterface<cricket::VideoFrame>,
public VideoSinkInterface<cricket::VideoFrame> {
public:
@@ -46,13 +53,15 @@ class VideoBroadcaster : public VideoSourceInterface<cricket::VideoFrame>,
VideoSinkInterface<cricket::VideoFrame>* sink;
VideoSinkWants wants;
};
- SinkPair* FindSinkPair(const VideoSinkInterface<cricket::VideoFrame>* sink);
- void UpdateWants();
+ SinkPair* FindSinkPair(const VideoSinkInterface<cricket::VideoFrame>* sink)
+ EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
+ void UpdateWants() EXCLUSIVE_LOCKS_REQUIRED(sinks_and_wants_lock_);
ThreadChecker thread_checker_;
+ rtc::CriticalSection sinks_and_wants_lock_;
- VideoSinkWants current_wants_;
- std::vector<SinkPair> sinks_;
+ VideoSinkWants current_wants_ GUARDED_BY(sinks_and_wants_lock_);
+ std::vector<SinkPair> sinks_ GUARDED_BY(sinks_and_wants_lock_);
};
} // namespace rtc
« no previous file with comments | « webrtc/api/videotracksource.cc ('k') | webrtc/media/base/videobroadcaster.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698