Commit 79eb3508 authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

Davinci decoder: New option "no-davinci-viddec-fullscreen" will let you

disable davinci resizer. (1:1 mode not implemented yet)
Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent 8e62eafb
......@@ -33,12 +33,18 @@
#define VIDDEC_CHROMA_LONGTEXT N_( \
"Force video decoder to output in specific chroma" )
#define VIDDEC_FULLSCREEN_TEXT N_( "Resize video to fullscreen" )
vlc_module_begin();
set_category( CAT_INPUT );
set_subcategory( SUBCAT_INPUT_VCODEC );
set_description( _("DaVinci DSP video decoder") );
set_capability( "decoder", 1337 );
set_callbacks( OpenVideoDecoder, CloseVideoDecoder );
#ifdef DAVINCI_HACK
add_bool( "davinci-viddec-fullscreen", VLC_TRUE, fullscreen_cb,
VIDDEC_FULLSCREEN_TEXT, VIDDEC_FULLSCREEN_TEXT, VLC_FALSE );
#endif
add_string( "davinci-viddec-chroma", "", NULL,
VIDDEC_CHROMA_TEXT, VIDDEC_CHROMA_LONGTEXT, VLC_TRUE );
......@@ -211,4 +217,3 @@ XDAS_Int32 VlcChromaToXdm( vlc_fourcc_t i_chroma )
return XDM_CHROMA_NA;
}
}
......@@ -36,9 +36,14 @@
#include <ti/sdo/ce/Engine.h>
#define DEBUG_DAVINCI
#define DAVINCI_HACK /* directly resize and output the decoded video */
int OpenVideoDecoder( vlc_object_t * );
void CloseVideoDecoder( vlc_object_t * );
#ifdef DAVINCI_HACK
int fullscreen_cb( vlc_object_t *, const char *,
vlc_value_t, vlc_value_t, void * );
#endif
int OpenAudioDecoder( vlc_object_t * );
void CloseAudioDecoder( vlc_object_t * );
......
......@@ -29,8 +29,6 @@
#include <assert.h>
#include <ti/sdo/ce/video/viddec.h>
#define DAVINCI_HACK /* directly resize and output the decoded video */
#ifdef DAVINCI_HACK
#include <sys/types.h>
#include <sys/stat.h>
......@@ -79,8 +77,8 @@ struct decoder_sys_t
int i_fd_resizer;
unsigned int i_height;
unsigned int i_width;
vlc_bool_t b_resize;
#endif
};
......@@ -88,6 +86,7 @@ struct decoder_sys_t
static void Resize( decoder_t *p_dec,
unsigned int *i_width, unsigned int *i_height )
{
/* FIXME : take aspect ratio in account */
unsigned int i_vidw = p_dec->fmt_out.video.i_width;
unsigned int i_vidh = p_dec->fmt_out.video.i_height;
unsigned int i_hratio = VOUT_ASPECT_FACTOR * *i_height / i_vidh;
......@@ -342,6 +341,7 @@ int OpenVideoDecoder( vlc_object_t *p_this )
memset( p_sys, 0, sizeof( decoder_sys_t ) );
#ifdef DAVINCI_HACK
p_sys->i_fd_fb = p_sys->i_fd_resizer = -1;
p_sys->b_resize = var_CreateGetBool( p_dec, "davinci-viddec-fullscreen" );
#endif
/* Initialize the codec engine */
......@@ -748,6 +748,8 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
#else
if( p_sys->b_resize )
{
/* Sets resizer parameters when video starts or when resolution changes */
if( p_sys->i_width != p_dec->fmt_out.video.i_width ||
p_sys->i_height != p_dec->fmt_out.video.i_height )
......@@ -847,6 +849,17 @@ static picture_t *DecodeVideoBlockInner( decoder_t *p_dec, block_t **pp_block, i
}
break;
}
}
else
{
/* FIXME */
/*
* We should output black bars for the top and bottom
* Then for each line, output black at the left and right of video
* Then output the line at the center of the video
*/
;
}
int i_dummy;
ioctl( p_sys->i_fd_fb, FBIO_WAITFORVSYNC, &i_dummy ); /* ignore return */
......@@ -868,3 +881,13 @@ error:
block_Release( p_block );
return NULL;
}
#ifdef DAVINCI_HACK
int fullscreen_cb( vlc_object_t *p_this, const char *psz_var,
vlc_value_t old, vlc_value_t new, void * p_data )
{
((decoder_t*)p_this)->p_sys->b_resize = new.b_bool;
return VLC_SUCCESS;
}
#endif
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