OMX只是一个框架,所以与解码器是硬解还是软解都没关系,而且大多说厂家的硬解码都是使用OMX框架
enum State {
DEAD,
LOADED,
LOADED_TO_IDLE,
IDLE_TO_EXECUTING,
EXECUTING,
EXECUTING_TO_IDLE,
IDLE_TO_LOADED,
RECONFIGURING,
ERROR
};
enum {
kPortIndexInput = 0,
kPortIndexOutput = 1
};
enum PortStatus {
ENABLED,
DISABLING,
DISABLED,
ENABLING,
SHUTTING_DOWN,
};
enum Quirks {
kNeedsFlushBeforeDisable = 1,
kWantsNALFragments = 2,
kRequiresLoadedToIdleAft erAllocation = 4,
kRequiresAllocateBufferO nInputPorts = 8,
kRequiresFlushCompleteEm ulation = 16,
kRequiresAllocateBufferO nOutputPorts = 32,
kRequiresFlushBeforeShut down = 64,
kDefersOutputBufferAlloc ation = 128,
kDecoderLiesAboutNumberO fChannels = 256,
kInputBufferSizesAreBogu s = 512,
kSupportsMultipleFramesP erInputBuffer = 1024,
kAvoidMemcopyInputRecord ingFrames = 2048,
kRequiresLargerEncoderOu tputBuffer = 4096,
kOutputBuffersAreUnreada ble = 8192,
};
enum BufferStatus {
OWNED_BY_US,
OWNED_BY_COMPONENT,
OWNED_BY_NATIVE_WINDOW,
OWNED_BY_CLIENT,
};
struct BufferInfo {
IOMX::buffer_id mBuffer;
BufferStatus mStatus;
sp<IMemory> mMem;
size_t mSize;
void *mData;
MediaBuffer *mMediaBuffer;
};
struct CodecSpecificData {
size_t mSize;
uint8_t mData[1];
};
mNode, info->mBuffer, 0, size,
OMX_BUFFERFLAG_ENDOFFRAME | OMX_BUFFERFLAG_CODECCONFIG,
0);
mNode, info->mBuffer, 0, offset,
flags, timestampUs);
数据格式及OMX输入缓冲细节
err = mOMX->sendCommand(mNode, OMX_CommandStateSet, OMX_StateIdle);
status_t err = mOMX->emptyBuffer(
err = mOMX->emptyBuffer(