Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(354)

Side by Side Diff: media/gpu/ipc/service/gpu_video_decode_accelerator.cc

Issue 2461073002: Use MediaCodec.setOutputSurface() for fullscreen transitions on M. (Closed)
Patch Set: Fix IPC, but now everything explodes :( Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h" 5 #include "media/gpu/ipc/service/gpu_video_decode_accelerator.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 197
198 bool handled = true; 198 bool handled = true;
199 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAccelerator, msg) 199 IPC_BEGIN_MESSAGE_MAP(GpuVideoDecodeAccelerator, msg)
200 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Decode, OnDecode) 200 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Decode, OnDecode)
201 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_AssignPictureBuffers, 201 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_AssignPictureBuffers,
202 OnAssignPictureBuffers) 202 OnAssignPictureBuffers)
203 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_ReusePictureBuffer, 203 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_ReusePictureBuffer,
204 OnReusePictureBuffer) 204 OnReusePictureBuffer)
205 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Flush, OnFlush) 205 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Flush, OnFlush)
206 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Reset, OnReset) 206 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Reset, OnReset)
207 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_SetSurface, OnSetSurface)
207 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Destroy, OnDestroy) 208 IPC_MESSAGE_HANDLER(AcceleratedVideoDecoderMsg_Destroy, OnDestroy)
208 IPC_MESSAGE_UNHANDLED(handled = false) 209 IPC_MESSAGE_UNHANDLED(handled = false)
209 IPC_END_MESSAGE_MAP() 210 IPC_END_MESSAGE_MAP()
210 return handled; 211 return handled;
211 } 212 }
212 213
213 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) { 214 void GpuVideoDecodeAccelerator::NotifyInitializationComplete(bool success) {
214 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete( 215 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializationComplete(
215 host_route_id_, success))) 216 host_route_id_, success)))
216 DLOG(ERROR) 217 DLOG(ERROR)
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 void GpuVideoDecodeAccelerator::OnFlush() { 491 void GpuVideoDecodeAccelerator::OnFlush() {
491 DCHECK(video_decode_accelerator_); 492 DCHECK(video_decode_accelerator_);
492 video_decode_accelerator_->Flush(); 493 video_decode_accelerator_->Flush();
493 } 494 }
494 495
495 void GpuVideoDecodeAccelerator::OnReset() { 496 void GpuVideoDecodeAccelerator::OnReset() {
496 DCHECK(video_decode_accelerator_); 497 DCHECK(video_decode_accelerator_);
497 video_decode_accelerator_->Reset(); 498 video_decode_accelerator_->Reset();
498 } 499 }
499 500
501 void GpuVideoDecodeAccelerator::OnSetSurface(int surface_id) {
502 DCHECK(video_decode_accelerator_);
503 video_decode_accelerator_->SetSurface(surface_id);
504 }
505
500 void GpuVideoDecodeAccelerator::OnDestroy() { 506 void GpuVideoDecodeAccelerator::OnDestroy() {
501 DCHECK(video_decode_accelerator_); 507 DCHECK(video_decode_accelerator_);
502 OnWillDestroyStub(); 508 OnWillDestroyStub();
503 } 509 }
504 510
505 void GpuVideoDecodeAccelerator::OnFilterRemoved() { 511 void GpuVideoDecodeAccelerator::OnFilterRemoved() {
506 // We're destroying; cancel all callbacks. 512 // We're destroying; cancel all callbacks.
507 weak_factory_for_io_.InvalidateWeakPtrs(); 513 weak_factory_for_io_.InvalidateWeakPtrs();
508 filter_removed_.Signal(); 514 filter_removed_.Signal();
509 } 515 }
510 516
511 void GpuVideoDecodeAccelerator::SetTextureCleared(const Picture& picture) { 517 void GpuVideoDecodeAccelerator::SetTextureCleared(const Picture& picture) {
512 DCHECK(child_task_runner_->BelongsToCurrentThread()); 518 DCHECK(child_task_runner_->BelongsToCurrentThread());
513 DebugAutoLock auto_lock(debug_uncleared_textures_lock_); 519 DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
514 auto it = uncleared_textures_.find(picture.picture_buffer_id()); 520 auto it = uncleared_textures_.find(picture.picture_buffer_id());
515 if (it == uncleared_textures_.end()) 521 if (it == uncleared_textures_.end())
516 return; // the texture has been cleared 522 return; // the texture has been cleared
517 523
518 for (auto texture_ref : it->second) { 524 for (auto texture_ref : it->second) {
519 GLenum target = texture_ref->texture()->target(); 525 GLenum target = texture_ref->texture()->target();
520 gpu::gles2::TextureManager* texture_manager = 526 gpu::gles2::TextureManager* texture_manager =
521 stub_->decoder()->GetContextGroup()->texture_manager(); 527 stub_->decoder()->GetContextGroup()->texture_manager();
522 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 528 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
523 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 529 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
524 } 530 }
525 uncleared_textures_.erase(it); 531 uncleared_textures_.erase(it);
526 } 532 }
527 533
528 } // namespace media 534 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698