mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 22:29:25 +00:00
Handle frame available from screen.c
This commit is contained in:
parent
c79d3a28ca
commit
e51e9c748f
3 changed files with 18 additions and 6 deletions
|
@ -272,12 +272,7 @@ video_buffer_on_frame_available(struct video_buffer *vb, void *userdata) {
|
||||||
(void) vb;
|
(void) vb;
|
||||||
(void) userdata;
|
(void) userdata;
|
||||||
|
|
||||||
static SDL_Event new_frame_event = {
|
screen_on_frame_available(&screen);
|
||||||
.type = EVENT_NEW_FRAME,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Post the event on the UI thread
|
|
||||||
SDL_PushEvent(&new_frame_event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -655,3 +655,15 @@ screen_hidpi_scale_coords(struct screen *screen, int32_t *x, int32_t *y) {
|
||||||
*x = (int64_t) *x * dw / ww;
|
*x = (int64_t) *x * dw / ww;
|
||||||
*y = (int64_t) *y * dh / wh;
|
*y = (int64_t) *y * dh / wh;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
screen_on_frame_available(struct screen *screen) {
|
||||||
|
(void) screen;
|
||||||
|
|
||||||
|
static SDL_Event new_frame_event = {
|
||||||
|
.type = EVENT_NEW_FRAME,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Post the event on the UI thread
|
||||||
|
SDL_PushEvent(&new_frame_event);
|
||||||
|
}
|
||||||
|
|
|
@ -141,4 +141,9 @@ screen_convert_drawable_to_frame_coords(struct screen *screen,
|
||||||
void
|
void
|
||||||
screen_hidpi_scale_coords(struct screen *screen, int32_t *x, int32_t *y);
|
screen_hidpi_scale_coords(struct screen *screen, int32_t *x, int32_t *y);
|
||||||
|
|
||||||
|
// Notify the screen that a new frame is available in the video_buffer.
|
||||||
|
// Called from a separate thread.
|
||||||
|
void
|
||||||
|
screen_on_frame_available(struct screen *screen);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue