2021-01-25 09:16:54 +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_ZoneMinderDeviceSource.h
|
|
|
|
**
|
|
|
|
** ADTS ZoneMinder live555 source
|
|
|
|
**
|
|
|
|
** -------------------------------------------------------------------------*/
|
|
|
|
|
2021-02-04 11:59:03 +08:00
|
|
|
#ifndef ZM_RTSP_SERVER_ADTS_SOURCE_H
|
|
|
|
#define ZM_RTSP_SERVER_ADTS_SOURCE_H
|
|
|
|
|
2021-02-04 11:47:28 +08:00
|
|
|
#include "zm_config.h"
|
|
|
|
#include "zm_rtsp_server_device_source.h"
|
2021-01-27 23:50:07 +08:00
|
|
|
|
|
|
|
#if HAVE_RTSP_SERVER
|
2021-01-25 09:16:54 +08:00
|
|
|
// ---------------------------------
|
|
|
|
// ADTS(AAC) ZoneMinder FramedSource
|
|
|
|
// ---------------------------------
|
|
|
|
|
|
|
|
class ADTS_ZoneMinderDeviceSource : public ZoneMinderDeviceSource {
|
|
|
|
public:
|
|
|
|
static ADTS_ZoneMinderDeviceSource* createNew(
|
|
|
|
UsageEnvironment& env,
|
2021-02-08 02:12:39 +08:00
|
|
|
std::shared_ptr<Monitor> monitor,
|
2021-01-25 09:16:54 +08:00
|
|
|
AVStream * stream,
|
|
|
|
unsigned int queueSize
|
|
|
|
) {
|
|
|
|
Debug(1, "m_stream %p codecpar %p channels %d",
|
|
|
|
stream, stream->codecpar, stream->codecpar->channels);
|
2021-02-08 02:12:39 +08:00
|
|
|
return new ADTS_ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize);
|
2021-01-25 09:16:54 +08:00
|
|
|
};
|
|
|
|
protected:
|
|
|
|
ADTS_ZoneMinderDeviceSource(
|
|
|
|
UsageEnvironment& env,
|
2021-02-08 02:12:39 +08:00
|
|
|
std::shared_ptr<Monitor> monitor,
|
2021-01-25 09:16:54 +08:00
|
|
|
AVStream *stream,
|
|
|
|
unsigned int queueSize
|
|
|
|
);
|
|
|
|
|
|
|
|
virtual ~ADTS_ZoneMinderDeviceSource() {}
|
|
|
|
|
|
|
|
/*
|
|
|
|
virtual unsigned char* extractFrame(unsigned char* frame, size_t& size, size_t& outsize);
|
|
|
|
virtual unsigned char* findMarker(unsigned char *frame, size_t size, size_t &length);
|
|
|
|
*/
|
|
|
|
public:
|
|
|
|
int samplingFrequency() { return m_stream->codecpar->sample_rate; };
|
|
|
|
const char *configStr() { return config.c_str(); };
|
|
|
|
int numChannels() {
|
|
|
|
Debug(1, "this %p m_stream %p channels %d",
|
|
|
|
this, m_stream, channels);
|
|
|
|
Debug(1, "m_stream %p codecpar %p channels %d => %d",
|
|
|
|
m_stream, m_stream->codecpar, m_stream->codecpar->channels, channels);
|
|
|
|
return channels;
|
|
|
|
return m_stream->codecpar->channels;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected:
|
|
|
|
std::string config;
|
|
|
|
int samplingFrequencyIndex;
|
|
|
|
int channels;
|
|
|
|
};
|
2021-02-04 11:59:03 +08:00
|
|
|
#endif // HAVE_RTSP_SERVER
|
|
|
|
|
|
|
|
#endif // ZM_RTSP_SERVER_ADTS_SOURCE_H
|