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

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

Issue 312773002: Support for audio output devices for getMediaDevices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test case for group ID in unit test. Created 6 years, 6 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_DISPATCHER_H_ 5 #ifndef CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ 6 #define CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "content/renderer/media/media_stream_dispatcher.h" 10 #include "content/renderer/media/media_stream_dispatcher.h"
(...skipping 19 matching lines...) Expand all
30 virtual void EnumerateDevices( 30 virtual void EnumerateDevices(
31 int request_id, 31 int request_id,
32 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler, 32 const base::WeakPtr<MediaStreamDispatcherEventHandler>& event_handler,
33 MediaStreamType type, 33 MediaStreamType type,
34 const GURL& security_origin) OVERRIDE; 34 const GURL& security_origin) OVERRIDE;
35 virtual void StopStreamDevice(const StreamDeviceInfo& device_info) OVERRIDE; 35 virtual void StopStreamDevice(const StreamDeviceInfo& device_info) OVERRIDE;
36 virtual bool IsStream(const std::string& label) OVERRIDE; 36 virtual bool IsStream(const std::string& label) OVERRIDE;
37 virtual int video_session_id(const std::string& label, int index) OVERRIDE; 37 virtual int video_session_id(const std::string& label, int index) OVERRIDE;
38 virtual int audio_session_id(const std::string& label, int index) OVERRIDE; 38 virtual int audio_session_id(const std::string& label, int index) OVERRIDE;
39 39
40 int audio_request_id() const { return audio_request_id_; } 40 int audio_input_request_id() const { return audio_input_request_id_; }
41 int audio_output_request_id() const { return audio_output_request_id_; }
41 int video_request_id() const { return video_request_id_; } 42 int video_request_id() const { return video_request_id_; }
42 int request_stream_counter() const { return request_stream_counter_; } 43 int request_stream_counter() const { return request_stream_counter_; }
43 void IncrementSessionId() { ++session_id_; } 44 void IncrementSessionId() { ++session_id_; }
44 45
45 int stop_audio_device_counter() const { return stop_audio_device_counter_; } 46 int stop_audio_device_counter() const { return stop_audio_device_counter_; }
46 int stop_video_device_counter() const { return stop_video_device_counter_; } 47 int stop_video_device_counter() const { return stop_video_device_counter_; }
47 48
48 const std::string& stream_label() const { return stream_label_;} 49 const std::string& stream_label() const { return stream_label_;}
49 StreamDeviceInfoArray audio_array() const { return audio_array_; } 50 StreamDeviceInfoArray audio_input_array() const { return audio_input_array_; }
tommi (sloooow) - chröme 2014/06/03 16:42:42 return by const&? (is it necessary to create a cop
tommi (sloooow) - chröme 2014/06/03 16:42:42 return by const&?
Henrik Grunell 2014/06/03 16:58:10 No, not necessary. Changed for all three functions
Henrik Grunell 2014/06/03 16:58:10 Done.
51 StreamDeviceInfoArray audio_output_array() const {
52 return audio_output_array_;
53 }
50 StreamDeviceInfoArray video_array() const { return video_array_; } 54 StreamDeviceInfoArray video_array() const { return video_array_; }
51 55
52 private: 56 private:
53 void AddAudioDeviceToArray(); 57 void AddAudioInputDeviceToArray(bool matched_output);
58 void AddAudioOutputDeviceToArray();
54 void AddVideoDeviceToArray(); 59 void AddVideoDeviceToArray();
55 60
56 int audio_request_id_; 61 int audio_input_request_id_;
62 int audio_output_request_id_; // Only used for EnumerateDevices.
57 int video_request_id_; // Only used for EnumerateDevices. 63 int video_request_id_; // Only used for EnumerateDevices.
58 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_; 64 base::WeakPtr<MediaStreamDispatcherEventHandler> event_handler_;
59 int request_stream_counter_; 65 int request_stream_counter_;
60 int stop_audio_device_counter_; 66 int stop_audio_device_counter_;
61 int stop_video_device_counter_; 67 int stop_video_device_counter_;
62 68
63 std::string stream_label_; 69 std::string stream_label_;
64 int session_id_; 70 int session_id_;
65 StreamDeviceInfoArray audio_array_; 71 StreamDeviceInfoArray audio_input_array_;
72 StreamDeviceInfoArray audio_output_array_;
66 StreamDeviceInfoArray video_array_; 73 StreamDeviceInfoArray video_array_;
67 74
68 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher); 75 DISALLOW_COPY_AND_ASSIGN(MockMediaStreamDispatcher);
69 }; 76 };
70 77
71 } // namespace content 78 } // namespace content
72 79
73 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_ 80 #endif // CONTENT_RENDERER_MEDIA_MOCK_MEDIA_STREAM_DISPATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698