[asterisk-scf-commits] asterisk-scf/release/media_rtp_pjmedia.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Fri Sep 16 11:55:48 CDT 2011
branch "master" has been updated
via 34d0513bcbe9db15aed100eb38635f7d7de7eb20 (commit)
from 458c78b6a0b5ca95265fb2ff8ad1ebbf0c2228ac (commit)
Summary of changes:
src/RTPSink.cpp | 15 +++++++++++----
src/RTPSource.cpp | 18 +++++++++++++-----
src/RTPTelephonyEventSink.cpp | 3 ++-
src/RTPTelephonyEventSink.h | 8 ++++++--
src/RTPTelephonyEventSource.cpp | 2 +-
src/RTPTelephonyEventSource.h | 11 +++++++----
6 files changed, 40 insertions(+), 17 deletions(-)
- Log -----------------------------------------------------------------
commit 34d0513bcbe9db15aed100eb38635f7d7de7eb20
Author: Brent Eagles <beagles at digium.com>
Date: Fri Sep 16 14:25:22 2011 -0230
Fix Winsock/Winsock2 build errors on Windows.
diff --git a/src/RTPSink.cpp b/src/RTPSink.cpp
index da5d45a..4f4eec6 100644
--- a/src/RTPSink.cpp
+++ b/src/RTPSink.cpp
@@ -14,18 +14,25 @@
* at the top of the source tree.
*/
+//
+// It is annoying that #include <windows.h> pulls in the old version of winsock. The fix is to include
+// winsock2 first.
+//
+#ifdef _WIN32
+#include <WinSock2.h>
+#endif
+
#include "RTPSink.h"
#include "RtpStateReplicationIf.h"
#include "RTPTelephonyEventSink.h"
-#include <pjlib.h>
-#include <pjmedia.h>
-
#include <Ice/Ice.h>
#include <IceUtil/UUID.h>
-
#include <boost/asio/detail/socket_ops.hpp>
+#include <pjlib.h>
+#include <pjmedia.h>
+
#include <AsteriskSCF/Media/MediaIf.h>
#include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
#include <AsteriskSCF/System/Component/ReplicaIf.h>
diff --git a/src/RTPSource.cpp b/src/RTPSource.cpp
index b9bf4f1..ea81708 100644
--- a/src/RTPSource.cpp
+++ b/src/RTPSource.cpp
@@ -14,19 +14,27 @@
* at the top of the source tree.
*/
+//
+// It is annoying that #include <windows.h> pulls in the old version of winsock. The fix is to include
+// winsock2 first.
+//
+#ifdef _WIN32
+#include <WinSock2.h>
+#endif
+
+#include "RTPTelephonyEventSource.h"
#include "RTPSource.h"
#include "RtpStateReplicationIf.h"
-#include "RTPTelephonyEventSource.h"
-
-#include <pjlib.h>
-#include <pjmedia.h>
#include <Ice/Ice.h>
#include <IceUtil/UUID.h>
#include <IceUtil/Timer.h>
-#include <boost/thread.hpp>
#include <boost/asio/detail/socket_ops.hpp>
+#include <boost/thread.hpp>
+
+#include <pjlib.h>
+#include <pjmedia.h>
#include <AsteriskSCF/Media/MediaIf.h>
#include <AsteriskSCF/Media/RTP/MediaRTPIf.h>
diff --git a/src/RTPTelephonyEventSink.cpp b/src/RTPTelephonyEventSink.cpp
index 82cf3a7..0e62dd2 100644
--- a/src/RTPTelephonyEventSink.cpp
+++ b/src/RTPTelephonyEventSink.cpp
@@ -18,6 +18,7 @@
#include <AsteriskSCF/Media/Formats/OtherFormats.h>
#include <IceUtil/UUID.h>
+#include <pjmedia.h>
namespace
{
@@ -184,7 +185,7 @@ void RTPTelephonyEventSink::getSource_async(
cb->ice_response(mStateItem->source);
}
-pj_uint8_t RTPTelephonyEventSink::translateDTMF(Ice::Byte signal)
+unsigned char RTPTelephonyEventSink::translateDTMF(Ice::Byte signal)
{
if (signal >= '0' && signal <= '9')
{
diff --git a/src/RTPTelephonyEventSink.h b/src/RTPTelephonyEventSink.h
index 407c1b2..fe458a1 100644
--- a/src/RTPTelephonyEventSink.h
+++ b/src/RTPTelephonyEventSink.h
@@ -16,13 +16,17 @@
#pragma once
-#include <pjmedia.h>
#include <AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.h>
#include <AsteriskSCF/SessionCommunications/TelephonyEventsIf.h>
#include "PJMediaTransport.h"
#include "SessionAdapter.h"
+//
+// Forward declarations for pjmedia.
+//
+struct pjmedia_rtp_session;
+
class RTPTelephonyEventSink : public AsteriskSCF::SessionCommunications::V1::TelephonyEventSink
{
public:
@@ -64,7 +68,7 @@ private:
/**
* Translate DTMF from ASCII into its RFC 4733-designated payload value
*/
- pj_uint8_t translateDTMF(Ice::Byte signal);
+ unsigned char translateDTMF(Ice::Byte signal);
/**
* Replicate state
diff --git a/src/RTPTelephonyEventSource.cpp b/src/RTPTelephonyEventSource.cpp
index 3a6631a..5024232 100644
--- a/src/RTPTelephonyEventSource.cpp
+++ b/src/RTPTelephonyEventSource.cpp
@@ -205,7 +205,7 @@ void RTPTelephonyEventSource::distributeToSinks(const TelephonyEventPtr& event)
// This function does no bounds checking and assumes that whoever
// calls it will not call into it with invalid input (i.e. event > 15)
-Ice::Byte RTPTelephonyEventSource::translateDTMF(pj_uint8_t event)
+Ice::Byte RTPTelephonyEventSource::translateDTMF(unsigned char event)
{
if (event < 10)
{
diff --git a/src/RTPTelephonyEventSource.h b/src/RTPTelephonyEventSource.h
index cd7eb13..cb315a6 100644
--- a/src/RTPTelephonyEventSource.h
+++ b/src/RTPTelephonyEventSource.h
@@ -20,11 +20,14 @@
#include <AsteriskSCF/SessionCommunications/TelephonyEventsIf.h>
#include <AsteriskSCF/Replication/MediaRTPPJMedia/RtpStateReplicationIf.h>
-
-#include <pjmedia.h>
-
#include "SessionAdapter.h"
+//
+// Forward declarations for pjmedia.
+//
+struct pjmedia_rtp_hdr;
+struct pjmedia_rtp_dtmf_event;
+
class RTPTelephonyEventSource : public AsteriskSCF::SessionCommunications::V1::TelephonyEventSource
{
public:
@@ -93,7 +96,7 @@ private:
/**
* Translate DTMF from its RFC 4733 event payload to ASCII representation
*/
- Ice::Byte translateDTMF(pj_uint8_t event);
+ Ice::Byte translateDTMF(unsigned char event);
/**
* Replicate state to replicas
-----------------------------------------------------------------------
--
asterisk-scf/release/media_rtp_pjmedia.git
More information about the asterisk-scf-commits
mailing list