mirror of https://github.com/mpv-player/mpv
vo_rpi: update display size on display mode switches
(cherry picked from commit 8c7f3adb41
)
This commit is contained in:
parent
73fc12c4e2
commit
a4ba496539
|
@ -30,6 +30,8 @@
|
|||
|
||||
#include <libavutil/rational.h>
|
||||
|
||||
#include "osdep/atomics.h"
|
||||
|
||||
#include "common/common.h"
|
||||
#include "common/msg.h"
|
||||
#include "options/m_config.h"
|
||||
|
@ -73,6 +75,8 @@ struct priv {
|
|||
// for RAM input
|
||||
MMAL_POOL_T *swpool;
|
||||
|
||||
atomic_bool update_display;
|
||||
|
||||
int background_layer;
|
||||
int video_layer;
|
||||
int osd_layer;
|
||||
|
@ -525,15 +529,32 @@ static int control(struct vo *vo, uint32_t request, void *data)
|
|||
case VOCTRL_SCREENSHOT_WIN:
|
||||
*(struct mp_image **)data = take_screenshot(vo);
|
||||
return VO_TRUE;
|
||||
case VOCTRL_CHECK_EVENTS:
|
||||
if (atomic_load(&p->update_display)) {
|
||||
atomic_store(&p->update_display, false);
|
||||
update_display_size(vo);
|
||||
}
|
||||
return VO_TRUE;
|
||||
}
|
||||
|
||||
return VO_NOTIMPL;
|
||||
}
|
||||
|
||||
static void tv_callback(void *callback_data, uint32_t reason, uint32_t param1,
|
||||
uint32_t param2)
|
||||
{
|
||||
struct vo *vo = callback_data;
|
||||
struct priv *p = vo->priv;
|
||||
atomic_store(&p->update_display, true);
|
||||
vo_wakeup(vo);
|
||||
}
|
||||
|
||||
static void uninit(struct vo *vo)
|
||||
{
|
||||
struct priv *p = vo->priv;
|
||||
|
||||
vc_tv_unregister_callback_full(tv_callback, vo);
|
||||
|
||||
talloc_free(p->next_image);
|
||||
|
||||
wipe_osd(vo);
|
||||
|
@ -588,6 +609,8 @@ static int preinit(struct vo *vo)
|
|||
if (update_display_size(vo) < 0)
|
||||
goto fail;
|
||||
|
||||
vc_tv_register_callback(tv_callback, vo);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
|
Loading…
Reference in New Issue