8#include <CoreMedia/CoreMedia.h>
9#include <CoreVideo/CoreVideo.h>
19 CMSampleBufferRef
buf;
27 buf((CMSampleBufferRef) CFRetain(
buf)) {
51 CMSampleBufferGetImageBuffer(sb)
53 CVPixelBufferLockBaseAddress(
buf, kCVPixelBufferLock_ReadOnly);
61 [[nodiscard]] uint8_t *
data()
const {
62 return static_cast<uint8_t *
>(CVPixelBufferGetBaseAddress(
buf));
68 CVPixelBufferUnlockBaseAddress(
buf, kCVPixelBufferLock_ReadOnly);
97 std::shared_ptr<av_sample_buf_t> sb,
98 std::shared_ptr<av_pixel_buf_t> pb,
Declarations for common platform specific utilities.
Captured macOS image backed by an AV sample buffer.
Definition av_img_t.h:76
std::shared_ptr< av_sample_buf_t > sample_buffer
Retained AVFoundation sample buffer for the captured frame.
Definition av_img_t.h:77
std::shared_ptr< av_pixel_buf_t > pixel_buffer
Retained CoreVideo pixel buffer extracted from the sample.
Definition av_img_t.h:78
CoreVideo pixel buffer retained by an AV image wrapper.
Definition av_img_t.h:40
av_pixel_buf_t(CMSampleBufferRef sb)
Lock the sample buffer's pixel buffer for read-only access.
Definition av_img_t.h:49
uint8_t * data() const
Return the base address of the locked Core Video pixel buffer.
Definition av_img_t.h:61
CVPixelBufferRef buf
Pixel buffer extracted from the sample buffer.
Definition av_img_t.h:41
CoreMedia sample buffer retained by an AV image wrapper.
Definition av_img_t.h:18
av_sample_buf_t(CMSampleBufferRef buf)
Retain a CoreMedia sample buffer for captured-image lifetime.
Definition av_img_t.h:26
CMSampleBufferRef buf
Retained CoreMedia sample buffer.
Definition av_img_t.h:19
Captured frame buffer shared between capture and encode stages.
Definition common.h:502
Temporary retain wrapper used while AV image data is borrowed.
Definition av_img_t.h:84
temp_retain_av_img_t(std::shared_ptr< av_sample_buf_t > sb, std::shared_ptr< av_pixel_buf_t > pb, uint8_t *dt)
Construct a temporary AV image retain wrapper.
Definition av_img_t.h:96
std::shared_ptr< av_pixel_buf_t > pixel_buffer
Pixel buffer kept locked while data is borrowed.
Definition av_img_t.h:86
std::shared_ptr< av_sample_buf_t > sample_buffer
Sample buffer kept alive while data is borrowed.
Definition av_img_t.h:85
uint8_t * data
Pointer to the locked pixel buffer bytes.
Definition av_img_t.h:87