diff options
Diffstat (limited to 'src/video_out/video_out_xv.c')
-rw-r--r-- | src/video_out/video_out_xv.c | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/src/video_out/video_out_xv.c b/src/video_out/video_out_xv.c index f2c47ef7e..65cd29aa4 100644 --- a/src/video_out/video_out_xv.c +++ b/src/video_out/video_out_xv.c @@ -218,7 +218,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) { frame = (xv_frame_t *) calloc(1, sizeof(xv_frame_t)); if (!frame) return NULL; - + pthread_mutex_init (&frame->vo_frame.mutex, NULL); /* @@ -235,7 +235,7 @@ static vo_frame_t *xv_alloc_frame (vo_driver_t *this_gen) { static int HandleXError (Display *display, XErrorEvent *xevent) { char str [1024]; - + XGetErrorText (display, xevent->error_code, str, 1024); printf ("received X error event: %s\n", str); gX11Fail = 1; @@ -309,7 +309,7 @@ static XvImage *create_ximage (xv_driver_t *this, XShmSegmentInfo *shminfo, lprintf( "XvImage height %d\n", image->height ); lprintf( "XvImage data_size %d\n", image->data_size ); lprintf( "XvImage num_planes %d\n", image->num_planes ); - + for( q=0; q < image->num_planes; q++) { lprintf( "XvImage pitches[%d] %d\n", q, image->pitches[q] ); @@ -425,10 +425,10 @@ static void dispose_ximage (xv_driver_t *this, shminfo->shmid = -1; } - } + } else { free (myimage->data); - + XFree (myimage); } } @@ -466,7 +466,7 @@ static void xv_update_frame_format (vo_driver_t *this_gen, if(format == XINE_IMGFMT_YUY2) { frame->vo_frame.pitches[0] = frame->image->pitches[0]; frame->vo_frame.base[0] = frame->image->data + frame->image->offsets[0]; - } + } else { frame->vo_frame.pitches[0] = frame->image->pitches[0]; frame->vo_frame.pitches[1] = frame->image->pitches[2]; @@ -505,7 +505,7 @@ static void xv_deinterlace_frame (xv_driver_t *this) { if(this->deinterlace_frame.image) dispose_ximage (this, &this->deinterlace_frame.shminfo, this->deinterlace_frame.image); - + this->deinterlace_frame.image = create_ximage (this, &this->deinterlace_frame.shminfo, frame->width,frame->height / xvscaling, frame->format); @@ -621,12 +621,12 @@ static void xv_clean_output_area (xv_driver_t *this) { this->sc.output_xoffset, this->sc.output_yoffset, this->sc.output_width, this->sc.output_height); } - + if (this->xoverlay) { x11osd_resize (this->xoverlay, this->sc.gui_width, this->sc.gui_height); this->ovl_changed = 1; } - + UNLOCK_DISPLAY(this); } @@ -657,7 +657,7 @@ static void xv_compute_output_size (xv_driver_t *this) { } } -static void xv_overlay_begin (vo_driver_t *this_gen, +static void xv_overlay_begin (vo_driver_t *this_gen, vo_frame_t *frame_gen, int changed) { xv_driver_t *this = (xv_driver_t *) this_gen; @@ -665,10 +665,10 @@ static void xv_overlay_begin (vo_driver_t *this_gen, if( this->ovl_changed && this->xoverlay ) { LOCK_DISPLAY(this); - x11osd_clear(this->xoverlay); + x11osd_clear(this->xoverlay); UNLOCK_DISPLAY(this); } - + this->alphablend_extra_data.offset_x = frame_gen->overlay_offset_x; this->alphablend_extra_data.offset_y = frame_gen->overlay_offset_y; } @@ -685,7 +685,7 @@ static void xv_overlay_end (vo_driver_t *this_gen, vo_frame_t *vo_img) { this->ovl_changed = 0; } -static void xv_overlay_blend (vo_driver_t *this_gen, +static void xv_overlay_blend (vo_driver_t *this_gen, vo_frame_t *frame_gen, vo_overlay_t *overlay) { xv_driver_t *this = (xv_driver_t *) this_gen; xv_frame_t *frame = (xv_frame_t *) frame_gen; @@ -694,16 +694,16 @@ static void xv_overlay_blend (vo_driver_t *this_gen, if( overlay->unscaled ) { if( this->ovl_changed && this->xoverlay ) { LOCK_DISPLAY(this); - x11osd_blend(this->xoverlay, overlay); + x11osd_blend(this->xoverlay, overlay); UNLOCK_DISPLAY(this); } } else { if (frame->format == XINE_IMGFMT_YV12) - _x_blend_yuv(frame->vo_frame.base, overlay, + _x_blend_yuv(frame->vo_frame.base, overlay, frame->width, frame->height, frame->vo_frame.pitches, &this->alphablend_extra_data); else - _x_blend_yuy2(frame->vo_frame.base[0], overlay, + _x_blend_yuy2(frame->vo_frame.base[0], overlay, frame->width, frame->height, frame->vo_frame.pitches[0], &this->alphablend_extra_data); } @@ -747,7 +747,7 @@ static int xv_redraw_needed (vo_driver_t *this_gen) { this->sc.delivered_height = this->cur_frame->height; this->sc.delivered_width = this->cur_frame->width; this->sc.delivered_ratio = this->cur_frame->ratio; - + this->sc.crop_left = this->cur_frame->vo_frame.crop_left; this->sc.crop_right = this->cur_frame->vo_frame.crop_right; this->sc.crop_top = this->cur_frame->vo_frame.crop_top; @@ -786,7 +786,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { /* printf ("video_out_xv: xv_display_frame...\n"); */ - + /* * queue frames (deinterlacing) * free old frames @@ -858,7 +858,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { if( factor > 1 ) { - lprintf( "%s PutImage %dX interval (%fs)\n", + lprintf( "%s PutImage %dX interval (%fs)\n", LOG_MODULE, factor, elapse_time ); } } @@ -900,7 +900,7 @@ static int xv_get_property (vo_driver_t *this_gen, int property) { static void xv_property_callback (void *property_gen, xine_cfg_entry_t *entry) { xv_property_t *property = (xv_property_t *) property_gen; xv_driver_t *this = property->this; - + LOCK_DISPLAY(this); XvSetPortAttribute (this->display, this->xv_port, property->atom, @@ -930,7 +930,7 @@ static int xv_set_property (vo_driver_t *this_gen, this->props[property].entry->num_value = this->props[property].value; return this->props[property].value; - } + } else { switch (property) { @@ -944,13 +944,13 @@ static int xv_set_property (vo_driver_t *this_gen, xv_compute_output_size (this); } break; - + case VO_PROP_ASPECT_RATIO: if (value>=XINE_VO_ASPECT_NUM_RATIOS) value = XINE_VO_ASPECT_AUTO; this->props[property].value = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, + xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_xv: VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value); this->sc.user_ratio = value; @@ -964,7 +964,7 @@ static int xv_set_property (vo_driver_t *this_gen, this->props[property].value = value; xprintf(this->xine, XINE_VERBOSITY_LOG, "video_out_xv: VO_PROP_ZOOM_X = %d\n", this->props[property].value); - + this->sc.zoom_factor_x = (double)value / (double)XINE_VO_ZOOM_STEP; xv_compute_ideal_size (this); @@ -1046,7 +1046,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, if(this->xoverlay) x11osd_expose(this->xoverlay); - + XSync(this->display, False); UNLOCK_DISPLAY(this); } @@ -1100,39 +1100,39 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, static void xv_store_port_attribute(xv_driver_t *this, const char *name) { Atom atom; xv_portattribute_t *attr; - + attr = (xv_portattribute_t *)malloc( sizeof(xv_portattribute_t) ); attr->name = strdup(name); - + LOCK_DISPLAY(this); atom = XInternAtom (this->display, attr->name, False); XvGetPortAttribute (this->display, this->xv_port, atom, &attr->value); UNLOCK_DISPLAY(this); - + xine_list_push_back (this->port_attributes, attr); } static void xv_restore_port_attributes(xv_driver_t *this) { Atom atom; xine_list_iterator_t ite; - + while ((ite = xine_list_front(this->port_attributes)) != NULL) { xv_portattribute_t *attr = xine_list_get_value(this->port_attributes, ite); xine_list_remove (this->port_attributes, ite); - + LOCK_DISPLAY(this); atom = XInternAtom (this->display, attr->name, False); XvSetPortAttribute (this->display, this->xv_port, atom, attr->value); UNLOCK_DISPLAY(this); - + free( attr->name ); free( attr ); } - + LOCK_DISPLAY(this); XSync(this->display, False); UNLOCK_DISPLAY(this); - + xine_list_delete( this->port_attributes ); } @@ -1142,7 +1142,7 @@ static void xv_dispose (vo_driver_t *this_gen) { /* restore port attributes to their initial values */ xv_restore_port_attributes(this); - + if (this->deinterlace_frame.image) { LOCK_DISPLAY(this); dispose_ximage (this, &this->deinterlace_frame.shminfo, @@ -1172,7 +1172,7 @@ static void xv_dispose (vo_driver_t *this_gen) { } _x_alphablend_free(&this->alphablend_extra_data); - + free (this); } @@ -1183,7 +1183,7 @@ static int xv_check_yv12 (Display *display, XvPortID port) { int i; formatValues = XvListImageFormats (display, port, &formats); - + for (i = 0; i < formats; i++) if ((formatValues[i].id == XINE_IMGFMT_YV12) && (! (strcmp (formatValues[i].guid, "YV12")))) { @@ -1204,7 +1204,7 @@ static void xv_check_capability (xv_driver_t *this, int int_default; cfg_entry_t *entry; const char *str_prop = attr.name; - + /* * some Xv drivers (Gatos ATI) report some ~0 as max values, this is confusing. */ @@ -1225,7 +1225,7 @@ static void xv_check_capability (xv_driver_t *this, /* might be overridden using config entry */ if(strcmp(str_prop, "XV_AUTOPAINT_COLORKEY") == 0) int_default = 0; - + if (config_name) { /* is this a boolean property ? */ if ((attr.min_value == 0) && (attr.max_value == 1)) { @@ -1242,12 +1242,12 @@ static void xv_check_capability (xv_driver_t *this, entry = this->config->lookup_entry (this->config, config_name); - if((entry->num_value < this->props[property].min) || + if((entry->num_value < this->props[property].min) || (entry->num_value > this->props[property].max)) { - this->config->update_num(this->config, config_name, + this->config->update_num(this->config, config_name, ((this->props[property].min + this->props[property].max) >> 1)); - + entry = this->config->lookup_entry (this->config, config_name); } @@ -1384,7 +1384,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * return NULL; _x_alphablend_init(&this->alphablend_extra_data, class->xine); - + this->display = visual->display; this->screen = visual->screen; this->config = config; @@ -1446,19 +1446,19 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * xprintf(class->xine, XINE_VERBOSITY_LOG, _("video_out_xv: Xv extension is present but I couldn't find a usable yuv12 port.\n" " Looks like your graphics hardware driver doesn't support Xv?!\n")); - + /* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/ UNLOCK_DISPLAY(this); return NULL; - } + } else xprintf(class->xine, XINE_VERBOSITY_LOG, _("video_out_xv: using Xv port %ld from adaptor %s for hardware " "colour space conversion and scaling.\n"), xv_port, adaptor_info[adaptor_num].name); - + UNLOCK_DISPLAY(this); - + this->xv_port = xv_port; _x_vo_scale_init (&this->sc, 1, 0, config ); @@ -1534,7 +1534,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * const char *const name = attr[k].name; /* store initial port attribute value */ xv_store_port_attribute(this, name); - + if(!strcmp(name, "XV_HUE")) { if (!strncmp(adaptor_info[adaptor_num].name, "NV", 2)) { xprintf (this->xine, XINE_VERBOSITY_NONE, "video_out_xv: ignoring broken XV_HUE settings on NVidia cards\n"); @@ -1582,7 +1582,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * } else if(((this->sync_is_vsync = 0), !strcmp(name, sync_atoms[0])) || ((this->sync_is_vsync = 1), !strcmp(name, sync_atoms[1]))) { int xv_sync_to_vblank; - xv_sync_to_vblank = + xv_sync_to_vblank = config->register_bool (config, "video.device.xv_sync_to_vblank", 1, _("enable vblank sync"), _("This option will synchronize the update of the video image to the " @@ -1613,10 +1613,10 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * fo = XvListImageFormats(this->display, this->xv_port, (int*)&formats); UNLOCK_DISPLAY(this); - + this->xv_format_yv12 = 0; this->xv_format_yuy2 = 0; - + for(i = 0; i < formats; i++) { lprintf ("Xv image format: 0x%x (%4.4s) %s\n", fo[i].id, (char*)&fo[i].id, @@ -1630,7 +1630,7 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * } else if (fo[i].id == XINE_IMGFMT_YUY2) { this->xv_format_yuy2 = fo[i].id; this->capabilities |= VO_CAP_YUY2; - xprintf(this->xine, XINE_VERBOSITY_LOG, + xprintf(this->xine, XINE_VERBOSITY_LOG, _("video_out_xv: this adaptor supports the yuy2 format.\n")); } } @@ -1651,12 +1651,12 @@ static vo_driver_t *open_plugin_2 (video_driver_class_t *class_gen, const void * dispose_ximage (this, &myshminfo, myimage); UNLOCK_DISPLAY(this); - this->use_pitch_alignment = + this->use_pitch_alignment = config->register_bool (config, "video.device.xv_pitch_alignment", 0, VIDEO_DEVICE_XV_PITCH_ALIGNMENT_HELP, 10, xv_update_xv_pitch_alignment, this); - this->deinterlace_method = + this->deinterlace_method = config->register_enum (config, "video.output.xv_deinterlace_method", 4, deinterlace_methods, _("deinterlace method (deprecated)"), @@ -1720,7 +1720,7 @@ static vo_driver_t *open_plugin_old (video_driver_class_t *class_gen, const void visual.frame_output_cb = old_visual->frame_output_cb; visual.lock_display = NULL; visual.unlock_display = NULL; - + return open_plugin_2(class_gen, (void *)&visual); } @@ -1738,7 +1738,7 @@ static char* get_description (video_driver_class_t *this_gen) { static void dispose_class (video_driver_class_t *this_gen) { xv_class_t *this = (xv_class_t *) this_gen; - + free (this); } |