Loading apex/mediatranscoding.rc +2 −1 Original line number Diff line number Diff line Loading @@ -6,5 +6,6 @@ service media.transcoding /apex/com.android.media/bin/mediatranscoding user media group media ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance # Restrict to little cores only with system-background cpuset. writepid /dev/cpuset/system-background/tasks disabled media/codec2/hidl/client/client.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -1482,7 +1482,8 @@ c2_status_t Codec2Client::Component::configureVideoTunnel( c2_status_t Codec2Client::Component::setOutputSurface( C2BlockPool::local_id_t blockPoolId, const sp<IGraphicBufferProducer>& surface, uint32_t generation) { uint32_t generation, int maxDequeueCount) { uint64_t bqId = 0; sp<IGraphicBufferProducer> nullIgbp; sp<HGraphicBufferProducer2> nullHgbp; Loading @@ -1496,14 +1497,15 @@ c2_status_t Codec2Client::Component::setOutputSurface( std::shared_ptr<SurfaceSyncObj> syncObj; if (!surface) { mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr); mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr); } else if (surface->getUniqueId(&bqId) != OK) { LOG(ERROR) << "setOutputSurface -- " "cannot obtain bufferqueue id."; bqId = 0; mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr); mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr); } else { mOutputBufferQueue->configure(surface, generation, bqId, nullptr); mOutputBufferQueue->configure(surface, generation, bqId, maxDequeueCount, mBase1_2 ? &syncObj : nullptr); } ALOGD("surface generation remote change %u HAL ver: %s", generation, syncObj ? "1.2" : "1.0"); Loading media/codec2/hidl/client/include/codec2/hidl/client.h +2 −1 Original line number Diff line number Diff line Loading @@ -384,7 +384,8 @@ struct Codec2Client::Component : public Codec2Client::Configurable { c2_status_t setOutputSurface( C2BlockPool::local_id_t blockPoolId, const sp<IGraphicBufferProducer>& surface, uint32_t generation); uint32_t generation, int maxDequeueBufferCount); // Extract a slot number from of the block, then call // IGraphicBufferProducer::queueBuffer(). Loading media/codec2/hidl/client/include/codec2/hidl/output.h +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ struct OutputBufferQueue { bool configure(const sp<IGraphicBufferProducer>& igbp, uint32_t generation, uint64_t bqId, int maxDequeueBufferCount, std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj); // Render a graphic block to current surface. Loading media/codec2/hidl/client/output.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ OutputBufferQueue::~OutputBufferQueue() { bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, uint32_t generation, uint64_t bqId, int maxDequeueBufferCount, std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj) { uint64_t consumerUsage = 0; if (igbp->getConsumerUsage(&consumerUsage) != OK) { Loading Loading @@ -219,6 +220,20 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, { std::scoped_lock<std::mutex> l(mMutex); if (generation == mGeneration) { // case of old BlockPool destruction C2SyncVariables *var = mSyncMem ? mSyncMem->mem() : nullptr; if (var) { *syncObj = std::make_shared<V1_2::SurfaceSyncObj>(); (*syncObj)->bqId = bqId; (*syncObj)->syncMemory = mSyncMem->handle(); (*syncObj)->generationId = generation; (*syncObj)->consumerUsage = consumerUsage; mMaxDequeueBufferCount = maxDequeueBufferCount; var->lock(); var->setSyncStatusLocked(C2SyncVariables::STATUS_INIT); var->setInitialDequeueCountLocked(mMaxDequeueBufferCount, 0); var->unlock(); } return false; } std::shared_ptr<C2SurfaceSyncMemory> oldMem = mSyncMem; Loading @@ -238,6 +253,7 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, mGeneration = generation; mBqId = bqId; mOwner = std::make_shared<int>(0); mMaxDequeueBufferCount = maxDequeueBufferCount; for (int i = 0; i < BufferQueueDefs::NUM_BUFFER_SLOTS; ++i) { if (mBqId == 0 || !mBuffers[i]) { continue; Loading Loading @@ -288,7 +304,9 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, mPoolDatas[i] = poolDatas[i]; } if (newSync) { newSync->setInitialDequeueCount(mMaxDequeueBufferCount, success); newSync->lock(); newSync->setInitialDequeueCountLocked(mMaxDequeueBufferCount, success); newSync->unlock(); } } ALOGD("remote graphic buffer migration %zu/%zu", Loading Loading @@ -452,6 +470,7 @@ void OutputBufferQueue::updateMaxDequeueBufferCount(int maxDequeueBufferCount) { syncVar->unlock(); } mMutex.unlock(); ALOGD("set max dequeue count %d from update", maxDequeueBufferCount); } } // namespace c2 Loading Loading
apex/mediatranscoding.rc +2 −1 Original line number Diff line number Diff line Loading @@ -6,5 +6,6 @@ service media.transcoding /apex/com.android.media/bin/mediatranscoding user media group media ioprio rt 4 task_profiles ProcessCapacityHigh HighPerformance # Restrict to little cores only with system-background cpuset. writepid /dev/cpuset/system-background/tasks disabled
media/codec2/hidl/client/client.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -1482,7 +1482,8 @@ c2_status_t Codec2Client::Component::configureVideoTunnel( c2_status_t Codec2Client::Component::setOutputSurface( C2BlockPool::local_id_t blockPoolId, const sp<IGraphicBufferProducer>& surface, uint32_t generation) { uint32_t generation, int maxDequeueCount) { uint64_t bqId = 0; sp<IGraphicBufferProducer> nullIgbp; sp<HGraphicBufferProducer2> nullHgbp; Loading @@ -1496,14 +1497,15 @@ c2_status_t Codec2Client::Component::setOutputSurface( std::shared_ptr<SurfaceSyncObj> syncObj; if (!surface) { mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr); mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr); } else if (surface->getUniqueId(&bqId) != OK) { LOG(ERROR) << "setOutputSurface -- " "cannot obtain bufferqueue id."; bqId = 0; mOutputBufferQueue->configure(nullIgbp, generation, 0, nullptr); mOutputBufferQueue->configure(nullIgbp, generation, 0, maxDequeueCount, nullptr); } else { mOutputBufferQueue->configure(surface, generation, bqId, nullptr); mOutputBufferQueue->configure(surface, generation, bqId, maxDequeueCount, mBase1_2 ? &syncObj : nullptr); } ALOGD("surface generation remote change %u HAL ver: %s", generation, syncObj ? "1.2" : "1.0"); Loading
media/codec2/hidl/client/include/codec2/hidl/client.h +2 −1 Original line number Diff line number Diff line Loading @@ -384,7 +384,8 @@ struct Codec2Client::Component : public Codec2Client::Configurable { c2_status_t setOutputSurface( C2BlockPool::local_id_t blockPoolId, const sp<IGraphicBufferProducer>& surface, uint32_t generation); uint32_t generation, int maxDequeueBufferCount); // Extract a slot number from of the block, then call // IGraphicBufferProducer::queueBuffer(). Loading
media/codec2/hidl/client/include/codec2/hidl/output.h +1 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,7 @@ struct OutputBufferQueue { bool configure(const sp<IGraphicBufferProducer>& igbp, uint32_t generation, uint64_t bqId, int maxDequeueBufferCount, std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj); // Render a graphic block to current surface. Loading
media/codec2/hidl/client/output.cpp +20 −1 Original line number Diff line number Diff line Loading @@ -178,6 +178,7 @@ OutputBufferQueue::~OutputBufferQueue() { bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, uint32_t generation, uint64_t bqId, int maxDequeueBufferCount, std::shared_ptr<V1_2::SurfaceSyncObj> *syncObj) { uint64_t consumerUsage = 0; if (igbp->getConsumerUsage(&consumerUsage) != OK) { Loading Loading @@ -219,6 +220,20 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, { std::scoped_lock<std::mutex> l(mMutex); if (generation == mGeneration) { // case of old BlockPool destruction C2SyncVariables *var = mSyncMem ? mSyncMem->mem() : nullptr; if (var) { *syncObj = std::make_shared<V1_2::SurfaceSyncObj>(); (*syncObj)->bqId = bqId; (*syncObj)->syncMemory = mSyncMem->handle(); (*syncObj)->generationId = generation; (*syncObj)->consumerUsage = consumerUsage; mMaxDequeueBufferCount = maxDequeueBufferCount; var->lock(); var->setSyncStatusLocked(C2SyncVariables::STATUS_INIT); var->setInitialDequeueCountLocked(mMaxDequeueBufferCount, 0); var->unlock(); } return false; } std::shared_ptr<C2SurfaceSyncMemory> oldMem = mSyncMem; Loading @@ -238,6 +253,7 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, mGeneration = generation; mBqId = bqId; mOwner = std::make_shared<int>(0); mMaxDequeueBufferCount = maxDequeueBufferCount; for (int i = 0; i < BufferQueueDefs::NUM_BUFFER_SLOTS; ++i) { if (mBqId == 0 || !mBuffers[i]) { continue; Loading Loading @@ -288,7 +304,9 @@ bool OutputBufferQueue::configure(const sp<IGraphicBufferProducer>& igbp, mPoolDatas[i] = poolDatas[i]; } if (newSync) { newSync->setInitialDequeueCount(mMaxDequeueBufferCount, success); newSync->lock(); newSync->setInitialDequeueCountLocked(mMaxDequeueBufferCount, success); newSync->unlock(); } } ALOGD("remote graphic buffer migration %zu/%zu", Loading Loading @@ -452,6 +470,7 @@ void OutputBufferQueue::updateMaxDequeueBufferCount(int maxDequeueBufferCount) { syncVar->unlock(); } mMutex.unlock(); ALOGD("set max dequeue count %d from update", maxDequeueBufferCount); } } // namespace c2 Loading