
explicit. This change refactors the media stream generation to a) pair video devices and audio devices in one structure (before in separate lists) and b) make it explicit that at most one audio device and one video device can be used in a stream. Bug: 1313021 Change-Id: Ie25c97d9e0ca89d5c14e07ab0889519abcefe86d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3575315 Reviewed-by: David Bertoni <dbertoni@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Reviewed-by: Michael Bai <michaelbai@chromium.org> Reviewed-by: Elad Alon <eladalon@chromium.org> Reviewed-by: Vasilii Sukhanov <vasilii@chromium.org> Reviewed-by: Dan H <harringtond@chromium.org> Reviewed-by: Sean Topping <seantopping@chromium.org> Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org> Commit-Queue: Simon Hangl <simonha@google.com> Reviewed-by: Henrik Boström <hbos@chromium.org> Reviewed-by: Evan Stade <estade@chromium.org> Reviewed-by: Fabrice de Gans <fdegans@chromium.org> Cr-Commit-Position: refs/heads/main@{#999765}
41 lines
1.6 KiB
C++
41 lines
1.6 KiB
C++
// Copyright 2020 The Chromium Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef COMPONENTS_WEBRTC_MEDIA_STREAM_DEVICE_ENUMERATOR_IMPL_H_
|
|
#define COMPONENTS_WEBRTC_MEDIA_STREAM_DEVICE_ENUMERATOR_IMPL_H_
|
|
|
|
#include "components/webrtc/media_stream_device_enumerator.h"
|
|
#include "third_party/blink/public/mojom/mediastream/media_stream.mojom-forward.h"
|
|
|
|
namespace webrtc {
|
|
|
|
// A default MediaStreamDeviceEnumerator that passes through to
|
|
// content::MediaCaptureDevices.
|
|
class MediaStreamDeviceEnumeratorImpl : public MediaStreamDeviceEnumerator {
|
|
public:
|
|
MediaStreamDeviceEnumeratorImpl() = default;
|
|
MediaStreamDeviceEnumeratorImpl(const MediaStreamDeviceEnumeratorImpl&) =
|
|
delete;
|
|
MediaStreamDeviceEnumeratorImpl& operator=(MediaStreamDeviceEnumeratorImpl&) =
|
|
delete;
|
|
~MediaStreamDeviceEnumeratorImpl() override = default;
|
|
|
|
// MediaStreamDeviceEnumerator:
|
|
const blink::MediaStreamDevices& GetAudioCaptureDevices() const override;
|
|
const blink::MediaStreamDevices& GetVideoCaptureDevices() const override;
|
|
void GetDefaultDevicesForBrowserContext(
|
|
content::BrowserContext* context,
|
|
bool audio,
|
|
bool video,
|
|
blink::mojom::StreamDevices& devices) override;
|
|
const blink::MediaStreamDevice* GetRequestedAudioDevice(
|
|
const std::string& requested_audio_device_id) override;
|
|
const blink::MediaStreamDevice* GetRequestedVideoDevice(
|
|
const std::string& requested_video_device_id) override;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // COMPONENTS_WEBRTC_MEDIA_STREAM_DEVICE_ENUMERATOR_IMPL_H_
|