Replace qsv with videotoolbox for MacOS codec library.

Windows and MacOS is not tested! We need users who test it.
This commit is contained in:
eisneinechse
2019-04-18 16:41:11 -07:00
parent b3f5406db3
commit 19f5fa37f2
2 changed files with 9 additions and 9 deletions

View File

@@ -248,9 +248,9 @@ static enum AVPixelFormat get_hw_dec_format_qs(AVCodecContext *ctx, const enum A
for (p = pix_fmts; *p != AV_PIX_FMT_NONE; p++) {
switch (*p) {
case AV_PIX_FMT_QSV:
hw_de_av_pix_fmt_global = AV_PIX_FMT_QSV;
hw_de_av_device_type_global = AV_HWDEVICE_TYPE_QSV;
case AV_PIX_FMT_VIDEOTOOLBOX:
hw_de_av_pix_fmt_global = AV_PIX_FMT_VIDEOTOOLBOX;
hw_de_av_device_type_global = AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
return *p;
break;
}
@@ -413,15 +413,15 @@ void FFmpegReader::Open() {
i_decoder_hw = openshot::Settings::Instance()->HARDWARE_DECODER;
switch (i_decoder_hw) {
case 0:
hw_de_av_device_type = AV_HWDEVICE_TYPE_QSV;
hw_de_av_device_type = AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
pCodecCtx->get_format = get_hw_dec_format_qs;
break;
case 5:
hw_de_av_device_type = AV_HWDEVICE_TYPE_QSV;
hw_de_av_device_type = AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
pCodecCtx->get_format = get_hw_dec_format_qs;
break;
default:
hw_de_av_device_type = AV_HWDEVICE_TYPE_QSV;
hw_de_av_device_type = AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
pCodecCtx->get_format = get_hw_dec_format_qs;
break;
}

View File

@@ -211,12 +211,12 @@ void FFmpegWriter::SetVideoOptions(bool has_video, string codec, Fraction fps, i
}
}
#elif defined(__APPLE__)
if ( (strcmp(codec.c_str(),"h264_qsv") == 0)) {
if ( (strcmp(codec.c_str(),"h264_videotoolbox") == 0)) {
new_codec = avcodec_find_encoder_by_name(codec.c_str());
hw_en_on = 1;
hw_en_supported = 1;
hw_en_av_pix_fmt = AV_PIX_FMT_QSV;
hw_en_av_device_type = AV_HWDEVICE_TYPE_QSV;
hw_en_av_pix_fmt = AV_PIX_FMT_VIDEOTOOLBOX;
hw_en_av_device_type = AV_HWDEVICE_TYPE_VIDEOTOOLBOX;
}
else {
new_codec = avcodec_find_encoder_by_name(codec.c_str());