Commit c914ccda authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

VAAPI: provide more logs to understand what is happenning

parent cfaaf916
...@@ -60,6 +60,8 @@ typedef struct ...@@ -60,6 +60,8 @@ typedef struct
{ {
vlc_va_t va; vlc_va_t va;
vlc_object_t *log;
/* */ /* */
Display *p_display_x11; Display *p_display_x11;
VADisplay p_display; VADisplay p_display;
...@@ -129,7 +131,6 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id ) ...@@ -129,7 +131,6 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id )
} }
/* */ /* */
memset( p_va, 0, sizeof(*p_va) );
p_va->i_config_id = VA_INVALID_ID; p_va->i_config_id = VA_INVALID_ID;
p_va->i_context_id = VA_INVALID_ID; p_va->i_context_id = VA_INVALID_ID;
p_va->image.image_id = VA_INVALID_ID; p_va->image.image_id = VA_INVALID_ID;
...@@ -137,19 +138,28 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id ) ...@@ -137,19 +138,28 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id )
/* Create a VA display */ /* Create a VA display */
p_va->p_display_x11 = XOpenDisplay(NULL); p_va->p_display_x11 = XOpenDisplay(NULL);
if( !p_va->p_display_x11 ) if( !p_va->p_display_x11 )
{
msg_Err( p_va->log, "Could not connect to X server" );
goto error; goto error;
}
p_va->p_display = vaGetDisplay( p_va->p_display_x11 ); p_va->p_display = vaGetDisplay( p_va->p_display_x11 );
if( !p_va->p_display ) if( !p_va->p_display )
{
msg_Err( p_va->log, "Could not get a VAAPI device" );
goto error; goto error;
}
if( vaInitialize( p_va->p_display, &p_va->i_version_major, &p_va->i_version_minor ) ) if( vaInitialize( p_va->p_display, &p_va->i_version_major, &p_va->i_version_minor ) )
{
msg_Err( p_va->log, "Failed to initialize the VAAPI device" );
goto error; goto error;
}
/* Check if the selected profile is supported */ /* Check if the selected profile is supported */
i_profiles_nb = vaMaxNumProfiles( p_va->p_display ); i_profiles_nb = vaMaxNumProfiles( p_va->p_display );
p_profiles_list = calloc( i_profiles_nb, sizeof( VAProfile ) ); p_profiles_list = calloc( i_profiles_nb, sizeof( VAProfile ) );
if ( !p_profiles_list ) if( !p_profiles_list )
goto error; goto error;
VAStatus i_status = vaQueryConfigProfiles( p_va->p_display, p_profiles_list, &i_profiles_nb ); VAStatus i_status = vaQueryConfigProfiles( p_va->p_display, p_profiles_list, &i_profiles_nb );
...@@ -166,7 +176,10 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id ) ...@@ -166,7 +176,10 @@ static int Open( vlc_va_vaapi_t *p_va, int i_codec_id )
} }
free( p_profiles_list ); free( p_profiles_list );
if ( !b_supported_profile ) if ( !b_supported_profile )
{
msg_Dbg( p_va->log, "Codec and profile not supported by the hardware" );
goto error; goto error;
}
/* Create a VA configuration */ /* Create a VA configuration */
VAConfigAttrib attrib; VAConfigAttrib attrib;
...@@ -506,6 +519,8 @@ vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id ) ...@@ -506,6 +519,8 @@ vlc_va_t *vlc_va_NewVaapi( vlc_object_t *obj, int i_codec_id )
if( !p_va ) if( !p_va )
return NULL; return NULL;
p_va->log = obj;
if( Open( p_va, i_codec_id ) ) if( Open( p_va, i_codec_id ) )
{ {
free( p_va ); free( p_va );
......
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