35 | * Does not require that the surface's EGL context be current. 36 | */ 37 | public void release() { 38 | releaseEglSurface(); 39 | if (mSurface != null) { 40 | if (mReleaseSurface) { 41 | mSurface.release(); 42 | } 43 | mSurface = null; 44 | } 45 | } 46 | 47 | /** 48 | * Recreate the EGLSurface, using the new EglBase. The caller should have already 49 | * freed the old EGLSurface with releaseEglSurface(). 50 | *
51 | * This is useful when we want to update the EGLSurface associated with a Surface. 52 | * For example, if we want to share with a different EGLContext, which can only 53 | * be done by tearing down and recreating the context. (That's handled by the caller; 54 | * this just creates a new EGLSurface for the Surface we were handed earlier.) 55 | *
56 | * If the previous EGLSurface isn't fully destroyed, e.g. it's still current on a
57 | * context somewhere, the create call will fail with complaints from the Surface
58 | * about already being connected.
59 | */
60 | public void recreate(GLCore newEglCore) {
61 | if (mSurface == null) {
62 | throw new RuntimeException("not yet implemented for SurfaceTexture");
63 | }
64 | mGlCore = newEglCore; // switch to new context
65 | createWindowSurface(mSurface); // create new surface
66 | }
67 |
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/Douyin/app/src/main/java/com/xue/douyin/common/util/FileUtils.java:
--------------------------------------------------------------------------------
1 | package com.xue.douyin.common.util;
2 |
3 | import android.content.res.AssetManager;
4 | import android.util.Log;
5 |
6 | import com.xue.douyin.R;
7 | import com.xue.douyin.application.AppProfile;
8 |
9 | import java.io.BufferedInputStream;
10 | import java.io.BufferedReader;
11 | import java.io.File;
12 | import java.io.FileOutputStream;
13 | import java.io.IOException;
14 | import java.io.InputStream;
15 | import java.io.InputStreamReader;
16 | import java.io.OutputStream;
17 | import java.io.RandomAccessFile;
18 | import java.util.List;
19 |
20 | /**
21 | * Created by 薛贤俊 on 2018/3/15.
22 | */
23 |
24 | public class FileUtils {
25 | /**
26 | * 此类用于生成合并视频所需要的文档
27 | *
28 | * @param strcontent 视频路径集合
29 | * @param filePath 生成的地址
30 | * @param fileName 生成的文件名
31 | */
32 | public static void writeTxtToFile(List