| Index: content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| diff --git a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| index e4ea5cdf4fdbbf35e0e3c8fe1f6ae2b2c6c8949c..e2f73c0860ffb6e1b1032636340ab61752010b16 100644
|
| --- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| +++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| @@ -288,11 +288,10 @@ bool VTVideoDecodeAccelerator::FrameOrder::operator()(
|
| }
|
|
|
| VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
|
| - const base::Callback<bool(void)>& make_context_current,
|
| - const base::Callback<void(uint32_t, uint32_t, scoped_refptr<gl::GLImage>)>&
|
| - bind_image)
|
| - : make_context_current_(make_context_current),
|
| - bind_image_(bind_image),
|
| + const MakeGLContextCurrentCallback& make_context_current_cb,
|
| + const BindGLImageCallback& bind_image_cb)
|
| + : make_context_current_cb_(make_context_current_cb),
|
| + bind_image_cb_(bind_image_cb),
|
| client_(nullptr),
|
| state_(STATE_DECODING),
|
| format_(nullptr),
|
| @@ -304,7 +303,6 @@ VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
|
| gpu_task_runner_(base::ThreadTaskRunnerHandle::Get()),
|
| decoder_thread_("VTDecoderThread"),
|
| weak_this_factory_(this) {
|
| - DCHECK(!make_context_current_.is_null());
|
| callback_.decompressionOutputCallback = OutputThunk;
|
| callback_.decompressionOutputRefCon = this;
|
| weak_this_ = weak_this_factory_.GetWeakPtr();
|
| @@ -318,6 +316,11 @@ bool VTVideoDecodeAccelerator::Initialize(const Config& config,
|
| Client* client) {
|
| DCHECK(gpu_thread_checker_.CalledOnValidThread());
|
|
|
| + if (make_context_current_cb_.is_null() || bind_image_cb_.is_null()) {
|
| + NOTREACHED() << "GL callbacks are required for this VDA";
|
| + return false;
|
| + }
|
| +
|
| if (config.is_encrypted) {
|
| NOTREACHED() << "Encrypted streams are not supported for this VDA";
|
| return false;
|
| @@ -1028,7 +1031,7 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
|
| DCHECK(!picture_info->cv_image);
|
| DCHECK(!picture_info->gl_image);
|
|
|
| - if (!make_context_current_.Run()) {
|
| + if (!make_context_current_cb_.Run()) {
|
| DLOG(ERROR) << "Failed to make GL context current";
|
| NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
|
| return false;
|
| @@ -1067,8 +1070,12 @@ bool VTVideoDecodeAccelerator::SendFrame(const Frame& frame) {
|
| } else {
|
| gl_image = nullptr;
|
| }
|
| - bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB,
|
| - gl_image);
|
| + if (!bind_image_cb_.Run(picture_info->client_texture_id,
|
| + GL_TEXTURE_RECTANGLE_ARB, gl_image)) {
|
| + DLOG(ERROR) << "Failed to bind image";
|
| + NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
|
| + return false;
|
| + }
|
|
|
| // Assign the new image(s) to the the picture info.
|
| picture_info->gl_image = gl_image;
|
| @@ -1145,7 +1152,9 @@ void VTVideoDecodeAccelerator::Destroy() {
|
| QueueFlush(TASK_DESTROY);
|
| }
|
|
|
| -bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() {
|
| +bool VTVideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread(
|
| + const base::WeakPtr<Client>& decode_client,
|
| + const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) {
|
| return false;
|
| }
|
|
|
|
|