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

Side by Side Diff: content/renderer/media/mock_media_stream_dependency_factory.h

Issue 9284020: Enabling usage of native PeerConnection v2 in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
7 7
8 #include <string>
9 #include <vector>
10
8 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
9 #include "content/renderer/media/media_stream_dependency_factory.h" 12 #include "content/renderer/media/media_stream_dependency_factory.h"
10 13
14 namespace webrtc {
15
16 class MockLocalVideoTrack : public LocalVideoTrackInterface {
17 public:
18 explicit MockLocalVideoTrack(std::string label)
19 : enabled_(false),
20 label_(label),
21 renderer_(NULL) {
22 }
23 virtual cricket::VideoCapturer* GetVideoCapture() OVERRIDE;
24 virtual void SetRenderer(VideoRendererWrapperInterface* renderer) OVERRIDE;
25 virtual VideoRendererWrapperInterface* GetRenderer() OVERRIDE;
26 virtual std::string kind() const OVERRIDE;
27 virtual std::string label() const OVERRIDE;
28 virtual bool enabled() const OVERRIDE;
29 virtual TrackState state() const OVERRIDE;
30 virtual bool set_enabled(bool enable) OVERRIDE;
31 virtual bool set_state(TrackState new_state) OVERRIDE;
32 virtual void RegisterObserver(ObserverInterface* observer) OVERRIDE;
33 virtual void UnregisterObserver(ObserverInterface* observer) OVERRIDE;
34
35 VideoRendererWrapperInterface* renderer() const { return renderer_; }
36
37 protected:
38 virtual ~MockLocalVideoTrack() {}
39
40 private:
41 bool enabled_;
42 std::string label_;
43 VideoRendererWrapperInterface* renderer_;
44 };
45
46 } // namespace webrtc
47
11 // A mock factory for creating different objects for MediaStreamImpl. 48 // A mock factory for creating different objects for MediaStreamImpl.
12 class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory { 49 class MockMediaStreamDependencyFactory : public MediaStreamDependencyFactory {
13 public: 50 public:
14 MockMediaStreamDependencyFactory(); 51 MockMediaStreamDependencyFactory();
15 virtual ~MockMediaStreamDependencyFactory(); 52 virtual ~MockMediaStreamDependencyFactory();
16 53
17 virtual cricket::WebRtcMediaEngine* CreateWebRtcMediaEngine() OVERRIDE;
18 virtual bool CreatePeerConnectionFactory( 54 virtual bool CreatePeerConnectionFactory(
19 cricket::MediaEngineInterface* media_engine, 55 talk_base::Thread* worker_thread,
20 talk_base::Thread* worker_thread) OVERRIDE; 56 talk_base::Thread* signaling_thread,
21 virtual void DeletePeerConnectionFactory() OVERRIDE;
22 virtual bool PeerConnectionFactoryCreated() OVERRIDE;
23 virtual cricket::PortAllocator* CreatePortAllocator(
24 content::P2PSocketDispatcher* socket_dispatcher, 57 content::P2PSocketDispatcher* socket_dispatcher,
25 talk_base::NetworkManager* network_manager, 58 talk_base::NetworkManager* network_manager,
26 talk_base::PacketSocketFactory* socket_factory, 59 talk_base::PacketSocketFactory* socket_factory) OVERRIDE;
27 const webkit_glue::P2PTransport::Config& config) OVERRIDE; 60 virtual void ReleasePeerConnectionFactory() OVERRIDE;
28 virtual webrtc::PeerConnection* CreatePeerConnection( 61 virtual bool PeerConnectionFactoryCreated() OVERRIDE;
29 cricket::PortAllocator* port_allocator, 62 virtual talk_base::scoped_refptr<webrtc::PeerConnectionInterface>
30 talk_base::Thread* signaling_thread) OVERRIDE; 63 CreatePeerConnection(
64 const std::string& config,
65 webrtc::PeerConnectionObserver* observer) OVERRIDE;
66 virtual talk_base::scoped_refptr<webrtc::LocalMediaStreamInterface>
67 CreateLocalMediaStream(const std::string& label) OVERRIDE;
68 virtual talk_base::scoped_refptr<webrtc::LocalVideoTrackInterface>
69 CreateLocalVideoTrack(
70 const std::string& label,
71 cricket::VideoCapturer* video_device) OVERRIDE;
72 virtual talk_base::scoped_refptr<webrtc::LocalAudioTrackInterface>
73 CreateLocalAudioTrack(
74 const std::string& label,
75 webrtc::AudioDeviceModule* audio_device) OVERRIDE;
31 76
32 private: 77 private:
33 bool mock_pc_factory_created_; 78 bool mock_pc_factory_created_;
34 scoped_ptr<cricket::MediaEngineInterface> media_engine_;
35 79
36 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory); 80 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDependencyFactory);
37 }; 81 };
38 82
39 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_ 83 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DEPENDENCY_FACTORY_H_
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_impl.cc ('k') | content/renderer/media/mock_media_stream_dependency_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698