void init_x264();
void encode_frame(QueuedFrame qf);
+ // bitrate_kbit can be 0 for no change.
+ static void speed_control_override_func(unsigned bitrate_kbit, movit::YCbCrLumaCoefficients coefficients, x264_param_t *param);
+
// One big memory chunk of all 50 (or whatever) frames, allocated in
// the constructor. All data functions just use pointers into this
// pool.
x264_t *x264;
std::unique_ptr<X264SpeedControl> speed_control;
- std::function<void(x264_param_t *)> bitrate_override_func;
-
std::atomic<unsigned> new_bitrate_kbit{0}; // 0 for no change.
// Protects everything below it.
// 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)