OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 import org.junit.Test; | 25 import org.junit.Test; |
26 import org.junit.runner.RunWith; | 26 import org.junit.runner.RunWith; |
27 | 27 |
28 @TargetApi(16) | 28 @TargetApi(16) |
29 @RunWith(BaseJUnit4ClassRunner.class) | 29 @RunWith(BaseJUnit4ClassRunner.class) |
30 public class HardwareVideoEncoderTest { | 30 public class HardwareVideoEncoderTest { |
31 final static String TAG = "MediaCodecVideoEncoderTest"; | 31 final static String TAG = "MediaCodecVideoEncoderTest"; |
32 | 32 |
33 private static final boolean ENABLE_INTEL_VP8_ENCODER = true; | 33 private static final boolean ENABLE_INTEL_VP8_ENCODER = true; |
34 private static final boolean ENABLE_H264_HIGH_PROFILE = true; | 34 private static final boolean ENABLE_H264_HIGH_PROFILE = true; |
35 private static final VideoEncoder.Settings SETTINGS = new VideoEncoder.Setting
s( | 35 private static final VideoEncoder.Settings SETTINGS = |
36 1 /* core */, 640 /* width */, 480 /* height */, 300 /* kbps */, 30 /* fps
*/); | 36 new VideoEncoder.Settings(1 /* core */, 640 /* width */, 480 /* height */,
300 /* kbps */, |
| 37 30 /* fps */, true /* automaticResizeOn */); |
37 | 38 |
38 @Test | 39 @Test |
39 @SmallTest | 40 @SmallTest |
40 public void testInitializeUsingYuvBuffer() { | 41 public void testInitializeUsingYuvBuffer() { |
41 HardwareVideoEncoderFactory factory = | 42 HardwareVideoEncoderFactory factory = |
42 new HardwareVideoEncoderFactory(ENABLE_INTEL_VP8_ENCODER, ENABLE_H264_HI
GH_PROFILE); | 43 new HardwareVideoEncoderFactory(ENABLE_INTEL_VP8_ENCODER, ENABLE_H264_HI
GH_PROFILE); |
43 VideoCodecInfo[] supportedCodecs = factory.getSupportedCodecs(); | 44 VideoCodecInfo[] supportedCodecs = factory.getSupportedCodecs(); |
44 if (supportedCodecs.length == 0) { | 45 if (supportedCodecs.length == 0) { |
45 Log.w(TAG, "No hardware encoding support, skipping testInitializeUsingYuvB
uffer"); | 46 Log.w(TAG, "No hardware encoding support, skipping testInitializeUsingYuvB
uffer"); |
46 return; | 47 return; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 203 |
203 // It should be Ok to delete the texture after calling encodeTexture. | 204 // It should be Ok to delete the texture after calling encodeTexture. |
204 GLES20.glDeleteTextures(1, new int[] {oesTextureId}, 0); | 205 GLES20.glDeleteTextures(1, new int[] {oesTextureId}, 0); |
205 | 206 |
206 ThreadUtils.awaitUninterruptibly(encodeDone); | 207 ThreadUtils.awaitUninterruptibly(encodeDone); |
207 | 208 |
208 assertEquals(encoder.release(), VideoCodecStatus.OK); | 209 assertEquals(encoder.release(), VideoCodecStatus.OK); |
209 eglOesBase.release(); | 210 eglOesBase.release(); |
210 } | 211 } |
211 } | 212 } |
OLD | NEW |