mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-10 01:59:04 +00:00
screen_on_new_frame
This commit is contained in:
parent
0bdb995f2e
commit
fe43453f47
3 changed files with 18 additions and 4 deletions
|
@ -271,10 +271,7 @@ decoder_on_new_frame(struct decoder *decoder, void *userdata) {
|
|||
(void) decoder;
|
||||
(void) userdata;
|
||||
|
||||
static SDL_Event new_frame_event = {
|
||||
.type = EVENT_NEW_FRAME,
|
||||
};
|
||||
SDL_PushEvent(&new_frame_event);
|
||||
screen_on_new_frame(&screen);
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
|
@ -647,3 +647,15 @@ screen_hidpi_scale_coords(struct screen *screen, int32_t *x, int32_t *y) {
|
|||
*x = (int64_t) *x * dw / ww;
|
||||
*y = (int64_t) *y * dh / wh;
|
||||
}
|
||||
|
||||
void
|
||||
screen_on_new_frame(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);
|
||||
}
|
||||
|
|
|
@ -137,4 +137,9 @@ screen_convert_drawable_to_frame_coords(struct screen *screen,
|
|||
void
|
||||
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_new_frame(struct screen *screen);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue