1 /*
2 * RTP input/output format
3 * Copyright (c) 2002 Fabrice Bellard
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
25
27
28 /* from http://www.iana.org/assignments/rtp-parameters last updated 05 January 2005 */
29 /* payload types >= 96 are dynamic;
30 * payload types between 72 and 76 are reserved for RTCP conflict avoidance;
31 * all the other payload types not present in the table are unassigned or
32 * reserved
33 */
34 static const struct {
69 };
70
72 {
73 int i = 0;
74
84 return 0;
85 }
86 }
87 return -1;
88 }
89
92 {
93 int i;
95
96 /* Was the payload type already specified for the RTP muxer? */
98 int64_t payload_type;
100 payload_type >= 0)
101 return (int)payload_type;
102 }
103
104 /* static payload type */
110 continue;
111 /* G722 has 8000 as nominal rate even if the sample rate is 16000,
112 * see section 4.5.2 in RFC 3551. */
121 continue;
123 }
124
125 if (idx < 0)
127
128 /* dynamic payload type */
130 }
131
133 {
134 int i;
135
139
140 return "";
141 }
142
144 {
145 int i;
146
150
152 }
static const struct @237 rtp_payload_types[]
enum AVCodecID codec_id
Specific type of the encoded data (the codec used).
enum AVMediaType codec_type
const char * ff_rtp_enc_name(int payload_type)
Return the encoding name (as defined in http://www.iana.org/assignments/rtp-parameters) for a given p...
This struct describes the properties of an encoded stream.
enum AVCodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type)
Return the codec id for the given encoding name and codec type.
Opaque data information usually continuous.
int ff_rtp_get_codec_info(AVCodecParameters *par, int payload_type)
Initialize a codec context based on the payload type.
struct AVOutputFormat * oformat
The output container format.
AVCodecID
Identify the syntax and semantics of the bitstream.
preferred ID for decoding MPEG audio layer 1, 2 or 3
enum AVMediaType codec_type
General type of the encoded data.
int av_strcasecmp(const char *a, const char *b)
Locale-independent case-insensitive compare.
Usually treated as AVMEDIA_TYPE_DATA.
preferred ID for MPEG-1/2 video decoding
int av_opt_get_int(void *obj, const char *name, int search_flags, int64_t *out_val)
int sample_rate
Audio only.
FAKE codec to indicate a raw MPEG-2 TS stream (only used by libavformat)
int ff_rtp_get_payload_type(AVFormatContext *fmt, AVCodecParameters *par, int idx)
Return the payload type for a given stream used in the given format context.
void * priv_data
Format private data.
int av_opt_flag_is_set(void *obj, const char *field_name, const char *flag_name)
Check whether a particular flag is set in a flags field.