public FrameProducer(final EglBase eglBase, final File videoFile, final int fps, final Callback callback) { mVideoFile = videoFile; mFps = fps; mCallback = callback; mBufferInfo = new MediaCodec.BufferInfo(); mSurfaceTextureHelper = SurfaceTextureHelper.create("SurfaceTextureHelper", eglBase.getEglBaseContext()); mSurfaceTextureHelper.startListening(this); mHubSurface = new Surface(mSurfaceTextureHelper.getSurfaceTexture()); }
/** * Constructor. * * @param uri uri of resource * @param width width * @param height height */ public VideoCapturerExternalResource(EglBase.Context sharedContext, final String uri, final int width, final int height) { mUri = uri; mWidth = width; mHeight = height; mFPS = 30; HandlerThread cameraThread = new HandlerThread(TAG); cameraThread.start(); mCameraThreadHandler = new Handler(cameraThread.getLooper()); mSurfaceHelper = SurfaceTextureHelper.create(sharedContext, mCameraThreadHandler); }
@Override public SurfaceTextureHelper getSurfaceTextureHelper() { return mSurfaceHelper; }