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

Side by Side Diff: webrtc/api/videotracksource.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 unified diff | Download patch
« no previous file with comments | « webrtc/api/videotrack_unittest.cc ('k') | webrtc/api/videotracksource.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_API_VIDEOTRACKSOURCE_H_ 11 #ifndef WEBRTC_API_VIDEOTRACKSOURCE_H_
12 #define WEBRTC_API_VIDEOTRACKSOURCE_H_ 12 #define WEBRTC_API_VIDEOTRACKSOURCE_H_
13 13
14 #include "webrtc/api/notifier.h" 14 #include "webrtc/api/notifier.h"
15 #include "webrtc/api/videosourceinterface.h" 15 #include "webrtc/api/videosourceinterface.h"
16 #include "webrtc/media/base/mediachannel.h" 16 #include "webrtc/media/base/mediachannel.h"
17 #include "webrtc/media/base/videosinkinterface.h" 17 #include "webrtc/media/base/videosinkinterface.h"
18 18
19 // VideoTrackSource implements VideoTrackSourceInterface. 19 // VideoTrackSource implements VideoTrackSourceInterface.
20 namespace webrtc { 20 namespace webrtc {
21 21
22 class VideoTrackSource : public Notifier<VideoTrackSourceInterface> { 22 class VideoTrackSource : public Notifier<VideoTrackSourceInterface> {
23 public: 23 public:
24 VideoTrackSource(rtc::VideoSourceInterface<cricket::VideoFrame>* source, 24 VideoTrackSource(rtc::VideoSourceInterface<cricket::VideoFrame>* source,
25 rtc::Thread* worker_thread, 25 rtc::Thread* worker_thread,
26 bool remote); 26 bool remote);
27 void SetState(SourceState new_state);
28 // OnSourceDestroyed clears this instance pointer to |source_|. It is useful
29 // when the underlying rtc::VideoSourceInterface is destroyed before the
30 // reference counted VideoTrackSource.
31 void OnSourceDestroyed();
27 32
28 void SetState(SourceState new_state);
29 SourceState state() const override { return state_; } 33 SourceState state() const override { return state_; }
30 bool remote() const override { return remote_; } 34 bool remote() const override { return remote_; }
31 35
32 void Stop() override{}; 36 void Stop() override{};
33 void Restart() override{}; 37 void Restart() override{};
34 38
35 virtual bool is_screencast() const { return false; }; 39 virtual bool is_screencast() const { return false; }
36 virtual bool needs_denoising() const { return false; }; 40 virtual bool needs_denoising() const { return false; }
37 41
38 void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink, 42 void AddOrUpdateSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink,
39 const rtc::VideoSinkWants& wants) override; 43 const rtc::VideoSinkWants& wants) override;
40 void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override; 44 void RemoveSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink) override;
41 45
46 cricket::VideoCapturer* GetVideoCapturer() override { return nullptr; }
47
42 protected: 48 protected:
43 rtc::Thread* worker_thread() { return worker_thread_; } 49 rtc::Thread* worker_thread() { return worker_thread_; }
44 50
45 private: 51 private:
46 rtc::VideoSourceInterface<cricket::VideoFrame>* source_; 52 rtc::VideoSourceInterface<cricket::VideoFrame>* source_;
47 rtc::Thread* worker_thread_; 53 rtc::Thread* worker_thread_;
48 cricket::VideoOptions options_; 54 cricket::VideoOptions options_;
49 SourceState state_; 55 SourceState state_;
50 const bool remote_; 56 const bool remote_;
51 }; 57 };
52 58
53 } // namespace webrtc 59 } // namespace webrtc
54 60
55 #endif // WEBRTC_API_VIDEOTRACKSOURCE_H_ 61 #endif // WEBRTC_API_VIDEOTRACKSOURCE_H_
OLDNEW
« no previous file with comments | « webrtc/api/videotrack_unittest.cc ('k') | webrtc/api/videotracksource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698