Core concepts of the ccap C interface
mainThe ccap C interface provides full camera capture functionality using an opaque pointer pattern to hide C++ implementation details.
Opaque Pointers
CcapProvider*: Encapsulates theccap::Providerobject for device management and control.CcapVideoFrame*: Encapsulates accap::VideoFrameshared pointer.
Memory Management Principles
- Creation and Destruction: Every object created via
ccap_xxx_create()must be released using its correspondingccap_xxx_destroy()function. - Array Release: Use specialized release functions for arrays of strings or structures returned by the API.
- Frame Management: Frames obtained via
ccap_provider_grab()must be released usingccap_video_frame_release()to prevent memory leaks.