[gst-devel] Maybe gst_x_overlay_set_render_rectangle has bug?

刘兴民 xflxmin17 at 163.com
Wed Jun 30 03:06:40 CEST 2010


I use gst_x_overlay_set_render_rectangle to resize my video rectangle, because I want to draw a  title bar for my video in the GtkDrawingArea's top section.
I dynamicly create the pipeline and drawing area.The first time, I can get the right result, xoverlay can be resized. But, when I create another, it can't work.I  can't change the render rectangle.It returns false. 
The following is the code :
static gboolean cb_process_events(GstBus *bus,
                                  GstMessage *message,
                                  player_t *player)
{
    switch(GST_MESSAGE_TYPE(message))
    {
        case GST_MESSAGE_EOS:
        case GST_MESSAGE_ERROR:
            // delete_player(player);
             break;
        case GST_MESSAGE_ELEMENT:
            if(gst_structure_has_name(message->structure, "prepare-xwindow-id") && player->cntl != NULL)
            {
                GstXOverlay *xoverlay = NULL;
                xoverlay = GST_X_OVERLAY (GST_MESSAGE_SRC (message));
                gulong xid = GDK_WINDOW_XID (player->win->window);
                gst_x_overlay_set_xwindow_id(xoverlay, xid);
                gst_x_overlay_set_render_rectangle(xoverlay,
                                           0,
                                           VIDEO_AREA_TITLEBAR_HEIGHT,
                                           player->win->allocation.width,
                                           player->win->allocation.height - VIDEO_AREA_TITLEBAR_HEIGHT);
              }
              break;
        default:
             break;
    }

    return TRUE;
}
/*
player_t
{
     GstElement *cntl;/* this is a pipeline*/
     GktWidget *win; /*this is for video output*/
}
*/
I don't know whether  you can understand me. My English needs improve.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20100630/f0b8db40/attachment.htm>


More information about the gstreamer-devel mailing list