Loading media/libstagefright/codec2/include/C2.h +17 −16 Original line number Diff line number Diff line Loading @@ -189,6 +189,7 @@ enum c2_blocking_t : int32_t { #define C2_CONST __attribute__((const)) #define C2_HIDE __attribute__((visibility("hidden"))) #define C2_INTERNAL __attribute__((internal_linkage)) #define C2_ALLOW_OVERFLOW __attribute__((no_sanitize("integer"))) #define DEFINE_OTHER_COMPARISON_OPERATORS(type) \ inline bool operator!=(const type &other) const { return !(*this == other); } \ Loading Loading @@ -221,13 +222,13 @@ class C2_HIDE c2_cntr_t; template<typename T> struct C2_HIDE _c2_cntr_compat_helper { template<typename U, typename E=typename std::enable_if<std::is_integral<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline static constexpr T get(const U &value) { return T(value); } template<typename U, typename E=typename std::enable_if<(sizeof(U) >= sizeof(T))>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline static constexpr T get(const c2_cntr_t<U, void> &value) { return T(value.mValue); } Loading Loading @@ -281,7 +282,7 @@ public: /** * Peek as underlying signed type. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr typename std::make_signed<T>::type peek() const { return static_cast<typename std::make_signed<T>::type>(mValue); } Loading @@ -296,7 +297,7 @@ public: /** * Peek as long long - e.g. for printing. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr long long peekll() const { return (long long)mValue; } Loading @@ -304,7 +305,7 @@ public: /** * Peek as unsigned long long - e.g. for printing. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr unsigned long long peekull() const { return (unsigned long long)mValue; } Loading Loading @@ -352,24 +353,24 @@ public: return c2_cntr_t<T, void>(mValue op); \ } DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), +, +=) DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), -, -=) DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), *, *=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, +, +=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, -, -=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, *, *=) DEFINE_C2_CNTR_UNARY_OP(__attribute__((no_sanitize("integer"))), -) DEFINE_C2_CNTR_UNARY_OP(__attribute__((no_sanitize("integer"))), +) DEFINE_C2_CNTR_UNARY_OP(C2_ALLOW_OVERFLOW, -) DEFINE_C2_CNTR_UNARY_OP(C2_ALLOW_OVERFLOW, +) DEFINE_C2_CNTR_CREMENT_OP(__attribute__((no_sanitize("integer"))), ++) DEFINE_C2_CNTR_CREMENT_OP(__attribute__((no_sanitize("integer"))), --) DEFINE_C2_CNTR_CREMENT_OP(C2_ALLOW_OVERFLOW, ++) DEFINE_C2_CNTR_CREMENT_OP(C2_ALLOW_OVERFLOW, --) template<typename U, typename E=typename std::enable_if<std::is_unsigned<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr c2_cntr_t<T> operator<<(const U &value) const { return c2_cntr_t<T>(mValue << value); } template<typename U, typename E=typename std::enable_if<std::is_unsigned<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline c2_cntr_t<T> &operator<<=(const U &value) { mValue <<= value; return *this; Loading @@ -378,12 +379,12 @@ public: /** * Comparison operators */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr bool operator<=(const c2_cntr_t<T> &other) const { return T(other.mValue - mValue) < HALF_RANGE; } __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr bool operator>=(const c2_cntr_t<T> &other) const { return T(mValue - other.mValue) < HALF_RANGE; } Loading media/libstagefright/codec2/include/C2Buffer.h +1288 −1098 File changed.Preview size limit exceeded, changes collapsed. Show changes media/libstagefright/codec2/include/C2Component.h +1 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,7 @@ public: DEFAULT_GRAPHIC, ///< basic graphic allocator type PLATFORM_START = 0x10, VENDOR_START = 0x100, BAD_ID = C2Allocator::BAD_ID, ///< DO NOT USE }; /** Loading media/libstagefright/codec2/tests/vndk/C2BufferTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -29,10 +29,10 @@ namespace android { class C2BufferTest : public ::testing::Test { public: C2BufferTest() : mLinearAllocator(std::make_shared<C2AllocatorIon>()), : mLinearAllocator(std::make_shared<C2AllocatorIon>('i')), mSize(0u), mAddr(nullptr), mGraphicAllocator(std::make_shared<C2AllocatorGralloc>()) { mGraphicAllocator(std::make_shared<C2AllocatorGralloc>('g')) { } ~C2BufferTest() = default; Loading media/libstagefright/codec2/vndk/C2AllocatorGralloc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -540,7 +540,7 @@ c2_status_t C2AllocatorGralloc::Impl::priorGraphicAllocation( return C2_OK; } C2AllocatorGralloc::C2AllocatorGralloc() : mImpl(new Impl) {} C2AllocatorGralloc::C2AllocatorGralloc(id_t) : mImpl(new Impl) {} C2AllocatorGralloc::~C2AllocatorGralloc() { delete mImpl; } Loading Loading
media/libstagefright/codec2/include/C2.h +17 −16 Original line number Diff line number Diff line Loading @@ -189,6 +189,7 @@ enum c2_blocking_t : int32_t { #define C2_CONST __attribute__((const)) #define C2_HIDE __attribute__((visibility("hidden"))) #define C2_INTERNAL __attribute__((internal_linkage)) #define C2_ALLOW_OVERFLOW __attribute__((no_sanitize("integer"))) #define DEFINE_OTHER_COMPARISON_OPERATORS(type) \ inline bool operator!=(const type &other) const { return !(*this == other); } \ Loading Loading @@ -221,13 +222,13 @@ class C2_HIDE c2_cntr_t; template<typename T> struct C2_HIDE _c2_cntr_compat_helper { template<typename U, typename E=typename std::enable_if<std::is_integral<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline static constexpr T get(const U &value) { return T(value); } template<typename U, typename E=typename std::enable_if<(sizeof(U) >= sizeof(T))>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline static constexpr T get(const c2_cntr_t<U, void> &value) { return T(value.mValue); } Loading Loading @@ -281,7 +282,7 @@ public: /** * Peek as underlying signed type. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr typename std::make_signed<T>::type peek() const { return static_cast<typename std::make_signed<T>::type>(mValue); } Loading @@ -296,7 +297,7 @@ public: /** * Peek as long long - e.g. for printing. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr long long peekll() const { return (long long)mValue; } Loading @@ -304,7 +305,7 @@ public: /** * Peek as unsigned long long - e.g. for printing. */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr unsigned long long peekull() const { return (unsigned long long)mValue; } Loading Loading @@ -352,24 +353,24 @@ public: return c2_cntr_t<T, void>(mValue op); \ } DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), +, +=) DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), -, -=) DEFINE_C2_CNTR_BINARY_OP(__attribute__((no_sanitize("integer"))), *, *=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, +, +=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, -, -=) DEFINE_C2_CNTR_BINARY_OP(C2_ALLOW_OVERFLOW, *, *=) DEFINE_C2_CNTR_UNARY_OP(__attribute__((no_sanitize("integer"))), -) DEFINE_C2_CNTR_UNARY_OP(__attribute__((no_sanitize("integer"))), +) DEFINE_C2_CNTR_UNARY_OP(C2_ALLOW_OVERFLOW, -) DEFINE_C2_CNTR_UNARY_OP(C2_ALLOW_OVERFLOW, +) DEFINE_C2_CNTR_CREMENT_OP(__attribute__((no_sanitize("integer"))), ++) DEFINE_C2_CNTR_CREMENT_OP(__attribute__((no_sanitize("integer"))), --) DEFINE_C2_CNTR_CREMENT_OP(C2_ALLOW_OVERFLOW, ++) DEFINE_C2_CNTR_CREMENT_OP(C2_ALLOW_OVERFLOW, --) template<typename U, typename E=typename std::enable_if<std::is_unsigned<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr c2_cntr_t<T> operator<<(const U &value) const { return c2_cntr_t<T>(mValue << value); } template<typename U, typename E=typename std::enable_if<std::is_unsigned<U>::value>::type> __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline c2_cntr_t<T> &operator<<=(const U &value) { mValue <<= value; return *this; Loading @@ -378,12 +379,12 @@ public: /** * Comparison operators */ __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr bool operator<=(const c2_cntr_t<T> &other) const { return T(other.mValue - mValue) < HALF_RANGE; } __attribute__((no_sanitize("integer"))) C2_ALLOW_OVERFLOW inline constexpr bool operator>=(const c2_cntr_t<T> &other) const { return T(mValue - other.mValue) < HALF_RANGE; } Loading
media/libstagefright/codec2/include/C2Buffer.h +1288 −1098 File changed.Preview size limit exceeded, changes collapsed. Show changes
media/libstagefright/codec2/include/C2Component.h +1 −0 Original line number Diff line number Diff line Loading @@ -696,6 +696,7 @@ public: DEFAULT_GRAPHIC, ///< basic graphic allocator type PLATFORM_START = 0x10, VENDOR_START = 0x100, BAD_ID = C2Allocator::BAD_ID, ///< DO NOT USE }; /** Loading
media/libstagefright/codec2/tests/vndk/C2BufferTest.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -29,10 +29,10 @@ namespace android { class C2BufferTest : public ::testing::Test { public: C2BufferTest() : mLinearAllocator(std::make_shared<C2AllocatorIon>()), : mLinearAllocator(std::make_shared<C2AllocatorIon>('i')), mSize(0u), mAddr(nullptr), mGraphicAllocator(std::make_shared<C2AllocatorGralloc>()) { mGraphicAllocator(std::make_shared<C2AllocatorGralloc>('g')) { } ~C2BufferTest() = default; Loading
media/libstagefright/codec2/vndk/C2AllocatorGralloc.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -540,7 +540,7 @@ c2_status_t C2AllocatorGralloc::Impl::priorGraphicAllocation( return C2_OK; } C2AllocatorGralloc::C2AllocatorGralloc() : mImpl(new Impl) {} C2AllocatorGralloc::C2AllocatorGralloc(id_t) : mImpl(new Impl) {} C2AllocatorGralloc::~C2AllocatorGralloc() { delete mImpl; } Loading