diff options
Diffstat (limited to 'src/video_out/video_out_xcbxv.c')
-rw-r--r-- | src/video_out/video_out_xcbxv.c | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/src/video_out/video_out_xcbxv.c b/src/video_out/video_out_xcbxv.c index 1564375b7..15b14c791 100644 --- a/src/video_out/video_out_xcbxv.c +++ b/src/video_out/video_out_xcbxv.c @@ -191,7 +191,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); /* @@ -380,7 +380,7 @@ static void xv_update_frame_format (vo_driver_t *this_gen, if(format == XINE_IMGFMT_YUY2) { frame->vo_frame.pitches[0] = frame->xv_pitches[0]; frame->vo_frame.base[0] = frame->image + frame->xv_offsets[0]; - } + } else { frame->vo_frame.pitches[0] = frame->xv_pitches[0]; frame->vo_frame.pitches[1] = frame->xv_pitches[2]; @@ -428,12 +428,12 @@ static void xv_clean_output_area (xv_driver_t *this) { this->sc.output_width, this->sc.output_height }; xcb_poly_fill_rectangle(this->connection, this->window, this->gc, 1, &rectangle); } - + if (this->xoverlay) { xcbosd_resize(this->xoverlay, this->sc.gui_width, this->sc.gui_height); this->ovl_changed = 1; } - + pthread_mutex_unlock(&this->main_mutex); } @@ -456,7 +456,7 @@ static void xv_compute_output_size (xv_driver_t *this) { _x_vo_scale_compute_output_size( &this->sc ); } -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; @@ -467,7 +467,7 @@ static void xv_overlay_begin (vo_driver_t *this_gen, xcbosd_clear(this->xoverlay); pthread_mutex_unlock(&this->main_mutex); } - + this->alphablend_extra_data.offset_x = frame_gen->overlay_offset_x; this->alphablend_extra_data.offset_y = frame_gen->overlay_offset_y; } @@ -484,7 +484,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; @@ -498,11 +498,11 @@ static void xv_overlay_blend (vo_driver_t *this_gen, } } 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); } @@ -546,7 +546,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; @@ -575,7 +575,7 @@ static void xv_display_frame (vo_driver_t *this_gen, vo_frame_t *frame_gen) { /* printf (LOG_MODULE ": xv_display_frame...\n"); */ - + /* * queue frames (deinterlacing) * free old frames @@ -665,7 +665,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; - + pthread_mutex_lock(&this->main_mutex); xcb_xv_set_port_attribute(this->connection, this->xv_port, property->atom, entry->num_value); @@ -699,7 +699,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) { case VO_PROP_ASPECT_RATIO: @@ -707,7 +707,7 @@ static int xv_set_property (vo_driver_t *this_gen, value = XINE_VO_ASPECT_AUTO; this->props[property].value = value; - xprintf(this->xine, XINE_VERBOSITY_LOG, + xprintf(this->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": VO_PROP_ASPECT_RATIO(%d)\n", this->props[property].value); this->sc.user_ratio = value; @@ -721,7 +721,7 @@ static int xv_set_property (vo_driver_t *this_gen, this->props[property].value = value; xprintf(this->xine, XINE_VERBOSITY_LOG, LOG_MODULE ": 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); @@ -813,7 +813,7 @@ static int xv_gui_data_exchange (vo_driver_t *this_gen, if(this->xoverlay) xcbosd_expose(this->xoverlay); - + xcb_flush(this->connection); pthread_mutex_unlock(&this->main_mutex); } @@ -862,7 +862,7 @@ static void xv_store_port_attribute(xv_driver_t *this, char *name) { xcb_xv_get_port_attribute_cookie_t get_attribute_cookie; xcb_xv_get_port_attribute_reply_t *get_attribute_reply; - + pthread_mutex_lock(&this->main_mutex); atom_cookie = xcb_intern_atom(this->connection, 0, strlen(name), name); atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL); @@ -870,7 +870,7 @@ static void xv_store_port_attribute(xv_driver_t *this, char *name) { get_attribute_reply = xcb_xv_get_port_attribute_reply(this->connection, get_attribute_cookie, NULL); free(atom_reply); pthread_mutex_unlock(&this->main_mutex); - + if (get_attribute_reply != NULL) { xv_portattribute_t *attr; @@ -888,26 +888,26 @@ static void xv_restore_port_attributes(xv_driver_t *this) { xcb_intern_atom_cookie_t atom_cookie; xcb_intern_atom_reply_t *atom_reply; - + 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); - + pthread_mutex_lock(&this->main_mutex); atom_cookie = xcb_intern_atom(this->connection, 0, strlen(attr->name), attr->name); atom_reply = xcb_intern_atom_reply(this->connection, atom_cookie, NULL); xcb_xv_set_port_attribute(this->connection, this->xv_port, atom_reply->atom, attr->value); free(atom_reply); pthread_mutex_unlock(&this->main_mutex); - + free( attr->name ); free( attr ); } - + pthread_mutex_lock(&this->main_mutex); xcb_flush(this->connection); pthread_mutex_unlock(&this->main_mutex); - + xine_list_delete( this->port_attributes ); } @@ -939,7 +939,7 @@ static void xv_dispose (vo_driver_t *this_gen) { pthread_mutex_destroy(&this->main_mutex); _x_alphablend_free(&this->alphablend_extra_data); - + free (this); } @@ -954,7 +954,7 @@ static int xv_check_yv12(xcb_connection_t *connection, xcb_xv_port_t port) { if (!list_formats_reply) return 1; /* no formats listed; probably due to an invalid port no. */ format_it = xcb_xv_list_image_formats_format_iterator(list_formats_reply); - + for (; format_it.rem; xcb_xv_image_format_info_next(&format_it)) if ((format_it.data->id == XINE_IMGFMT_YV12) && (! (strcmp ((char *) format_it.data->guid, "YV12")))) { @@ -981,7 +981,7 @@ static void xv_check_capability (xv_driver_t *this, xcb_intern_atom_cookie_t atom_cookie; xcb_intern_atom_reply_t *atom_reply; - + /* * some Xv drivers (Gatos ATI) report some ~0 as max values, this is confusing. */ @@ -1011,7 +1011,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 == 0) && (attr->max == 1)) { @@ -1028,12 +1028,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); } @@ -1175,7 +1175,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis pthread_mutex_init(&this->main_mutex, NULL); _x_alphablend_init(&this->alphablend_extra_data, class->xine); - + this->connection = visual->connection; this->screen = visual->screen; this->window = visual->window; @@ -1241,16 +1241,16 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis _("%s: Xv extension is present but I couldn't find a usable yuv12 port.\n" "\tLooks like your graphics hardware driver doesn't support Xv?!\n"), LOG_MODULE); - + /* XvFreeAdaptorInfo (adaptor_info); this crashed on me (gb)*/ return NULL; - } + } else xprintf(class->xine, XINE_VERBOSITY_LOG, _("%s: using Xv port %d from adaptor %s for hardware " "colour space conversion and scaling.\n"), LOG_MODULE, xv_port, xcb_xv_adaptor_info_name(adaptor_it.data)); - + this->xv_port = xv_port; _x_vo_scale_init (&this->sc, 1, 0, config ); @@ -1366,10 +1366,10 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis VIDEO_DEVICE_XV_DOUBLE_BUFFER_HELP, 20, xv_update_XV_DOUBLE_BUFFER, this); config->update_num(config,"video.device.xv_double_buffer",xv_double_buffer); - } else if(!strcmp(name, sync_atoms[this->sync_is_vsync = 0]) || - !strcmp(name, sync_atoms[this->sync_is_vsync = 1])) { + } else if(!strcmp(name, sync_atoms[this->sync_is_vsync = 0]) || + !strcmp(name, sync_atoms[this->sync_is_vsync = 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 " @@ -1402,10 +1402,10 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis list_formats_reply = xcb_xv_list_image_formats_reply(this->connection, list_formats_cookie, NULL); format_it = xcb_xv_list_image_formats_format_iterator(list_formats_reply); - + this->xv_format_yv12 = 0; this->xv_format_yuy2 = 0; - + for (; format_it.rem; xcb_xv_image_format_info_next(&format_it)) { lprintf ("Xv image format: 0x%x (%4.4s) %s\n", format_it.data->id, (char*)&format_it.data->id, @@ -1422,7 +1422,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis case XINE_IMGFMT_YUY2: this->xv_format_yuy2 = format_it.data->id; this->capabilities |= VO_CAP_YUY2; - xprintf(this->xine, XINE_VERBOSITY_LOG, + xprintf(this->xine, XINE_VERBOSITY_LOG, _("%s: this adaptor supports the %s format.\n"), LOG_MODULE, "YUY2"); break; default: @@ -1432,7 +1432,7 @@ static vo_driver_t *open_plugin(video_driver_class_t *class_gen, const void *vis free(list_formats_reply); - 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); |