summaryrefslogtreecommitdiffstats
path: root/video/out/opengl/hwdec_rpi.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2017-08-09 20:57:37 +0200
committerwm4 <wm4@nowhere>2017-08-09 20:57:37 +0200
commit9c5dcf93989bdfccd4779c2f19282a23703ee4f7 (patch)
tree6702e0220639837a2d4749da60a2a304e5ef52b2 /video/out/opengl/hwdec_rpi.c
parentde6d3f8ca10f22901d1cdfb44d117e7ef3eabcc1 (diff)
downloadmpv-9c5dcf93989bdfccd4779c2f19282a23703ee4f7.tar.bz2
mpv-9c5dcf93989bdfccd4779c2f19282a23703ee4f7.tar.xz
vo_opengl: shrink the hwdec overlay API
Just remove one callback, and fold the functionality into the other one. RPI will still not compile, so the hwdec_rpi.c changes are untested.
Diffstat (limited to 'video/out/opengl/hwdec_rpi.c')
-rw-r--r--video/out/opengl/hwdec_rpi.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/video/out/opengl/hwdec_rpi.c b/video/out/opengl/hwdec_rpi.c
index e8feb714fa..daa1a9a54c 100644
--- a/video/out/opengl/hwdec_rpi.c
+++ b/video/out/opengl/hwdec_rpi.c
@@ -244,17 +244,6 @@ static int enable_renderer(struct gl_hwdec *hw)
return 0;
}
-static void overlay_adjust(struct gl_hwdec *hw,
- struct mp_rect *src, struct mp_rect *dst)
-{
- struct priv *p = hw->priv;
-
- p->src = *src;
- p->dst = *dst;
-
- update_overlay(hw, false);
-}
-
static int reinit(struct gl_hwdec *hw, struct mp_image_params *params)
{
struct priv *p = hw->priv;
@@ -306,10 +295,20 @@ static struct mp_image *upload(struct gl_hwdec *hw, struct mp_image *hw_image)
return new_ref;
}
-static int overlay_frame(struct gl_hwdec *hw, struct mp_image *hw_image)
+static int overlay_frame(struct gl_hwdec *hw, struct mp_image *hw_image,
+ struct mp_rect *src, struct mp_rect *dst, bool newframe)
{
struct priv *p = hw->priv;
+ if (hw_image && p->current_frame && !newframe) {
+ if (!mp_rect_equals(&p->src, src) ||mp_rect_equals(&p->dst, dst)) {
+ p->src = *src;
+ p->dst = *dst;
+ update_overlay(hw, false);
+ }
+ return;
+ }
+
mp_image_unrefp(&p->current_frame);
if (!hw_image) {