]> git.sesse.net Git - nageru/blobdiff - x264_encoder.h
Add some base x264 metrics.
[nageru] / x264_encoder.h
index 455bb1e96e822282c3dfd41162f6fe0304b7ceda..973b62ce5ba5353d74b82cf2b72f869a24325199 100644 (file)
@@ -32,6 +32,7 @@ extern "C" {
 
 #include <movit/image_format.h>
 
+#include "defs.h"
 #include "print_latency.h"
 #include "x264_dynamic.h"
 
@@ -113,6 +114,14 @@ private:
 
        // 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};
 };
 
 #endif  // !defined(_X264ENCODE_H)