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 3 // found in the LICENSE file. 4 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 6 #define CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 7 8 #include <string> 9 10 #include "content/common/content_export.h" 11 #include "content/common/media/media_stream_options.h" 12 13 namespace content { 14 15 // MediaStreamRequester must be implemented by the class requesting a new media 16 // stream to be opened. MediaStreamManager will use this interface to signal 17 // success and error for a request. 18 class CONTENT_EXPORT MediaStreamRequester { 19 public: 20 // Called as a reply of a successful call to GenerateStream. 21 virtual void StreamGenerated(const std::string& label, 22 const StreamDeviceInfoArray& audio_devices, 23 const StreamDeviceInfoArray& video_devices) = 0; 24 // Called if GenerateStream failed. 25 virtual void StreamGenerationFailed(const std::string& label) = 0; 26 27 // Called if stream has been stopped by user request. 28 virtual void StopGeneratedStream(const std::string& label) = 0; 29 30 // Called as a reply of a successful call to EnumerateDevices. 31 virtual void DevicesEnumerated(const std::string& label, 32 const StreamDeviceInfoArray& devices) = 0; 33 // Called as a reply of a successful call to OpenDevice. 34 virtual void DeviceOpened(const std::string& label, 35 const StreamDeviceInfo& device_info) = 0; 36 37 protected: 38 virtual ~MediaStreamRequester() { 39 } 40 }; 41 42 } // namespace content 43 44 #endif // CONTENT_BROWSER_RENDERER_HOST_MEDIA_MEDIA_STREAM_REQUESTER_H_ 45