sipxmediaadapterlib  Version 3.3
IMediaSocket.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2006 Pingtel Corp. All rights reserved.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 #ifndef _IMediaSocket_h_
12 #define _IMediaSocket_h_
13 
14 
15 // DEFINES
16 #define TYPE_AUDIO_RTP 0
17 #define TYPE_AUDIO_RTCP 1
18 #define TYPE_VIDEO_RTP 2
19 #define TYPE_VIDEO_RTCP 3
20 
21 #define TRANSPORT_DUMP
22 #undef TRANSPORT_DUMP
23 #ifdef TRANSPORT_DUMP
24 #define TRANSPORT_DUMP_FILE "C:\\transport-debug.txt"
25 #endif
26 
27 // MACROS
28 // EXTERNAL FUNCTIONS
29 // EXTERNAL VARIABLES
30 // CONSTANTS
31 // STRUCTS
32 // TYPEDEFS
33 typedef struct RTP_HEADER
34 {
35  unsigned char vpxcc ;
36  unsigned char mp ;
37 
38  unsigned short seq_number ;
39  unsigned long timestamp ;
40  unsigned long SSRC ;
41 } RTP_HEADER ;
42 
43 typedef struct RTP_MONITOR_CONEXT
44 {
45  bool bInitialized ;
46  unsigned char payloadType ;
47  unsigned short seq_number ;
48  unsigned long SSRC ;
49 
50  UtlString fromAddress ;
51  int fromPort ;
52  unsigned int mismatches ;
54 
61 {
62 /* //////////////////////////// PUBLIC //////////////////////////////////// */
63 public:
64 
65 /* ============================ MANIPULATORS ============================== */
66 
70  virtual ~IMediaSocket() {};
71 
75  virtual void pushPacket() = 0;
76 
80  virtual void pushPacket(char* rtpPacket, size_t packetSize, int port) = 0;
81 
88  virtual void setVideoChannel(int channelId) = 0;
89 
94  virtual void setLastTimeReadToNow() = 0;
95 
99  virtual void setEnabled(bool bEnabled) = 0;
100 
101  virtual void setPreferredReceiveAddress(const char*szAddress, int port) = 0;
102 
103 };
104 
105 
106 inline IMediaSocket* getMediaSocketPtr(IStunSocket* pStunSocket)
107 {
108  return dynamic_cast<IMediaSocket*>(pStunSocket->getSocket());
109 }
110 
111 #endif // #ifndef _IMediaSocket_h_
Definition: IMediaSocket.h:33
int fromPort
Definition: IMediaSocket.h:51
bool bInitialized
Definition: IMediaSocket.h:45
unsigned short seq_number
Definition: IMediaSocket.h:38
struct RTP_HEADER RTP_HEADER
struct RTP_MONITOR_CONEXT RTP_MONITOR_CONEXT
unsigned char payloadType
Definition: IMediaSocket.h:46
unsigned char vpxcc
Definition: IMediaSocket.h:35
unsigned char mp
Definition: IMediaSocket.h:36
Definition: IMediaSocket.h:60
virtual ~IMediaSocket()
Definition: IMediaSocket.h:70
unsigned long timestamp
Definition: IMediaSocket.h:39
unsigned short seq_number
Definition: IMediaSocket.h:47
UtlString fromAddress
Definition: IMediaSocket.h:50
IMediaSocket * getMediaSocketPtr(IStunSocket *pStunSocket)
Definition: IMediaSocket.h:106
unsigned int mismatches
Definition: IMediaSocket.h:52
Definition: IMediaSocket.h:43
unsigned long SSRC
Definition: IMediaSocket.h:40
unsigned long SSRC
Definition: IMediaSocket.h:48