OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "media/gpu/android_video_decode_accelerator.h" | 5 #include "media/gpu/android_video_decode_accelerator.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 protected: | 64 protected: |
65 void SetUp() override { | 65 void SetUp() override { |
66 JNIEnv* env = base::android::AttachCurrentThread(); | 66 JNIEnv* env = base::android::AttachCurrentThread(); |
67 RegisterJni(env); | 67 RegisterJni(env); |
68 | 68 |
69 gl::init::ClearGLBindings(); | 69 gl::init::ClearGLBindings(); |
70 ASSERT_TRUE(gl::init::InitializeGLOneOff()); | 70 ASSERT_TRUE(gl::init::InitializeGLOneOff()); |
71 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size(1024, 1024)); | 71 surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size(1024, 1024)); |
72 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), | 72 context_ = gl::init::CreateGLContext(nullptr, surface_.get(), |
73 gl::GLContextAttribs()); | 73 gl::PreferDiscreteGpu); |
74 context_->MakeCurrent(surface_.get()); | 74 context_->MakeCurrent(surface_.get()); |
75 | 75 |
76 // Start a message loop because AVDA starts a timer task. | 76 // Start a message loop because AVDA starts a timer task. |
77 message_loop_.reset(new base::MessageLoop()); | 77 message_loop_.reset(new base::MessageLoop()); |
78 gl_decoder_.reset(new testing::NiceMock<gpu::gles2::MockGLES2Decoder>()); | 78 gl_decoder_.reset(new testing::NiceMock<gpu::gles2::MockGLES2Decoder>()); |
79 client_.reset(new MockVideoDecodeAcceleratorClient()); | 79 client_.reset(new MockVideoDecodeAcceleratorClient()); |
80 | 80 |
81 vda_.reset(new AndroidVideoDecodeAccelerator( | 81 vda_.reset(new AndroidVideoDecodeAccelerator( |
82 base::Bind(&MakeContextCurrent), | 82 base::Bind(&MakeContextCurrent), |
83 base::Bind(&GetGLES2Decoder, gl_decoder_->AsWeakPtr()))); | 83 base::Bind(&GetGLES2Decoder, gl_decoder_->AsWeakPtr()))); |
(...skipping 21 matching lines...) Expand all Loading... |
105 } | 105 } |
106 | 106 |
107 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureSupportedCodec) { | 107 TEST_F(AndroidVideoDecodeAcceleratorTest, ConfigureSupportedCodec) { |
108 if (!MediaCodecUtil::IsMediaCodecAvailable()) | 108 if (!MediaCodecUtil::IsMediaCodecAvailable()) |
109 return; | 109 return; |
110 // H264 is always supported by AVDA. | 110 // H264 is always supported by AVDA. |
111 ASSERT_TRUE(Initialize(H264PROFILE_BASELINE)); | 111 ASSERT_TRUE(Initialize(H264PROFILE_BASELINE)); |
112 } | 112 } |
113 | 113 |
114 } // namespace media | 114 } // namespace media |
OLD | NEW |