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

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

Issue 7779001: Replace the use of an int32* with a proper struct for decoder configuration. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Replaced struct with explicit profile parameter. Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 568
569 void EglRenderingVDAClient::CreateDecoder() { 569 void EglRenderingVDAClient::CreateDecoder() {
570 CHECK(decoder_deleted()); 570 CHECK(decoder_deleted());
571 decoder_ = new OmxVideoDecodeAccelerator(this); 571 decoder_ = new OmxVideoDecodeAccelerator(this);
572 decoder_->SetEglState(egl_display(), egl_context()); 572 decoder_->SetEglState(egl_display(), egl_context());
573 SetState(CS_DECODER_SET); 573 SetState(CS_DECODER_SET);
574 if (decoder_deleted()) 574 if (decoder_deleted())
575 return; 575 return;
576 576
577 // Configure the decoder. 577 // Configure the decoder.
578 int32 config_array[] = { 578 media::VideoDecodeAccelerator::Profile profile =
579 media::VIDEOATTRIBUTEKEY_BITSTREAMFORMAT_FOURCC, 579 media::VideoDecodeAccelerator::H264PROFILE_BASELINE;
580 media::VIDEOCODECFOURCC_H264, 580 if (profile_ != -1)
581 media::VIDEOATTRIBUTEKEY_VIDEOCOLORFORMAT, media::VIDEOCOLORFORMAT_RGBA, 581 profile = static_cast<media::VideoDecodeAccelerator::Profile>(profile_);
582 }; 582 CHECK(decoder_->Initialize(profile));
583 std::vector<int32> config(
584 config_array, config_array + arraysize(config_array));
585 if (profile_ != -1) {
586 config.push_back(media::VIDEOATTRIBUTEKEY_BITSTREAMFORMAT_H264_PROFILE);
587 config.push_back(profile_);
588 }
589 CHECK(decoder_->Initialize(config));
590 } 583 }
591 584
592 void EglRenderingVDAClient::ProvidePictureBuffers( 585 void EglRenderingVDAClient::ProvidePictureBuffers(
593 uint32 requested_num_of_buffers, 586 uint32 requested_num_of_buffers,
594 const gfx::Size& dimensions) { 587 const gfx::Size& dimensions) {
595 if (decoder_deleted()) 588 if (decoder_deleted())
596 return; 589 return;
597 std::vector<media::PictureBuffer> buffers; 590 std::vector<media::PictureBuffer> buffers;
598 591
599 for (uint32 i = 0; i < requested_num_of_buffers; ++i) { 592 for (uint32 i = 0; i < requested_num_of_buffers; ++i) {
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1024 it != switches.end(); ++it) { 1017 it != switches.end(); ++it) {
1025 if (it->first == "test_video_data") { 1018 if (it->first == "test_video_data") {
1026 test_video_data = it->second.c_str(); 1019 test_video_data = it->second.c_str();
1027 continue; 1020 continue;
1028 } 1021 }
1029 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; 1022 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second;
1030 } 1023 }
1031 1024
1032 return RUN_ALL_TESTS(); 1025 return RUN_ALL_TESTS();
1033 } 1026 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698