#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "media/cdm/library_cdm/clear_key_cdm/cdm_video_decoder.h"
#include <memory>
#include <optional>
#include <utility>
#include "base/command_line.h"
#include "base/containers/queue.h"
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "base/task/single_thread_task_runner.h"
#include "build/build_config.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_executor.h"
#include "media/base/decoder_status.h"
#include "media/base/media_switches.h"
#include "media/base/media_util.h"
#include "media/cdm/cdm_type_conversion.h"
#include "media/cdm/library_cdm/cdm_host_proxy.h"
#include "media/media_buildflags.h"
#include "third_party/libyuv/include/libyuv/planar_functions.h"
#if BUILDFLAG(ENABLE_LIBVPX)
#include "media/filters/vpx_video_decoder.h"
#endif
#if BUILDFLAG(ENABLE_DAV1D_DECODER)
#include "media/filters/dav1d_video_decoder.h"
#endif
#if BUILDFLAG(ENABLE_FFMPEG_VIDEO_DECODERS)
#include "media/filters/ffmpeg_video_decoder.h"
#endif
namespace media {
namespace {
media::VideoDecoderConfig ToClearMediaVideoDecoderConfig(
const cdm::VideoDecoderConfig_3& config) { … }
bool ToCdmVideoFrame(const VideoFrame& video_frame,
CdmHostProxy* cdm_host_proxy,
CdmVideoDecoder::CdmVideoFrame* cdm_video_frame) { … }
void SetupGlobalEnvironmentIfNeeded() { … }
class VideoDecoderAdapter final : public CdmVideoDecoder { … };
}
std::unique_ptr<CdmVideoDecoder> CreateVideoDecoder(
CdmHostProxy* cdm_host_proxy,
const cdm::VideoDecoderConfig_3& config) { … }
}