diff options
Diffstat (limited to 'Swiften/ScreenSharing')
-rw-r--r-- | Swiften/ScreenSharing/OutgoingScreenSharing.cpp | 1 | ||||
-rw-r--r-- | Swiften/ScreenSharing/RTPSession.h | 2 | ||||
-rw-r--r-- | Swiften/ScreenSharing/RTPSessionImpl.cpp | 10 | ||||
-rw-r--r-- | Swiften/ScreenSharing/RTPSessionImpl.h | 2 | ||||
-rw-r--r-- | Swiften/ScreenSharing/VP8RTPPacketizer.h | 2 |
5 files changed, 14 insertions, 3 deletions
diff --git a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp index ec0a39c..906bd68 100644 --- a/Swiften/ScreenSharing/OutgoingScreenSharing.cpp +++ b/Swiften/ScreenSharing/OutgoingScreenSharing.cpp @@ -65,6 +65,7 @@ void OutgoingScreenSharing::start(unsigned int width, unsigned int height) jingleSession->sendInitiate(contentID, desc, transport); onStateChange(ScreenSharing::WaitingForAccept); + serverSocket->onConnected.connect(boost::bind(&OutgoingScreenSharing::handleSocketConnected, this)); serverSocket->connectToFirstIncoming(); } diff --git a/Swiften/ScreenSharing/RTPSession.h b/Swiften/ScreenSharing/RTPSession.h index 4399b2d..e4aa9c1 100644 --- a/Swiften/ScreenSharing/RTPSession.h +++ b/Swiften/ScreenSharing/RTPSession.h @@ -29,6 +29,8 @@ namespace Swift { virtual void injectData(const SafeByteArray& data) = 0; virtual void stop(int maxWaitMs = 100) = 0; + virtual size_t getMaxRTPPayloadSize() const = 0; + public: boost::signal<void (uint8_t* data, size_t len, bool marker)> onIncomingPacket; }; diff --git a/Swiften/ScreenSharing/RTPSessionImpl.cpp b/Swiften/ScreenSharing/RTPSessionImpl.cpp index 94641ff..bbd3d72 100644 --- a/Swiften/ScreenSharing/RTPSessionImpl.cpp +++ b/Swiften/ScreenSharing/RTPSessionImpl.cpp @@ -88,13 +88,13 @@ void RTPSessionImpl::checkIncomingPackets() void RTPSessionImpl::sendPacket(const SafeByteArray& data, int timestampinc, bool marker) { - checkError(session.SendPacket((void*)(&data[0]), data.size(), payloadType.getID(), marker, timestampinc)); + checkError(session.SendPacket((void*)(data.data()), data.size(), payloadType.getID(), marker, timestampinc)); poll(); } void RTPSessionImpl::injectData(const SafeByteArray& data) { - packetInjecter->InjectRTPorRTCP((void*)(&data[0]), data.size(), jRTPRemotePeer); + packetInjecter->InjectRTPorRTCP((void*)(data.data()), data.size(), jRTPRemotePeer); checkIncomingPackets(); poll(); } @@ -105,6 +105,12 @@ void RTPSessionImpl::stop(int maxWaitMs) udpSocket->close(); } +size_t RTPSessionImpl::getMaxRTPPayloadSize() const +{ + jrtplib::RTPSessionParams sessparams; + return sessparams.GetMaximumPacketSize(); +} + void RTPSessionImpl::checkError(int rtperr) const { if (rtperr < 0) diff --git a/Swiften/ScreenSharing/RTPSessionImpl.h b/Swiften/ScreenSharing/RTPSessionImpl.h index 231ec1e..2c6fed2 100644 --- a/Swiften/ScreenSharing/RTPSessionImpl.h +++ b/Swiften/ScreenSharing/RTPSessionImpl.h @@ -46,6 +46,8 @@ namespace Swift { virtual void injectData(const SafeByteArray &data); virtual void stop(int maxWaitMs = 100); + virtual size_t getMaxRTPPayloadSize() const; + public: static jrtplib::RTPIPv4Address nativeAddressToJRTPAddress(const HostAddressPort& hostAddressPort); diff --git a/Swiften/ScreenSharing/VP8RTPPacketizer.h b/Swiften/ScreenSharing/VP8RTPPacketizer.h index d5343c0..c56e754 100644 --- a/Swiften/ScreenSharing/VP8RTPPacketizer.h +++ b/Swiften/ScreenSharing/VP8RTPPacketizer.h @@ -29,7 +29,7 @@ namespace Swift { static const uint8_t HBit = 1 << 4; static const uint8_t Size0BitMask = 7; static const uint8_t Size0BitShift = 5; - static const size_t MaxRTPPayloadSize = 1400; // Replace with JRTPLIB's one + static const size_t MaxRTPPayloadSize = 1300; // Replace with JRTPLIB's one; TODO: fix the issue with maximum size std::vector<uint8_t> payloadBuffer; }; |