From b462b616bea6ca275d17993e263da8b8dfbf98e2 Mon Sep 17 00:00:00 2001 From: doe300 Date: Tue, 5 Jul 2016 17:16:34 +0200 Subject: [PATCH] Added CryptographicContext to ParticipantDatabase for #56 Signed-off-by:doe300 --- include/rtp/ParticipantDatabase.h | 13 +++++++++++-- src/rtp/RTPPackageHandler.cpp | 4 ++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/include/rtp/ParticipantDatabase.h b/include/rtp/ParticipantDatabase.h index a005ea3..2767bcf 100644 --- a/include/rtp/ParticipantDatabase.h +++ b/include/rtp/ParticipantDatabase.h @@ -18,12 +18,18 @@ namespace ohmcomm { + namespace crypto + { + //Forward declaration for pointer to cryptographic context + struct CryptographicContext; + } + namespace rtp { //Forward declaration for pointer to statistical and informational RTCP data struct RTCPData; - + /*! * Global data store for a single participant in an RTP session */ @@ -58,10 +64,13 @@ namespace ohmcomm //the RTCP participant-data //we can't use reference/unique_ptr here, because RTCPData is incomplete at this point std::shared_ptr rtcpData; + //the cryptographic context + //we can't use reference/unique_ptr here, because CryptographicContext is incomplete at this point + std::shared_ptr cryptoContext; Participant(const uint32_t ssrc, const bool localParticipant) : lastDelay(0), isLocalParticipant(localParticipant), ssrc(ssrc), payloadType(-1), initialRTPTimestamp(0), extendedHighestSequenceNumber(0), interarrivalJitter(0), lastPackageReceived(std::chrono::steady_clock::time_point::min()), - firstPackageReceived(std::chrono::steady_clock::now()), packagesLost(0), totalPackages(0), totalBytes(0), rtcpData(nullptr) + firstPackageReceived(std::chrono::steady_clock::now()), packagesLost(0), totalPackages(0), totalBytes(0), rtcpData(nullptr), cryptoContext(nullptr) { } diff --git a/src/rtp/RTPPackageHandler.cpp b/src/rtp/RTPPackageHandler.cpp index 34c1291..d754add 100644 --- a/src/rtp/RTPPackageHandler.cpp +++ b/src/rtp/RTPPackageHandler.cpp @@ -71,9 +71,9 @@ unsigned int RTPPackageHandler::getRTPHeaderSize() const unsigned int RTPPackageHandler::getRTPHeaderExtensionSize() const { - if(((RTPHeader*)workBuffer.data())->hasExtension()) + if(((RTPHeader*)getReadBuffer())->hasExtension()) { - const RTPHeaderExtension* readEx = (RTPHeaderExtension*)(workBuffer.data() + getRTPHeaderSize()); + const RTPHeaderExtension* readEx = (RTPHeaderExtension*)(getReadBuffer() + getRTPHeaderSize()); return RTPHeaderExtension::MIN_EXTENSION_SIZE + readEx->getLength() * sizeof(uint32_t); } else