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

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: Address comments. 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(int32_t 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 }
(...skipping 15 matching lines...) Expand all
525 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0)); 531 DCHECK(texture_ref->texture()->IsLevelCleared(target, 0));
526 } else { 532 } else {
527 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0)); 533 DCHECK(!texture_ref->texture()->IsLevelCleared(target, 0));
528 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true); 534 texture_manager->SetLevelCleared(texture_ref.get(), target, 0, true);
529 } 535 }
530 } 536 }
531 uncleared_textures_.erase(it); 537 uncleared_textures_.erase(it);
532 } 538 }
533 539
534 } // namespace media 540 } // namespace media
OLDNEW
« no previous file with comments | « media/gpu/ipc/service/gpu_video_decode_accelerator.h ('k') | media/video/video_decode_accelerator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698