Maybe gst_x_overlay_set_render_rectangle has bug?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Maybe gst_x_overlay_set_render_rectangle has bug?

Hecate_Eos
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.