1 #ifndef LIVETHREAD_HEADER_GUARD 2 #define LIVETHREAD_HEADER_GUARD 44 void setLiveOutPacketBuffermaxSize(
unsigned i);
68 void setLiveThread(
void* live_thread);
100 connection_type(ct), address(address), slot(slot), framefilter(framefilter), msreconnect(0),
101 request_multicast(false), request_tcp(false), recv_buffer_size(0), reordering_time(0),
107 request_multicast(false), request_tcp(false),time_correction(
TimeCorrectionType::smart)
128 unsigned short int portnum) :
129 connection_type(ct), address(address), slot(slot), portnum(portnum), ttl(225)
132 connection_type(LiveConnectionType::none), address(
""), slot(0), portnum(0), ttl(255)
217 virtual void playStream() =0;
218 virtual void stopStream() =0;
219 virtual void reStartStream();
220 virtual void reStartStreamIf();
221 virtual bool isClosed();
222 virtual void forceClose();
223 SlotNumber getSlot();
250 virtual void reinit();
251 virtual void handleFrame(
Frame *f);
277 void reStartStreamIf();
321 void handleFrame(
Frame *f);
347 void handleFrame(
Frame *f);
350 ServerMediaSession *media_session;
351 std::vector<ValkkaServerMediaSubsession*> media_subsessions;
371 static void periodicTask(
void* cdata);
398 EventTriggerId event_trigger_id_hello_world;
399 EventTriggerId event_trigger_id_frame_arrived;
400 EventTriggerId event_trigger_id_got_frames;
404 UserAuthenticationDatabase *authDB;
415 void handlePending();
418 void handleSignals();
419 void handleFrame(
Frame* f);
422 int safeGetSlot (SlotNumber slot,
Connection*& con);
423 int safeGetOutboundSlot (SlotNumber slot,
Outbound*& outbound);
444 void requestStopCall();
447 void setRTSPServer(
int portnum=8554);
450 static void helloWorldEvent(
void* clientData);
451 static void frameArrivedEvent(
void* clientData);
452 static void gotFramesEvent(
void* clientData);
453 static void readFrameFifoTask(
void* clientData);
457 void triggerGotFrames();
UsageEnvironment & env
UsageEnvironment identifying the Live555 event loop (see Live555 primer)
Definition: livethread.h:213
Describes the stack structure and fifo behaviour for a FrameFifo.
Definition: framefifo.h:45
LiveFifo(const char *name, FrameFifoContext ctx)
Default constructor.
Definition: livethread.cpp:49
A negotiated RTSP connection.
Definition: livethread.h:261
signal to AVThread or OpenGLThread. Also custom signals to custom Threads
Thread safe system of fifo and a stack.
Same as LiveConnectionContext, but for outbound streams (i.e.
Definition: livethread.h:126
long unsigned int msreconnect
If stream has delivered nothing during this many milliseconds, reconnect // <pyapi> ...
Definition: livethread.h:113
FrameFifo & fifo
Outgoing fFrames are being read and finally recycled here.
Definition: livethread.h:244
unsigned char ttl
Packet time-to-live // <pyapi>
Definition: livethread.h:138
FifoFrameFilter infilter
A FrameFilter for writing incoming frames.
Definition: livethread.h:385
FrameFilter * framefilter
The frames are feeded into this FrameFilter // <pyapi>
Definition: livethread.h:112
Identifies a stream and encapsulates information about the type of connection the user is requesting ...
Definition: livethread.h:96
SlotNumber slot
A unique stream slot that identifies this stream // <pyapi>
Definition: livethread.h:136
A thread-safe combination of a fifo (first-in-first-out) queue and an associated stack.
Definition: framefifo.h:72
std::deque< LiveSignalContext > signal_fifo
Redefinition of signal fifo (Thread::signal_fifo becomes hidden)
Definition: livethread.h:388
LiveOutboundContext & ctx
Identifies the connection type, stream address, etc. See LiveOutboundContext.
Definition: livethread.h:242
TimeCorrectionType
Methods to correct frame timestamps.
Definition: frame.h:83
Live555 interface for server side: streaming to udp sockets directly or by using an on-demand rtsp se...
unsigned short int portnum
Start port number (for sdp) // <pyapi>
Definition: livethread.h:137
Class to hold per-stream state that we maintain throughout each stream's lifetime.
Definition: live.h:78
TimeCorrectionType time_correction
How to perform frame timestamp correction // <pyapi>
Definition: livethread.h:118
undefined (initial value)
Definition: usbthread.h:143
std::string address
Stream address // <pyapi>
Definition: livethread.h:110
Sending a stream without rtsp negotiation (i.e.
Definition: livethread.h:313
This is a special FrameFifo class for feeding frames into live555, i.e.
Definition: livethread.h:56
LiveConnectionContext(LiveConnectionType ct, std::string address, SlotNumber slot, FrameFilter *framefilter)
Default constructor.
Definition: livethread.h:98
UsageEnvironment & env
Identifies the live555 event loop.
Definition: livethread.h:243
LiveConnectionType connection_type
Identifies the connection type // <pyapi>
Definition: livethread.h:134
LiveFifo infifo
A FrameFifo for incoming frames.
Definition: livethread.h:384
char eventLoopWatchVariable
Modifying this, kills the Live555 event loop.
Definition: livethread.h:393
SlotNumber slot
A unique stream slot that identifies this stream // <pyapi>
Definition: livethread.h:111
Base class for multithreading.
LiveStatus livestatus
Reference of this variable is passed to ValkkaRTSPClient. We can see outside of the live555 callback ...
Definition: livethread.h:272
unsigned reordering_time
Live555 packet reordering treshold time (microsecs) // <pyapi>
Definition: livethread.h:117
std::vector< Stream * > streams
SubStreams of the outgoing streams (typically two, e.g. video and sound)
Definition: livethread.h:324
RTSPServer & server
Reference to the RTSPServer instance.
Definition: livethread.h:343
Sending a stream using the on-demand rtsp server.
Definition: livethread.h:336
bool writeCopy(Frame *f, bool wait=false)
Take a frame "ftmp" from the stack, copy contents of "f" into "ftmp" and insert "ftmp" into the begin...
Definition: livethread.cpp:61
std::vector< Connection * > slots_
A constant sized vector. Book-keeping of the connections (RTSP or SDP) currently active in the live55...
Definition: livethread.h:394
long int frametimer
Measures time when the last frame was received.
Definition: livethread.h:210
FrameFifoContext ctx
Parameters defining the stack and overflow behaviour.
Definition: framefifo.h:82
LiveStatus
Status for the ValkkaRTSPClient.
Definition: live.h:62
ValkkaRTSPClient * client
ValkkaRTSPClient defines the behaviour (i.e. event registration and callbacks) of the RTSP client (se...
Definition: livethread.h:271
bool request_multicast
Request multicast in the rtsp negotiation or not // <pyapi>
Definition: livethread.h:114
Fifo fifo
The fifo queue.
Definition: framefifo.h:87
Live555, running in a separate thread.
Definition: livethread.h:368
LiveConnectionContext()
Dummy constructor : remember to set member values by hand.
Definition: livethread.h:105
FrameFilter * repeat_sps_filter
Repeat sps & pps packets before i-frame (if they were not there before the i-frame) ...
Definition: livethread.h:208
Handles a live555 RTSP connection.
Definition: live.h:111
UsageEnvironment * env
Live555 UsageEnvironment identifying the event loop.
Definition: livethread.h:392
Identifies the information the signals LiveThread::Signals carry.
Definition: livethread.h:165
LiveSignal
Characteristic signals for the Live555 thread.
Definition: livethread.h:148
Definition of FrameFilter and derived classes for various purposes.
A class for multithreading with a signaling system.
Definition: thread.h:90
std::list< Connection * > pending
Incoming connections pending for closing.
Definition: livethread.h:396
int fc
debugging: incoming frame counter
Definition: livethread.h:401
Frame: An abstract queueable class.
Definition: frame.h:108
LiveConnectionType connection_type
Identifies the connection type // <pyapi>
Definition: livethread.h:109
Passes frames to a FrameFifo.
Definition: framefilter.h:560
A base class that unifies all kinds of outgoing streams (i.e.
Definition: livethread.h:235
unsigned recv_buffer_size
Operating system ringbuffer size for incoming socket // <pyapi>
Definition: livethread.h:116
Connection is is defined in an SDP file.
Definition: livethread.h:287
TaskScheduler * scheduler
Live555 event loop TaskScheduler.
Definition: livethread.h:391
bool exit_requested
Exit asap.
Definition: livethread.h:397
bool request_tcp
Request interleaved rtsp streaming or not // <pyapi>
Definition: livethread.h:115
The mother class of all frame filters! FrameFilters are used to create "filter chains".
Definition: framefilter.h:46
~LiveFifo()
Default virtual destructor.
Definition: livethread.cpp:52
bool at_setup
Flags used by Outbound::handleFrame.
Definition: livethread.h:247
std::string address
Stream address // <pyapi>
Definition: livethread.h:135
A base class that unifies all kinds of connections (RTSP and SDP).
Definition: livethread.h:184
LiveConnectionContext & ctx
LiveConnectionContext identifying the stream source (address), it's destination (slot and target fram...
Definition: livethread.h:198
LiveConnectionType
LiveThread connection types.
Definition: livethread.h:79
std::vector< Outbound * > out_slots_
Book-keeping for the outbound connections.
Definition: livethread.h:395