style(macos): various code style fixes (#2086)

This commit is contained in:
ReenigneArcher 2024-02-04 18:37:44 -05:00 committed by GitHub
commit 76e160bb0a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 53 additions and 53 deletions

View file

@ -2,6 +2,8 @@
* @file src/platform/macos/nv12_zero_device.cpp
* @brief todo
*/
#include <utility>
#include "src/platform/macos/nv12_zero_device.h"
#include "src/video.h"
@ -24,7 +26,7 @@ namespace platf {
int
nv12_zero_device::convert(platf::img_t &img) {
av_img_t *av_img = (av_img_t *) &img;
auto *av_img = (av_img_t *) &img;
// Release any existing CVPixelBuffer previously retained for encoding
av_buffer_unref(&av_frame->buf[0]);
@ -34,7 +36,7 @@ namespace platf {
//
// The presence of the AVBufferRef allows FFmpeg to simply add a reference to the buffer
// rather than having to perform a deep copy of the data buffers in avcodec_send_frame().
av_frame->buf[0] = av_buffer_create((uint8_t *) CFRetain(av_img->pixel_buffer->buf), 0, free_buffer, NULL, 0);
av_frame->buf[0] = av_buffer_create((uint8_t *) CFRetain(av_img->pixel_buffer->buf), 0, free_buffer, nullptr, 0);
// Place a CVPixelBufferRef at data[3] as required by AV_PIX_FMT_VIDEOTOOLBOX
av_frame->data[3] = (uint8_t *) av_img->pixel_buffer->buf;
@ -54,15 +56,15 @@ namespace platf {
}
int
nv12_zero_device::init(void *display, pix_fmt_e pix_fmt, resolution_fn_t resolution_fn, pixel_format_fn_t pixel_format_fn) {
nv12_zero_device::init(void *display, pix_fmt_e pix_fmt, resolution_fn_t resolution_fn, const pixel_format_fn_t &pixel_format_fn) {
pixel_format_fn(display, pix_fmt == pix_fmt_e::nv12 ?
kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange :
kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange);
this->display = display;
this->resolution_fn = resolution_fn;
this->resolution_fn = std::move(resolution_fn);
// we never use this pointer but it's existence is checked/used
// we never use this pointer, but its existence is checked/used
// by the platform independent code
data = this;