diff --git a/configure.ac b/configure.ac index 18d5a28d6e59428e327dab3b97ad851b0e8a516c..609b77ae322ff863595ab27b496dfa5dc0ba8805 100644 --- a/configure.ac +++ b/configure.ac @@ -456,7 +456,6 @@ AC_ARG_ENABLE([accel], AS_HELP_STRING([--disable-accel], [Disable all hardware a AC_ARG_ENABLE([vdpau], AS_HELP_STRING([--disable-vdpau], [Disable VDPAU hardware acceleration (auto)])) AC_ARG_ENABLE([vaapi], AS_HELP_STRING([--disable-vaapi], [Disable VAAPI hardware acceleration (auto)])) AC_ARG_ENABLE([videotoolbox], AS_HELP_STRING([--disable-videotoolbox], [Disable VideoToolbox hardware acceleration (auto)])) -AC_ARG_ENABLE([vda], AS_HELP_STRING([--disable-vda], [Disable VDA hardware acceleration (auto)])) AS_IF([test "x$enable_video" != "xno" -a "x$enable_accel" != "xno"], [ ring_accel="yes" AC_DEFINE([RING_ACCEL], [1], [Hardware acceleration is enabled in Ring]) @@ -499,21 +498,12 @@ AS_IF([test "x$enable_video" != "xno" -a "x$enable_accel" != "xno"], [ ]) ]) ]) - AS_IF([test "x$enable_vda" != "xno"], [ - AC_CHECK_HEADER([VideoDecodeAcceleration/VDADecoder.h], [ - AC_CHECK_HEADER([libavcodec/vda.h], [ - ring_vda="yes" - AC_DEFINE([RING_VDA], [1], [Defined if vda is available in Ring]) - ]) - ]) - ]) ]) ]) AM_CONDITIONAL([RING_ACCEL], [test "x${ring_accel}" = "xyes"]) AM_CONDITIONAL([RING_VAAPI], [test "x${ring_vaapi}" = "xyes"]) AM_CONDITIONAL([RING_VDPAU], [test "x${ring_vdpau}" = "xyes"]) AM_CONDITIONAL([RING_VIDEOTOOLBOX], [test "x${ring_vt}" = "xyes"]) -AM_CONDITIONAL([RING_VDA], [test "x${ring_vda}" = "xyes"]) dnl check for GnuTLS PKG_CHECK_MODULES([GNUTLS], [gnutls >= 3.4.14], [HAVE_GNUTLS=1], [HAVE_GNUTLS=0]) diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak index bf06545ae991e85f65ed1d6e1f0801b205d5ba0f..23ba966ef347b5cb0dedf97ddf4d697c7a89129d 100644 --- a/contrib/src/ffmpeg/rules.mak +++ b/contrib/src/ffmpeg/rules.mak @@ -142,9 +142,7 @@ FFMPEGCONF += \ --enable-videotoolbox \ --enable-hwaccel=h263_videotoolbox \ --enable-hwaccel=h264_videotoolbox \ - --enable-hwaccel=mpeg4_videotoolbox \ - --enable-vda \ - --enable-hwaccel=h264_vda + --enable-hwaccel=mpeg4_videotoolbox endif ifdef HAVE_IOS diff --git a/src/media/video/accel.cpp b/src/media/video/accel.cpp index 02276b42384afed48e7d7487aa7ad44dd298c217..47876089bd6811eb75bc1bc9eee27aa69f9aa074 100644 --- a/src/media/video/accel.cpp +++ b/src/media/video/accel.cpp @@ -31,7 +31,7 @@ #include "v4l2/vdpau.h" #endif -#if defined(RING_VIDEOTOOLBOX) || defined(RING_VDA) +#ifdef RING_VIDEOTOOLBOX #include "osxvideo/videotoolbox.h" #endif @@ -176,7 +176,6 @@ makeHardwareAccel(AVCodecContext* codecCtx) Vdpau, Vaapi, VideoToolbox, - Vda, }; struct AccelInfo { @@ -208,9 +207,6 @@ makeHardwareAccel(AVCodecContext* codecCtx) #endif #ifdef RING_VIDEOTOOLBOX { AccelID::VideoToolbox, "videotoolbox", AV_PIX_FMT_VIDEOTOOLBOX, makeHardwareAccel<VideoToolboxAccel> }, -#endif -#ifdef RING_VDA - { AccelID::Vda, "vda", AV_PIX_FMT_VDA, makeHardwareAccel<VideoToolboxAccel> }, #endif { AccelID::NoAccel, "none", AV_PIX_FMT_NONE, nullptr }, }; @@ -221,7 +217,6 @@ makeHardwareAccel(AVCodecContext* codecCtx) possibleAccels.push_back(AccelID::Vdpau); possibleAccels.push_back(AccelID::Vaapi); possibleAccels.push_back(AccelID::VideoToolbox); - possibleAccels.push_back(AccelID::Vda); break; case AV_CODEC_ID_MPEG4: case AV_CODEC_ID_H263P: diff --git a/src/media/video/osxvideo/videotoolbox.h b/src/media/video/osxvideo/videotoolbox.h index 587311b4b4de25663f4df64c9dc8ed3a4864cd1c..a006f70abbd5ba9ba5d0bc33bacb907c14e61aa2 100644 --- a/src/media/video/osxvideo/videotoolbox.h +++ b/src/media/video/osxvideo/videotoolbox.h @@ -24,16 +24,11 @@ #include "config.h" -#if defined(RING_VIDEOTOOLBOX) || defined(RING_VDA) +#ifdef RING_VIDEOTOOLBOX extern "C" { #include <libavcodec/avcodec.h> -#ifdef RING_VIDEOTOOLBOX #include <libavcodec/videotoolbox.h> -#endif -#ifdef RING_VDA -#include <libavcodec/vda.h> -#endif #include <libavutil/imgutils.h> } @@ -53,12 +48,8 @@ class VideoToolboxAccel : public HardwareAccel { bool init() override; int allocateBuffer(AVFrame* frame, int flags) override; void extractData(VideoFrame& input, VideoFrame& output) override; - - private: - bool usingVT_ = false; - std::string decoderName_; }; }} // namespace ring::video -#endif // defined(RING_VIDEOTOOLBOX) || defined(RING_VDA) +#endif // RING_VIDEOTOOLBOX diff --git a/src/media/video/osxvideo/videotoolbox.mm b/src/media/video/osxvideo/videotoolbox.mm index d6af30672404f7fd5905125c41c09ae16664b0a6..2316154ec22982a5c68c6000a95552768b94babc 100644 --- a/src/media/video/osxvideo/videotoolbox.mm +++ b/src/media/video/osxvideo/videotoolbox.mm @@ -22,7 +22,7 @@ #include "config.h" -#if defined(RING_VIDEOTOOLBOX) || defined(RING_VDA) +#ifdef RING_VIDEOTOOLBOX #include <string> #include <sstream> @@ -42,23 +42,14 @@ VideoToolboxAccel::VideoToolboxAccel(const std::string name, const AVPixelFormat VideoToolboxAccel::~VideoToolboxAccel() { - if (codecCtx_) { - if (usingVT_) { -#ifdef RING_VIDEOTOOLBOX - av_videotoolbox_default_free(codecCtx_); -#endif - } else { -#ifdef RING_VDA - av_vda_default_free(codecCtx_); -#endif - } - } + if (codecCtx_) + av_videotoolbox_default_free(codecCtx_); } int VideoToolboxAccel::allocateBuffer(AVFrame* frame, int flags) { - // do nothing, as this is done during extractData for VideoT and VDA + // do nothing, as this is done during extractData (void) frame; // unused (void) flags; // unused return 0; @@ -89,7 +80,7 @@ VideoToolboxAccel::extractData(VideoFrame& input, VideoFrame& output) char codecTag[32]; av_get_codec_tag_string(codecTag, sizeof(codecTag), codecCtx_->codec_tag); std::stringstream buf; - buf << decoderName_ << " (" << codecTag << "): unsupported pixel format ("; + buf << "VideoToolbox (" << codecTag << "): unsupported pixel format ("; buf << av_get_pix_fmt_name(format_) << ")"; throw std::runtime_error(buf.str()); } @@ -99,7 +90,7 @@ VideoToolboxAccel::extractData(VideoFrame& input, VideoFrame& output) // align on 32 bytes if (av_frame_get_buffer(outFrame, 32) < 0) { std::stringstream buf; - buf << "Could not allocate a buffer for " << decoderName_; + buf << "Could not allocate a buffer for VideoToolbox"; throw std::runtime_error(buf.str()); } @@ -144,33 +135,15 @@ VideoToolboxAccel::checkAvailability() bool VideoToolboxAccel::init() { - decoderName_ = ""; - bool success = false; -#ifdef RING_VIDEOTOOLBOX - if (int ret = av_videotoolbox_default_init(codecCtx_) == 0) { - success = true; - usingVT_ = true; - decoderName_ = "VideoToolbox"; - } -#endif -#ifdef RING_VDA - if (!success) { - if (int ret = av_vda_default_init(codecCtx_) == 0) { - success = true; - usingVT_ = false; - decoderName_ = "VDA"; - } + if (av_videotoolbox_default_init(codecCtx_) >= 0) { + RING_DBG("VideoToolbox decoder initialized"); + return true; + } else { + RING_ERR("Failed to initialize VideoToolbox decoder"); + return false; } -#endif - - if (success) - RING_DBG("%s decoder initialized", decoderName_.c_str()); - else - RING_ERR("Failed to initialize Mac hardware accelerator"); - - return success; } }} -#endif // defined(RING_VIDEOTOOLBOX) || defined(RING_VDA) +#endif // RING_VIDEOTOOLBOX