[vlc-commits] omxil: vout: Handle dynamic aspect changes.
Julian Scheel
git at videolan.org
Thu Sep 5 23:05:27 CEST 2013
vlc | branch: master | Julian Scheel <julian at jusst.de> | Thu Sep 5 16:03:01 2013 +0200| [3b564f5f943a0687706ff5f1b6a70288eacfd909] | committer: Martin Storsjö
omxil: vout: Handle dynamic aspect changes.
Handle changes of aspect ratio through the Control handler.
Signed-off-by: Julian Scheel <julian at jusst.de>
Signed-off-by: Martin Storsjö <martin at martin.st>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3b564f5f943a0687706ff5f1b6a70288eacfd909
---
modules/codec/omxil/vout.c | 33 +++++++++++++++++++++++++--------
1 file changed, 25 insertions(+), 8 deletions(-)
diff --git a/modules/codec/omxil/vout.c b/modules/codec/omxil/vout.c
index 48aa744..d0864ae 100644
--- a/modules/codec/omxil/vout.c
+++ b/modules/codec/omxil/vout.c
@@ -126,6 +126,22 @@ static OMX_ERRORTYPE OmxFillBufferDone(OMX_HANDLETYPE omx_handle,
return OMX_ErrorNone;
}
+static void UpdateDisplaySize(vout_display_t *vd, vout_display_cfg_t *cfg)
+{
+ OMX_CONFIG_DISPLAYREGIONTYPE config_display;
+ OMX_INIT_STRUCTURE(config_display);
+
+ /* OMX_DISPLAY_SET_PIXEL is broadcom specific */
+ if (strcmp(vd->sys->psz_component, "OMX.broadcom.video_render"))
+ return;
+
+ config_display.nPortIndex = vd->sys->port.i_port_index;
+ config_display.set = OMX_DISPLAY_SET_PIXEL;
+ config_display.pixel_x = cfg->display.width * vd->fmt.i_height;
+ config_display.pixel_y = cfg->display.height * vd->fmt.i_width;
+ OMX_SetConfig(vd->sys->omx_handle, OMX_IndexConfigDisplayRegion, &config_display);
+}
+
static int Open(vlc_object_t *p_this)
{
vout_display_t *vd = (vout_display_t *)p_this;
@@ -261,12 +277,7 @@ static int Open(vlc_object_t *p_this)
config_display.fullscreen = OMX_TRUE;
OMX_SetConfig(p_sys->omx_handle, OMX_IndexConfigDisplayRegion, &config_display);
- if (vd->fmt.i_width != vd->cfg->display.width || vd->fmt.i_height != vd->cfg->display.height) {
- config_display.set = OMX_DISPLAY_SET_PIXEL;
- config_display.pixel_x = vd->cfg->display.width * vd->fmt.i_height;
- config_display.pixel_y = vd->cfg->display.height * vd->fmt.i_width;
- OMX_SetConfig(p_sys->omx_handle, OMX_IndexConfigDisplayRegion, &config_display);
- }
+ UpdateDisplaySize(vd, vd->cfg);
}
@@ -444,12 +455,18 @@ static int Control(vout_display_t *vd, int query, va_list args)
default:
msg_Err(vd, "Unknown request in omxil vout display");
+ case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
+ return VLC_SUCCESS;
+ case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
+ {
+ const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *);
+ UpdateDisplaySize(vd, cfg);
+ return VLC_SUCCESS;
+ }
case VOUT_DISPLAY_CHANGE_FULLSCREEN:
case VOUT_DISPLAY_CHANGE_WINDOW_STATE:
- case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE:
case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED:
case VOUT_DISPLAY_CHANGE_ZOOM:
- case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT:
case VOUT_DISPLAY_CHANGE_SOURCE_CROP:
case VOUT_DISPLAY_GET_OPENGL:
return VLC_EGENERIC;
More information about the vlc-commits
mailing list