mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-21 01:33:36 +00:00
Move frame swapping logic to frame.c
Expose frames_offer_decoded_frame() and frames_consume_rendered_frame() so that callers are not exposed to frame swapping (between the decoding and rendering frames) details.
This commit is contained in:
parent
0d7f050389
commit
629c296207
4 changed files with 58 additions and 27 deletions
|
|
@ -22,6 +22,15 @@ struct frames {
|
|||
SDL_bool frames_init(struct frames *frames);
|
||||
void frames_destroy(struct frames *frames);
|
||||
|
||||
void frames_swap(struct frames *frames);
|
||||
// set the decoder frame as ready for rendering
|
||||
// this function locks frames->mutex during its execution
|
||||
// returns true if the previous frame had been consumed
|
||||
SDL_bool frames_offer_decoded_frame(struct frames *frames);
|
||||
|
||||
// mark the rendering frame as consumed and return it
|
||||
// MUST be called with frames->mutex locked!!!
|
||||
// the caller is expected to render the returned frame to some texture before
|
||||
// unlocking frames->mutex
|
||||
const AVFrame *frames_consume_rendered_frame(struct frames *frames);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue