Merge "Suppress fortify-source warning" into main
diff --git a/media/codec2/core/include/C2Buffer.h b/media/codec2/core/include/C2Buffer.h
index 7e1df91..a04fc41 100644
--- a/media/codec2/core/include/C2Buffer.h
+++ b/media/codec2/core/include/C2Buffer.h
@@ -1046,13 +1046,9 @@
* (unexpected)
*/
virtual c2_status_t fetchLinearBlock(
- uint32_t capacity __unused, C2MemoryUsage usage __unused,
+ uint32_t capacity, C2MemoryUsage usage,
std::shared_ptr<C2LinearBlock> *block /* nonnull */,
- C2Fence *fence /* nonnull */) {
- *block = nullptr;
- (void) fence;
- return C2_OMITTED;
- }
+ C2Fence *fence /* nonnull */);
/**
* Blocking fetch for 2D graphic block. Obtains a 2D graphic writable block of given |capacity|
@@ -1096,14 +1092,10 @@
* (unexpected)
*/
virtual c2_status_t fetchGraphicBlock(
- uint32_t width __unused, uint32_t height __unused, uint32_t format __unused,
- C2MemoryUsage usage __unused,
+ uint32_t width, uint32_t height, uint32_t format,
+ C2MemoryUsage usage,
std::shared_ptr<C2GraphicBlock> *block /* nonnull */,
- C2Fence *fence /* nonnull */) {
- *block = nullptr;
- (void) fence;
- return C2_OMITTED;
- }
+ C2Fence *fence /* nonnull */);
protected:
C2BlockPool() = default;
};
diff --git a/media/codec2/vndk/C2Buffer.cpp b/media/codec2/vndk/C2Buffer.cpp
index a56a216..7b9b80d 100644
--- a/media/codec2/vndk/C2Buffer.cpp
+++ b/media/codec2/vndk/C2Buffer.cpp
@@ -28,6 +28,7 @@
#include <C2AllocatorGralloc.h>
#include <C2AllocatorIon.h>
#include <C2BufferPriv.h>
+#include <C2Debug.h>
#include <C2BlockInternal.h>
#include <C2PlatformSupport.h>
#include <bufferpool/ClientManager.h>
@@ -116,6 +117,32 @@
} // namespace
+/*
+*/
+
+c2_status_t C2BlockPool::fetchLinearBlock(
+ uint32_t capacity, C2MemoryUsage usage,
+ std::shared_ptr<C2LinearBlock> *block /* nonnull */,
+ C2Fence *fence /* nonnull */) {
+ // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING
+ c2_status_t result = fetchLinearBlock(capacity, usage, block);
+ C2_CHECK_NE(result, C2_BLOCKING);
+ *fence = C2Fence();
+ return result;
+}
+
+c2_status_t C2BlockPool::fetchGraphicBlock(
+ uint32_t width, uint32_t height, uint32_t format,
+ C2MemoryUsage usage,
+ std::shared_ptr<C2GraphicBlock> *block /* nonnull */,
+ C2Fence *fence /* nonnull */) {
+ // fall back to non-waitable implementation, as long as it does not return C2_BLOCKING
+ c2_status_t result = fetchGraphicBlock(width, height, format, usage, block);
+ C2_CHECK_NE(result, C2_BLOCKING);
+ *fence = C2Fence();
+ return result;
+}
+
/* ========================================== 1D BLOCK ========================================= */
/**