OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 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 |
11 package org.webrtc; | 11 package org.webrtc; |
12 | 12 |
13 import android.os.Handler; | 13 import android.os.Handler; |
14 import android.os.HandlerThread; | 14 import android.os.HandlerThread; |
15 import java.io.FileOutputStream; | 15 import java.io.FileOutputStream; |
16 import java.io.IOException; | 16 import java.io.IOException; |
17 import java.nio.ByteBuffer; | 17 import java.nio.ByteBuffer; |
18 import java.util.concurrent.CountDownLatch; | 18 import java.util.concurrent.CountDownLatch; |
19 import java.util.ArrayList; | 19 import java.util.ArrayList; |
20 | 20 |
21 /** | 21 /** |
22 * Can be used to save the video frames to file. | 22 * Can be used to save the video frames to file. |
23 */ | 23 */ |
24 public class VideoFileRenderer implements VideoRenderer.Callbacks { | 24 public class VideoFileRenderer implements VideoRenderer.Callbacks { |
| 25 static { |
| 26 System.loadLibrary("jingle_peerconnection_so"); |
| 27 } |
| 28 |
25 private static final String TAG = "VideoFileRenderer"; | 29 private static final String TAG = "VideoFileRenderer"; |
26 | 30 |
27 private final HandlerThread renderThread; | 31 private final HandlerThread renderThread; |
28 private final Object handlerLock = new Object(); | 32 private final Object handlerLock = new Object(); |
29 private final Handler renderThreadHandler; | 33 private final Handler renderThreadHandler; |
30 private final FileOutputStream videoOutFile; | 34 private final FileOutputStream videoOutFile; |
31 private final String outputFileName; | 35 private final String outputFileName; |
32 private final int outputFileWidth; | 36 private final int outputFileWidth; |
33 private final int outputFileHeight; | 37 private final int outputFileHeight; |
34 private final int outputFrameSize; | 38 private final int outputFrameSize; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 165 } |
162 | 166 |
163 public static native void nativeI420Scale(ByteBuffer srcY, int strideY, ByteBu
ffer srcU, | 167 public static native void nativeI420Scale(ByteBuffer srcY, int strideY, ByteBu
ffer srcU, |
164 int strideU, ByteBuffer srcV, int strideV, int width, int height, ByteBuff
er dst, | 168 int strideU, ByteBuffer srcV, int strideV, int width, int height, ByteBuff
er dst, |
165 int dstWidth, int dstHeight); | 169 int dstWidth, int dstHeight); |
166 | 170 |
167 public static native ByteBuffer nativeCreateNativeByteBuffer(int size); | 171 public static native ByteBuffer nativeCreateNativeByteBuffer(int size); |
168 | 172 |
169 public static native void nativeFreeNativeByteBuffer(ByteBuffer buffer); | 173 public static native void nativeFreeNativeByteBuffer(ByteBuffer buffer); |
170 } | 174 } |
OLD | NEW |