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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 assertEquals(image.frameType, EncodedImage.FrameType.VideoFrameKey); | 74 assertEquals(image.frameType, EncodedImage.FrameType.VideoFrameKey); |
75 assertEquals(image.rotation, 0); | 75 assertEquals(image.rotation, 0); |
76 assertTrue(image.completeFrame); | 76 assertTrue(image.completeFrame); |
77 | 77 |
78 encodeDone.countDown(); | 78 encodeDone.countDown(); |
79 } | 79 } |
80 }; | 80 }; |
81 | 81 |
82 assertEquals(encoder.initEncode(SETTINGS, callback), VideoCodecStatus.OK); | 82 assertEquals(encoder.initEncode(SETTINGS, callback), VideoCodecStatus.OK); |
83 | 83 |
84 VideoFrame.I420Buffer buffer = new I420BufferImpl(SETTINGS.width, SETTINGS.h
eight); | 84 VideoFrame.I420Buffer buffer = I420BufferImpl.allocate(SETTINGS.width, SETTI
NGS.height); |
85 VideoFrame frame = | 85 VideoFrame frame = |
86 new VideoFrame(buffer, 0 /* rotation */, presentationTimestampUs * 1000,
new Matrix()); | 86 new VideoFrame(buffer, 0 /* rotation */, presentationTimestampUs * 1000,
new Matrix()); |
87 VideoEncoder.EncodeInfo info = new VideoEncoder.EncodeInfo( | 87 VideoEncoder.EncodeInfo info = new VideoEncoder.EncodeInfo( |
88 new EncodedImage.FrameType[] {EncodedImage.FrameType.VideoFrameKey}); | 88 new EncodedImage.FrameType[] {EncodedImage.FrameType.VideoFrameKey}); |
89 | 89 |
90 assertEquals(encoder.encode(frame, info), VideoCodecStatus.OK); | 90 assertEquals(encoder.encode(frame, info), VideoCodecStatus.OK); |
91 | 91 |
92 ThreadUtils.awaitUninterruptibly(encodeDone); | 92 ThreadUtils.awaitUninterruptibly(encodeDone); |
93 | 93 |
94 assertEquals(encoder.release(), VideoCodecStatus.OK); | 94 assertEquals(encoder.release(), VideoCodecStatus.OK); |
95 } | 95 } |
96 } | 96 } |
OLD | NEW |