1

I have written following gstreamer function to display the videotestsrc video on a Win32 Window(HWND) in Windows. This function works perfectly and displays videotestsrc in the entire window for the given "win" window handle.

void runGstPipe(HWND win)
{
    GstElement *pipeline =
    gst_parse_launch
        ("rtspsrc location=\"...\" ! decodebin ! d3dvideosink name=sink", NULL);

    GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "sink");
    gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink), (guintptr)win);
    GstStateChangeReturn sret = gst_element_set_state(pipeline,
            GST_STATE_PLAYING);
}

Next I tried to enhance the above function to display the videotestsrc in a portion of the window "win" using the following options.

a) By using glimagesink with render-rectangle option as follows

"rtspsrc location=\"...\" ! decodebin ! glvideosink render-rectange=\"<50, 50, 200, 150>\" name=sink"

b) By using gst_video_overlay_set_render_rectangle as follows

gst_video_overlay_set_render_rectangle(GST_VIDEO_OVERLAY(sink), 50, 50, 200, 150);

Both above options did not change the rendering area. i.e., videotestsrc still occupied whole window, instead of given coordinates. Appreciate, if I can get any suggestions.

Venkata Subbarao
  • 352
  • 4
  • 22
  • I'm facing the same issue today. Did you finally find a solution ? – Zyend Jul 06 '21 at 10:27
  • No. It was for flutter video player plugin. Idea was to use gstreamer for fetching video source, decode and generate the yuv stream to display in a portion of the flutter widget. We ended up with converting to images(RGB), which is compatible with flutter widgets. – Venkata Subbarao Jul 10 '21 at 07:42

0 Answers0