Android 硬编码 备注

这里是为了在学习硬编码过程中遇到很多方法,不明白是什么意思,查阅资料后得到了一些理解立刻在这里做了记录,所以比较乱;

public final int dequeueInputBuffer (long timeoutUs) :Returns the index of an input buffer to be filled with valid data or -1 if no such buffer is currently available. This method will return immediately if timeoutUs == 0, wait indefinitely for the availability of an input buffer if timeoutUs < 0 or wait up to "timeoutUs" microseconds if timeoutUs > 0.

返回一个可用来填充有效数据的inputbuffer的索引(Index),如果返回-1表示暂无可用的buffer. 如果 timeoutUs == 0,该方法会立刻返回值, 如果 timeoutUs < 0 则一直等待,如果 timeoutUs > 0则等待对应时间.


public final int  dequeueOutputBuffer(MediaCodec.BufferInfo, long) :Dequeue an output buffer, block at most "timeoutUs" microseconds. Returns the index of an output buffer that has been successfully decoded or one of the INFO_* constants.

使输出缓冲器出队,最多阻塞“timeoutUs”微秒。 返回已成功解码的输出缓冲区的索引或INFO_ *常量之一。


public ByteBuffer[] getInputBuffers () :Retrieve the set of input buffers. Call this after start() returns. After calling this method, any ByteBuffers previously returned by an earlier call to this method MUST no longer be used.

检索输入缓冲区集。 在start()返回后调用此函数。 调用此方法后,先前由此方法调用返回的任何ByteBuffer都不再使用。

This method was deprecated in API level 21.
Use the new getInputBuffer(int) method instead each time an input buffer is dequeued. Note: As of API 21, dequeued input buffers are automatically clearedDo not use this method if using an input surface.此方法在API级别21中已弃用。
每次输入缓冲区出队时,使用新的getInputBuffer(int)方法。 注意:自API 21起,出列的输入缓冲区将自动清除。 如果使用输入表面,请勿使用此方法。

public void queueInputBuffer(int index, int offset, int size, long presentationTimeUs, int flags)
After filling a range of the input buffer at the specified index submit it to the component.

以指定索引填充输入缓冲区的范围后,将其提交到组件。


public ByteBuffer[] getOutputBuffers () :Retrieve the set of output buffers. Call this after start() returns and whenever dequeueOutputBuffer signals an output buffer change by returning INFO_OUTPUT_BUFFERS_CHANGED. After calling this method, any ByteBuffers previously returned by an earlier call to this method MUST no longer be used.

检索该组输出缓冲区。 在start()返回后,每当dequeueOutputBuffer通过返回INFO_OUTPUT_BUFFERS_CHANGED通知输出缓冲区发生更改时调用此函数。 调用此方法后,先前由此方法调用返回的任何ByteBuffer都不再使用。

INFO_OUTPUT_BUFFERS_CHANGED:The output buffers have changed, the client must refer to the new set of output buffers returned by getOutputBuffers() from this point on.

Additionally, this event signals that the video scaling mode may have been reset to the default.
输出缓冲区已更改,客户端必须参考从这一点开始由getOutputBuffers()返回的新的输出缓冲区集。
此外,此事件表示视频缩放模式可能已重置为默认值。

INFO_OUTPUT_FORMAT_CHANGED:The output format has changed, subsequent data will follow the new format. getOutputFormat() returns the new format. Note, that you can also use the new getOutputFormat(int) method to get the format for a specific output buffer. This frees you from having to track output format changes.

输出格式已更改,后续数据将遵循新格式。 getOutputFormat()返回新格式。 注意,你也可以使用新的getOutputFormat(int)方法来获取特定输出缓冲区的格式。 这使您不必跟踪输出格式更改。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值