Loading...
Searching...
No Matches
ml::ScreenSenderBase Class Reference

Captures this machine's desktop and publishes it as an H.264 RTSP stream (the sending counterpart to ScreenReceiver). More...

#include <Malena/Screen/ScreenSender.h>

Inheritance diagram for ml::ScreenSenderBase:
[legend]

Public Member Functions

 ScreenSenderBase (const char *name, const char *rtspUrl)
 ScreenSenderBase (const ScreenSenderBase &)=delete
virtual ~ScreenSenderBase ()
bool isPublishing () const
ScreenSenderBaseoperator= (const ScreenSenderBase &)=delete
const std::string & senderName () const
void start ()
void stop ()
const std::string & url () const

Detailed Description

Captures this machine's desktop and publishes it as an H.264 RTSP stream (the sending counterpart to ScreenReceiver).

Headless (no UI): it captures the screen with a platform-native GStreamer source, encodes with a platform-native non-GPL H.264 encoder, and pushes the stream to an RTSP server (e.g. MediaMTX on the Pi) via rtspclientsink. A Malena admin app constructs one of these to share its own desktop; the stream is then displayed by any ScreenReceiver pulling the same path.

capture → videoconvert → H.264 encode → h264parse → rtspclientsink(URL)

Encoders are chosen to keep the product distributable (no GPL/x264):

  • macOS : VideoToolbox (vtenc_h264) + avfvideosrc capture-screen
  • Windows : Media Foundation (mfh264enc) + d3d11screencapturesrc
  • Linux/Pi: V4L2 stateful HW encoder (v4l2h264enc) + ximagesrc

The pipeline runs on its own GStreamer threads with a background watcher that auto-reconnects (with backoff) if the RTSP server is not yet up or drops.

See also
ScreenReceiver

Definition at line 36 of file ScreenSender.h.

Constructor & Destructor Documentation

◆ ScreenSenderBase() [1/2]

ml::ScreenSenderBase::ScreenSenderBase ( const char * name,
const char * rtspUrl )
Parameters
nameHuman-readable label for logs/status.
rtspUrlPublish target, e.g. "rtsp://192.168.4.1:8554/admin".

◆ ~ScreenSenderBase()

virtual ml::ScreenSenderBase::~ScreenSenderBase ( )
virtual

◆ ScreenSenderBase() [2/2]

ml::ScreenSenderBase::ScreenSenderBase ( const ScreenSenderBase & )
delete

Member Function Documentation

◆ isPublishing()

bool ml::ScreenSenderBase::isPublishing ( ) const

True while the pipeline is live (PLAYING with no recent error).

◆ operator=()

ScreenSenderBase & ml::ScreenSenderBase::operator= ( const ScreenSenderBase & )
delete

◆ senderName()

const std::string & ml::ScreenSenderBase::senderName ( ) const

◆ start()

void ml::ScreenSenderBase::start ( )

Start (or restart) capturing + publishing. Non-blocking.

◆ stop()

void ml::ScreenSenderBase::stop ( )

Stop publishing and release the pipeline.

◆ url()

const std::string & ml::ScreenSenderBase::url ( ) const

The documentation for this class was generated from the following file: