Using glupload on windows with glutin and glow
Hello, I’m trying to build an app using glutin
glow
and gstreamer
on Windows
I’m using as a reference the glupload example, I’m able to compile the app but I’m running in this runtime error:
0:00:23.651939000 11680 00000182A2FD4D80 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl0> Failed to create context
0:00:23.654347000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<gluploadelement0> error: failed to share contexts through wglShareLists 0xaa
0:00:25.927844000 11680 00000182A2FD4DC0 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl1> Failed to create context
0:00:25.929047000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<glcolorconvertelement0> error: failed to share contexts through wglShareLists 0xaa
0:00:31.059709000 11680 00000182A2FD4E00 WARN glcontext gstglcontext.c:1257:gst_gl_context_create_thread:<glcontextwgl2> Failed to create context
0:00:31.061391000 11680 00000182A2FD4D00 WARN glbasefilter gstglbasefilter.c:608:gst_gl_base_filter_find_gl_context_unlocked:<gluploadelement0> error: failed to share contexts through wglShareLists 0xaa
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.974: gst_caps_is_subset: assertion 'subset != NULL' failed
0:00:33.962252000 11680 00000182A2FD4D00 ERROR basetransform gstbasetransform.c:485:gst_base_transform_transform_caps:<gluploadelement0> transform_caps returned caps (NULL) which are not a real subset of the filter caps video/x-raw, format=(string){ AYUV64, ARGB64, GBRA_12LE, GBRA_12BE, Y412_LE, Y412_BE, A444_10LE, GBRA_10LE, A444_10BE, GBRA_10BE, A422_10LE, A422_10BE, A420_10LE, A420_10BE, RGB10A2_LE, BGR10A2_LE, Y410, GBRA, ABGR, VUYA, BGRA, AYUV, ARGB, RGBA, A420, Y444_16LE, Y444_16BE, v216, P016_LE, P016_BE, Y444_12LE, GBR_12LE, Y444_12BE, GBR_12BE, I422_12LE, I422_12BE, Y212_LE, Y212_BE, I420_12LE, I420_12BE, P012_LE, P012_BE, Y444_10LE, GBR_10LE, Y444_10BE, GBR_10BE, r210, I422_10LE, I422_10BE, NV16_10LE32, Y210, v210, UYVP, I420_10LE, I420_10BE, P010_10LE, NV12_10LE32, NV12_10LE40, P010_10BE, Y444, GBR, NV24, xBGR, BGRx, xRGB, RGBx, BGR, IYU2, v308, RGB, Y42B, NV61, NV16, VYUY, UYVY, YVYU, YUY2, I420, YV12, NV21, NV12, NV12_64Z32, NV12_4L4, NV12_32L32, Y41B, IYU1, YVU9, YUV9, RGB16, BGR16, RGB15, BGR15, RGB8P, GRAY16_LE, GRAY16_BE, GRAY10_LE32, GRAY8 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }; video/x-bayer, format=(string){ bggr, rggb, grbg, gbrg }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ], multiview-mode=(string){ mono, left, right }
** (pira-gst.exe:11680): WARNING **: 06:55:10.977: gluploadelement0: transform_caps returned caps which are not a real subset of the filter caps
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps2)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps2)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_is_empty: assertion 'GST_IS_CAPS (caps)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.977: gst_caps_intersect_full: assertion 'GST_IS_CAPS (caps1)' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.978: gst_mini_object_unref: assertion 'mini_object != NULL' failed
(pira-gst.exe:11680): GStreamer-CRITICAL **: 06:55:10.978: gst_mini_object_unref: assertion 'mini_object != NULL' failed
0:00:33.966942000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.968752000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.969730000 11680 00000182A2FD4D00 WARN GST_PADS gstpad.c:4303:gst_pad_peer_query:<videotestsrc0:src> could not send sticky events
0:00:33.971674000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progress0:00:33.973723000 11680 00000182A2FD4D00 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: Internal data stream error.
0:00:33.974315000 11680 00000182A2FD4D00 WARN basesrc gstbasesrc.c:3127:gst_base_src_loop:<videotestsrc0> error: streaming stopped, reason not-negotiated (-4)
0:00:33.975122000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.975815000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUV64, width=(int)320, height=(int)240, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive not accepted
0:00:33.976519000 11680 00000182A2FD4D00 WARN GST_CAPS gstpad.c:5702:pre_eventfunc_check:<glsinkbin0:sink> caps video/x-raw, format=(string)AYUive not accepted
Here's how I'm creating the gl context:
let gl_display = gst_gl::GLDisplay::new();
let mut shared_ctx_opt = None;
match unsafe { app.context.context().raw_handle() } {
piralib::glutin::platform::windows::RawHandle::Wgl(wgl_handle) => {
println!("WGL");
unsafe {
let raw_handle = wgl_handle as libc::uintptr_t;
shared_ctx_opt = gst_gl::GLContext::new_wrapped(
&gl_display,
raw_handle,
gst_gl::GLPlatform::WGL,
gst_gl::GLAPI::OPENGL3,
)
};
}
_ => (),
};
Here’s the code for reference if someone wants to see https://github.com/Hperigo/pira-gst/blob/main/src/main.rs#L147