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

Side by Side Diff: content/renderer/media/webrtc/mock_peer_connection_dependency_factory.h

Issue 1660483002: Make MockVideoSource use rtc::VideoSinkInterface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | content/renderer/media/webrtc/mock_peer_connection_dependency_factory.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 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 14 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
15 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h" 15 #include "third_party/libjingle/source/talk/app/webrtc/mediaconstraintsinterface .h"
16 #include "third_party/libjingle/source/talk/media/base/videorenderer.h" 16 #include "third_party/libjingle/source/talk/media/base/videorenderer.h"
17 #include "third_party/webrtc/media/base/videosinkinterface.h"
17 18
18 namespace content { 19 namespace content {
19 20
20 class WebAudioCapturerSource; 21 class WebAudioCapturerSource;
21 typedef std::set<webrtc::ObserverInterface*> ObserverSet; 22 typedef std::set<webrtc::ObserverInterface*> ObserverSet;
22 23
23 class MockVideoRenderer : public cricket::VideoRenderer { 24 class MockVideoRenderer : public cricket::VideoRenderer {
24 public: 25 public:
25 MockVideoRenderer(); 26 MockVideoRenderer();
26 ~MockVideoRenderer() override; 27 ~MockVideoRenderer() override;
27 bool RenderFrame(const cricket::VideoFrame* frame) override; 28 bool RenderFrame(const cricket::VideoFrame* frame) override;
28 29
29 int num() const { return num_; } 30 int num() const { return num_; }
30 31
31 private: 32 private:
32 int num_; 33 int num_;
33 }; 34 };
34 35
35 class MockVideoSource : public webrtc::VideoSourceInterface { 36 class MockVideoSource : public webrtc::VideoSourceInterface {
36 public: 37 public:
37 MockVideoSource(bool remote); 38 MockVideoSource(bool remote);
38 39
39 void RegisterObserver(webrtc::ObserverInterface* observer) override; 40 void RegisterObserver(webrtc::ObserverInterface* observer) override;
40 void UnregisterObserver(webrtc::ObserverInterface* observer) override; 41 void UnregisterObserver(webrtc::ObserverInterface* observer) override;
41 MediaSourceInterface::SourceState state() const override; 42 MediaSourceInterface::SourceState state() const override;
42 bool remote() const override; 43 bool remote() const override;
43 cricket::VideoCapturer* GetVideoCapturer() override; 44 cricket::VideoCapturer* GetVideoCapturer() override;
44 void AddSink(cricket::VideoRenderer* output) override; 45 void AddSink(rtc::VideoSinkInterface<cricket::VideoFrame>* output) override;
45 void RemoveSink(cricket::VideoRenderer* output) override; 46 void RemoveSink(
47 rtc::VideoSinkInterface<cricket::VideoFrame>* output) override;
46 cricket::VideoRenderer* FrameInput() override; 48 cricket::VideoRenderer* FrameInput() override;
47 const cricket::VideoOptions* options() const override; 49 const cricket::VideoOptions* options() const override;
48 void Stop() override; 50 void Stop() override;
49 void Restart() override; 51 void Restart() override;
50 52
51 // Changes the state of the source to live and notifies the observer. 53 // Changes the state of the source to live and notifies the observer.
52 void SetLive(); 54 void SetLive();
53 // Changes the state of the source to ended and notifies the observer. 55 // Changes the state of the source to ended and notifies the observer.
54 void SetEnded(); 56 void SetEnded();
55 // Set the video capturer. 57 // Set the video capturer.
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 bool fail_to_create_next_audio_capturer_; 226 bool fail_to_create_next_audio_capturer_;
225 scoped_refptr <MockAudioSource> last_audio_source_; 227 scoped_refptr <MockAudioSource> last_audio_source_;
226 scoped_refptr <MockVideoSource> last_video_source_; 228 scoped_refptr <MockVideoSource> last_video_source_;
227 229
228 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory); 230 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory);
229 }; 231 };
230 232
231 } // namespace content 233 } // namespace content
232 234
233 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY _H_ 235 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY _H_
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/webrtc/mock_peer_connection_dependency_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698