mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 23:46:24 -06:00
Add support for Bambu Lab X1 series live video stream on Linux.
wxWidgets on Linux uses GStreamer as its back-end for wxMediaCtrl, which doesn't have a bambu: URI handler. On Windows, this is handled by a Windows Media subsystem plugin, and on Mac, this is handled with a BambuPlayer class. Luckily, the libBambuSource.so binary that is distributed with the network plugin package already contains support for receiving h.264 data from the network, and the API is the same as is used by the tiny bambusource.exe binary on Windows; we glue this into a GStreamer source plugin that registers a URI handler for bambu:. To make this work, we make a few additional changes elsewhere. GStreamer seems to have trouble rendering an Xv overlay onto a 32bpp X visual, but Bambu Slicer seems to request a 32bpp visual for some background transparency in the Notebook; it doesn't seem to use it in an interesting way on Linux, though, so we remove that request for transparency to allow Bambu Studio to render to a 24bpp visual. The media controller infrastructure also makes a few assumptions about when sizing information can be queried from a wxMediaCtrl backend that do not hold true on Linux; we either fix those assumptions, or fake them out, as needed. We also make a few changes needed to successfully compile C. This has only been tested with the GStreamer backend for wxWidgets -- notably, not the GStreamer-play backend (these are, astonishingly, two different things!). If you find that this seems not to work, consider *un*installing the libgstreamer-plugins-bad1.0-dev package and then rebuilding wxWidgets.
This commit is contained in:
parent
89d38fc6f6
commit
43a7f88c6c
10 changed files with 691 additions and 1 deletions
|
@ -541,7 +541,11 @@ bool MediaPlayCtrl::get_stream_url(std::string *url)
|
|||
|
||||
void wxMediaCtrl2::DoSetSize(int x, int y, int width, int height, int sizeFlags)
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
|
||||
#else
|
||||
wxMediaCtrl::DoSetSize(x, y, width, height, sizeFlags);
|
||||
#endif
|
||||
if (sizeFlags & wxSIZE_USE_EXISTING) return;
|
||||
wxSize size = GetVideoSize();
|
||||
if (size.GetWidth() <= 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue