Only include hwaccel support if LIBAVUTIL_HWCONTEXT_H is deifned

pull/2653/head
Isaac Connor 2019-06-25 15:58:55 -04:00
parent 679b6b1b2d
commit 5ab4414b11
1 changed files with 4 additions and 0 deletions

View File

@ -426,6 +426,7 @@ int FfmpegCamera::OpenFfmpeg() {
zm_dump_stream_format(mFormatContext, mVideoStreamId, 0, 0);
if ( hwaccel_name != "" ) {
#if HAVE_LIBAVUTIL_HWCONTEXT_H
enum AVHWDeviceType type = AV_HWDEVICE_TYPE_NONE;
while ( (type = av_hwdevice_iterate_types(type)) != AV_HWDEVICE_TYPE_NONE )
Debug(1, "%s", av_hwdevice_get_type_name(type));
@ -465,6 +466,9 @@ int FfmpegCamera::OpenFfmpeg() {
mVideoCodecContext->hw_device_ctx = av_buffer_ref(hw_device_ctx);
hwaccel = true;
hwFrame = zm_av_frame_alloc();
#else
Warning("HWAccel support not compiled in.");
#endif
} // end if hwacel_name
// Open the codec