public class TuSdkVideoSurfaceEncodecOperation extends java.lang.Object implements TuSdkEncodecOperation
构造器和说明 |
---|
TuSdkVideoSurfaceEncodecOperation(TuSdkCodecOutput.TuSdkEncodecOutput encodecOutput)
视频编码输出Surface接口
|
限定符和类型 | 方法和说明 |
---|---|
void |
encodecException(java.lang.Exception e)
捕捉到执行异常 宿主线程将自动退出并清理
|
boolean |
encodecInit(TuSdkMediaMuxer mediaMuxer)
初始化编码器 (该操作在合成器线程)
|
boolean |
encodecProcessUntilEnd(TuSdkMediaMuxer mediaMuxer)
执行编码直到完成 (该操作在合成器线程)
|
void |
encodecRelease()
Free up resources used by the codec instance.
|
protected void |
finalize() |
void |
flush() |
TuSdkVideoSurfaceEncodecOperationPatch |
getCodecPatch()
编码器补丁
|
android.view.Surface |
getSurface()
获取 Surface
|
TuSdkVideoInfo |
getVideoInfo()
视频信息
|
boolean |
isEncodecStarted()
是否已启动编解码器
|
void |
notifyNewFrameReady()
通知编码器新帧已经准备好
|
void |
requestKeyFrame()
Request that the encoder produce a sync frame "soon".
|
void |
setCodecPatch(TuSdkVideoSurfaceEncodecOperationPatch codecPatch)
编码器补丁 必须在setMediaFormat之前设置
|
int |
setMediaFormat(android.media.MediaFormat mediaFormat)
设置媒体格式信息
一旦设定后将创建编码器对象并进行configer以及创建输入Surface
补丁必须在setMediaFormat之前设置
|
void |
signalEndOfInputStream()
Signals end-of-stream on input.
|
public TuSdkVideoSurfaceEncodecOperation(TuSdkCodecOutput.TuSdkEncodecOutput encodecOutput)
public android.view.Surface getSurface()
public TuSdkVideoSurfaceEncodecOperationPatch getCodecPatch()
public void setCodecPatch(TuSdkVideoSurfaceEncodecOperationPatch codecPatch)
public TuSdkVideoInfo getVideoInfo()
public int setMediaFormat(android.media.MediaFormat mediaFormat)
mediaFormat
- 媒体格式信息public void requestKeyFrame()
public void notifyNewFrameReady()
public void signalEndOfInputStream()
java.lang.IllegalStateException
- if not in the Executing state.MediaCodec.CodecException
- upon codec error.public void encodecRelease()
Make sure you call this when you're done to free up any opened component instance instead of relying on the garbage collector to do this for you at some point in the future.
encodecRelease
在接口中 TuSdkEncodecOperation
protected void finalize() throws java.lang.Throwable
finalize
在类中 java.lang.Object
java.lang.Throwable
public boolean isEncodecStarted()
isEncodecStarted
在接口中 TuSdkEncodecOperation
public void encodecException(java.lang.Exception e)
encodecException
在接口中 TuSdkEncodecOperation
e
- 异常信息public void flush()
flush
在接口中 TuSdkEncodecOperation
public boolean encodecInit(TuSdkMediaMuxer mediaMuxer)
encodecInit
在接口中 TuSdkEncodecOperation
mediaMuxer
- 系统合成器public boolean encodecProcessUntilEnd(TuSdkMediaMuxer mediaMuxer)
encodecProcessUntilEnd
在接口中 TuSdkEncodecOperation
mediaMuxer
- 系统合成器