Skip to content

Commit

Permalink
Added CryptographicContext to ParticipantDatabase for #56
Browse files Browse the repository at this point in the history
Signed-off-by:doe300 <stadeldani@web.de>
  • Loading branch information
doe300 committed Jul 5, 2016
1 parent 5c4a1c4 commit b462b61
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 11 additions & 2 deletions include/rtp/ParticipantDatabase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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> rtcpData;
//the cryptographic context
//we can't use reference/unique_ptr here, because CryptographicContext is incomplete at this point
std::shared_ptr<crypto::CryptographicContext> 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)
{

}
Expand Down
4 changes: 2 additions & 2 deletions src/rtp/RTPPackageHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b462b61

Please sign in to comment.