2021-03-02 05:42:31 +08:00
|
|
|
/* ---------------------------------------------------------------------------
|
|
|
|
** This software is in the public domain, furnished "as is", without technical
|
|
|
|
** support, and with no warranty, express or implied, as to its usefulness for
|
|
|
|
** any purpose.
|
|
|
|
**
|
|
|
|
** ADTS_ZoneMinderFifoSource.h
|
|
|
|
**
|
|
|
|
** ADTS ZoneMinder live555 source
|
|
|
|
**
|
|
|
|
** -------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifndef ZM_RTSP_SERVER_FIFO_AUDIO_SOURCE_H
|
|
|
|
#define ZM_RTSP_SERVER_FIFO_AUDIO_SOURCE_H
|
|
|
|
|
|
|
|
#include "zm_config.h"
|
|
|
|
#include "zm_rtsp_server_fifo_source.h"
|
|
|
|
|
|
|
|
#if HAVE_RTSP_SERVER
|
|
|
|
// ---------------------------------
|
|
|
|
// ZoneMinder AUDIO FramedSource
|
|
|
|
// ---------------------------------
|
|
|
|
|
|
|
|
class ZoneMinderFifoAudioSource : public ZoneMinderFifoSource {
|
|
|
|
public:
|
|
|
|
ZoneMinderFifoAudioSource(
|
2021-03-11 00:01:04 +08:00
|
|
|
std::shared_ptr<xop::RtspServer>& rtspServer,
|
|
|
|
xop::MediaSessionId sessionId,
|
|
|
|
xop::MediaChannelId channelId,
|
2021-04-21 05:18:00 +08:00
|
|
|
const std::string &fifo
|
2021-03-02 05:42:31 +08:00
|
|
|
);
|
|
|
|
|
|
|
|
virtual ~ZoneMinderFifoAudioSource() {}
|
|
|
|
|
2021-03-05 02:24:26 +08:00
|
|
|
void setFrequency(int p_frequency) {
|
|
|
|
frequency = p_frequency;
|
|
|
|
samplingFrequencyIndex = getFrequencyIndex();
|
2021-03-11 00:01:04 +08:00
|
|
|
m_timeBase = {1, frequency};
|
2021-03-05 02:24:26 +08:00
|
|
|
};
|
2021-03-02 05:42:31 +08:00
|
|
|
int getFrequency() { return frequency; };
|
2021-03-05 02:24:26 +08:00
|
|
|
int getFrequencyIndex();
|
2021-03-02 05:42:31 +08:00
|
|
|
const char *configStr() const { return config.c_str(); };
|
|
|
|
void setChannels(int p_channels) { channels = p_channels; };
|
|
|
|
int getChannels() const { return channels; };
|
|
|
|
|
2021-03-11 00:01:04 +08:00
|
|
|
protected:
|
2021-04-21 05:18:00 +08:00
|
|
|
void PushFrame(const uint8_t *data, size_t size, int64_t pts) override;
|
2021-03-11 00:01:04 +08:00
|
|
|
|
2021-03-02 05:42:31 +08:00
|
|
|
protected:
|
|
|
|
std::string config;
|
|
|
|
int samplingFrequencyIndex;
|
2021-03-11 00:01:04 +08:00
|
|
|
int frequency;
|
2021-03-02 05:42:31 +08:00
|
|
|
int channels;
|
|
|
|
};
|
|
|
|
#endif // HAVE_RTSP_SERVER
|
|
|
|
|
|
|
|
#endif // ZM_RTSP_SERVER_FIFO_AUDIO_SOURCE_H
|