summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/video_out/video_out_vdpau.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/src/video_out/video_out_vdpau.c b/src/video_out/video_out_vdpau.c
index 57ee478b0..95903e21e 100644
--- a/src/video_out/video_out_vdpau.c
+++ b/src/video_out/video_out_vdpau.c
@@ -71,7 +71,7 @@
#define NUMBER_OF_DEINTERLACERS 5
-char *vdpau_deinterlacer_name[] = {
+static const char *const vdpau_deinterlacer_name[] = {
"bob",
"half temporal",
"half temporal_spatial",
@@ -80,7 +80,7 @@ char *vdpau_deinterlacer_name[] = {
NULL
};
-char* vdpau_deinterlacer_description [] = {
+static const char *const vdpau_deinterlacer_description [] = {
"bob\nBasic deinterlacing, doing 50i->50p.\n\n",
"half temporal\nDisplays first field only, doing 50i->25p\n\n",
"half temporal_spatial\nDisplays first field only, doing 50i->25p\n\n",
@@ -90,7 +90,7 @@ char* vdpau_deinterlacer_description [] = {
};
-char *vdpau_sd_only_properties[] = {
+static const char *const vdpau_sd_only_properties[] = {
"none",
"noise",
"sharpness",
@@ -98,7 +98,7 @@ char *vdpau_sd_only_properties[] = {
NULL
};
-VdpOutputSurfaceRenderBlendState blend = {
+static const VdpOutputSurfaceRenderBlendState blend = {
VDP_OUTPUT_SURFACE_RENDER_BLEND_STATE_VERSION,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE,
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_COLOR,
@@ -106,7 +106,7 @@ VdpOutputSurfaceRenderBlendState blend = {
VDP_OUTPUT_SURFACE_RENDER_BLEND_FACTOR_ONE_MINUS_SRC_ALPHA,
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
VDP_OUTPUT_SURFACE_RENDER_BLEND_EQUATION_ADD,
- 0
+ { 0 }
};
@@ -188,8 +188,8 @@ static VdpDecoderDestroy *orig_vdp_decoder_destroy;
static VdpDecoderRender *orig_vdp_decoder_render;
#ifdef LOCKDISPLAY
-#define DO_LOCKDISPLAY XLockDisplay(guarded_display);
-#define DO_UNLOCKDISPLAY XUnlockDisplay(guarded_display);
+#define DO_LOCKDISPLAY XLockDisplay(guarded_display)
+#define DO_UNLOCKDISPLAY XUnlockDisplay(guarded_display)
static Display *guarded_display;
#else
#define DO_LOCKDISPLAY
@@ -199,18 +199,18 @@ static Display *guarded_display;
static VdpStatus guarded_vdp_video_surface_putbits_ycbcr(VdpVideoSurface surface, VdpYCbCrFormat source_ycbcr_format, void const *const *source_data, uint32_t const *source_pitches)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_video_surface_putbits_ycbcr(surface, source_ycbcr_format, source_data, source_pitches);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
static VdpStatus guarded_vdp_video_surface_create(VdpDevice device, VdpChromaType chroma_type, uint32_t width, uint32_t height,VdpVideoSurface *surface)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_video_surface_create(device, chroma_type, width, height, surface);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
@@ -226,45 +226,45 @@ static VdpStatus guarded_vdp_video_surface_destroy(VdpVideoSurface surface)
static VdpStatus guarded_vdp_output_surface_create(VdpDevice device, VdpChromaType chroma_type, uint32_t width, uint32_t height,VdpVideoSurface *surface)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_output_surface_create(device, chroma_type, width, height, surface);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
static VdpStatus guarded_vdp_output_surface_destroy(VdpVideoSurface surface)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_output_surface_destroy(surface);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
static VdpStatus guarded_vdp_decoder_create(VdpDevice device, VdpDecoderProfile profile, uint32_t width, uint32_t height, uint32_t max_references, VdpDecoder *decoder)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_decoder_create(device, profile, width, height, max_references, decoder);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
static VdpStatus guarded_vdp_decoder_destroy(VdpDecoder decoder)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_decoder_destroy(decoder);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
static VdpStatus guarded_vdp_decoder_render(VdpDecoder decoder, VdpVideoSurface target, VdpPictureInfo const *picture_info, uint32_t bitstream_buffer_count, VdpBitstreamBuffer const *bitstream_buffers)
{
VdpStatus r;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
r = orig_vdp_decoder_render(decoder, target, picture_info, bitstream_buffer_count, bitstream_buffers);
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return r;
}
@@ -387,7 +387,7 @@ typedef struct {
VdpBool skip_chroma_is_supported;
VdpBool background_is_supported;
- char* deinterlacers_name[NUMBER_OF_DEINTERLACERS+1];
+ const char* deinterlacers_name[NUMBER_OF_DEINTERLACERS+1];
int deinterlacers_method[NUMBER_OF_DEINTERLACERS];
int scaling_level_max;
@@ -1919,7 +1919,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
if ( this->init_queue>1 )
vdp_queue_block( vdp_queue, this->output_surface[this->current_output_surface], &last_time );
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
vdpau_check_output_size( this_gen );
@@ -1951,9 +1951,9 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
if ( (dm != DEINT_HALF_TEMPORAL) && (dm != DEINT_HALF_TEMPORAL_SPATIAL) && frame->vo_frame.future_frame ) { /* process second field */
if ( this->init_queue >= this->queue_length ) {
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
vdp_queue_block( vdp_queue, this->output_surface[this->current_output_surface], &last_time );
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
}
vdpau_check_output_size( this_gen );
@@ -1990,7 +1990,7 @@ static void vdpau_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen)
vdpau_shift_queue( this_gen );
}
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
if ( stream_speed )
vdpau_backup_frame( this_gen, frame_gen );
@@ -2216,14 +2216,14 @@ static int vdpau_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *
case XINE_GUI_SEND_EXPOSE_EVENT: {
if ( this->init_queue ) {
pthread_mutex_lock(&this->drawable_lock); /* wait for other thread which is currently displaying */
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
int previous;
if ( this->current_output_surface )
previous = this->current_output_surface - 1;
else
previous = this->queue_length - 1;
vdp_queue_display( vdp_queue, this->output_surface[previous], 0, 0, 0 );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
pthread_mutex_unlock(&this->drawable_lock);
}
break;
@@ -2232,26 +2232,26 @@ static int vdpau_gui_data_exchange (vo_driver_t *this_gen, int data_type, void *
case XINE_GUI_SEND_DRAWABLE_CHANGED: {
VdpStatus st;
pthread_mutex_lock(&this->drawable_lock); /* wait for other thread which is currently displaying */
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
this->drawable = (Drawable) data;
vdp_queue_destroy( vdp_queue );
vdp_queue_target_destroy( vdp_queue_target );
st = vdp_queue_target_create_x11( vdp_device, this->drawable, &vdp_queue_target );
if ( st != VDP_STATUS_OK ) {
fprintf(stderr, "vo_vdpau: FATAL !! Can't recreate presentation queue target after drawable change !!\n" );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
pthread_mutex_unlock(&this->drawable_lock);
break;
}
st = vdp_queue_create( vdp_device, vdp_queue_target, &vdp_queue );
if ( st != VDP_STATUS_OK ) {
fprintf(stderr, "vo_vdpau: FATAL !! Can't recreate presentation queue after drawable change !!\n" );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
pthread_mutex_unlock(&this->drawable_lock);
break;
}
vdp_queue_set_background_color( vdp_queue, &this->back_color );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
pthread_mutex_unlock(&this->drawable_lock);
this->sc.force_redraw = 1;
break;
@@ -2367,7 +2367,7 @@ static void vdpau_reinit( vo_driver_t *this_gen )
fprintf(stderr,"vo_vdpau: VDPAU was pre-empted. Reinit.\n");
vdpau_driver_t *this = (vdpau_driver_t *)this_gen;
- DO_LOCKDISPLAY
+ DO_LOCKDISPLAY;
vdpau_release_back_frames(this_gen);
VdpStatus st = vdp_device_create_x11( this->display, this->screen, &vdp_device, &vdp_get_proc_address );
@@ -2378,18 +2378,18 @@ static void vdpau_reinit( vo_driver_t *this_gen )
fprintf(stderr, "No vdpau implementation.\n" );
else
fprintf(stderr, "unsupported GPU?\n" );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
st = vdp_queue_target_create_x11( vdp_device, this->drawable, &vdp_queue_target );
if ( vdpau_reinit_error( st, "Can't create presentation queue target !!" ) ) {
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
st = vdp_queue_create( vdp_device, vdp_queue_target, &vdp_queue );
if ( vdpau_reinit_error( st, "Can't create presentation queue !!" ) ) {
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
vdp_queue_set_background_color( vdp_queue, &this->back_color );
@@ -2398,7 +2398,7 @@ static void vdpau_reinit( vo_driver_t *this_gen )
VdpChromaType chroma = VDP_CHROMA_TYPE_420;
st = orig_vdp_video_surface_create( vdp_device, chroma, this->soft_surface_width, this->soft_surface_height, &this->soft_surface );
if ( vdpau_reinit_error( st, "Can't create video surface !!" ) ) {
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
@@ -2415,7 +2415,7 @@ static void vdpau_reinit( vo_driver_t *this_gen )
for ( j=0; j<i; ++j )
vdp_output_surface_destroy( this->output_surface[j] );
vdp_video_surface_destroy( this->soft_surface );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
}
@@ -2467,7 +2467,7 @@ static void vdpau_reinit( vo_driver_t *this_gen )
orig_vdp_video_surface_destroy( this->soft_surface );
for ( i=0; i<this->queue_length; ++i )
vdp_output_surface_destroy( this->output_surface[i] );
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
return;
}
this->video_mixer_chroma = chroma;
@@ -2484,7 +2484,7 @@ static void vdpau_reinit( vo_driver_t *this_gen )
this->vdp_runtime_nr++;
this->reinit_needed = 0;
- DO_UNLOCKDISPLAY
+ DO_UNLOCKDISPLAY;
fprintf(stderr,"vo_vdpau: Reinit done.\n");
}