Home | History | Annotate | Download | only in libstagefright

Lines Matching full:portindex

717 void OMXCodec::setMinBufferSize(OMX_U32 portIndex, OMX_U32 size) {
720 def.nPortIndex = portIndex;
726 if ((portIndex == kPortIndexInput && (mQuirks & kInputBufferSizesAreBogus))
740 if (portIndex == kPortIndexInput
749 OMX_U32 portIndex,
754 format.nPortIndex = portIndex;
773 CODEC_LOGV("portIndex: %u, index: %u, eCompressionFormat=%d eColorFormat=%d",
774 portIndex,
848 OMX_COLOR_FORMATTYPE colorFormat, int portIndex) {
856 portFormat.nPortIndex = portIndex;
1626 status_t OMXCodec::allocateBuffersOnPort(OMX_U32 portIndex) {
1627 if (mNativeWindow != NULL && portIndex == kPortIndexOutput) {
1631 if ((mFlags & kEnableGrallocUsageProtected) && portIndex == kPortIndexOutput) {
1638 && portIndex == kPortIndexInput) {
1648 def.nPortIndex = portIndex;
1659 portIndex == kPortIndexInput ? "input" : "output");
1665 mDealer[portIndex] = new MemoryDealer(totalSize, "OMXCodec");
1668 sp<IMemory> mem = mDealer[portIndex]->allocate(def.nBufferSize);
1676 if (portIndex == kPortIndexInput
1683 mNode, portIndex, def.nBufferSize, &buffer,
1687 mNode, portIndex, mem, &buffer, mem->size());
1689 } else if (portIndex == kPortIndexOutput
1695 mNode, portIndex, def.nBufferSize, &buffer,
1699 mNode, portIndex, mem, &buffer, mem->size());
1702 err = mOMX->useBuffer(mNode, portIndex, mem, &buffer, mem->size());
1719 if (portIndex == kPortIndexOutput) {
1731 mPortBuffers[portIndex].push(info);
1734 portIndex == kPortIndexInput ? "input" : "output");
1737 if (portIndex == kPortIndexOutput) {
1763 // dumpPortStatus(portIndex);
1765 if (portIndex == kPortIndexInput && (mFlags & kUseSecureInputBuffers)) {
2395 OMX_U32 portIndex = data;
2396 CODEC_LOGV("PORT_DISABLED(%u)", portIndex);
2399 CHECK_EQ((int)mPortStatus[portIndex], (int)DISABLING);
2400 CHECK_EQ(mPortBuffers[portIndex].size(), 0u);
2402 mPortStatus[portIndex] = DISABLED;
2405 CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
2418 status_t err = enablePortAsync(portIndex);
2420 CODEC_LOGE("enablePortAsync(%u) failed (err = %d)", portIndex, err);
2423 err = allocateBuffersOnPort(portIndex);
2427 portIndex == kPortIndexInput
2440 OMX_U32 portIndex = data;
2441 CODEC_LOGV("PORT_ENABLED(%u)", portIndex);
2444 CHECK_EQ((int)mPortStatus[portIndex], (int)ENABLING);
2446 mPortStatus[portIndex] = ENABLED;
2449 CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
2460 OMX_U32 portIndex = data;
2462 CODEC_LOGV("FLUSH_DONE(%u)", portIndex);
2464 CHECK_EQ((int)mPortStatus[portIndex], (int)SHUTTING_DOWN);
2465 mPortStatus[portIndex] = ENABLED;
2467 CHECK_EQ(countBuffersWeOwn(mPortBuffers[portIndex]),
2468 mPortBuffers[portIndex].size());
2475 CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
2477 disablePortAsync(portIndex);
2644 OMX_U32 portIndex, bool onlyThoseWeOwn) {
2645 Vector<BufferInfo> *buffers = &mPortBuffers[portIndex];
2659 CODEC_LOGV("freeing buffer %u on port %u", info->mBuffer, portIndex);
2661 status_t err = freeBuffer(portIndex, i);
2674 status_t OMXCodec::freeBuffer(OMX_U32 portIndex, size_t bufIndex) {
2675 Vector<BufferInfo> *buffers = &mPortBuffers[portIndex];
2679 status_t err = mOMX->freeBuffer(mNode, portIndex, info->mBuffer);
2682 CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
2705 void OMXCodec::onPortSettingsChanged(OMX_U32 portIndex) {
2706 CODEC_LOGV("PORT_SETTINGS_CHANGED(%u)", portIndex);
2709 CHECK_EQ(portIndex, (OMX_U32)kPortIndexOutput);
2721 if (!flushPortAsync(portIndex)) {
2722 onCmdComplete(OMX_CommandFlush, portIndex);
2725 disablePortAsync(portIndex);
2729 bool OMXCodec::flushPortAsync(OMX_U32 portIndex) {
2734 portIndex, countBuffersWeOwn(mPortBuffers[portIndex]),
2735 mPortBuffers[portIndex].size());
2737 CHECK_EQ((int)mPortStatus[portIndex], (int)ENABLED);
2738 mPortStatus[portIndex] = SHUTTING_DOWN;
2741 && countBuffersWeOwn(mPortBuffers[portIndex])
2742 == mPortBuffers[portIndex].size()) {
2750 mOMX->sendCommand(mNode, OMX_CommandFlush, portIndex);
2756 void OMXCodec::disablePortAsync(OMX_U32 portIndex) {
2759 CHECK_EQ((int)mPortStatus[portIndex], (int)ENABLED);
2760 mPortStatus[portIndex] = DISABLING;
2762 CODEC_LOGV("sending OMX_CommandPortDisable(%u)", portIndex);
2764 mOMX->sendCommand(mNode, OMX_CommandPortDisable, portIndex);
2767 freeBuffersOnPort(portIndex, true);
2770 status_t OMXCodec::enablePortAsync(OMX_U32 portIndex) {
2773 CHECK_EQ((int)mPortStatus[portIndex], (int)DISABLED);
2774 mPortStatus[portIndex] = ENABLING;
2776 CODEC_LOGV("sending OMX_CommandPortEnable(%u)", portIndex);
2777 return mOMX->sendCommand(mNode, OMX_CommandPortEnable, portIndex);
3192 OMX_U32 portIndex, int32_t sampleRate, int32_t numChannels) {
3197 def.nPortIndex = portIndex;
3208 pcmParams.nPortIndex = portIndex;
3276 OMX_U32 portIndex = mIsEncoder ? kPortIndexOutput : kPortIndexInput;
3280 def.nPortIndex = portIndex;
3893 void OMXCodec::dumpPortStatus(OMX_U32 portIndex) {
3896 def.nPortIndex = portIndex;
3902 printf("%s Port = {\n", portIndex == kPortIndexInput ? "Input" : "Output");
3904 CHECK((portIndex == kPortIndexInput && def.eDir == OMX_DirInput)
3905 || (portIndex == kPortIndexOutput && def.eDir == OMX_DirOutput));
3962 params.nPortIndex = portIndex;
3981 amr.nPortIndex = portIndex;