{ { "Theora", "theora", "Theora (libtheora)", HB_VCODEC_THEORA, HB_MUX_MASK_MKV, }, NULL, 1, HB_GID_VCODEC_THEORA, },
};
int hb_video_encoders_count = sizeof(hb_video_encoders) / sizeof(hb_video_encoders[0]);
-static int hb_video_encoder_is_enabled(int encoder)
+static int hb_video_encoder_is_enabled(int encoder, int disable_hardware)
{
-#ifdef USE_QSV
- if (encoder & HB_VCODEC_QSV_MASK)
+ // Hardware Encoders
+ if (!disable_hardware)
{
- return hb_qsv_video_encoder_is_enabled(encoder);
- }
+#ifdef USE_QSV
+ if (encoder & HB_VCODEC_QSV_MASK)
+ {
+ return hb_qsv_video_encoder_is_enabled(encoder);
+ }
#endif
- switch (encoder)
- {
- // the following encoders are always enabled
- case HB_VCODEC_THEORA:
- case HB_VCODEC_FFMPEG_MPEG4:
- case HB_VCODEC_FFMPEG_MPEG2:
- case HB_VCODEC_FFMPEG_VP8:
- case HB_VCODEC_FFMPEG_VP9:
- return 1;
+ switch (encoder){
#ifdef USE_VCE
- case HB_VCODEC_FFMPEG_VCE_H264:
- return hb_vce_h264_available();
- case HB_VCODEC_FFMPEG_VCE_H265:
- return hb_vce_h265_available();
+ case HB_VCODEC_FFMPEG_VCE_H264:
+ return hb_vce_h264_available();
+ case HB_VCODEC_FFMPEG_VCE_H265:
+ return hb_vce_h265_available();
#endif
#ifdef USE_NVENC
- case HB_VCODEC_FFMPEG_NVENC_H264:
- return hb_nvenc_h264_available();
- case HB_VCODEC_FFMPEG_NVENC_H265:
- return hb_nvenc_h265_available();
+ case HB_VCODEC_FFMPEG_NVENC_H264:
+ return hb_nvenc_h264_available();
+ case HB_VCODEC_FFMPEG_NVENC_H265:
+ return hb_nvenc_h265_available();
#endif
#ifdef __APPLE__
- case HB_VCODEC_FFMPEG_VT_H264:
- return hb_vt_h264_is_available();
- case HB_VCODEC_FFMPEG_VT_H265:
- return hb_vt_h265_is_available();
+ case HB_VCODEC_FFMPEG_VT_H264:
+ return hb_vt_h264_is_available();
+ case HB_VCODEC_FFMPEG_VT_H265:
+ return hb_vt_h265_is_available();
#endif
+ }
+ }
+
+ // Software Encoders
+ switch (encoder)
+ {
+ // the following encoders are always enabled
+ case HB_VCODEC_THEORA:
+ case HB_VCODEC_FFMPEG_MPEG4:
+ case HB_VCODEC_FFMPEG_MPEG2:
+ case HB_VCODEC_FFMPEG_VP8:
+ case HB_VCODEC_FFMPEG_VP9:
+ return 1;
#ifdef USE_X265
case HB_VCODEC_X265_8BIT:
}
}
-void hb_common_global_init()
+void hb_common_global_init(int disable_hardware)
{
static int common_init_done = 0;
if (common_init_done)
{
// we still need to check
hb_video_encoders[i].enabled =
- hb_video_encoder_is_enabled(hb_video_encoders[i].item.codec);
+ hb_video_encoder_is_enabled(hb_video_encoders[i].item.codec, disable_hardware);
}
if (hb_video_encoders[i].enabled)
{
if (!hb_video_encoders[i].enabled)
{
if ((hb_video_encoders[i].item.codec & HB_VCODEC_MASK) &&
- (hb_video_encoder_is_enabled(hb_video_encoders[i].item.codec)))
+ (hb_video_encoder_is_enabled(hb_video_encoders[i].item.codec, disable_hardware)))
{
// we have a specific fallback and it's enabled
continue;
hb_work_object_t * hb_objects = NULL;
int hb_instance_counter = 0;
+int disable_hardware = 0;
static void thread_func( void * );
hb_log(" - logical processor count: %d", hb_get_cpu_count());
#ifdef USE_QSV
- /* Print QSV info here so that it's in all scan and encode logs */
- hb_qsv_info_print();
+ if (!is_hardware_disabled())
+ {
+ /* Print QSV info here so that it's in all scan and encode logs */
+ hb_qsv_info_print();
+ }
#endif
hb_log( "hb_scan: path=%s, title_index=%d", path, title_index );
*_h = NULL;
}
+int hb_global_init_no_hardware()
+{
+ disable_hardware = 1;
+ hb_global_init();
+}
+
int hb_global_init()
{
int result = 0;
}
#ifdef USE_QSV
- result = hb_qsv_info_init();
- if (result < 0)
+ if (!disable_hardware)
{
- hb_error("hb_qsv_info_init failed!");
- return -1;
+ result = hb_qsv_info_init();
+ if (result < 0)
+ {
+ hb_error("hb_qsv_info_init failed!");
+ return -1;
+ }
+ hb_param_configure_qsv();
}
- hb_param_configure_qsv();
#endif
/* libavcodec */
hb_register(&hb_encx265);
#endif
#ifdef USE_QSV
- hb_register(&hb_encqsv);
+ if (!disable_hardware)
+ {
+ hb_register(&hb_encqsv);
+ }
#endif
hb_x264_global_init();
- hb_common_global_init();
+ hb_common_global_init(disable_hardware);
/*
* Initialise buffer pool
{
return h->interjob;
}
+
+int is_hardware_disabled(void){
+ return disable_hardware;
+}