From bb88558ef79b440bde6de10692ac78dbc8c332bd Mon Sep 17 00:00:00 2001 From: Michel Promonet Date: Mon, 11 Mar 2024 21:29:27 +0100 Subject: [PATCH] add frequency & channels --- inc/SessionSink.h | 2 +- src/mkvclient.cpp | 2 +- src/rtspconnectionclient.cpp | 2 +- src/sdpclient.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/SessionSink.h b/inc/SessionSink.h index 4db6bd1..0d0a39f 100644 --- a/inc/SessionSink.h +++ b/inc/SessionSink.h @@ -23,7 +23,7 @@ class SessionCallback { public: - virtual bool onNewSession(const char* id, const char* media, const char* codec, const char* sdp) { return true; } + virtual bool onNewSession(const char* id, const char* media, const char* codec, const char* sdp, unsigned int rtpfrequency, unsigned int channels) { return true; } virtual bool onData(const char* id, unsigned char* buffer, ssize_t size, struct timeval presentationTime) = 0; virtual ssize_t onNewBuffer(const char* id, const char* mime, unsigned char* buffer, ssize_t size) { ssize_t markerSize = 0; diff --git a/src/mkvclient.cpp b/src/mkvclient.cpp index 3f6fc78..a08b48c 100644 --- a/src/mkvclient.cpp +++ b/src/mkvclient.cpp @@ -54,7 +54,7 @@ void MKVClient::onMatroskaFileCreation(MatroskaFile* newFile) { m_env << "Failed to create sink for \"" << track->mimeType << "\" subsession error: " << m_env.getResultMsg() << "\n"; m_callback->onError(*this, m_env.getResultMsg()); } - else if (m_callback->onNewSession(sink->name(), media.c_str(), codec.c_str(), sdp.c_str())) + else if (m_callback->onNewSession(sink->name(), media.c_str(), codec.c_str(), sdp.c_str(), rtpsink->rtpTimestampFrequency(), rtpsink->numChannels())) { m_env << "Start playing sink for \"" << track->mimeType << "\" sdp:" << sdp.c_str() << "\n"; sink->startPlaying(*trackSource, onEndOfFile, this); diff --git a/src/rtspconnectionclient.cpp b/src/rtspconnectionclient.cpp index 5e87cf2..2b41a14 100755 --- a/src/rtspconnectionclient.cpp +++ b/src/rtspconnectionclient.cpp @@ -278,7 +278,7 @@ void RTSPConnection::RTSPClientConnection::continueAfterSETUP(int resultCode, ch envir() << "Failed to create sink for \"" << m_subSession->mediumName() << "/" << m_subSession->codecName() << "\" subsession error: " << envir().getResultMsg() << "\n"; m_callback->onError(m_connection, envir().getResultMsg()); } - else if (m_callback->onNewSession(sink->name(), m_subSession->mediumName(), m_subSession->codecName(), m_subSession->savedSDPLines())) + else if (m_callback->onNewSession(sink->name(), m_subSession->mediumName(), m_subSession->codecName(), m_subSession->savedSDPLines(), m_subSession->rtpTimestampFrequency(), m_subSession->numChannels())) { envir() << "Start playing sink for \"" << m_subSession->mediumName() << "/" << m_subSession->codecName() << "\" subsession" << "\n"; m_subSession->sink = sink; diff --git a/src/sdpclient.cpp b/src/sdpclient.cpp index 7963750..ffe0b36 100644 --- a/src/sdpclient.cpp +++ b/src/sdpclient.cpp @@ -33,7 +33,7 @@ SDPClient::SDPClient(Environment& env, Callback* callback, const char* sdp, cons m_env << "Failed to create sink for \"" << subsession->mediumName() << "/" << subsession->codecName() << "\" subsession error: " << m_env.getResultMsg() << "\n"; m_callback->onError(*this, m_env.getResultMsg()); } - else if (m_callback->onNewSession(sink->name(), subsession->mediumName(), subsession->codecName(), subsession->savedSDPLines())) + else if (m_callback->onNewSession(sink->name(), subsession->mediumName(), subsession->codecName(), subsession->savedSDPLines(), subsession->rtpTimestampFrequency(), subsession->numChannels())) { m_env << "Start playing sink for \"" << subsession->mediumName() << "/" << subsession->codecName() << "\" subsession" << "\n"; subsession->sink = sink;