Skip to content

gh #755 Add API to relase the acquired avbufferhelper instance - #765

Open
susanmary007 wants to merge 1 commit into
developfrom
feature/gh755_release_avbuffer_helper_instance
Open

gh #755 Add API to relase the acquired avbufferhelper instance#765
susanmary007 wants to merge 1 commit into
developfrom
feature/gh755_release_avbuffer_helper_instance

Conversation

@susanmary007

Copy link
Copy Markdown
  • Add API to relase the acquired avbufferhelper instance
  • Add changes to support dynamic library loading of avbufferhelper library

Copilot AI review requested due to automatic review settings July 31, 2026 12:46
@github-project-automation github-project-automation Bot moved this to Architecture Review Required in halif_aidl Jul 31, 2026
  *  Add API to release the acquired avbufferhelper instance
  *  Add changes to support dynamic library loading of avbufferhelper library
@susanmary007
susanmary007 force-pushed the feature/gh755_release_avbuffer_helper_instance branch from bccb568 to f652275 Compare July 31, 2026 12:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the avbuffer module’s public AVBufferHelper header to support a release API for the acquired helper instance and to support dynamic loading expectations for a vendor-provided libavbufferhelper.so.

Changes:

  • Documented the expected shared library name (libavbufferhelper.so) for vendor implementations.
  • Added a new releaseAVBufferHelperInstance(IAVBufferHelper*) API alongside the existing acquisition factory.
  • Wrapped the factory functions in an extern "C" block to support predictable symbol names for dynamic loading.

Comment on lines +98 to 106
#ifdef __cplusplus
extern "C" {
#endif

// Factory function to acquire the AVBufferHelper singleton instance.
// This API returns the singleton AVBufferHelper instance and increments
// the internal reference count. The caller must invoke
// releaseAVBufferHelperInstance() when the instance is no longer needed.
IAVBufferHelper* getAVBufferHelperInstance();
Comment on lines +36 to +42
/**
* @brief Vendors shall provide the AV Buffer Helper implementation as libavbufferhelper.so.
*
* The middleware uses this predefined library name for dynamic loading, eliminating the need for
* vendor-specific handling and avoiding build-time dependencies.
*/

Copilot AI review requested due to automatic review settings July 31, 2026 12:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Suppressed comments (3)

avbuffer/current/avbufferhelper.h:41

  • The library name is documented here as a predefined value, but it’s only present in a comment. Exposing it as a constant in the header reduces the risk of callers hardcoding divergent strings when doing dlopen/dlsym.
 * @brief Vendors shall provide the AV Buffer Helper implementation as libavbufferhelper.so.
 *
 * The middleware uses this predefined library name for dynamic loading, eliminating the need for
 * vendor-specific handling and avoiding build-time dependencies.
 */

avbuffer/current/avbufferhelper.h:46

  • With the new releaseAVBufferHelperInstance() API and reference-counted lifetime, implementations may end up deleting the helper via an IAVBufferHelper* when the refcount reaches zero. Without a virtual destructor on the interface, deleting through the base pointer is undefined behaviour.
public:
    struct CopyMap {

avbuffer/current/avbufferhelper.h:106

  • This header now has an extern "C" block around the factory APIs, but it also still contains an earlier empty extern "C" block (lines 23-30) that doesn’t wrap any declarations. Keeping both is confusing for readers and maintainers; prefer a single extern "C" wrapper for the factory symbols.
#ifdef __cplusplus
extern "C" {
#endif

// Factory function to acquire the AVBufferHelper singleton instance.
// This API returns the singleton AVBufferHelper instance and increments
// the internal reference count. The caller must invoke
// releaseAVBufferHelperInstance() when the instance is no longer needed.
IAVBufferHelper* getAVBufferHelperInstance();

@Ulrond Ulrond left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix your copilot questions please.

@github-project-automation github-project-automation Bot moved this from Architecture Review Required to Changes Requested in halif_aidl Aug 13, 2026
@Ulrond Ulrond assigned Ulrond and susanmary007 and unassigned Ulrond Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Changes Requested

Development

Successfully merging this pull request may close these issues.

3 participants