mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00: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:
parent
218636dc10
commit
cb197ee3a2
9 changed files with 27 additions and 23 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue