arduino-audio-tools
Loading...
Searching...
No Matches
src
AudioTools
Communication
RTSP
RTSPServerTaskless.h
Go to the documentation of this file.
1
/*
2
* Author: Phil Schatzmann
3
*
4
* Based on Micro-RTSP library:
5
* https://github.com/geeksville/Micro-RTSP
6
* https://github.com/Tomp0801/Micro-RTSP-Audio
7
*
8
*/
9
#pragma once
10
#include "
RTSPSession.h
"
11
#include "
RTSPMediaStreamer.h
"
12
#include "
RTSPServerBase.h
"
13
#ifdef ESP32
14
#include <WiFi.h>
15
#include <esp_wifi.h>
16
#endif
17
18
namespace
audio_tools
{
19
42
template
<
typename
Platform>
43
class
RTSPServerTaskless
:
public
RTSPServerBase
<Platform> {
44
public
:
45
using
streamer_t
=
RTSPMediaStreamerBase<Platform>
;
46
47
RTSPServerTaskless
(
streamer_t
&
streamer
,
int
port
= 8554)
48
:
RTSPServerBase
<Platform>(
streamer
,
port
) {}
49
50
~RTSPServerTaskless
() { this->
end
(); }
51
52
void
setOnSessionPath
(
bool
(*cb)(
const
char
* path,
void
* ref),
void
* ref =
nullptr
) {
53
this->
RTSPServerBase<Platform>::setOnSessionPath
(cb, ref);
54
}
55
56
#ifdef ESP32
57
bool
begin
(
const
char
* ssid,
const
char
* password) {
58
return
this->
RTSPServerBase<Platform>::begin
(ssid, password);
59
}
60
#endif
61
62
bool
begin
() {
63
return
this->
RTSPServerBase<Platform>::begin
();
64
}
65
66
void
end
() {
67
this->
RTSPServerBase<Platform>::end
();
68
}
69
70
int
clientCount
() {
return
this->
RTSPServerBase<Platform>::clientCount
(); }
71
operator
bool() {
return
this->
RTSPServerBase<Platform>::operator
bool(); }
72
void
setSessionTimeoutMs
(
unsigned
long
ms) { this->
RTSPServerBase<Platform>::setSessionTimeoutMs
(ms); }
73
77
void
doLoop
() {
78
this->
RTSPServerBase<Platform>::acceptClient
();
79
this->
RTSPServerBase<Platform>::handleSession
();
80
}
81
};
82
83
}
// namespace audio_tools
RTSPMediaStreamer.h
RTSPServerBase.h
RTSPSession.h
audio_tools::RTSPMediaStreamerBase
RTSPMediaStreamerBase - Core RTP Media Streaming Engine.
Definition
RTSPMediaStreamer.h:50
audio_tools::RTSPServerBase
RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless.
Definition
RTSPServerBase.h:29
audio_tools::RTSPServerBase::handleSession
void handleSession()
Handle requests session if active.
Definition
RTSPServerBase.h:127
audio_tools::RTSPServerBase::clientCount
int clientCount()
Get number of connected clients.
Definition
RTSPServerBase.h:89
audio_tools::RTSPServerBase::begin
virtual bool begin()
Start server.
Definition
RTSPServerBase.h:66
audio_tools::RTSPServerBase::port
int port
Definition
RTSPServerBase.h:98
audio_tools::RTSPServerBase::streamer
RTSPMediaStreamerBase< Platform > * streamer
Definition
RTSPServerBase.h:101
audio_tools::RTSPServerBase::setSessionTimeoutMs
void setSessionTimeoutMs(unsigned long ms)
Set session timeout in milliseconds.
Definition
RTSPServerBase.h:93
audio_tools::RTSPServerBase::end
void end()
Stop server and clean up.
Definition
RTSPServerBase.h:76
audio_tools::RTSPServerBase::acceptClient
void acceptClient()
Accept new client if none is active.
Definition
RTSPServerBase.h:110
audio_tools::RTSPServerBase::setOnSessionPath
void setOnSessionPath(bool(*cb)(const char *path, void *ref), void *ref=nullptr)
Set callback for session path.
Definition
RTSPServerBase.h:41
audio_tools::RTSPServerTaskless
RTSPServerTaskless - Manual Multi-client RTSP Audio Streaming Server.
Definition
RTSPServerTaskless.h:43
audio_tools::RTSPServerTaskless::begin
bool begin(const char *ssid, const char *password)
Definition
RTSPServerTaskless.h:57
audio_tools::RTSPServerTaskless::clientCount
int clientCount()
Definition
RTSPServerTaskless.h:70
audio_tools::RTSPServerTaskless::doLoop
void doLoop()
Main server loop - call this frequently from Arduino loop()
Definition
RTSPServerTaskless.h:77
audio_tools::RTSPServerTaskless::begin
bool begin()
Start server.
Definition
RTSPServerTaskless.h:62
audio_tools::RTSPServerTaskless::~RTSPServerTaskless
~RTSPServerTaskless()
Definition
RTSPServerTaskless.h:50
audio_tools::RTSPServerTaskless::setSessionTimeoutMs
void setSessionTimeoutMs(unsigned long ms)
Definition
RTSPServerTaskless.h:72
audio_tools::RTSPServerTaskless::end
void end()
Definition
RTSPServerTaskless.h:66
audio_tools::RTSPServerTaskless::setOnSessionPath
void setOnSessionPath(bool(*cb)(const char *path, void *ref), void *ref=nullptr)
Definition
RTSPServerTaskless.h:52
audio_tools::RTSPServerTaskless::RTSPServerTaskless
RTSPServerTaskless(streamer_t &streamer, int port=8554)
Definition
RTSPServerTaskless.h:47
audio_tools
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition
LMSEchoCancellationStream.h:6
Generated by
1.9.8