| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // - |profile| is the media::H264Profile set during Initialization. | 69 // - |profile| is the media::H264Profile set during Initialization. |
| 70 // An empty value for a numeric field means "ignore". | 70 // An empty value for a numeric field means "ignore". |
| 71 #if defined(OS_MACOSX) | 71 #if defined(OS_MACOSX) |
| 72 const FilePath::CharType* test_video_data = | 72 const FilePath::CharType* test_video_data = |
| 73 FILE_PATH_LITERAL("test-25fps_high.h264:1280:720:249:252:50:175:4"); | 73 FILE_PATH_LITERAL("test-25fps_high.h264:1280:720:249:252:50:175:4"); |
| 74 #else | 74 #else |
| 75 const FilePath::CharType* test_video_data = | 75 const FilePath::CharType* test_video_data = |
| 76 FILE_PATH_LITERAL("test-25fps.h264:320:240:250:258:50:175:1"); | 76 FILE_PATH_LITERAL("test-25fps.h264:320:240:250:258:50:175:1"); |
| 77 #endif | 77 #endif |
| 78 | 78 |
| 79 // AAVC data required to initialize the H.264 video decoder. | |
| 80 const uint8_t MP4_EXTRA_DATA[] = { | |
| 81 0x01, 0x64, 0x00, 0x1f, 0xff, 0xe1, 0x00, 0x19, | |
| 82 0x67, 0x64, 0x00, 0x1f, 0xac, 0x34, 0xec, 0x05, | |
| 83 0x00, 0x5b, 0xa1, 0x00, 0x00, 0x03, 0x00, 0x01, | |
| 84 0x00, 0x00, 0x03, 0x00, 0x32, 0x0f, 0x18, 0x31, | |
| 85 0x38, 0x01, 0x00, 0x05, 0x68, 0xef, 0xb2, 0xc8, | |
| 86 0xb0, | |
| 87 }; | |
| 88 | |
| 89 // Parse |data| into its constituent parts and set the various output fields | 79 // Parse |data| into its constituent parts and set the various output fields |
| 90 // accordingly. CHECK-fails on unexpected or missing required data. | 80 // accordingly. CHECK-fails on unexpected or missing required data. |
| 91 // Unspecified optional fields are set to -1. | 81 // Unspecified optional fields are set to -1. |
| 92 void ParseTestVideoData(FilePath::StringType data, | 82 void ParseTestVideoData(FilePath::StringType data, |
| 93 FilePath::StringType* file_name, | 83 FilePath::StringType* file_name, |
| 94 int* width, int* height, | 84 int* width, int* height, |
| 95 int* num_frames, | 85 int* num_frames, |
| 96 int* num_NALUs, | 86 int* num_NALUs, |
| 97 int* min_fps_render, | 87 int* min_fps_render, |
| 98 int* min_fps_no_render, | 88 int* min_fps_no_render, |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 310 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 321 scoped_refptr<OmxVideoDecodeAccelerator> decoder = | 311 scoped_refptr<OmxVideoDecodeAccelerator> decoder = |
| 322 new OmxVideoDecodeAccelerator(this); | 312 new OmxVideoDecodeAccelerator(this); |
| 323 decoder->SetEglState( | 313 decoder->SetEglState( |
| 324 static_cast<EGLDisplay>(rendering_helper->GetGLDisplay()), | 314 static_cast<EGLDisplay>(rendering_helper->GetGLDisplay()), |
| 325 static_cast<EGLContext>(rendering_helper->GetGLContext())); | 315 static_cast<EGLContext>(rendering_helper->GetGLContext())); |
| 326 #elif defined(OS_MACOSX) | 316 #elif defined(OS_MACOSX) |
| 327 scoped_refptr<MacVideoDecodeAccelerator> decoder = | 317 scoped_refptr<MacVideoDecodeAccelerator> decoder = |
| 328 new MacVideoDecodeAccelerator(this); | 318 new MacVideoDecodeAccelerator(this); |
| 329 decoder->SetGLContext(rendering_helper_->GetGLContext()); | 319 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 | 320 #endif // OS_WIN |
| 337 decoder_ = decoder.release(); | 321 decoder_ = decoder.release(); |
| 338 SetState(CS_DECODER_SET); | 322 SetState(CS_DECODER_SET); |
| 339 if (decoder_deleted()) | 323 if (decoder_deleted()) |
| 340 return; | 324 return; |
| 341 | 325 |
| 342 // Configure the decoder. | 326 // Configure the decoder. |
| 343 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; | 327 media::VideoCodecProfile profile = media::H264PROFILE_BASELINE; |
| 344 if (profile_ != -1) | 328 if (profile_ != -1) |
| 345 profile = static_cast<media::VideoCodecProfile>(profile_); | 329 profile = static_cast<media::VideoCodecProfile>(profile_); |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 833 | 817 |
| 834 base::ShadowingAtExitManager at_exit_manager; | 818 base::ShadowingAtExitManager at_exit_manager; |
| 835 RenderingHelper::InitializePlatform(); | 819 RenderingHelper::InitializePlatform(); |
| 836 | 820 |
| 837 #if defined(OS_WIN) | 821 #if defined(OS_WIN) |
| 838 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 822 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
| 839 #endif | 823 #endif |
| 840 | 824 |
| 841 return RUN_ALL_TESTS(); | 825 return RUN_ALL_TESTS(); |
| 842 } | 826 } |
| OLD | NEW |