#include "third_party/blink/renderer/modules/mediastream/apply_constraints_processor.h"
#include <utility>
#include "base/location.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/trace_event.h"
#include "third_party/blink/public/mojom/mediastream/media_devices.mojom-blink.h"
#include "third_party/blink/public/platform/modules/mediastream/web_media_stream_track.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/modules/mediastream/media_stream_video_source.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_audio.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_content.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_constraints_util_video_device.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_utils.h"
#include "third_party/blink/renderer/modules/mediastream/media_stream_video_track.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_audio_source.h"
#include "third_party/blink/renderer/platform/mediastream/media_stream_source.h"
#include "third_party/blink/renderer/platform/wtf/functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
namespace {
void RequestFailed(blink::ApplyConstraintsRequest* request,
const String& constraint,
const String& message) { … }
void RequestSucceeded(blink::ApplyConstraintsRequest* request) { … }
}
BASE_FEATURE(…);
ApplyConstraintsProcessor::ApplyConstraintsProcessor(
LocalFrame* frame,
MediaDevicesDispatcherCallback media_devices_dispatcher_cb,
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: … { … }
ApplyConstraintsProcessor::~ApplyConstraintsProcessor() { … }
void ApplyConstraintsProcessor::ProcessRequest(
blink::ApplyConstraintsRequest* request,
base::OnceClosure callback) { … }
void ApplyConstraintsProcessor::ProcessAudioRequest() { … }
void ApplyConstraintsProcessor::ProcessVideoRequest() { … }
void ApplyConstraintsProcessor::ProcessVideoDeviceRequest() { … }
void ApplyConstraintsProcessor::ProcessVideoContentRequest() { … }
void ApplyConstraintsProcessor::MaybeStopVideoDeviceSourceForRestart(
const Vector<media::VideoCaptureFormat>& formats) { … }
void ApplyConstraintsProcessor::MaybeStopVideoContentSourceForRestart() { … }
void ApplyConstraintsProcessor::MaybeDeviceSourceStoppedForRestart(
blink::MediaStreamVideoSource::RestartResult result) { … }
void ApplyConstraintsProcessor::MaybeRestartStoppedVideoContentSource(
blink::MediaStreamVideoSource::RestartResult result) { … }
void ApplyConstraintsProcessor::FindNewFormatAndRestartDeviceSource(
const Vector<media::VideoCaptureFormat>& formats) { … }
void ApplyConstraintsProcessor::MaybeSourceRestarted(
blink::MediaStreamVideoSource::RestartResult result) { … }
void ApplyConstraintsProcessor::FinalizeVideoRequest() { … }
blink::VideoCaptureSettings
ApplyConstraintsProcessor::SelectVideoDeviceSettings(
Vector<media::VideoCaptureFormat> formats) { … }
blink::VideoCaptureSettings
ApplyConstraintsProcessor::SelectVideoContentSettings() { … }
blink::MediaStreamAudioSource*
ApplyConstraintsProcessor::GetCurrentAudioSource() { … }
blink::MediaStreamVideoTrack*
ApplyConstraintsProcessor::GetCurrentVideoTrack() { … }
blink::MediaStreamVideoSource*
ApplyConstraintsProcessor::GetCurrentVideoSource() { … }
bool ApplyConstraintsProcessor::AbortIfVideoRequestStateInvalid() { … }
void ApplyConstraintsProcessor::ApplyConstraintsSucceeded() { … }
void ApplyConstraintsProcessor::ApplyConstraintsFailed(
const char* failed_constraint_name) { … }
void ApplyConstraintsProcessor::CannotApplyConstraints(const String& message) { … }
void ApplyConstraintsProcessor::CleanupRequest(
base::OnceClosure user_media_request_callback) { … }
blink::mojom::blink::MediaDevicesDispatcherHost*
ApplyConstraintsProcessor::GetMediaDevicesDispatcher() { … }
}