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

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

Issue 137023008: Add support for Tegra V4L2 VDA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
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
11 // to be written sequentially and wait for the decode client to see certain 11 // to be written sequentially and wait for the decode client to see certain
12 // state transitions. 12 // state transitions.
13 // - GLRenderingVDAClient is a VideoDecodeAccelerator::Client implementation 13 // - GLRenderingVDAClient is a VideoDecodeAccelerator::Client implementation
14 // - Finally actual TEST cases are at the bottom of this file, using the above 14 // - Finally actual TEST cases are at the bottom of this file, using the above
15 // infrastructure. 15 // infrastructure.
16 16
17 #include <dlfcn.h>
17 #include <fcntl.h> 18 #include <fcntl.h>
18 #include <sys/stat.h> 19 #include <sys/stat.h>
19 #include <sys/types.h> 20 #include <sys/types.h>
20 #include <algorithm> 21 #include <algorithm>
21 #include <deque> 22 #include <deque>
22 #include <map> 23 #include <map>
23 24
24 // Include gtest.h out of order because <X11/X.h> #define's Bool & None, which 25 // Include gtest.h out of order because <X11/X.h> #define's Bool & None, which
25 // gtest uses as struct names (inside a namespace). This means that 26 // gtest uses as struct names (inside a namespace). This means that
26 // #include'ing gtest after anything that pulls in X.h fails to compile. 27 // #include'ing gtest after anything that pulls in X.h fails to compile.
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 if (throttling_client_) { 553 if (throttling_client_) {
553 client = throttling_client_.get(); 554 client = throttling_client_.get();
554 weak_client = throttling_client_->AsWeakPtr(); 555 weak_client = throttling_client_->AsWeakPtr();
555 } 556 }
556 #if defined(OS_WIN) 557 #if defined(OS_WIN)
557 decoder_.reset( 558 decoder_.reset(
558 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); 559 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue)));
559 #elif defined(OS_CHROMEOS) 560 #elif defined(OS_CHROMEOS)
560 #if defined(ARCH_CPU_ARMEL) 561 #if defined(ARCH_CPU_ARMEL)
561 562
562 scoped_ptr<V4L2Device> device = V4L2Device::Create(); 563 scoped_ptr<V4L2Device> device = V4L2Device::Create(
564 static_cast<EGLContext>(rendering_helper_->GetGLContext()));
563 if (!device.get()) { 565 if (!device.get()) {
564 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); 566 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
565 return; 567 return;
566 } 568 }
567 decoder_.reset(new V4L2VideoDecodeAccelerator( 569 decoder_.reset(new V4L2VideoDecodeAccelerator(
568 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), 570 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()),
569 client, 571 client,
570 weak_client, 572 weak_client,
571 base::Bind(&DoNothingReturnTrue), 573 base::Bind(&DoNothingReturnTrue),
572 device.Pass(), 574 device.Pass(),
(...skipping 1010 matching lines...) Expand 10 before | Expand all | Expand 10 after
1583 } 1585 }
1584 if (it->first == "v" || it->first == "vmodule") 1586 if (it->first == "v" || it->first == "vmodule")
1585 continue; 1587 continue;
1586 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1588 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1587 } 1589 }
1588 1590
1589 base::ShadowingAtExitManager at_exit_manager; 1591 base::ShadowingAtExitManager at_exit_manager;
1590 1592
1591 return RUN_ALL_TESTS(); 1593 return RUN_ALL_TESTS();
1592 } 1594 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698