arduino-audio-tools
Loading...
Searching...
No Matches
RTSPServerTaskless.h
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 "RTSPAudioStreamer.h"
12#include "RTSPServerBase.h"
13#ifdef ESP32
14#include <WiFi.h>
15#include <esp_wifi.h>
16#endif
17
18namespace audio_tools {
19
42template <typename Platform>
43class RTSPServerTaskless : public RTSPServerBase<Platform> {
44 public:
45 RTSPServerTaskless(RTSPAudioStreamerBase<Platform>& streamer, int port = 8554)
46 : RTSPServerBase<Platform>(streamer, port) {}
47
48 ~RTSPServerTaskless() { this->end(); }
49
50 void setOnSessionPath(bool (*cb)(const char* path, void* ref), void* ref = nullptr) {
52 }
53
54#ifdef ESP32
55 bool begin(const char* ssid, const char* password) {
56 return this->RTSPServerBase<Platform>::begin(ssid, password);
57 }
58#endif
59
60 bool begin() {
62 }
63
64 void end() {
66 }
67
68 int clientCount() { return this->RTSPServerBase<Platform>::clientCount(); }
69 operator bool() { return this->RTSPServerBase<Platform>::operator bool(); }
70 void setSessionTimeoutMs(unsigned long ms) { this->RTSPServerBase<Platform>::setSessionTimeoutMs(ms); }
71
79};
80
81} // namespace audio_tools
RTSPAudioStreamerBase - Core RTP Audio Streaming Engine.
Definition RTSPAudioStreamer.h:50
RTSPServerBase - Shared logic for RTSPServer and RTSPServerTaskless.
Definition RTSPServerBase.h:29
void handleSession()
Handle requests session if active.
Definition RTSPServerBase.h:125
int clientCount()
Get number of connected clients.
Definition RTSPServerBase.h:89
virtual bool begin()
Start server.
Definition RTSPServerBase.h:66
void setSessionTimeoutMs(unsigned long ms)
Set session timeout in milliseconds.
Definition RTSPServerBase.h:93
void end()
Stop server and clean up.
Definition RTSPServerBase.h:76
void acceptClient()
Accept new client if none is active.
Definition RTSPServerBase.h:108
void setOnSessionPath(bool(*cb)(const char *path, void *ref), void *ref=nullptr)
Set callback for session path.
Definition RTSPServerBase.h:41
RTSPServerTaskless - Manual Multi-client RTSP Audio Streaming Server.
Definition RTSPServerTaskless.h:43
void doLoop()
Main server loop - call this frequently from Arduino loop()
Definition RTSPServerTaskless.h:75
bool begin()
Start server.
Definition RTSPServerTaskless.h:60
Generic Implementation of sound input and output for desktop environments using portaudio.
Definition AudioCodecsBase.h:10