Skip to content
Snippets Groups Projects
Commit d6e34004 authored by Pierre Lespagnol's avatar Pierre Lespagnol
Browse files

accel: enable hardware encoding with videotoolbox on macOS

Change-Id: Icc6a87f62aaf80f867d7dd3ef6927f9940e724a0
parent 4ec9e1a2
No related branches found
No related tags found
No related merge requests found
......@@ -564,8 +564,11 @@ MediaEncoder::prepareEncoderContext(AVCodec* outputCodec, bool is_video)
encoderCtx->max_b_frames = 0;
encoderCtx->pix_fmt = AV_PIX_FMT_YUV420P;
#ifdef RING_ACCEL
// Keep YUV format for macOS
#if !(defined(__APPLE__) && !TARGET_OS_IOS)
if (accel_)
encoderCtx->pix_fmt = accel_->getFormat();
#endif
#endif
// Fri Jul 22 11:37:59 EDT 2011:tmatth:XXX: DON'T set this, we want our
......
......@@ -335,7 +335,7 @@ HardwareAccel::initAPI(bool linkable, AVBufferRef* framesCtx)
if (linkable && framesCtx)
link = linkHardware(framesCtx);
// we don't need frame context for videotoolbox
if (format_ == AV_PIX_FMT_VIDEOTOOLBOX || link || initFrame()) {
if (hwType_ == AV_HWDEVICE_TYPE_VIDEOTOOLBOX || link || initFrame()) {
return 0;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment