| 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, and GLES2. | 7 // - RenderingHelper is charged with interacting with X11, EGL, and GLES2. |
| 8 // - ClientState is an enum for the state of the decode client used by the test. | 8 // - ClientState is an enum for the state of the decode client used by the test. |
| 9 // - ClientStateNotification is a barrier abstraction that allows the test code | 9 // - ClientStateNotification is a barrier abstraction that allows the test code |
| 10 // to be written sequentially and wait for the decode client to see certain | 10 // to be written sequentially and wait for the decode client to see certain |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 320 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 321 scoped_refptr<OmxVideoDecodeAccelerator> decoder = | 321 scoped_refptr<OmxVideoDecodeAccelerator> decoder = |
| 322 new OmxVideoDecodeAccelerator(this); | 322 new OmxVideoDecodeAccelerator(this); |
| 323 decoder->SetEglState( | 323 decoder->SetEglState( |
| 324 static_cast<EGLDisplay>(rendering_helper->GetGLDisplay()), | 324 static_cast<EGLDisplay>(rendering_helper->GetGLDisplay()), |
| 325 static_cast<EGLContext>(rendering_helper->GetGLContext())); | 325 static_cast<EGLContext>(rendering_helper->GetGLContext())); |
| 326 #elif defined(OS_MACOSX) | 326 #elif defined(OS_MACOSX) |
| 327 scoped_refptr<MacVideoDecodeAccelerator> decoder = | 327 scoped_refptr<MacVideoDecodeAccelerator> decoder = |
| 328 new MacVideoDecodeAccelerator(this); | 328 new MacVideoDecodeAccelerator(this); |
| 329 decoder->SetGLContext(rendering_helper_->GetGLContext()); | 329 decoder->SetGLContext(rendering_helper_->GetGLContext()); |
| 330 std::vector<uint8_t> avc_data(MP4_EXTRA_DATA, | |
| 331 MP4_EXTRA_DATA + arraysize(MP4_EXTRA_DATA)); | |
| 332 if (!decoder->SetConfigInfo(frame_width_, frame_height_, avc_data)) { | |
| 333 SetState(CS_ERROR); | |
| 334 return; | |
| 335 } | |
| 336 #endif // OS_WIN | 330 #endif // OS_WIN |
| 337 decoder_ = decoder.release(); | 331 decoder_ = decoder.release(); |
| 338 SetState(CS_DECODER_SET); | 332 SetState(CS_DECODER_SET); |
| 339 if (decoder_deleted()) | 333 if (decoder_deleted()) |
| 340 return; | 334 return; |
| 341 | 335 |
| 342 // Configure the decoder. | 336 // Configure the decoder. |
| 343 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; | 337 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; |
| 344 if (profile_ != -1) | 338 if (profile_ != -1) |
| 345 profile = static_cast<media::VideoCodecProfile>(profile_); | 339 profile = static_cast<media::VideoCodecProfile>(profile_); |
| 346 CHECK(decoder_->Initialize(profile)); | 340 std::vector<uint8_t> avc_data(MP4_EXTRA_DATA, |
| 341 MP4_EXTRA_DATA + arraysize(MP4_EXTRA_DATA)); |
| 342 CHECK(decoder_->Initialize( |
| 343 profile, gfx::Size(frame_width_, frame_height_), avc_data)); |
| 347 } | 344 } |
| 348 | 345 |
| 349 void EglRenderingVDAClient::ProvidePictureBuffers( | 346 void EglRenderingVDAClient::ProvidePictureBuffers( |
| 350 uint32 requested_num_of_buffers, | 347 uint32 requested_num_of_buffers, |
| 351 const gfx::Size& dimensions) { | 348 const gfx::Size& dimensions) { |
| 352 if (decoder_deleted()) | 349 if (decoder_deleted()) |
| 353 return; | 350 return; |
| 354 std::vector<media::PictureBuffer> buffers; | 351 std::vector<media::PictureBuffer> buffers; |
| 355 | 352 |
| 356 for (uint32 i = 0; i < requested_num_of_buffers; ++i) { | 353 for (uint32 i = 0; i < requested_num_of_buffers; ++i) { |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 830 |
| 834 base::ShadowingAtExitManager at_exit_manager; | 831 base::ShadowingAtExitManager at_exit_manager; |
| 835 RenderingHelper::InitializePlatform(); | 832 RenderingHelper::InitializePlatform(); |
| 836 | 833 |
| 837 #if defined(OS_WIN) | 834 #if defined(OS_WIN) |
| 838 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 835 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
| 839 #endif | 836 #endif |
| 840 | 837 |
| 841 return RUN_ALL_TESTS(); | 838 return RUN_ALL_TESTS(); |
| 842 } | 839 } |
| OLD | NEW |