#include <dlfcn.h>
#include <math.h>
#include <stdio.h>
+#include <stdint.h>
#include <x264.h>
#include <algorithm>
#include <chrono>
#include <cmath>
-#include <ratio>
-#include <type_traits>
#include "flags.h"
#include "shared/metrics.h"
+#include "x264_dynamic.h"
using namespace std;
using namespace std::chrono;
stat.max_buffer = max(buffer_fill, stat.max_buffer);
if (buffer_fill >= buffer_size) { // oops, cpu was idle
- // not really an error, but we'll warn for debugging purposes
- static int64_t idle_t = 0;
- static steady_clock::time_point print_interval;
- static bool first = false;
- idle_t += buffer_fill - buffer_size;
- if (first || duration<double>(t - print_interval).count() > 0.1) {
- //fprintf(stderr, "speedcontrol idle (%.6f sec)\n", idle_t/1e6);
- print_interval = t;
- idle_t = 0;
- first = false;
- }
buffer_fill = buffer_size;
metric_x264_speedcontrol_buffer_available_seconds = buffer_fill * 1e-6;
++metric_x264_speedcontrol_idle_frames;