-#else
- AVFrame *enc_frame = av_frame_alloc();
- if (!enc_frame) return AVERROR(ENOMEM);
-
- status = av_frame_ref(enc_frame, frame);
- if (status) {
- av_frame_free(&enc_frame);
- return status;
- }
-
- status = CVPixelBufferCreateWithPlanarBytes(
- kCFAllocatorDefault,
- enc_frame->width,
- enc_frame->height,
- color,
- NULL,
- contiguous_buf_size,
- plane_count,
- (void **)enc_frame->data,
- widths,
- heights,
- strides,
- free_avframe,
- enc_frame,
- NULL,
- cv_img
- );
-
- add_color_attr(avctx, pix_buf_attachments);
- CVBufferSetAttachments(*cv_img, pix_buf_attachments, kCVAttachmentMode_ShouldPropagate);
- CFRelease(pix_buf_attachments);
-
- if (status) {
- av_log(avctx, AV_LOG_ERROR, "Error: Could not create CVPixelBuffer: %d\n", status);
- return AVERROR_EXTERNAL;
- }
-#endif