mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-27 10:51:22 +00:00
feat: enable https camera stream mode
This commit is contained in:
@@ -184,6 +184,7 @@ void MediaPlayCtrl::SetMachineObject(MachineObject* obj)
|
||||
|
||||
switch (mode) {
|
||||
case CameraStreamMode::http:
|
||||
case CameraStreamMode::https:
|
||||
case CameraStreamMode::http_snapshot:
|
||||
case CameraStreamMode::rtsp: {
|
||||
std::string machine = obj ? obj->get_dev_id() : "";
|
||||
@@ -346,6 +347,7 @@ void MediaPlayCtrl::Play()
|
||||
SetStatus(_L("Playing..."), false);
|
||||
return;
|
||||
case CameraStreamMode::http:
|
||||
case CameraStreamMode::https:
|
||||
case CameraStreamMode::rtsp:
|
||||
if (m_next_retry.IsValid() && wxDateTime::Now() < m_next_retry)
|
||||
return;
|
||||
@@ -565,13 +567,14 @@ void MediaPlayCtrl::Stop(wxString const &msg, wxString const &msg2)
|
||||
}
|
||||
switch (current_mode()) {
|
||||
case CameraStreamMode::http:
|
||||
case CameraStreamMode::https:
|
||||
case CameraStreamMode::http_snapshot: {
|
||||
const bool snapshot = current_mode() == CameraStreamMode::http_snapshot;
|
||||
if (m_last_state != MEDIASTATE_IDLE) {
|
||||
if (snapshot) {
|
||||
if (m_web_ctrl) m_web_ctrl->Stop();
|
||||
} else {
|
||||
// http mode plays through the ffmpeg backend (m_media_ctrl), not
|
||||
// http/https mode plays through the ffmpeg backend (m_media_ctrl), not
|
||||
// the webview - tear its read thread down too, otherwise it keeps
|
||||
// pulling and painting frames after the UI says "Video Stopped".
|
||||
boost::unique_lock lock(m_mutex);
|
||||
|
||||
@@ -50,6 +50,7 @@ enum class FilamentSyncMode {
|
||||
enum class CameraStreamMode {
|
||||
none = 0,
|
||||
http, // LAN or Cloud
|
||||
https, // LAN or Cloud over TLS
|
||||
rtsp, // LAN only
|
||||
webrtc, // Cloud only
|
||||
http_snapshot // HTTP endpoint returning one image per request
|
||||
@@ -330,7 +331,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get the camera stream mode for this agent. This value can be deterministic and derived at
|
||||
* runtime if the printer supports multiple camera stream modes. E.g. LAN => HTTP/RTSP, Cloud => WebRTC.
|
||||
* runtime if the printer supports multiple camera stream modes. E.g. LAN => HTTP/HTTPS/RTSP, Cloud => WebRTC.
|
||||
*
|
||||
* @return CameraStreamMode indicating how the camera stream is obtained or used:
|
||||
*/
|
||||
@@ -355,7 +356,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get the current camera stream URL for this agent's active machine.
|
||||
* Only meaningful when get_camera_stream_mode() returns an HTTP or RTSP mode.
|
||||
* Only meaningful when get_camera_stream_mode() returns an HTTP, HTTPS, or RTSP mode.
|
||||
*/
|
||||
virtual std::string get_camera_url() const { return {}; }
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ void PrinterAgentPluginCapability::RegisterBindings(pybind11::module_& module)
|
||||
py::enum_<CameraStreamMode>(printer_agent_module, "CameraStreamMode")
|
||||
.value("None_", CameraStreamMode::none)
|
||||
.value("HTTP", CameraStreamMode::http)
|
||||
.value("HTTPS", CameraStreamMode::https)
|
||||
.value("HTTP_SNAPSHOT", CameraStreamMode::http_snapshot)
|
||||
.value("RTSP", CameraStreamMode::rtsp)
|
||||
.value("WebRTC", CameraStreamMode::webrtc)
|
||||
|
||||
Reference in New Issue
Block a user