Loading media/codec2/sfplugin/C2OMXNode.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -202,8 +202,10 @@ C2OMXNode::C2OMXNode(const std::shared_ptr<Codec2Client::Component> &comp) android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ALWAYS); mQueueThread->run("C2OMXNode", PRIORITY_AUDIO); Mutexed<android_dataspace>::Locked ds(mDataspace); *ds = HAL_DATASPACE_UNKNOWN; android_dataspace ds = HAL_DATASPACE_UNKNOWN; mDataspace.lock().set(ds); uint32_t pf = PIXEL_FORMAT_UNKNOWN; mPixelFormat.lock().set(pf); } status_t C2OMXNode::freeNode() { Loading Loading @@ -521,8 +523,8 @@ status_t C2OMXNode::dispatchMessage(const omx_message& msg) { ALOGD("dataspace changed to %#x pixel format: %#x", dataSpace, pixelFormat); mQueueThread->setDataspace(dataSpace); Mutexed<android_dataspace>::Locked ds(mDataspace); *ds = dataSpace; mDataspace.lock().set(dataSpace); mPixelFormat.lock().set(pixelFormat); return OK; } Loading Loading @@ -559,6 +561,10 @@ android_dataspace C2OMXNode::getDataspace() { return *mDataspace.lock(); } uint32_t C2OMXNode::getPixelFormat() { return *mPixelFormat.lock(); } void C2OMXNode::setPriority(int priority) { mQueueThread->setPriority(priority); } Loading media/codec2/sfplugin/C2OMXNode.h +6 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ struct C2OMXNode : public BnOMXNode { */ android_dataspace getDataspace(); /** * Returns dataspace information from GraphicBufferSource. */ uint32_t getPixelFormat(); /** * Sets priority of the queue thread. */ Loading @@ -112,6 +117,7 @@ private: uint32_t mHeight; uint64_t mUsage; Mutexed<android_dataspace> mDataspace; Mutexed<uint32_t> mPixelFormat; // WORKAROUND: timestamp adjustment Loading media/codec2/sfplugin/CCodec.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,10 @@ public: return mNode->getDataspace(); } uint32_t getPixelFormat() override { return mNode->getPixelFormat(); } private: sp<HGraphicBufferSource> mSource; sp<C2OMXNode> mNode; Loading Loading @@ -2510,6 +2514,8 @@ void CCodec::onMessageReceived(const sp<AMessage> &msg) { uint32_t pf = PIXEL_FORMAT_UNKNOWN; if (!config->mInputSurface) { pf = mChannel->getBuffersPixelFormat(config->mDomain & Config::IS_ENCODER); } else { pf = config->mInputSurface->getPixelFormat(); } if (pf != PIXEL_FORMAT_UNKNOWN) { mMetrics->setInt64(kCodecPixelFormat, pf); Loading media/codec2/sfplugin/InputSurfaceWrapper.h +6 −0 Original line number Diff line number Diff line Loading @@ -112,8 +112,14 @@ public: */ virtual android_dataspace getDataspace() { return mDataSpace; } /** * Returns pixel format information from GraphicBufferSource. */ virtual uint32_t getPixelFormat() { return mPixelFormat; } protected: android_dataspace mDataSpace; uint32_t mPixelFormat; }; } // namespace android Loading Loading
media/codec2/sfplugin/C2OMXNode.cpp +10 −4 Original line number Diff line number Diff line Loading @@ -202,8 +202,10 @@ C2OMXNode::C2OMXNode(const std::shared_ptr<Codec2Client::Component> &comp) android_fdsan_set_error_level(ANDROID_FDSAN_ERROR_LEVEL_WARN_ALWAYS); mQueueThread->run("C2OMXNode", PRIORITY_AUDIO); Mutexed<android_dataspace>::Locked ds(mDataspace); *ds = HAL_DATASPACE_UNKNOWN; android_dataspace ds = HAL_DATASPACE_UNKNOWN; mDataspace.lock().set(ds); uint32_t pf = PIXEL_FORMAT_UNKNOWN; mPixelFormat.lock().set(pf); } status_t C2OMXNode::freeNode() { Loading Loading @@ -521,8 +523,8 @@ status_t C2OMXNode::dispatchMessage(const omx_message& msg) { ALOGD("dataspace changed to %#x pixel format: %#x", dataSpace, pixelFormat); mQueueThread->setDataspace(dataSpace); Mutexed<android_dataspace>::Locked ds(mDataspace); *ds = dataSpace; mDataspace.lock().set(dataSpace); mPixelFormat.lock().set(pixelFormat); return OK; } Loading Loading @@ -559,6 +561,10 @@ android_dataspace C2OMXNode::getDataspace() { return *mDataspace.lock(); } uint32_t C2OMXNode::getPixelFormat() { return *mPixelFormat.lock(); } void C2OMXNode::setPriority(int priority) { mQueueThread->setPriority(priority); } Loading
media/codec2/sfplugin/C2OMXNode.h +6 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,11 @@ struct C2OMXNode : public BnOMXNode { */ android_dataspace getDataspace(); /** * Returns dataspace information from GraphicBufferSource. */ uint32_t getPixelFormat(); /** * Sets priority of the queue thread. */ Loading @@ -112,6 +117,7 @@ private: uint32_t mHeight; uint64_t mUsage; Mutexed<android_dataspace> mDataspace; Mutexed<uint32_t> mPixelFormat; // WORKAROUND: timestamp adjustment Loading
media/codec2/sfplugin/CCodec.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -431,6 +431,10 @@ public: return mNode->getDataspace(); } uint32_t getPixelFormat() override { return mNode->getPixelFormat(); } private: sp<HGraphicBufferSource> mSource; sp<C2OMXNode> mNode; Loading Loading @@ -2510,6 +2514,8 @@ void CCodec::onMessageReceived(const sp<AMessage> &msg) { uint32_t pf = PIXEL_FORMAT_UNKNOWN; if (!config->mInputSurface) { pf = mChannel->getBuffersPixelFormat(config->mDomain & Config::IS_ENCODER); } else { pf = config->mInputSurface->getPixelFormat(); } if (pf != PIXEL_FORMAT_UNKNOWN) { mMetrics->setInt64(kCodecPixelFormat, pf); Loading
media/codec2/sfplugin/InputSurfaceWrapper.h +6 −0 Original line number Diff line number Diff line Loading @@ -112,8 +112,14 @@ public: */ virtual android_dataspace getDataspace() { return mDataSpace; } /** * Returns pixel format information from GraphicBufferSource. */ virtual uint32_t getPixelFormat() { return mPixelFormat; } protected: android_dataspace mDataSpace; uint32_t mPixelFormat; }; } // namespace android Loading