1 /**************************************************************************/
2 /*                                                                        */
3 /*       Copyright (c) Microsoft Corporation. All rights reserved.        */
4 /*                                                                        */
5 /*       This software is licensed under the Microsoft Software License   */
6 /*       Terms for Microsoft Azure RTOS. Full text of the license can be  */
7 /*       found in the LICENSE file at https://aka.ms/AzureRTOS_EULA       */
8 /*       and in the root directory of this software.                      */
9 /*                                                                        */
10 /**************************************************************************/
11 
12 
13 /**************************************************************************/
14 /**************************************************************************/
15 /**                                                                       */
16 /** NetX Component                                                        */
17 /**                                                                       */
18 /**   Real Time Transport Protocol (RTP)                                  */
19 /**                                                                       */
20 /**************************************************************************/
21 /**************************************************************************/
22 
23 
24 /**************************************************************************/
25 /*                                                                        */
26 /*  APPLICATION INTERFACE DEFINITION                       RELEASE        */
27 /*                                                                        */
28 /*    nx_rtp_sender.h                                     PORTABLE C      */
29 /*                                                           6.3.0        */
30 /*  AUTHOR                                                                */
31 /*                                                                        */
32 /*    Haiqing Zhao, Microsoft Corporation                                 */
33 /*                                                                        */
34 /*  DESCRIPTION                                                           */
35 /*                                                                        */
36 /*    This file defines the NetX RTP Sender component, including all      */
37 /*    data types and external references.                                 */
38 /*                                                                        */
39 /*  RELEASE HISTORY                                                       */
40 /*                                                                        */
41 /*    DATE              NAME                      DESCRIPTION             */
42 /*                                                                        */
43 /*  10-31-2023     Haiqing Zhao             Initial Version 6.3.0         */
44 /*                                                                        */
45 /**************************************************************************/
46 
47 #ifndef _NX_RTP_SENDER_H_
48 #define _NX_RTP_SENDER_H_
49 
50 #include "tx_api.h"
51 #include "nx_api.h"
52 
53 /* Determine if a C++ compiler is being used.  If so, ensure that standard
54    C is used to process the API information.  */
55 
56 #ifdef __cplusplus
57 /* Yes, C++ compiler is present.  Use standard C.  */
58 extern   "C" {
59 
60 #endif
61 
62 #ifdef NX_DISABLE_PACKET_CHAIN
63 #error "NX_DISABLE_PACKET_CHAIN must not be defined"
64 #endif /* NX_DISABLE_PACKET_CHAIN */
65 
66 /* Define UDP socket create options.  */
67 #ifndef NX_RTP_SENDER_TYPE_OF_SERVICE
68 #define NX_RTP_SENDER_TYPE_OF_SERVICE                   NX_IP_NORMAL
69 #endif /* NX_RTP_SENDER_TYPE_OF_SERVICE */
70 
71 #ifndef NX_RTP_SENDER_FRAGMENT_OPTION
72 #define NX_RTP_SENDER_FRAGMENT_OPTION                   NX_FRAGMENT_OKAY
73 #endif /* NX_RTP_SENDER_FRAGMENT_OPTION */
74 
75 #ifndef NX_RTP_SENDER_TIME_TO_LIVE
76 #define NX_RTP_SENDER_TIME_TO_LIVE                      0x80
77 #endif /* NX_RTP_SENDER_TIME_TO_LIVE */
78 
79 #ifndef NX_RTP_SENDER_QUEUE_DEPTH
80 #define NX_RTP_SENDER_QUEUE_DEPTH                       5
81 #endif /* NX_RTP_SENDER_QUEUE_DEPTH */
82 
83 #ifndef NX_RTP_SENDER_PACKET_TIMEOUT
84 #define NX_RTP_SENDER_PACKET_TIMEOUT                    (1 * NX_IP_PERIODIC_RATE)
85 #endif /* NX_RTP_SENDER_PACKET_TIMEOUT */
86 
87 /* 5 seconds is the recommended minimum interval by RFC 3550, Chapter 6.2. */
88 #ifndef NX_RTCP_INTERVAL
89 #define NX_RTCP_INTERVAL                                5
90 #endif /* NX_RTCP_INTERVAL */
91 
92 /* RTP Payload Type Table - Reference RFC 3551, Page33-34, Table 4-5 */
93 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_PCMU           0       /* G.711 */
94 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_GSM            3
95 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_G723           4
96 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_DVI4_8000HZ    5
97 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_DVI4_16000HZ   6
98 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_LPC            7
99 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_PCMA           8       /* G.711 */
100 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_G722           9
101 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_L16_2_CHANNELS 10
102 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_L16_1_CHANNEL  11
103 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_QCELP          12
104 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_CN             13
105 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_MPA            14      /* RFC 2250 */
106 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_G728           15
107 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_DVI4_11025HZ   16
108 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_DVI4_22050HZ   17
109 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_G729           18
110 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_CELB           25      /* RFC 2029 */
111 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_JPEG           26      /* RFC 2435 */
112 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_NV             28
113 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_H261           31      /* RFC 2032 */
114 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_MPV            32      /* RFC 2250 */
115 #define NX_RTP_SENDER_PAYLOAD_TYPE_AUDIO_VIDEO_MP2T     33      /* RFC 2250 */
116 #define NX_RTP_SENDER_PAYLOAD_TYPE_VIDEO_H263           34      /* RFC 2190 */
117 #define NX_RTP_SENDER_PAYLOAD_TYPE_DYNAMIC_MIN          96
118 #define NX_RTP_SENDER_PAYLOAD_TYPE_DYNAMIC_MAX          127
119 
120 /* Use the string "RTPS" as a magic number for RTP sender */
121 #define NX_RTP_SENDER_ID                                0x52545053
122 #define NX_RTP_SESSION_ID                               0x52545054
123 
124 /* The initial target rtp port to use - Reference RFC3551, section 8, p35 */
125 #define NX_RTP_SENDER_INITIAL_RTP_PORT                  5004
126 
127 /* The rtp header length and corresponding rtp packet header size */
128 #define NX_RTP_HEADER_LENGTH                            12
129 #define NX_RTP_PACKET                                   (NX_UDP_PACKET + NX_RTP_HEADER_LENGTH)
130 
131 /* Define RTP protocol version.  */
132 #define NX_RTP_VERSION                                  2
133 
134 /* Define RTP header field(s) */
135 #define NX_RTP_HEADER_MARKER_BIT                        0x80
136 
137 /* Define RTCP packet types.  */
138 #define NX_RTCP_TYPE_SR                                 200
139 #define NX_RTCP_TYPE_RR                                 201
140 #define NX_RTCP_TYPE_SDES                               202
141 
142 /* Define SDES types.  */
143 #define NX_RTCP_SDES_TYPE_CNAME                         1
144 
145 /* Define mask for version and padding bit pair. */
146 #define NX_RTCP_COUNT_MASK                              0x1F
147 #define NX_RTCP_VERSION_MASK                            0xC0
148 #define NX_RTCP_PAD_MASK                                0x20
149 #define NX_RTCP_TYPE_MASK                               0xFE
150 #define NX_RTCP_VERSION_VALUE                           (NX_RTP_VERSION << 6)
151 #define NX_RTCP_PAD_VALUE                               0
152 
153 /* Define receiver report structure for user callback. */
154 typedef struct NX_RTCP_RECEIVER_REPORT_STRUCT
155 {
156     UINT receiver_ssrc;
157     UINT fraction_loss;
158     INT  packet_loss;
159     UINT extended_max;
160     UINT jitter;
161     UINT last_sr;
162     UINT delay;
163 } NX_RTCP_RECEIVER_REPORT;
164 
165 /* Define SDES information structure for user callback. */
166 typedef struct NX_RTCP_SDES_INFO_STRUCT
167 {
168     UINT   ssrc;
169     UCHAR *cname;
170     ULONG  cname_length;
171 } NX_RTCP_SDES_INFO;
172 
173 /* Define RTCP packet header structure for internal packet processing.  */
174 typedef struct NX_RTCP_HEADER_STRUCT
175 {
176     /* V(2), P(1), RC(5). */
177     UCHAR nx_rtcp_byte0;
178 
179     /* RTCP packet type. */
180     UCHAR nx_rtcp_packet_type;
181 
182     /* Packet length in words. */
183     USHORT nx_rtcp_length;
184 } NX_RTCP_HEADER;
185 
186 /* Define RTCP report block structure for internal packet processing. */
187 typedef struct NX_RTCP_REPORT_STRUCT
188 {
189 
190     /* Data source being reported. */
191     ULONG nx_rtcp_report_ssrc;
192 
193     /* Fraction loss + cumulative number of packets lost. */
194     ULONG nx_rtcp_report_loss;
195 
196     /* Extended hightest sequence number received. */
197     ULONG nx_rtcp_report_extended_max;
198 
199     /* Data packet inter-arrival time. */
200     ULONG nx_rtcp_report_jitter;
201 
202     /* The middle 32 bits out of 64 in the NTP timestamp. */
203     ULONG nx_rtcp_report_last_sr;
204 
205     /* Delay since last SR timestamp. */
206     ULONG nx_rtcp_report_delay;
207 } NX_RTCP_REPORT;
208 
209 /* Define RTCP RR block for internal packet processing. */
210 typedef struct NX_RTCP_RR_STRUCT
211 {
212     /* Packet header. */
213     NX_RTCP_HEADER nx_rtcp_rr_header;
214 
215     /* RTCP packet type. */
216     ULONG nx_rtcp_rr_ssrc;
217 
218     /* Reception report block. */
219     NX_RTCP_REPORT nx_rtcp_rr_report;
220 } NX_RTCP_RR;
221 
222 /* Define RTCP SR structure for internal packet processing. */
223 typedef struct NX_RTCP_SR_STRUCT
224 {
225     NX_RTCP_HEADER nx_rtcp_sr_header;
226     ULONG          nx_rtcp_sr_ssrc;
227     ULONG          nx_rtcp_sr_ntp_timestamp_msw;
228     ULONG          nx_rtcp_sr_ntp_timestamp_lsw;
229     ULONG          nx_rtcp_sr_rtp_timestamp;
230     ULONG          nx_rtcp_sr_rtp_packet_count;
231     ULONG          nx_rtcp_sr_rtp_octet_count;
232 } NX_RTCP_SR;
233 
234 /* Define RTCP SDES item structure for internal packet processing. */
235 typedef struct NX_RTCP_SDES_ITEM_STRUCT
236 {
237     UCHAR nx_rtcp_sdes_type; /* Chunk type. */
238     UCHAR nx_rtcp_sdes_length;
239     UCHAR nx_rtcp_sdes_data[1];
240 } NX_RTCP_SDES_ITEM;
241 
242 /* Define RTCP SDES chunk structure for internal packet processing. */
243 typedef struct NX_RTCP_SDES_CHUNK_STRUCT
244 {
245     ULONG             nx_rtcp_sdes_ssrc;
246     NX_RTCP_SDES_ITEM nx_rtcp_sdes_item[1];
247 } NX_RTCP_SDES_CHUNK;
248 
249 typedef struct NX_RTP_SESSION_STRUCT NX_RTP_SESSION;
250 
251 typedef struct NX_RTP_SENDER_STRUCT
252 {
253 
254     /* Store the magic number for RTP sender service */
255     ULONG           nx_rtp_sender_id;
256 
257     /* Pointer to IP structure of the corresponding IP instance. */
258     NX_IP          *nx_rtp_sender_ip_ptr;
259 
260     /* Pointer to RTP sender packet pool   */
261     NX_PACKET_POOL *nx_rtp_sender_packet_pool_ptr;
262 
263     /* Mutex to protect critical section such as sequence number and so on */
264     TX_MUTEX        nx_rtp_sender_protection;
265 
266     /* Local RTP/RTCP port & socket */
267     USHORT          nx_rtp_sender_rtp_port;
268     USHORT          nx_rtp_sender_rtcp_port;
269     NX_UDP_SOCKET   nx_rtp_sender_rtp_socket;
270     NX_UDP_SOCKET   nx_rtp_sender_rtcp_socket;
271 
272     /* Callback function to process rtcp messages. */
273     UINT          (*nx_rtp_sender_rtcp_receiver_report_cb)(NX_RTP_SESSION *rtp_session, NX_RTCP_RECEIVER_REPORT *rtcp_receiver_report);
274     UINT          (*nx_rtp_sender_rtcp_sdes_cb)(NX_RTCP_SDES_INFO *sdes_info);
275 
276     /* RTP sender name */
277     CHAR           *nx_rtp_sender_cname;
278     UCHAR           nx_rtp_sender_cname_length;
279 
280     NX_RTP_SESSION *nx_rtp_sender_session_created_ptr;
281 } NX_RTP_SENDER;
282 
283 struct NX_RTP_SESSION_STRUCT
284 {
285 
286     /* Store the pointer for the corresponding rtp sender */
287     NX_RTP_SENDER                *nx_rtp_sender;
288 
289     /* Store the magic number for the specific RTP session */
290     ULONG                         nx_rtp_session_id;
291 
292     /* Store the ip interface index when session created. */
293     UINT                          nx_rtp_session_interface_index;
294 
295     /* Receiver's IP address and port number */
296     NXD_ADDRESS                   nx_rtp_session_peer_ip_address;
297     USHORT                        nx_rtp_session_peer_rtp_port;
298     USHORT                        nx_rtp_session_peer_rtcp_port;
299 
300     /* RTP header */
301     UCHAR                         nx_rtp_session_reserved;         /* Alignment */
302     UCHAR                         nx_rtp_session_payload_type;     /* Type, to be programmed into payload type field in RTP header */
303     USHORT                        nx_rtp_session_sequence_number;  /* Session sequence number */
304     ULONG                         nx_rtp_session_ssrc;
305 
306     /* The maximum frame packet size computed corresponding to mtu. */
307     ULONG                         nx_rtp_session_max_packet_size;
308 
309     /* None zero value: sample-based encoding
310        Default zero value: frame-based encoding */
311     ULONG                         nx_rtp_session_sample_factor;
312 
313     /* RTCP statistics */
314 
315     /* The total number of RTP data packets transmitted by the sender. */
316     ULONG                         nx_rtp_session_packet_count;
317 
318     /* The total number of payload octets transmitted by the sender. */
319     ULONG                         nx_rtp_session_octet_count;
320 
321     /* The timestamp of last sent RTP packet. */
322     ULONG                         nx_rtp_session_rtp_timestamp;
323 
324     /* The most significant word of the NTP timestamp corresponds to the same time as the RTP timestamp. */
325     ULONG                         nx_rtp_session_ntp_timestamp_msw;
326 
327     /* The least significant word of the NTP timestamp corresponds to the same time as the RTP timestamp. */
328     ULONG                         nx_rtp_session_ntp_timestamp_lsw;
329 
330     /* The last time an RTCP packet was transmitted. */
331     ULONG                         nx_rtp_session_rtcp_time;
332 
333     struct NX_RTP_SESSION_STRUCT *nx_rtp_session_next;
334 };
335 
336 typedef struct NX_RTP_HEADER_STRUCT
337 {
338     UCHAR  nx_rtp_header_field0;
339     UCHAR  nx_rtp_header_field1;
340     USHORT nx_rtp_header_sequence_number;
341     ULONG  nx_rtp_header_timestamp;
342     ULONG  nx_rtp_header_ssrc;
343 } NX_RTP_HEADER;
344 
345 
346 #ifndef NX_RTP_SENDER_SOURCE_CODE
347 
348 /* Application caller is present, perform API mapping.  */
349 
350 /* Determine if error checking is desired.  If so, map API functions
351    to the appropriate error checking front-ends.  Otherwise, map API
352    functions to the core functions that actually perform the work.
353    Note: error checking is enabled by default.  */
354 #ifdef NX_DISABLE_ERROR_CHECKING
355 
356 /* Services without error checking.  */
357 #define nx_rtp_sender_create                            _nx_rtp_sender_create
358 #define nx_rtp_sender_delete                            _nx_rtp_sender_delete
359 #define nx_rtp_sender_port_get                          _nx_rtp_sender_port_get
360 #define nx_rtp_sender_session_create                    _nx_rtp_sender_session_create
361 #define nx_rtp_sender_session_delete                    _nx_rtp_sender_session_delete
362 #define nx_rtp_sender_session_sample_factor_set         _nx_rtp_sender_session_sample_factor_set
363 #define nx_rtp_sender_session_packet_allocate           _nx_rtp_sender_session_packet_allocate
364 #define nx_rtp_sender_session_packet_send               _nx_rtp_sender_session_packet_send
365 #define nx_rtp_sender_session_jpeg_send                 _nx_rtp_sender_session_jpeg_send
366 #define nx_rtp_sender_session_h264_send                 _nx_rtp_sender_session_h264_send
367 #define nx_rtp_sender_session_aac_send                  _nx_rtp_sender_session_aac_send
368 #define nx_rtp_sender_session_sequence_number_get       _nx_rtp_sender_session_sequence_number_get
369 #define nx_rtp_sender_session_ssrc_get                  _nx_rtp_sender_session_ssrc_get
370 #define nx_rtp_sender_rtcp_receiver_report_callback_set _nx_rtp_sender_rtcp_receiver_report_callback_set
371 #define nx_rtp_sender_rtcp_sdes_callback_set            _nx_rtp_sender_rtcp_sdes_callback_set
372 
373 #else
374 
375 /* Services with error checking.  */
376 #define nx_rtp_sender_create                            _nxe_rtp_sender_create
377 #define nx_rtp_sender_delete                            _nxe_rtp_sender_delete
378 #define nx_rtp_sender_port_get                          _nxe_rtp_sender_port_get
379 #define nx_rtp_sender_session_create                    _nxe_rtp_sender_session_create
380 #define nx_rtp_sender_session_delete                    _nxe_rtp_sender_session_delete
381 #define nx_rtp_sender_session_sample_factor_set         _nxe_rtp_sender_session_sample_factor_set
382 #define nx_rtp_sender_session_packet_allocate           _nxe_rtp_sender_session_packet_allocate
383 #define nx_rtp_sender_session_packet_send               _nxe_rtp_sender_session_packet_send
384 #define nx_rtp_sender_session_jpeg_send                 _nxe_rtp_sender_session_jpeg_send
385 #define nx_rtp_sender_session_h264_send                 _nxe_rtp_sender_session_h264_send
386 #define nx_rtp_sender_session_aac_send                  _nxe_rtp_sender_session_aac_send
387 #define nx_rtp_sender_session_sequence_number_get       _nxe_rtp_sender_session_sequence_number_get
388 #define nx_rtp_sender_session_ssrc_get                  _nxe_rtp_sender_session_ssrc_get
389 #define nx_rtp_sender_rtcp_receiver_report_callback_set _nxe_rtp_sender_rtcp_receiver_report_callback_set
390 #define nx_rtp_sender_rtcp_sdes_callback_set            _nxe_rtp_sender_rtcp_sdes_callback_set
391 
392 #endif /* NX_DISABLE_ERROR_CHECKING */
393 
394 /* Define the prototypes accessible to the application software.  */
395 
396 /* Initiate RTP sender service, create UDP sockets. */
397 UINT nx_rtp_sender_create(NX_RTP_SENDER *rtp_sender, NX_IP *ip_ptr, NX_PACKET_POOL *pool_ptr, CHAR *cname, UCHAR cname_length);
398 
399 /* Terminate the RTP service */
400 UINT nx_rtp_sender_delete(NX_RTP_SENDER *rtp_sender);
401 
402 /* Obtain RTP/RTCP port numbers.  The port numbers may be used by RTSP */
403 UINT nx_rtp_sender_port_get(NX_RTP_SENDER *rtp_sender, UINT *rtp_port, UINT *rtcp_port);
404 
405 /* Setup a session, find and bind to available ports. */
406 UINT nx_rtp_sender_session_create(NX_RTP_SENDER *rtp_sender, NX_RTP_SESSION *session, ULONG payload_type,
407                                   UINT interface_index, NXD_ADDRESS *receiver_ip_address,
408                                   UINT receiver_rtp_port_number, UINT receiver_rtcp_port_number);
409 
410 /* Delete a session, and then it is available to re-setup the session */
411 UINT nx_rtp_sender_session_delete(NX_RTP_SESSION *session);
412 
413 /* Set the sample factor for sample-based mode inside the specific session. */
414 UINT nx_rtp_sender_session_sample_factor_set(NX_RTP_SESSION *session, UINT factor);
415 
416 /* Allocate and obtain a rtp session packet. */
417 UINT nx_rtp_sender_session_packet_allocate(NX_RTP_SESSION *session, NX_PACKET **packet_ptr, ULONG wait_option);
418 
419 /* Send payload data through a specific session. */
420 UINT nx_rtp_sender_session_packet_send(NX_RTP_SESSION *session, NX_PACKET *packet_ptr, ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
421 
422 /* API functions for sending video payload over rtp. */
423 UINT nx_rtp_sender_session_jpeg_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
424                                      ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
425 UINT nx_rtp_sender_session_h264_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
426                                      ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
427 
428 /* API functions for sending audio payload over rtp. */
429 UINT nx_rtp_sender_session_aac_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size, ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
430 
431 /* Obtain the current sequence number inside the specific session. */
432 UINT nx_rtp_sender_session_sequence_number_get(NX_RTP_SESSION *session, UINT *sequence_number);
433 
434 /* Obtain the current ssrc inside the specific session. */
435 UINT nx_rtp_sender_session_ssrc_get(NX_RTP_SESSION *session, ULONG *ssrc);
436 
437 /* Set a callback function to handle incoming RTCP message. */
438 UINT nx_rtp_sender_rtcp_receiver_report_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_rr_cb)(NX_RTP_SESSION *, NX_RTCP_RECEIVER_REPORT *));
439 UINT nx_rtp_sender_rtcp_sdes_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_sdes_cb)(NX_RTCP_SDES_INFO *));
440 
441 #else
442 
443 /* Define the prototypes accessible to the application software.  */
444 
445 UINT _nxe_rtp_sender_create(NX_RTP_SENDER *rtp_sender, NX_IP *ip_ptr, NX_PACKET_POOL *pool_ptr, CHAR *cname, UCHAR cname_length);
446 UINT _nx_rtp_sender_create(NX_RTP_SENDER *rtp_sender, NX_IP *ip_ptr, NX_PACKET_POOL *pool_ptr, CHAR *cname, UCHAR cname_length);
447 UINT _nxe_rtp_sender_delete(NX_RTP_SENDER *rtp_sender);
448 UINT _nx_rtp_sender_delete(NX_RTP_SENDER *rtp_sender);
449 UINT _nxe_rtp_sender_port_get(NX_RTP_SENDER *rtp_sender, UINT *rtp_port, UINT *rtcp_port);
450 UINT _nx_rtp_sender_port_get(NX_RTP_SENDER *rtp_sender, UINT *rtp_port, UINT *rtcp_port);
451 UINT _nxe_rtp_sender_session_create(NX_RTP_SENDER *rtp_sender, NX_RTP_SESSION *session, ULONG payload_type,
452                                     UINT interface_index, NXD_ADDRESS *receiver_ip_address,
453                                     UINT receiver_rtp_port_number, UINT receiver_rtcp_port_number);
454 UINT _nx_rtp_sender_session_create(NX_RTP_SENDER *rtp_sender, NX_RTP_SESSION *session, ULONG payload_type,
455                                    UINT interface_index, NXD_ADDRESS *receiver_ip_address,
456                                    UINT receiver_rtp_port_number, UINT receiver_rtcp_port_number);
457 UINT _nxe_rtp_sender_session_delete(NX_RTP_SESSION *session);
458 UINT _nx_rtp_sender_session_delete(NX_RTP_SESSION *session);
459 UINT _nxe_rtp_sender_session_sample_factor_set(NX_RTP_SESSION *session, UINT factor);
460 UINT _nx_rtp_sender_session_sample_factor_set(NX_RTP_SESSION *session, UINT factor);
461 UINT _nxe_rtp_sender_session_packet_allocate(NX_RTP_SESSION *session, NX_PACKET **packet_ptr, ULONG wait_option);
462 UINT _nx_rtp_sender_session_packet_allocate(NX_RTP_SESSION *session, NX_PACKET **packet_ptr, ULONG wait_option);
463 UINT _nxe_rtp_sender_session_packet_send(NX_RTP_SESSION *session, NX_PACKET *packet_ptr, ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
464 UINT _nx_rtp_sender_session_packet_send(NX_RTP_SESSION *session, NX_PACKET *packet_ptr, ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
465 UINT _nxe_rtp_sender_session_sequence_number_get(NX_RTP_SESSION *session, UINT *sequence_number);
466 UINT _nx_rtp_sender_session_sequence_number_get(NX_RTP_SESSION *session, UINT *sequence_number);
467 UINT _nxe_rtp_sender_session_jpeg_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
468                                        ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
469 UINT _nx_rtp_sender_session_jpeg_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
470                                        ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
471 UINT _nxe_rtp_sender_session_h264_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
472                                        ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
473 UINT _nx_rtp_sender_session_h264_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
474                                       ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
475 UINT _nxe_rtp_sender_session_aac_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
476                                       ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
477 UINT _nx_rtp_sender_session_aac_send(NX_RTP_SESSION *session, UCHAR *frame_data, ULONG frame_data_size,
478                                      ULONG timestamp, ULONG ntp_msw, ULONG ntp_lsw, UINT marker);
479 UINT _nxe_rtp_sender_session_ssrc_get(NX_RTP_SESSION *session, ULONG *ssrc);
480 UINT _nx_rtp_sender_session_ssrc_get(NX_RTP_SESSION *session, ULONG *ssrc);
481 UINT _nxe_rtp_sender_rtcp_receiver_report_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_rr_cb)(NX_RTP_SESSION *, NX_RTCP_RECEIVER_REPORT *));
482 UINT _nx_rtp_sender_rtcp_receiver_report_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_rr_cb)(NX_RTP_SESSION *, NX_RTCP_RECEIVER_REPORT *));
483 UINT _nxe_rtp_sender_rtcp_sdes_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_sdes_cb)(NX_RTCP_SDES_INFO *));
484 UINT _nx_rtp_sender_rtcp_sdes_callback_set(NX_RTP_SENDER *rtp_sender, UINT (*rtcp_sdes_cb)(NX_RTCP_SDES_INFO *));
485 
486 #endif /* NX_RTP_SENDER_SOURCE_CODE */
487 
488 /* Determine if a C++ compiler is being used.  If so, complete the standard
489    C conditional started above.  */
490 #ifdef __cplusplus
491 }
492 #endif
493 
494 #endif /* _NX_RTP_SENDER_H_ */
495 
496