1 /*
2 * Common code for the RTP depacketization of MPEG-1/2 formats.
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
30 {
32 if (len <= 4)
35 buf += 4;
36 len -= 4;
38 /* MPEG-2 */
39 if (len <= 4)
41 buf += 4;
42 len -= 4;
43 }
46 memcpy(pkt->
data, buf, len);
48 return 0;
49 }
50
56 .static_payload_id = 14,
57 };
58
64 .static_payload_id = 32,
65 };
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ptrdiff_t const GLvoid * data
RTP/JPEG specific private data.
int index
stream index in AVFormatContext
const RTPDynamicProtocolHandler ff_mpeg_video_dynamic_handler
enum AVMediaType codec_type
Macro definitions for various function/variable attributes.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_WL32 unsigned int_TMPL AV_WL24 unsigned int_TMPL AV_WL16 uint64_t_TMPL AV_WB64 unsigned int_TMPL AV_RB32
int av_new_packet(AVPacket *pkt, int size)
Allocate the payload of a packet and initialize its fields with default values.
const RTPDynamicProtocolHandler ff_mpeg_audio_dynamic_handler
preferred ID for decoding MPEG audio layer 1, 2 or 3
enum AVMediaType codec_type
General type of the encoded data.
static int mpeg_parse_packet(AVFormatContext *ctx, PayloadContext *data, AVStream *st, AVPacket *pkt, uint32_t *timestamp, const uint8_t *buf, int len, uint16_t seq, int flags)
preferred ID for MPEG-1/2 video decoding
AVCodecParameters * codecpar
Codec parameters associated with this stream.
This structure stores compressed data.