- call_once(x264_metrics_inited, [](){
- global_metrics.add("x264_queued_frames", &metric_x264_queued_frames, Metrics::TYPE_GAUGE);
- global_metrics.add("x264_max_queued_frames", &metric_x264_max_queued_frames, Metrics::TYPE_GAUGE);
- global_metrics.add("x264_dropped_frames", &metric_x264_dropped_frames);
- global_metrics.add("x264_output_frames", {{ "type", "i" }}, &metric_x264_output_frames_i);
- global_metrics.add("x264_output_frames", {{ "type", "p" }}, &metric_x264_output_frames_p);
- global_metrics.add("x264_output_frames", {{ "type", "b" }}, &metric_x264_output_frames_b);
-
- metric_x264_crf.init_uniform(50);
- global_metrics.add("x264_crf", &metric_x264_crf);
- x264_latency_histogram.init("x264");
- });
-
- size_t bytes_per_pixel = global_flags.x264_bit_depth > 8 ? 2 : 1;
+ if (use_separate_disk_params) {
+ call_once(x264_disk_metrics_inited, []{
+ global_metrics.add("x264_queued_frames", {{ "encode", "separate_disk" }}, &metric_x264_disk_queued_frames, Metrics::TYPE_GAUGE);
+ global_metrics.add("x264_max_queued_frames", {{ "encode", "separate_disk" }}, &metric_x264_disk_max_queued_frames, Metrics::TYPE_GAUGE);
+ global_metrics.add("x264_dropped_frames", {{ "encode", "separate_disk" }}, &metric_x264_disk_dropped_frames);
+ global_metrics.add("x264_output_frames", {{ "encode", "separate_disk" }, { "type", "i" }}, &metric_x264_disk_output_frames_i);
+ global_metrics.add("x264_output_frames", {{ "encode", "separate_disk" }, { "type", "p" }}, &metric_x264_disk_output_frames_p);
+ global_metrics.add("x264_output_frames", {{ "encode", "separate_disk" }, { "type", "b" }}, &metric_x264_disk_output_frames_b);
+
+ metric_x264_disk_crf.init_uniform(50);
+ global_metrics.add("x264_crf", {{ "encode", "separate_disk" }}, &metric_x264_disk_crf);
+ x264_disk_latency_histogram.init("x264_disk");
+ });
+ } else {
+ call_once(use_separate_disk_params ? x264_disk_metrics_inited : x264_metrics_inited, []{
+ global_metrics.add("x264_queued_frames", {{ "encode", "regular" }}, &metric_x264_queued_frames, Metrics::TYPE_GAUGE);
+ global_metrics.add("x264_max_queued_frames", {{ "encode", "regular" }}, &metric_x264_max_queued_frames, Metrics::TYPE_GAUGE);
+ global_metrics.add("x264_dropped_frames", {{ "encode", "regular" }}, &metric_x264_dropped_frames);
+ global_metrics.add("x264_output_frames", {{ "encode", "regular" }, { "type", "i" }}, &metric_x264_output_frames_i);
+ global_metrics.add("x264_output_frames", {{ "encode", "regular" }, { "type", "p" }}, &metric_x264_output_frames_p);
+ global_metrics.add("x264_output_frames", {{ "encode", "regular" }, { "type", "b" }}, &metric_x264_output_frames_b);
+
+ metric_x264_crf.init_uniform(50);
+ global_metrics.add("x264_crf", {{ "encode", "regular" }}, &metric_x264_crf);
+ x264_latency_histogram.init("x264");
+ });
+ }
+
+ size_t bytes_per_pixel = global_flags.bit_depth > 8 ? 2 : 1;