2021-01-23 09:21:28 +08:00
|
|
|
/* ---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
** ADTS_DeviceSource.cpp
|
|
|
|
**
|
|
|
|
** ADTS Live555 source
|
|
|
|
**
|
|
|
|
** -------------------------------------------------------------------------*/
|
|
|
|
|
2021-02-04 11:47:28 +08:00
|
|
|
#include "zm_rtsp_server_adts_source.h"
|
2021-01-27 23:50:07 +08:00
|
|
|
|
2021-02-04 11:47:28 +08:00
|
|
|
#include "zm_config.h"
|
2021-01-23 09:21:28 +08:00
|
|
|
#include <sstream>
|
|
|
|
|
2021-02-04 11:47:28 +08:00
|
|
|
#if HAVE_RTSP_SERVER
|
2021-01-23 09:21:28 +08:00
|
|
|
// live555
|
|
|
|
#include <Base64.hh>
|
|
|
|
|
|
|
|
static unsigned const samplingFrequencyTable[16] = {
|
|
|
|
96000, 88200, 64000, 48000,
|
|
|
|
44100, 32000, 24000, 22050,
|
|
|
|
16000, 12000, 11025, 8000,
|
|
|
|
7350, 0, 0, 0
|
|
|
|
};
|
|
|
|
// ---------------------------------
|
|
|
|
// ADTS ZoneMinder FramedSource
|
|
|
|
// ---------------------------------
|
|
|
|
//
|
|
|
|
ADTS_ZoneMinderDeviceSource::ADTS_ZoneMinderDeviceSource(
|
|
|
|
UsageEnvironment& env,
|
2021-02-08 02:12:39 +08:00
|
|
|
std::shared_ptr<Monitor> monitor,
|
2021-01-23 09:21:28 +08:00
|
|
|
AVStream *stream,
|
|
|
|
unsigned int queueSize
|
|
|
|
)
|
|
|
|
:
|
2021-02-08 02:12:39 +08:00
|
|
|
ZoneMinderDeviceSource(env, std::move(monitor), stream, queueSize),
|
2021-01-23 09:21:28 +08:00
|
|
|
samplingFrequencyIndex(0),
|
2021-03-03 05:30:40 +08:00
|
|
|
channels(
|
|
|
|
#if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)
|
|
|
|
stream->codecpar->channels
|
|
|
|
#else
|
|
|
|
stream->codec->channels
|
|
|
|
#endif
|
|
|
|
)
|
2021-01-23 09:21:28 +08:00
|
|
|
{
|
|
|
|
std::ostringstream os;
|
|
|
|
os <<
|
|
|
|
"profile-level-id=1;"
|
|
|
|
"mode=AAC-hbr;sizelength=13;indexlength=3;"
|
|
|
|
"indexdeltalength=3"
|
|
|
|
//<< extradata2psets(nullptr, m_stream)
|
|
|
|
<< "\r\n";
|
|
|
|
m_auxLine.assign(os.str());
|
|
|
|
}
|
2021-02-04 11:59:03 +08:00
|
|
|
#endif // HAVE_RTSP_SERVER
|