Commit 1220075a authored by Thomas Guillem's avatar Thomas Guillem Committed by Jean-Baptiste Kempf

omxil-dr: reorient video

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 842b6578
...@@ -2173,6 +2173,31 @@ static int HwBuffer_AllocateBuffers( decoder_t *p_dec, OmxPort *p_port ) ...@@ -2173,6 +2173,31 @@ static int HwBuffer_AllocateBuffers( decoder_t *p_dec, OmxPort *p_port )
i_hw_usage = 0; i_hw_usage = 0;
} }
if( p_port->p_fmt->video.orientation != ORIENT_NORMAL )
{
int i_angle;
switch( p_port->p_fmt->video.orientation )
{
case ORIENT_ROTATED_90:
i_angle = 90;
break;
case ORIENT_ROTATED_180:
i_angle = 180;
break;
case ORIENT_ROTATED_270:
i_angle = 270;
break;
default:
i_angle = 0;
}
p_port->p_hwbuf->anwpriv.setOrientation( p_port->p_hwbuf->window,
i_angle );
video_format_ApplyRotation( &p_port->p_hwbuf->fmt_out,
&p_port->p_fmt->video );
} else
p_port->p_hwbuf->fmt_out = p_port->p_fmt->video;
if( p_port->p_hwbuf->anwpriv.setup( p_port->p_hwbuf->window, if( p_port->p_hwbuf->anwpriv.setup( p_port->p_hwbuf->window,
def->format.video.nFrameWidth, def->format.video.nFrameWidth,
def->format.video.nFrameHeight, def->format.video.nFrameHeight,
...@@ -2212,12 +2237,12 @@ static int HwBuffer_AllocateBuffers( decoder_t *p_dec, OmxPort *p_port ) ...@@ -2212,12 +2237,12 @@ static int HwBuffer_AllocateBuffers( decoder_t *p_dec, OmxPort *p_port )
goto error; goto error;
} }
jni_SetAndroidSurfaceSize( def->format.video.nFrameWidth, jni_SetAndroidSurfaceSize( p_port->p_hwbuf->fmt_out.i_width,
def->format.video.nFrameHeight, p_port->p_hwbuf->fmt_out.i_height,
def->format.video.nFrameWidth, p_port->p_hwbuf->fmt_out.i_visible_width,
def->format.video.nFrameHeight, p_port->p_hwbuf->fmt_out.i_visible_height,
p_dec->fmt_out.video.i_sar_num, p_port->p_hwbuf->fmt_out.i_sar_num,
p_dec->fmt_out.video.i_sar_den ); p_port->p_hwbuf->fmt_out.i_sar_den );
p_port->p_hwbuf->i_buffers = p_port->definition.nBufferCountActual; p_port->p_hwbuf->i_buffers = p_port->definition.nBufferCountActual;
p_port->p_hwbuf->i_max_owned = p_port->p_hwbuf->i_buffers - min_undequeued; p_port->p_hwbuf->i_max_owned = p_port->p_hwbuf->i_buffers - min_undequeued;
......
...@@ -76,6 +76,7 @@ typedef struct HwBuffer ...@@ -76,6 +76,7 @@ typedef struct HwBuffer
void *p_library; void *p_library;
void *window; void *window;
video_format_t fmt_out;
#if defined(USE_IOMX) #if defined(USE_IOMX)
native_window_api_t native_window; native_window_api_t native_window;
native_window_priv_api_t anwpriv; native_window_priv_api_t anwpriv;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment