Loading media/codec2/components/base/SimpleC2Component.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ public: c2_status_t status; do { status = mBase->fetchLinearBlock(capacity, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading @@ -162,7 +162,7 @@ public: c2_status_t status; do { status = mBase->fetchCircularBlock(capacity, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading @@ -174,7 +174,7 @@ public: do { status = mBase->fetchGraphicBlock(width, height, format, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading media/codec2/core/include/C2Buffer.h +3 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error) * \retval C2_OMITTED this pool does not support linear blocks Loading Loading @@ -916,6 +917,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error) * \retval C2_OMITTED this pool does not support circular blocks Loading Loading @@ -946,6 +948,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE width, height, format or usage are not supported (invalid) (caller * error) Loading media/codec2/vndk/platform/C2BqBuffer.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -207,13 +207,17 @@ private: // dequeueBuffer returns flag. if (!transStatus.isOk() || status < android::OK) { ALOGD("cannot dequeue buffer %d", status); if (transStatus.isOk() && status == android::INVALID_OPERATION) { // Too many buffer dequeued. retrying after some time is required. return C2_TIMED_OUT; } else { return C2_BAD_VALUE; if (transStatus.isOk()) { if (status == android::INVALID_OPERATION || status == android::TIMED_OUT || status == android::WOULD_BLOCK) { // Dequeue buffer is blocked temporarily. Retrying is // required. return C2_BLOCKING; } } return C2_BAD_VALUE; } ALOGV("dequeued a buffer successfully"); native_handle_t* nh = nullptr; hidl_handle fenceHandle; Loading @@ -227,7 +231,7 @@ private: if (status == -ETIME) { // fence is not signalled yet. (void)mProducer->cancelBuffer(slot, fenceHandle).isOk(); return C2_TIMED_OUT; return C2_BLOCKING; } if (status != android::NO_ERROR) { ALOGD("buffer fence wait error %d", status); Loading Loading @@ -353,14 +357,14 @@ public: return C2_OK; } c2_status_t status = fetchFromIgbp_l(width, height, format, usage, block); if (status == C2_TIMED_OUT) { if (status == C2_BLOCKING) { lock.unlock(); ::usleep(kMaxIgbpRetryDelayUs); continue; } return status; } return C2_TIMED_OUT; return C2_BLOCKING; } void setRenderCallback(const OnRenderCallback &renderCallback) { Loading Loading
media/codec2/components/base/SimpleC2Component.cpp +3 −3 Original line number Diff line number Diff line Loading @@ -151,7 +151,7 @@ public: c2_status_t status; do { status = mBase->fetchLinearBlock(capacity, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading @@ -162,7 +162,7 @@ public: c2_status_t status; do { status = mBase->fetchCircularBlock(capacity, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading @@ -174,7 +174,7 @@ public: do { status = mBase->fetchGraphicBlock(width, height, format, usage, block); } while (status == C2_TIMED_OUT); } while (status == C2_BLOCKING); return status; } Loading
media/codec2/core/include/C2Buffer.h +3 −0 Original line number Diff line number Diff line Loading @@ -888,6 +888,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error) * \retval C2_OMITTED this pool does not support linear blocks Loading Loading @@ -916,6 +917,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE capacity or usage are not supported (invalid) (caller error) * \retval C2_OMITTED this pool does not support circular blocks Loading Loading @@ -946,6 +948,7 @@ public: * \retval C2_OK the operation was successful * \retval C2_NO_MEMORY not enough memory to complete any required allocation * \retval C2_TIMED_OUT the operation timed out * \retval C2_BLOCKING the operation is blocked * \retval C2_REFUSED no permission to complete any required allocation * \retval C2_BAD_VALUE width, height, format or usage are not supported (invalid) (caller * error) Loading
media/codec2/vndk/platform/C2BqBuffer.cpp +12 −8 Original line number Diff line number Diff line Loading @@ -207,13 +207,17 @@ private: // dequeueBuffer returns flag. if (!transStatus.isOk() || status < android::OK) { ALOGD("cannot dequeue buffer %d", status); if (transStatus.isOk() && status == android::INVALID_OPERATION) { // Too many buffer dequeued. retrying after some time is required. return C2_TIMED_OUT; } else { return C2_BAD_VALUE; if (transStatus.isOk()) { if (status == android::INVALID_OPERATION || status == android::TIMED_OUT || status == android::WOULD_BLOCK) { // Dequeue buffer is blocked temporarily. Retrying is // required. return C2_BLOCKING; } } return C2_BAD_VALUE; } ALOGV("dequeued a buffer successfully"); native_handle_t* nh = nullptr; hidl_handle fenceHandle; Loading @@ -227,7 +231,7 @@ private: if (status == -ETIME) { // fence is not signalled yet. (void)mProducer->cancelBuffer(slot, fenceHandle).isOk(); return C2_TIMED_OUT; return C2_BLOCKING; } if (status != android::NO_ERROR) { ALOGD("buffer fence wait error %d", status); Loading Loading @@ -353,14 +357,14 @@ public: return C2_OK; } c2_status_t status = fetchFromIgbp_l(width, height, format, usage, block); if (status == C2_TIMED_OUT) { if (status == C2_BLOCKING) { lock.unlock(); ::usleep(kMaxIgbpRetryDelayUs); continue; } return status; } return C2_TIMED_OUT; return C2_BLOCKING; } void setRenderCallback(const OnRenderCallback &renderCallback) { Loading