#include <movit/image_format.h>
+#include "defs.h"
+#include "metrics.h"
#include "print_latency.h"
+#include "x264_dynamic.h"
class Mux;
class X264SpeedControl;
std::thread encoder_thread;
std::atomic<bool> x264_init_done{false};
std::atomic<bool> should_quit{false};
+ X264Dynamic dyn;
x264_t *x264;
std::unique_ptr<X264SpeedControl> speed_control;
// Key is the pts of the frame.
std::unordered_map<int64_t, ReceivedTimestamps> frames_being_encoded;
+
+ // Metrics.
+ std::atomic<int64_t> metric_x264_queued_frames{0};
+ std::atomic<int64_t> metric_x264_max_queued_frames{X264_QUEUE_LENGTH};
+ std::atomic<int64_t> metric_x264_dropped_frames{0};
+ std::atomic<int64_t> metric_x264_output_frames_i{0};
+ std::atomic<int64_t> metric_x264_output_frames_p{0};
+ std::atomic<int64_t> metric_x264_output_frames_b{0};
+ Histogram metric_x264_crf;
+ LatencyHistogram latency_histogram;
};
#endif // !defined(_X264ENCODE_H)