#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/WebRtcMediaController.hpp>
Classes | |
| struct | Status |
Public Member Functions | |
| WebRtcMediaController (std::function< void(const wxImage &, wxSize)> frame_sink, std::function< void(Status)> on_status) | |
| ~WebRtcMediaController () override | |
| void | set_signalling_channel (std::unique_ptr< ICameraSignalingChannel > channel) |
| std::uint64_t | epoch () const |
| bool | is_active () const |
| void | Load (wxURI) override |
| void | Play () override |
| void | Stop () override |
| wxMediaState | GetState () override |
| wxSize | GetVideoSize () const override |
| virtual int | GetLastError () const |
Private Member Functions | |
| void | teardown (bool notify) |
| void | report (Status status) |
| void | bind_data_channel (const std::shared_ptr< rtc::DataChannel > &dc) |
| void | on_ready (std::vector< CameraIceServer > servers) |
| void | on_answer (std::string sdp) |
| void | on_ice (std::string candidate, std::string mid) |
| void | on_unavailable (CameraUnavailableReason reason, std::string detail) |
| void | decode_loop () |
| void | enqueue_jpeg (std::vector< std::byte > jpeg) |
| void | deliver_jpeg (std::vector< std::byte > jpeg) |
Private Attributes | |
| std::mutex | m_mutex |
| std::condition_variable | m_cond |
| std::deque< std::vector< std::byte > > | m_jpeg_queue |
| std::vector< std::pair< std::string, std::string > > | m_pending_candidates |
| bool | m_remote_description_set = false |
| std::unique_ptr< ICameraSignalingChannel > | m_pending_signaling |
| std::unique_ptr< ICameraSignalingChannel > | m_signaling |
| std::shared_ptr< rtc::PeerConnection > | m_peer_connection |
| std::shared_ptr< rtc::DataChannel > | m_data_channel |
| std::thread | m_decode_thread |
| std::atomic< bool > | m_alive {false} |
| std::atomic< std::uint64_t > | m_epoch {0} |
| wxMediaState | m_state = static_cast<wxMediaState>(3) |
| wxSize | m_video_size = wxDefaultSize |
| std::function< void(const wxImage &, wxSize)> | m_frame_sink |
| std::function< void(Status)> | m_on_status |
| bool | m_has_frame = false |
| std::chrono::steady_clock::time_point | m_last_frame_time {} |
| Slic3r::GUI::WebRtcMediaController::WebRtcMediaController | ( | std::function< void(const wxImage &, wxSize)> | frame_sink, |
| std::function< void(Status)> | on_status ) |
References m_frame_sink, and m_on_status.
|
override |
|
private |
References enqueue_jpeg(), and m_alive.
Referenced by on_ready().
|
private |
References deliver_jpeg(), Slic3r::GUI::WebRtcMediaController::Status::Failed, m_alive, m_cond, m_data_channel, m_has_frame, m_jpeg_queue, m_mutex, m_peer_connection, report(), and Slic3r::GUI::WebRtcMediaController::Status::TIMEOUT.
Referenced by Play().
|
private |
References Slic3r::GUI::WebRtcMediaController::Status::DECODE_ERROR, Slic3r::GUI::WebRtcMediaController::Status::Failed, m_frame_sink, m_has_frame, m_last_frame_time, m_mutex, m_video_size, Slic3r::GUI::WebRtcMediaController::Status::Playing, and report().
Referenced by decode_loop().
|
private |
References m_cond, m_jpeg_queue, and m_mutex.
Referenced by bind_data_channel().
|
inline |
References m_epoch.
|
inlinevirtualinherited |
Reimplemented in wxMediaCtrl3.
|
overridevirtual |
Reimplemented from Slic3r::GUI::IMediaController.
|
overridevirtual |
Reimplemented from Slic3r::GUI::IMediaController.
References m_mutex, and m_video_size.
|
inline |
|
inlineoverridevirtual |
Implements Slic3r::GUI::IMediaController.
|
private |
References Slic3r::GUI::WebRtcMediaController::Status::Failed, Slic3r::GUI::WebRtcMediaController::Status::ICE_FAILED, m_mutex, m_peer_connection, m_pending_candidates, m_remote_description_set, and report().
Referenced by Play().
|
private |
References m_mutex, m_peer_connection, m_pending_candidates, and m_remote_description_set.
Referenced by Play().
|
private |
References bind_data_channel(), Slic3r::GUI::WebRtcMediaController::Status::Failed, Slic3r::GUI::WebRtcMediaController::Status::ICE_FAILED, m_alive, m_data_channel, m_mutex, m_peer_connection, m_signaling, and report().
Referenced by Play().
|
private |
References Slic3r::Busy, Slic3r::Closed, Slic3r::Disabled, Slic3r::GUI::WebRtcMediaController::Status::Failed, report(), Slic3r::GUI::WebRtcMediaController::Status::SIGNALING_CLOSED, Slic3r::GUI::WebRtcMediaController::Status::UNAVAILABLE_BUSY, Slic3r::GUI::WebRtcMediaController::Status::UNAVAILABLE_DISABLED, and Slic3r::GUI::WebRtcMediaController::Status::UNAVAILABLE_ERROR.
Referenced by Play().
|
overridevirtual |
Implements Slic3r::GUI::IMediaController.
References Slic3r::GUI::WebRtcMediaController::Status::Connecting, decode_loop(), m_alive, m_decode_thread, m_epoch, m_has_frame, m_jpeg_queue, m_last_frame_time, m_mutex, m_pending_candidates, m_pending_signaling, m_remote_description_set, m_signaling, m_video_size, on_answer(), Slic3r::ICameraSignalingChannel::on_answer, on_ice(), Slic3r::ICameraSignalingChannel::on_ice, on_ready(), Slic3r::ICameraSignalingChannel::on_ready, on_unavailable(), Slic3r::ICameraSignalingChannel::on_unavailable, Slic3r::ICameraSignalingChannel::open(), report(), and teardown().
|
private |
References Slic3r::GUI::WebRtcMediaController::Status::code, Slic3r::GUI::WebRtcMediaController::Status::Connecting, Slic3r::GUI::WebRtcMediaController::Status::epoch, Slic3r::GUI::WebRtcMediaController::Status::kind, m_epoch, m_mutex, m_on_status, m_state, and Slic3r::GUI::WebRtcMediaController::Status::Playing.
Referenced by decode_loop(), deliver_jpeg(), on_answer(), on_ready(), on_unavailable(), Play(), and teardown().
| void Slic3r::GUI::WebRtcMediaController::set_signalling_channel | ( | std::unique_ptr< ICameraSignalingChannel > | channel | ) |
References m_pending_signaling.
|
overridevirtual |
Implements Slic3r::GUI::IMediaController.
References teardown().
Referenced by ~WebRtcMediaController().
|
private |
References m_alive, m_cond, m_data_channel, m_decode_thread, m_jpeg_queue, m_mutex, m_peer_connection, m_signaling, report(), and Slic3r::GUI::WebRtcMediaController::Status::Stopped.
Referenced by Play(), and Stop().
|
private |
Referenced by bind_data_channel(), decode_loop(), is_active(), on_ready(), Play(), and teardown().
|
private |
Referenced by decode_loop(), enqueue_jpeg(), and teardown().
|
private |
Referenced by decode_loop(), on_ready(), and teardown().
|
private |
Referenced by Play(), and teardown().
|
private |
|
private |
Referenced by WebRtcMediaController(), and deliver_jpeg().
|
private |
Referenced by decode_loop(), deliver_jpeg(), and Play().
|
private |
Referenced by decode_loop(), enqueue_jpeg(), Play(), and teardown().
|
private |
Referenced by deliver_jpeg(), and Play().
|
mutableprivate |
Referenced by decode_loop(), deliver_jpeg(), enqueue_jpeg(), GetState(), GetVideoSize(), on_answer(), on_ice(), on_ready(), Play(), report(), and teardown().
|
private |
Referenced by WebRtcMediaController(), and report().
|
private |
Referenced by decode_loop(), on_answer(), on_ice(), on_ready(), and teardown().
|
private |
Referenced by on_answer(), on_ice(), and Play().
|
private |
Referenced by Play(), and set_signalling_channel().
|
private |
Referenced by on_answer(), on_ice(), and Play().
|
private |
Referenced by on_ready(), Play(), and teardown().
|
private |
Referenced by GetState(), and report().
|
private |
Referenced by deliver_jpeg(), GetVideoSize(), and Play().