| OLD | NEW |
| 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 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 | 19 |
| 20 class WebAudioCapturerSource; | 20 class WebAudioCapturerSource; |
| 21 typedef std::set<webrtc::ObserverInterface*> ObserverSet; | 21 typedef std::set<webrtc::ObserverInterface*> ObserverSet; |
| 22 | 22 |
| 23 class MockVideoRenderer : public cricket::VideoRenderer { | 23 class MockVideoRenderer : public cricket::VideoRenderer { |
| 24 public: | 24 public: |
| 25 MockVideoRenderer(); | 25 MockVideoRenderer(); |
| 26 ~MockVideoRenderer() override; | 26 ~MockVideoRenderer() override; |
| 27 bool SetSize(int width, int height, int reserved) override; | |
| 28 bool RenderFrame(const cricket::VideoFrame* frame) override; | 27 bool RenderFrame(const cricket::VideoFrame* frame) override; |
| 29 | 28 |
| 30 int width() const { return width_; } | |
| 31 int height() const { return height_; } | |
| 32 int num() const { return num_; } | 29 int num() const { return num_; } |
| 33 | 30 |
| 34 private: | 31 private: |
| 35 int width_; | |
| 36 int height_; | |
| 37 int num_; | 32 int num_; |
| 38 }; | 33 }; |
| 39 | 34 |
| 40 class MockVideoSource : public webrtc::VideoSourceInterface { | 35 class MockVideoSource : public webrtc::VideoSourceInterface { |
| 41 public: | 36 public: |
| 42 MockVideoSource(bool remote); | 37 MockVideoSource(bool remote); |
| 43 | 38 |
| 44 void RegisterObserver(webrtc::ObserverInterface* observer) override; | 39 void RegisterObserver(webrtc::ObserverInterface* observer) override; |
| 45 void UnregisterObserver(webrtc::ObserverInterface* observer) override; | 40 void UnregisterObserver(webrtc::ObserverInterface* observer) override; |
| 46 MediaSourceInterface::SourceState state() const override; | 41 MediaSourceInterface::SourceState state() const override; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 bool fail_to_create_next_audio_capturer_; | 224 bool fail_to_create_next_audio_capturer_; |
| 230 scoped_refptr <MockAudioSource> last_audio_source_; | 225 scoped_refptr <MockAudioSource> last_audio_source_; |
| 231 scoped_refptr <MockVideoSource> last_video_source_; | 226 scoped_refptr <MockVideoSource> last_video_source_; |
| 232 | 227 |
| 233 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory); | 228 DISALLOW_COPY_AND_ASSIGN(MockPeerConnectionDependencyFactory); |
| 234 }; | 229 }; |
| 235 | 230 |
| 236 } // namespace content | 231 } // namespace content |
| 237 | 232 |
| 238 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY
_H_ | 233 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_MOCK_PEER_CONNECTION_DEPENDENCY_FACTORY
_H_ |
| OLD | NEW |