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

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

Issue 9346012: Video decode in hardware on ARM platform. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 8 years, 9 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 | Annotate | Revision Log
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, 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // - |filename| must be an h264 Annex B (NAL) stream. 67 // - |filename| must be an h264 Annex B (NAL) stream.
68 // - |width| and |height| are in pixels. 68 // - |width| and |height| are in pixels.
69 // - |numframes| is the number of picture frames in the file. 69 // - |numframes| is the number of picture frames in the file.
70 // - |numNALUs| is the number of NAL units in the stream. 70 // - |numNALUs| is the number of NAL units in the stream.
71 // - |minFPSwithRender| and |minFPSnoRender| are minimum frames/second speeds 71 // - |minFPSwithRender| and |minFPSnoRender| are minimum frames/second speeds
72 // expected to be achieved with and without rendering to the screen, resp. 72 // expected to be achieved with and without rendering to the screen, resp.
73 // (the latter tests just decode speed). 73 // (the latter tests just decode speed).
74 // - |profile| is the media::H264Profile set during Initialization. 74 // - |profile| is the media::H264Profile set during Initialization.
75 // An empty value for a numeric field means "ignore". 75 // An empty value for a numeric field means "ignore".
76 const FilePath::CharType* test_video_data = 76 const FilePath::CharType* test_video_data =
77 FILE_PATH_LITERAL("test-25fps.h264:320:240:250:258:50:175:1"); 77 FILE_PATH_LITERAL("test-25fps.h264:1280:720:250:258:33:175:1");
Ami GONE FROM CHROMIUM 2012/03/14 17:21:59 You can't change this without providing a new test
78 78
79 // 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
80 // accordingly. CHECK-fails on unexpected or missing required data. 80 // accordingly. CHECK-fails on unexpected or missing required data.
81 // Unspecified optional fields are set to -1. 81 // Unspecified optional fields are set to -1.
82 void ParseTestVideoData(FilePath::StringType data, 82 void ParseTestVideoData(FilePath::StringType data,
83 FilePath::StringType* file_name, 83 FilePath::StringType* file_name,
84 int* width, int* height, 84 int* width, int* height,
85 int* num_frames, 85 int* num_frames,
86 int* num_NALUs, 86 int* num_NALUs,
87 int* min_fps_render, 87 int* min_fps_render,
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 return window; 413 return window;
414 } 414 }
415 415
416 EGLDisplay RenderingHelper::PlatformGetDisplay() { 416 EGLDisplay RenderingHelper::PlatformGetDisplay() {
417 return eglGetDisplay(EGL_DEFAULT_DISPLAY); 417 return eglGetDisplay(EGL_DEFAULT_DISPLAY);
418 } 418 }
419 419
420 #else // OS_WIN 420 #else // OS_WIN
421 421
422 void RenderingHelper::PlatformInitialize() { 422 void RenderingHelper::PlatformInitialize() {
423 CHECK(x_display_ = XOpenDisplay(NULL)); 423 CHECK(x_display_ = base::MessagePumpForUI::GetDefaultXDisplay());
424 } 424 }
425 425
426 void RenderingHelper::PlatformUnInitialize() { 426 void RenderingHelper::PlatformUnInitialize() {
427 // Destroy resources acquired in Initialize, in reverse-acquisition order. 427 // Destroy resources acquired in Initialize, in reverse-acquisition order.
428 for (size_t i = 0; i < x_windows_.size(); ++i) { 428 for (size_t i = 0; i < x_windows_.size(); ++i) {
429 CHECK(XUnmapWindow(x_display_, x_windows_[i])); 429 CHECK(XUnmapWindow(x_display_, x_windows_[i]));
430 CHECK(XDestroyWindow(x_display_, x_windows_[i])); 430 CHECK(XDestroyWindow(x_display_, x_windows_[i]));
431 } 431 }
432 // Mimic newly created object. 432 // Mimic newly created object.
433 x_display_ = NULL; 433 x_display_ = NULL;
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after
1152 } 1152 }
1153 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1153 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1154 } 1154 }
1155 #if defined(OS_WIN) 1155 #if defined(OS_WIN)
1156 base::ShadowingAtExitManager at_exit_manager; 1156 base::ShadowingAtExitManager at_exit_manager;
1157 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2); 1157 gfx::InitializeGLBindings(gfx::kGLImplementationEGLGLES2);
1158 DXVAVideoDecodeAccelerator::PreSandboxInitialization(); 1158 DXVAVideoDecodeAccelerator::PreSandboxInitialization();
1159 #endif // OS_WIN 1159 #endif // OS_WIN
1160 return RUN_ALL_TESTS(); 1160 return RUN_ALL_TESTS();
1161 } 1161 }
OLDNEW
« AUTHORS ('K') | « 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