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

Side by Side Diff: content/common/gpu/media/video_decode_accelerator_unittest.cc

Issue 10843058: VAVDA: Destroy vaapi buffers after we're done drawing. (Closed) Base URL: https://git.chromium.org/git/chromium/src@master
Patch Set: Fix MakeCurrent Created 8 years, 4 months 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
« no previous file with comments | « content/common/gpu/media/omx_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // The bulk of this file is support code; sorry about that. Here's an overview 5 // The bulk of this file is support code; sorry about that. Here's an overview
6 // to hopefully help readers of this code: 6 // to hopefully help readers of this code:
7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or
8 // Win/EGL. 8 // Win/EGL.
9 // - ClientState is an enum for the state of the decode client used by the test. 9 // - ClientState is an enum for the state of the decode client used by the test.
10 // - ClientStateNotification is a barrier abstraction that allows the test code 10 // - ClientStateNotification is a barrier abstraction that allows the test code
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 CHECK_GT(num_play_throughs, 0); 303 CHECK_GT(num_play_throughs, 0);
304 } 304 }
305 305
306 GLRenderingVDAClient::~GLRenderingVDAClient() { 306 GLRenderingVDAClient::~GLRenderingVDAClient() {
307 DeleteDecoder(); // Clean up in case of expected error. 307 DeleteDecoder(); // Clean up in case of expected error.
308 CHECK(decoder_deleted()); 308 CHECK(decoder_deleted());
309 STLDeleteValues(&picture_buffers_by_id_); 309 STLDeleteValues(&picture_buffers_by_id_);
310 SetState(CS_DESTROYED); 310 SetState(CS_DESTROYED);
311 } 311 }
312 312
313 #if !defined(OS_WIN) && !defined(OS_MACOSX) && defined(ARCH_CPU_X86_FAMILY) 313 #if !defined(OS_WIN) && !defined(OS_MACOSX)
314 static bool DoNothingReturnTrue() { return true; } 314 static bool DoNothingReturnTrue() { return true; }
315 #endif 315 #endif
316 316
317 void GLRenderingVDAClient::CreateDecoder() { 317 void GLRenderingVDAClient::CreateDecoder() {
318 CHECK(decoder_deleted()); 318 CHECK(decoder_deleted());
319 CHECK(!decoder_.get()); 319 CHECK(!decoder_.get());
320 #if defined(OS_WIN) 320 #if defined(OS_WIN)
321 decoder_.reset(new DXVAVideoDecodeAccelerator(this)); 321 decoder_.reset(new DXVAVideoDecodeAccelerator(this));
322 #elif defined(OS_MACOSX) 322 #elif defined(OS_MACOSX)
323 decoder_.reset(new MacVideoDecodeAccelerator( 323 decoder_.reset(new MacVideoDecodeAccelerator(
324 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); 324 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this));
325 #elif defined(ARCH_CPU_ARMEL) 325 #elif defined(ARCH_CPU_ARMEL)
326 decoder_.reset( 326 decoder_.reset(
327 new OmxVideoDecodeAccelerator( 327 new OmxVideoDecodeAccelerator(
328 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 328 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
329 static_cast<EGLContext>(rendering_helper_->GetGLContext()), 329 static_cast<EGLContext>(rendering_helper_->GetGLContext()),
330 this)); 330 this,
331 base::Bind(&DoNothingReturnTrue)));
331 #elif defined(ARCH_CPU_X86_FAMILY) 332 #elif defined(ARCH_CPU_X86_FAMILY)
332 decoder_.reset(new VaapiVideoDecodeAccelerator( 333 decoder_.reset(new VaapiVideoDecodeAccelerator(
333 static_cast<Display*>(rendering_helper_->GetGLDisplay()), 334 static_cast<Display*>(rendering_helper_->GetGLDisplay()),
334 static_cast<GLXContext>(rendering_helper_->GetGLContext()), 335 static_cast<GLXContext>(rendering_helper_->GetGLContext()),
335 this, base::Bind(&DoNothingReturnTrue))); 336 this, base::Bind(&DoNothingReturnTrue)));
336 #endif // OS_WIN 337 #endif // OS_WIN
337 CHECK(decoder_.get()); 338 CHECK(decoder_.get());
338 SetState(CS_DECODER_SET); 339 SetState(CS_DECODER_SET);
339 if (decoder_deleted()) 340 if (decoder_deleted())
340 return; 341 return;
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 #if defined(OS_WIN) 890 #if defined(OS_WIN)
890 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 891 DXVAVideoDecodeAccelerator::PreSandboxInitialization();
891 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) 892 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL)
892 OmxVideoDecodeAccelerator::PreSandboxInitialization(); 893 OmxVideoDecodeAccelerator::PreSandboxInitialization();
893 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 894 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
894 VaapiVideoDecodeAccelerator::PreSandboxInitialization(); 895 VaapiVideoDecodeAccelerator::PreSandboxInitialization();
895 #endif 896 #endif
896 897
897 return RUN_ALL_TESTS(); 898 return RUN_ALL_TESTS();
898 } 899 }
OLDNEW
« no previous file with comments | « content/common/gpu/media/omx_video_decode_accelerator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698