source: roaraudio/include/libroar/vio_rtp.h @ 3287:501ae8e87527

Last change on this file since 3287:501ae8e87527 was 3287:501ae8e87527, checked in by phi, 14 years ago

rename tx buffer to io as we will use it in read(), too

File size: 5.0 KB
Line 
1//vio_rtp.h:
2
3/*
4 *      Copyright (C) Philipp 'ph3-der-loewe' Schafft - 2010
5 *
6 *  This file is part of libroar a part of RoarAudio,
7 *  a cross-platform sound system for both, home and professional use.
8 *  See README for details.
9 *
10 *  This file is free software; you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License version 3
12 *  as published by the Free Software Foundation.
13 *
14 *  libroar is distributed in the hope that it will be useful,
15 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *  GNU General Public License for more details.
18 *
19 *  You should have received a copy of the GNU General Public License
20 *  along with this software; see the file COPYING.  If not, write to
21 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22 *
23 *  NOTE for everyone want's to change something and send patches:
24 *  read README and HACKING! There a addition information on
25 *  the license of this document you need to read before you send
26 *  any patches.
27 *
28 *  NOTE for uses of non-GPL (LGPL,...) software using libesd, libartsc
29 *  or libpulse*:
30 *  The libs libroaresd, libroararts and libroarpulse link this lib
31 *  and are therefore GPL. Because of this it may be illigal to use
32 *  them with any software that uses libesd, libartsc or libpulse*.
33 */
34
35#ifndef _LIBROARVIO_RTP_H_
36#define _LIBROARVIO_RTP_H_
37
38#include "libroar.h"
39
40#define ROAR_RTP_FLAG_PADDING    0x02
41#define ROAR_RTP_FLAG_EXTENSION  0x03
42#define ROAR_RTP_FLAG_MARKER     0x08
43
44/*
45RFC 3551                    RTP A/V Profile                    July 2003
46
47
48               PT   encoding    media type  clock rate   channels
49                    name                    (Hz)
50               ___________________________________________________
51               0    PCMU        A            8,000       1
52               1    reserved    A
53               2    reserved    A
54               3    GSM         A            8,000       1
55               4    G723        A            8,000       1
56               5    DVI4        A            8,000       1
57               6    DVI4        A           16,000       1
58               7    LPC         A            8,000       1
59               8    PCMA        A            8,000       1
60               9    G722        A            8,000       1
61               10   L16         A           44,100       2
62               11   L16         A           44,100       1
63               12   QCELP       A            8,000       1
64               13   CN          A            8,000       1
65               14   MPA         A           90,000       (see text)
66               15   G728        A            8,000       1
67               16   DVI4        A           11,025       1
68               17   DVI4        A           22,050       1
69               18   G729        A            8,000       1
70               19   reserved    A
71               20   unassigned  A
72               21   unassigned  A
73               22   unassigned  A
74               23   unassigned  A
75               dyn  G726-40     A            8,000       1
76               dyn  G726-32     A            8,000       1
77               dyn  G726-24     A            8,000       1
78               dyn  G726-16     A            8,000       1
79               dyn  G729D       A            8,000       1
80               dyn  G729E       A            8,000       1
81               dyn  GSM-EFR     A            8,000       1
82               dyn  L8          A            var.        var.
83               dyn  RED         A                        (see text)
84               dyn  VDVI        A            var.        1
85
86               Table 4: Payload types (PT) for audio encodings
87 */
88
89#define ROAR_RTP_PT_A_PCMU         0 /* mu-Law */
90#define ROAR_RTP_PT_A_PCMA         8 /* A-Law  */
91#define ROAR_RTP_PT_A_L16_441_2   10
92#define ROAR_RTP_PT_A_L16_441_1   11
93#define ROAR_RTP_PT_UNKNOWN      127 /* non standard asignment */
94
95struct roar_rtp_header {
96 int version;
97 int flags;
98 int csrc_count;
99 int payload_type;
100 uint16_t seq_num;
101 uint32_t ts;
102 uint32_t ssrc;
103 uint32_t csrc[16];
104};
105
106struct roar_rtp_inst {
107 struct roar_vio_calls * vio;
108 struct roar_rtp_header header;
109 struct roar_buffer    * io;
110 struct roar_audio_info  info;
111 size_t                  mtu;
112 int                     bpf; // byte per frame
113};
114
115int roar_vio_open_rtp        (struct roar_vio_calls * calls, struct roar_vio_calls * dst,
116                              char * dstr, struct roar_vio_defaults * odef);
117
118ssize_t roar_vio_rtp_read    (struct roar_vio_calls * vio, void *buf, size_t count);
119ssize_t roar_vio_rtp_write   (struct roar_vio_calls * vio, void *buf, size_t count);
120off_t   roar_vio_rtp_lseek   (struct roar_vio_calls * vio, off_t offset, int whence);
121int     roar_vio_rtp_nonblock(struct roar_vio_calls * vio, int state);
122int     roar_vio_rtp_sync    (struct roar_vio_calls * vio);
123int     roar_vio_rtp_ctl     (struct roar_vio_calls * vio, int cmd, void * data);
124int     roar_vio_rtp_close   (struct roar_vio_calls * vio);
125
126#endif
127
128//ll
Note: See TracBrowser for help on using the repository browser.