static void Prepare(vout_display_t *vd, picture_t *pic, subpicture_t *subpic, vlc_tick_t date) { const video_format_t *fmt = &vd->source; vout_display_sys_t *sys = vd->sys; xcb_connection_t *conn = sys->conn; size_t offset = PictureAttach(vd, pic); if (offset != (size_t)-1) { xcb_shm_put_image(conn, sys->drawable.source, sys->gc, pic->p->i_pitch / pic->p->i_pixel_pitch, pic->p->i_lines, 0, 0, pic->p->i_pitch / pic->p->i_pixel_pitch, pic->p->i_lines, 0, 0, 32, XCB_IMAGE_FORMAT_Z_PIXMAP, 0, sys->segment, offset); } else { xcb_put_image(conn, XCB_IMAGE_FORMAT_Z_PIXMAP, sys->drawable.source, sys->gc, pic->p->i_pitch / pic->p->i_pixel_pitch, pic->p->i_lines, 0, 0, 0, 32, pic->p->i_pitch * pic->p->i_lines, pic->p->p_pixels); } /* Crop the picture with pixel accuracy */ xcb_render_composite(conn, XCB_RENDER_PICT_OP_SRC, sys->picture.source, XCB_RENDER_PICTURE_NONE, sys->picture.crop, fmt->i_x_offset, fmt->i_y_offset, 0, 0, 0, 0, fmt->i_visible_width, fmt->i_visible_height); /* Blank background */ static const xcb_render_color_t black_color = { 0, 0, 0, 0xffff }; xcb_rectangle_t rects[] = { { 0, 0, vd->cfg->display.width, vd->cfg->display.height }, }; xcb_render_fill_rectangles(conn, XCB_RENDER_PICT_OP_SRC, sys->picture.scale, black_color, ARRAY_SIZE(rects), rects); /* Scale and orient the picture */ xcb_render_composite(conn, XCB_RENDER_PICT_OP_SRC, sys->picture.crop, XCB_RENDER_PICTURE_NONE, sys->picture.scale, sys->src_x, sys->src_y, 0, 0, sys->place.x, sys->place.y, sys->place.width, sys->place.height); if (offset != (size_t)-1) PictureDetach(vd); /* Blend subpictures */ if (subpic != NULL) for (subpicture_region_t *r = subpic->p_region; r != NULL; r = r->p_next) RenderRegion(vd, subpic, r); xcb_flush(conn); (void) date; }
/** * ALI_DTV_SUB_Region_Actual_Rendering: * @ SUBHandle: IN, the context ptr of SUB module * @ ctxt: IN, the context ptr of region render. * * Description: Actual Rendering of this region * * Returns: -1, error * >=0, ok */ int ALI_DTV_SUB_Region_Actual_Rendering(HANDLE SUBHandle,void* ctxt) { pSUBCtxt hr = (pSUBCtxt)SUBHandle; tRenderingContext *r_cntx=(tRenderingContext *)ctxt; if(IS_HANDLE_VALID(hr)&& IS_HANDLE_VALID(r_cntx)){ RenderRegion(r_cntx); return 0; } return -1; }