Loading media/libstagefright/codec2/include/C2Buffer.h +1 −1 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,7 @@ public: * \retval C2_NOT_FOUND the notification was not found * \retval C2_CORRUPTED an unknown error prevented the registration (unexpected) */ C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify); C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg = nullptr); ///@} Loading media/libstagefright/codec2/tests/vndk/C2BufferTest.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -475,9 +475,10 @@ TEST_F(C2BufferTest, BufferTest) { destroyed = false; ASSERT_EQ(C2_OK, buffer->registerOnDestroyNotify(&DestroyCallback, &arg)); EXPECT_FALSE(destroyed); ASSERT_EQ(C2_OK, buffer->unregisterOnDestroyNotify(&DestroyCallback)); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback, nullptr)); ASSERT_EQ(C2_OK, buffer->unregisterOnDestroyNotify(&DestroyCallback, &arg)); EXPECT_FALSE(destroyed); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback)); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback, &arg)); buffer.reset(); EXPECT_FALSE(destroyed); Loading media/libstagefright/codec2/vndk/C2Buffer.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,7 @@ public: const C2BufferData &data() const { return mData; } C2Error registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg = nullptr) { C2Error registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { auto it = std::find_if( mNotify.begin(), mNotify.end(), [onDestroyNotify, arg] (const auto &pair) { Loading @@ -1357,11 +1357,11 @@ public: return C2_OK; } C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify) { C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { auto it = std::find_if( mNotify.begin(), mNotify.end(), [onDestroyNotify] (const auto &pair) { return pair.first == onDestroyNotify; [onDestroyNotify, arg] (const auto &pair) { return pair.first == onDestroyNotify && pair.second == arg; }); if (it == mNotify.end()) { return C2_NOT_FOUND; Loading Loading @@ -1418,8 +1418,8 @@ C2Error C2Buffer::registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void return mImpl->registerOnDestroyNotify(onDestroyNotify, arg); } C2Error C2Buffer::unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify) { return mImpl->unregisterOnDestroyNotify(onDestroyNotify); C2Error C2Buffer::unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { return mImpl->unregisterOnDestroyNotify(onDestroyNotify, arg); } const std::list<std::shared_ptr<const C2Info>> C2Buffer::infos() const { Loading Loading
media/libstagefright/codec2/include/C2Buffer.h +1 −1 Original line number Diff line number Diff line Loading @@ -1236,7 +1236,7 @@ public: * \retval C2_NOT_FOUND the notification was not found * \retval C2_CORRUPTED an unknown error prevented the registration (unexpected) */ C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify); C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg = nullptr); ///@} Loading
media/libstagefright/codec2/tests/vndk/C2BufferTest.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -475,9 +475,10 @@ TEST_F(C2BufferTest, BufferTest) { destroyed = false; ASSERT_EQ(C2_OK, buffer->registerOnDestroyNotify(&DestroyCallback, &arg)); EXPECT_FALSE(destroyed); ASSERT_EQ(C2_OK, buffer->unregisterOnDestroyNotify(&DestroyCallback)); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback, nullptr)); ASSERT_EQ(C2_OK, buffer->unregisterOnDestroyNotify(&DestroyCallback, &arg)); EXPECT_FALSE(destroyed); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback)); ASSERT_EQ(C2_NOT_FOUND, buffer->unregisterOnDestroyNotify(&DestroyCallback, &arg)); buffer.reset(); EXPECT_FALSE(destroyed); Loading
media/libstagefright/codec2/vndk/C2Buffer.cpp +6 −6 Original line number Diff line number Diff line Loading @@ -1344,7 +1344,7 @@ public: const C2BufferData &data() const { return mData; } C2Error registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg = nullptr) { C2Error registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { auto it = std::find_if( mNotify.begin(), mNotify.end(), [onDestroyNotify, arg] (const auto &pair) { Loading @@ -1357,11 +1357,11 @@ public: return C2_OK; } C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify) { C2Error unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { auto it = std::find_if( mNotify.begin(), mNotify.end(), [onDestroyNotify] (const auto &pair) { return pair.first == onDestroyNotify; [onDestroyNotify, arg] (const auto &pair) { return pair.first == onDestroyNotify && pair.second == arg; }); if (it == mNotify.end()) { return C2_NOT_FOUND; Loading Loading @@ -1418,8 +1418,8 @@ C2Error C2Buffer::registerOnDestroyNotify(OnDestroyNotify onDestroyNotify, void return mImpl->registerOnDestroyNotify(onDestroyNotify, arg); } C2Error C2Buffer::unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify) { return mImpl->unregisterOnDestroyNotify(onDestroyNotify); C2Error C2Buffer::unregisterOnDestroyNotify(OnDestroyNotify onDestroyNotify, void *arg) { return mImpl->unregisterOnDestroyNotify(onDestroyNotify, arg); } const std::list<std::shared_ptr<const C2Info>> C2Buffer::infos() const { Loading