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

Unified Diff: webrtc/api/videotracksource.h

Issue 1773993002: Add VideoTrackSource implementation. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed 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/videosourceproxy.h ('k') | webrtc/api/videotracksource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/videotracksource.h
diff --git a/webrtc/api/videotracksource.h b/webrtc/api/videotracksource.h
index a1340acf343bd976e6be07fa8efdd829fc8fbe0a..59dae42950b9597d958190dc5e2c980646940263 100644
--- a/webrtc/api/videotracksource.h
+++ b/webrtc/api/videotracksource.h
@@ -11,7 +11,45 @@
#ifndef WEBRTC_API_VIDEOTRACKSOURCE_H_
#define WEBRTC_API_VIDEOTRACKSOURCE_H_
-// TODO(perkj): This file is added to prepare for splitting VideoSource
-// into two parts, VideoCapturerTrackSource that will inherit VideoTrackSource.
+#include "webrtc/api/notifier.h"
+#include "webrtc/api/videosourceinterface.h"
+#include "webrtc/media/base/mediachannel.h"
+#include "webrtc/media/base/videosinkinterface.h"
+
+// VideoTrackSource implements VideoTrackSourceInterface.
+namespace webrtc {
+
+class VideoTrackSource : public Notifier<VideoTrackSourceInterface> {
+ public:
+ VideoTrackSource(rtc::VideoSourceInterface<cricket::VideoFrame>* source,
+ rtc::Thread* worker_thread,
+ bool remote);
+
+ void SetState(SourceState new_state);
+ SourceState state() const override { return state_; }
+ bool remote() const override { return remote_; }
+
+ void Stop() override{};
+ void Restart() override{};
+
+ virtual bool is_screencast() const { return false; };
+ virtual bool needs_denoising() const { return false; };
+
+ void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
+ const rtc::VideoSinkWants& wants) override;
+ void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
+
+ protected:
+ rtc::Thread* worker_thread() { return worker_thread_; }
+
+ private:
+ rtc::VideoSourceInterface<cricket::VideoFrame>* source_;
+ rtc::Thread* worker_thread_;
+ cricket::VideoOptions options_;
+ SourceState state_;
+ const bool remote_;
+};
+
+} // namespace webrtc
#endif // WEBRTC_API_VIDEOTRACKSOURCE_H_
« no previous file with comments | « webrtc/api/videosourceproxy.h ('k') | webrtc/api/videotracksource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698