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

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

Issue 9284020: Enabling usage of native PeerConnection v2 in libjingle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_IMPL_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_ 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_
7 7
8 #include <map>
8 #include <string> 9 #include <string>
9 10
10 #include "content/renderer/media/media_stream_impl.h" 11 #include "content/renderer/media/media_stream_impl.h"
11 12
12 class MockMediaStreamImpl : public MediaStreamImpl { 13 class MockMediaStreamImpl : public MediaStreamImpl {
13 public: 14 public:
14 MockMediaStreamImpl(); 15 MockMediaStreamImpl();
15 virtual ~MockMediaStreamImpl(); 16 virtual ~MockMediaStreamImpl();
16 17
17 virtual WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler( 18 virtual WebKit::WebPeerConnectionHandler* CreatePeerConnectionHandler(
18 WebKit::WebPeerConnectionHandlerClient* client) OVERRIDE; 19 WebKit::WebPeerConnectionHandlerClient* client) OVERRIDE;
19 virtual void ClosePeerConnection() OVERRIDE; 20 virtual void ClosePeerConnection() OVERRIDE;
20 // Returns true if created successfully or already exists, false otherwise. 21 virtual webrtc::MediaStreamTrackInterface* GetLocalMediaStreamTrack(
21 virtual bool SetVideoCaptureModule(const std::string& label) OVERRIDE; 22 std::string label) OVERRIDE;
tommi (sloooow) - chröme 2012/01/24 15:18:56 change the interface to pass |label| by ref
Henrik Grunell 2012/01/26 13:03:16 Done.
22 23
23 // Implement webkit_glue::MediaStreamClient. 24 // Implement webkit_glue::MediaStreamClient.
24 virtual scoped_refptr<media::VideoDecoder> GetVideoDecoder( 25 virtual scoped_refptr<media::VideoDecoder> GetVideoDecoder(
25 const GURL& url, 26 const GURL& url,
26 media::MessageLoopFactory* message_loop_factory) OVERRIDE; 27 media::MessageLoopFactory* message_loop_factory) OVERRIDE;
27 28
28 // Implement MediaStreamDispatcherEventHandler. 29 // Implement MediaStreamDispatcherEventHandler.
29 virtual void OnStreamGenerated( 30 virtual void OnStreamGenerated(
30 int request_id, 31 int request_id,
31 const std::string& label, 32 const std::string& label,
32 const media_stream::StreamDeviceInfoArray& audio_array, 33 const media_stream::StreamDeviceInfoArray& audio_array,
33 const media_stream::StreamDeviceInfoArray& video_array) OVERRIDE; 34 const media_stream::StreamDeviceInfoArray& video_array) OVERRIDE;
34 virtual void OnStreamGenerationFailed(int request_id) OVERRIDE; 35 virtual void OnStreamGenerationFailed(int request_id) OVERRIDE;
35 virtual void OnVideoDeviceFailed( 36 virtual void OnVideoDeviceFailed(
36 const std::string& label, 37 const std::string& label,
37 int index) OVERRIDE; 38 int index) OVERRIDE;
38 virtual void OnAudioDeviceFailed( 39 virtual void OnAudioDeviceFailed(
39 const std::string& label, 40 const std::string& label,
40 int index) OVERRIDE; 41 int index) OVERRIDE;
41 42
42 const std::string& video_label() const { return video_label_; } 43 void AddTrack(std::string label, webrtc::MediaStreamTrackInterface* track);
tommi (sloooow) - chröme 2012/01/24 15:18:56 label should be passed by ref
Henrik Grunell 2012/01/26 13:03:16 Done.
44
45 const std::string& get_track_label() const { return get_track_label_; }
43 46
44 private: 47 private:
45 std::string video_label_; 48 std::string get_track_label_;
tommi (sloooow) - chröme 2012/01/24 15:18:56 get_track_label_ feels like a method name, not var
Henrik Grunell 2012/01/26 13:03:16 Not used anymore, removed.
49 typedef std::map<std::string, webrtc::MediaStreamTrackInterface*>
50 MockMediaStreamTrackPtrMap;
51 MockMediaStreamTrackPtrMap mock_local_tracks_;
46 52
47 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamImpl); 53 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamImpl);
48 }; 54 };
49 55
50 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_ 56 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698