#include "third_party/blink/public/platform/modules/video_capture/web_video_capture_impl_manager.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/ranges/algorithm.h"
#include "base/task/bind_post_task.h"
#include "base/task/single_thread_task_runner.h"
#include "base/token.h"
#include "media/capture/mojom/video_capture_types.mojom-blink.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
#include "third_party/blink/renderer/platform/video_capture/video_capture_impl.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_media.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
namespace blink {
media::VideoCaptureFormats ToVideoCaptureFormats(
const Vector<media::VideoCaptureFormat>& format_vector) { … }
void MediaCallbackCaller(VideoCaptureDeviceFormatsCB media_callback,
const Vector<media::VideoCaptureFormat>& formats) { … }
struct WebVideoCaptureImplManager::DeviceEntry { … };
WebVideoCaptureImplManager::WebVideoCaptureImplManager()
: … { … }
WebVideoCaptureImplManager::~WebVideoCaptureImplManager() { … }
base::OnceClosure WebVideoCaptureImplManager::UseDevice(
const media::VideoCaptureSessionId& id,
const BrowserInterfaceBrokerProxy& browser_interface_broker) { … }
base::OnceClosure WebVideoCaptureImplManager::StartCapture(
const media::VideoCaptureSessionId& id,
const media::VideoCaptureParams& params,
const VideoCaptureStateUpdateCB& state_update_cb,
const VideoCaptureDeliverFrameCB& deliver_frame_cb,
const VideoCaptureSubCaptureTargetVersionCB& sub_capture_target_version_cb,
const VideoCaptureNotifyFrameDroppedCB& frame_dropped_cb) { … }
void WebVideoCaptureImplManager::RequestRefreshFrame(
const media::VideoCaptureSessionId& id) { … }
void WebVideoCaptureImplManager::Suspend(
const media::VideoCaptureSessionId& id) { … }
void WebVideoCaptureImplManager::Resume(
const media::VideoCaptureSessionId& id) { … }
void WebVideoCaptureImplManager::GetDeviceSupportedFormats(
const media::VideoCaptureSessionId& id,
VideoCaptureDeviceFormatsCB callback) { … }
void WebVideoCaptureImplManager::GetDeviceFormatsInUse(
const media::VideoCaptureSessionId& id,
VideoCaptureDeviceFormatsCB callback) { … }
std::unique_ptr<VideoCaptureImpl>
WebVideoCaptureImplManager::CreateVideoCaptureImpl(
const media::VideoCaptureSessionId& session_id,
const BrowserInterfaceBrokerProxy& browser_interface_broker) const { … }
void WebVideoCaptureImplManager::StopCapture(
int client_id,
const media::VideoCaptureSessionId& id) { … }
void WebVideoCaptureImplManager::UnrefDevice(
const media::VideoCaptureSessionId& id) { … }
void WebVideoCaptureImplManager::SuspendDevices(
const MediaStreamDevices& video_devices,
bool suspend) { … }
void WebVideoCaptureImplManager::OnLog(const media::VideoCaptureSessionId& id,
const WebString& message) { … }
VideoCaptureFeedbackCB WebVideoCaptureImplManager::GetFeedbackCallback(
const media::VideoCaptureSessionId& id) const { … }
void WebVideoCaptureImplManager::ProcessFeedback(
VideoCaptureFeedbackCB callback_to_io_thread,
const media::VideoCaptureFeedback& feedback) { … }
void WebVideoCaptureImplManager::ProcessFeedbackInternal(
const media::VideoCaptureSessionId& id,
const media::VideoCaptureFeedback& feedback) { … }
}