/* LVAVS Preset */ LVAVSPipeline *lvavs_pipeline_new () { LVAVSPipeline *pipeline; VisColor *col = visual_color_black(); int i,j; pipeline = visual_mem_new0 (LVAVSPipeline, 1); pipeline->dummy_vid = visual_video_new_with_buffer(0, 0, 1); pipeline->last_vid = visual_video_new_with_buffer(0, 0, 1); for(i = 0; i < sizeof(pipeline->buffers) / sizeof(VisVideo); i++) { pipeline->buffers[i] = visual_video_new_with_buffer(0, 0, 1); } for (j=0;j<256;j++) for (i=0;i<256;i++) pipeline->blendtable[i][j] = (unsigned char)((i / 255.0) * (float)j); /* Do the VisObject initialization */ visual_object_set_allocated (VISUAL_OBJECT (pipeline), TRUE); visual_object_initialize (VISUAL_OBJECT (pipeline), TRUE, lvavs_pipeline_dtor); return pipeline; }
static int negotiate_video (VisActor *actor, int noevent) { VisActorPlugin *actplugin = get_actor_plugin (actor); int tmpwidth, tmpheight, tmppitch; tmpwidth = actor->video->width; tmpheight = actor->video->height; tmppitch = actor->video->pitch; /* Pump the resize events and handle all the pending events */ actplugin->requisition (visual_actor_get_plugin (actor), &actor->video->width, &actor->video->height); if (noevent == FALSE) { visual_event_queue_add_resize (&actor->plugin->eventqueue, actor->video, actor->video->width, actor->video->height); visual_plugin_events_pump (actor->plugin); } /* Size fitting enviroment */ if (tmpwidth != actor->video->width || tmpheight != actor->video->height) { if (actor->video->depth != VISUAL_VIDEO_DEPTH_GL) { actor->fitting = visual_video_new_with_buffer (actor->video->width, actor->video->height, actor->video->depth); } visual_video_set_dimension (actor->video, tmpwidth, tmpheight); } /* Set the pitch seen this is the framebuffer context */ visual_video_set_pitch (actor->video, tmppitch); return VISUAL_OK; }
static VisVideo *visvideo_from_gdkpixbuf (GdkPixbuf *src) { int width = gdk_pixbuf_get_width (src); int height = gdk_pixbuf_get_height (src); VisVideoDepth depth = visual_video_depth_enum_from_value (gdk_pixbuf_get_n_channels (src) * 8); /* Wrap GdkPixbuf's pixel buffer in VisVideo */ VisVideo *bgr = visual_video_new_wrap_buffer (gdk_pixbuf_get_pixels (src), FALSE, width, height, depth, gdk_pixbuf_get_rowstride (src)); /* Flip RGB byte order */ VisVideo *target = visual_video_new_with_buffer (width, height, depth); visual_video_flip_pixel_bytes (target, bgr); visual_video_unref (bgr); return target; }