Fix CVPixelBuffer/CMSampleBuffer ownership issues

This commit is contained in:
Cameron Gutman
2023-10-03 18:48:04 -05:00
parent ca041f2934
commit e535706a09
4 changed files with 57 additions and 48 deletions

View File

@@ -5,8 +5,13 @@
#pragma once
#include "src/platform/common.h"
#include "src/platform/macos/av_img_t.h"
struct AVFrame;
namespace platf {
void
free_frame(AVFrame *frame);
class nv12_zero_device: public avcodec_encode_device_t {
// display holds a pointer to an av_video object. Since the namespaces of AVFoundation
@@ -27,6 +32,10 @@ namespace platf {
convert(img_t &img);
int
set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx);
private:
util::safe_ptr<AVFrame, free_frame> av_frame;
av_img_t backing_img;
};
} // namespace platf