| 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 69e1517d5a7f4945e423362a7c148e9935027986..50e144b592eb2bdeec06c9baba59155553fd2de8 100644
|
| --- a/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| +++ b/content/common/gpu/media/vt_video_decode_accelerator_mac.cc
|
| @@ -283,10 +283,10 @@
|
| }
|
|
|
| VTVideoDecodeAccelerator::VTVideoDecodeAccelerator(
|
| - 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),
|
| + const MakeContextCurrentCallback& make_context_current,
|
| + const BindImageCallback& bind_image)
|
| + : make_context_current_(make_context_current),
|
| + bind_image_(bind_image),
|
| client_(nullptr),
|
| state_(STATE_DECODING),
|
| format_(nullptr),
|
| @@ -298,6 +298,7 @@
|
| 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();
|
| @@ -310,11 +311,6 @@
|
| 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";
|
| @@ -1026,7 +1022,7 @@
|
| DCHECK(!picture_info->cv_image);
|
| DCHECK(!picture_info->gl_image);
|
|
|
| - if (!make_context_current_cb_.Run()) {
|
| + if (!make_context_current_.Run()) {
|
| DLOG(ERROR) << "Failed to make GL context current";
|
| NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
|
| return false;
|
| @@ -1045,12 +1041,8 @@
|
|
|
| // Mark that the image is not bound for sampling. 4:2:0 images need to
|
| // undergo a separate copy to be displayed.
|
| - if (!bind_image_cb_.Run(picture_info->client_texture_id,
|
| - GL_TEXTURE_RECTANGLE_ARB, gl_image, false)) {
|
| - DLOG(ERROR) << "Failed to bind image";
|
| - NotifyError(PLATFORM_FAILURE, SFT_PLATFORM_ERROR);
|
| - return false;
|
| - }
|
| + bind_image_.Run(picture_info->client_texture_id, GL_TEXTURE_RECTANGLE_ARB,
|
| + gl_image, false);
|
|
|
| // Assign the new image(s) to the the picture info.
|
| picture_info->gl_image = gl_image;
|
| @@ -1126,9 +1118,7 @@
|
| QueueFlush(TASK_DESTROY);
|
| }
|
|
|
| -bool VTVideoDecodeAccelerator::TryToSetupDecodeOnSeparateThread(
|
| - const base::WeakPtr<Client>& decode_client,
|
| - const scoped_refptr<base::SingleThreadTaskRunner>& decode_task_runner) {
|
| +bool VTVideoDecodeAccelerator::CanDecodeOnIOThread() {
|
| return false;
|
| }
|
|
|
|
|