| 333 | }; |
| 334 | int hb_video_encoders_count = sizeof(hb_video_encoders) / sizeof(hb_video_encoders[0]); |
| 335 | static int hb_video_encoder_is_enabled(int encoder, int disable_hardware) |
| 336 | { |
| 337 | // Hardware Encoders |
| 338 | if (!disable_hardware) |
| 339 | { |
| 340 | #if HB_PROJECT_FEATURE_QSV |
| 341 | if (encoder & HB_VCODEC_QSV_MASK) |
| 342 | { |
| 343 | return hb_qsv_video_encoder_is_available(encoder); |
| 344 | } |
| 345 | #endif |
| 346 | |
| 347 | switch (encoder) |
| 348 | { |
| 349 | #if HB_PROJECT_FEATURE_VCE |
| 350 | case HB_VCODEC_FFMPEG_VCE_H264: |
| 351 | return hb_vce_h264_available(); |
| 352 | case HB_VCODEC_FFMPEG_VCE_H265: |
| 353 | case HB_VCODEC_FFMPEG_VCE_H265_10BIT: |
| 354 | return hb_vce_h265_available(); |
| 355 | case HB_VCODEC_FFMPEG_VCE_AV1: |
| 356 | case HB_VCODEC_FFMPEG_VCE_AV1_10BIT: |
| 357 | return hb_vce_av1_available(); |
| 358 | #endif |
| 359 | |
| 360 | #if HB_PROJECT_FEATURE_NVENC |
| 361 | case HB_VCODEC_FFMPEG_NVENC_H264: |
| 362 | return hb_nvenc_h264_available(); |
| 363 | case HB_VCODEC_FFMPEG_NVENC_H265: |
| 364 | case HB_VCODEC_FFMPEG_NVENC_H265_10BIT: |
| 365 | return hb_nvenc_h265_available(); |
| 366 | case HB_VCODEC_FFMPEG_NVENC_AV1: |
| 367 | case HB_VCODEC_FFMPEG_NVENC_AV1_10BIT: |
| 368 | return hb_nvenc_av1_available(); |
| 369 | #endif |
| 370 | |
| 371 | #ifdef __APPLE__ |
| 372 | case HB_VCODEC_VT_H264: |
| 373 | case HB_VCODEC_VT_H265: |
| 374 | case HB_VCODEC_VT_H265_10BIT: |
| 375 | case HB_VCODEC_VT_PRORES: |
| 376 | return hb_vt_is_encoder_available(encoder); |
| 377 | #endif |
| 378 | |
| 379 | #if HB_PROJECT_FEATURE_MF |
| 380 | // TODO: Try to instantiate a throwaway encoder to see if a suitable MediaFoundation encoder can be found? |
| 381 | // Alt, implement logic similar to ffmpeg's encoder selection, to see if one would be found. |
| 382 | case HB_VCODEC_FFMPEG_MF_H264: |
| 383 | return hb_mf_h264_available(); |
| 384 | case HB_VCODEC_FFMPEG_MF_H265: |
| 385 | return hb_mf_h265_available(); |
| 386 | case HB_VCODEC_FFMPEG_MF_AV1: |
| 387 | return hb_mf_av1_available(); |
| 388 | #endif |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | // Software Encoders |
no test coverage detected