| OLD | NEW |
| 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 517 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 if (throttling_client_) { | 545 if (throttling_client_) { |
| 545 client = throttling_client_.get(); | 546 client = throttling_client_.get(); |
| 546 weak_client = throttling_client_->AsWeakPtr(); | 547 weak_client = throttling_client_->AsWeakPtr(); |
| 547 } | 548 } |
| 548 #if defined(OS_WIN) | 549 #if defined(OS_WIN) |
| 549 decoder_.reset( | 550 decoder_.reset( |
| 550 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); | 551 new DXVAVideoDecodeAccelerator(client, base::Bind(&DoNothingReturnTrue))); |
| 551 #elif defined(OS_CHROMEOS) | 552 #elif defined(OS_CHROMEOS) |
| 552 #if defined(ARCH_CPU_ARMEL) | 553 #if defined(ARCH_CPU_ARMEL) |
| 553 | 554 |
| 554 scoped_ptr<V4L2Device> device = V4L2Device::Create(); | 555 scoped_ptr<V4L2Device> device = V4L2Device::Create( |
| 556 static_cast<EGLContext>(rendering_helper_->GetGLContext())); |
| 555 if (!device.get()) { | 557 if (!device.get()) { |
| 556 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 558 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 557 return; | 559 return; |
| 558 } | 560 } |
| 559 decoder_.reset(new V4L2VideoDecodeAccelerator( | 561 decoder_.reset(new V4L2VideoDecodeAccelerator( |
| 560 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 562 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 561 client, | 563 client, |
| 562 weak_client, | 564 weak_client, |
| 563 base::Bind(&DoNothingReturnTrue), | 565 base::Bind(&DoNothingReturnTrue), |
| 564 device.Pass(), | 566 device.Pass(), |
| (...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 } | 1529 } |
| 1528 if (it->first == "v" || it->first == "vmodule") | 1530 if (it->first == "v" || it->first == "vmodule") |
| 1529 continue; | 1531 continue; |
| 1530 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 1532 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
| 1531 } | 1533 } |
| 1532 | 1534 |
| 1533 base::ShadowingAtExitManager at_exit_manager; | 1535 base::ShadowingAtExitManager at_exit_manager; |
| 1534 | 1536 |
| 1535 return RUN_ALL_TESTS(); | 1537 return RUN_ALL_TESTS(); |
| 1536 } | 1538 } |
| OLD | NEW |