Ctrl K
ComunidadGuías…

src/zm_rtsp_server_stream_video_source.cpp

Rama master · réplica de lectura del repositorio original.

Archivo original ↗Preguntar a KiBot
/* ---------------------------------------------------------------------------
** 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.
**
**
** ZoneMinder Live555 source
**
** -------------------------------------------------------------------------*/

#include "zm_rtsp_server_stream_video_source.h"

#if HAVE_RTSP_SERVER
ZoneMinderStreamVideoSource::ZoneMinderStreamVideoSource(
  std::shared_ptr<xop::RtspServer>& rtspServer,
  xop::MediaSessionId sessionId,
  xop::MediaChannelId channelId
) :
  ZoneMinderStreamSource(rtspServer, sessionId, channelId),
  m_width(0),
  m_height(0) {
  m_timeBase = {1, 90000};
}

void ZoneMinderStreamVideoSource::PushFrame(const uint8_t *data, size_t size, int64_t pts) {
  xop::AVFrame frame(data, size);
  frame.timestamp = av_rescale_q(pts, AV_TIME_BASE_Q, m_timeBase);
  m_rtspServer->PushFrame(m_sessionId, m_channelId, frame);
}

#endif // HAVE_RTSP_SERVER