mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-12-18 05:54:20 +01:00
Move fps counter out of video buffer
In order to make video buffer more generic, move out its specific responsibility to count the fps between the decoder and the renderer.
This commit is contained in:
@@ -18,6 +18,7 @@ push_frame(struct decoder *decoder) {
|
||||
video_buffer_offer_decoded_frame(decoder->video_buffer,
|
||||
&previous_frame_skipped);
|
||||
if (previous_frame_skipped) {
|
||||
fps_counter_add_skipped_frame(decoder->fps_counter);
|
||||
// the previous EVENT_NEW_FRAME will consume this frame
|
||||
return;
|
||||
}
|
||||
@@ -28,8 +29,10 @@ push_frame(struct decoder *decoder) {
|
||||
}
|
||||
|
||||
void
|
||||
decoder_init(struct decoder *decoder, struct video_buffer *vb) {
|
||||
decoder_init(struct decoder *decoder, struct video_buffer *vb,
|
||||
struct fps_counter *fps_counter) {
|
||||
decoder->video_buffer = vb;
|
||||
decoder->fps_counter = fps_counter;
|
||||
}
|
||||
|
||||
bool
|
||||
|
||||
Reference in New Issue
Block a user