annotate libmpdemux/demux_rtp_internal.h @ 36189:71360817b772

Discard parts that we do not actually care about instead of reading them in. Since more than one character can match, this could read beyond the target variable. Based on patch by wm4 (nfxjfg googlemail.com).
author reimar
date Sat, 25 May 2013 12:06:55 +0000
parents 4614728cab25
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
29238
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
1 /*
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
2 * This file is part of MPlayer.
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
3 *
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
5 * it under the terms of the GNU General Public License as published by
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
7 * (at your option) any later version.
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
8 *
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
12 * GNU General Public License for more details.
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
13 *
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
14 * You should have received a copy of the GNU General Public License along
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
17 */
d643e4643313 Add standard license header to all files in libmpdemux.
diego
parents: 27341
diff changeset
18
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
19 #ifndef MPLAYER_DEMUX_RTP_INTERNAL_H
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
20 #define MPLAYER_DEMUX_RTP_INTERNAL_H
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
21
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
22 #include <stdlib.h>
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
23
32084
6332e41e13b3 Add required config.h #includes.
diego
parents: 30717
diff changeset
24 #include "config.h"
6332e41e13b3 Add required config.h #includes.
diego
parents: 30717
diff changeset
25
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
26 extern "C" {
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
27 #include "demuxer.h"
32142
4614728cab25 build system: Merge all FFmpeg library checks into a single FFmpeg check.
diego
parents: 32084
diff changeset
28 #ifdef CONFIG_FFMPEG
22852
d7f4da5e9ee4 Support h264 over rtsp
cehoyos
parents: 22605
diff changeset
29 #include "libavcodec/avcodec.h"
d7f4da5e9ee4 Support h264 over rtsp
cehoyos
parents: 22605
diff changeset
30 #endif
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
31 }
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
32
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
33 #ifndef _LIVEMEDIA_HH
12530
773ad7374436 MinGW compilation fix, idea and approval by Sascha Sommer
diego
parents: 11754
diff changeset
34 #undef STREAM_SEEK
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
35 #include <liveMedia.hh>
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
36 #endif
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
37
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
38 // Codec-specific initialization routines:
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
39 void rtpCodecInitialize_video(demuxer_t* demuxer,
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
40 MediaSubsession* subsession, unsigned& flags);
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
41 void rtpCodecInitialize_audio(demuxer_t* demuxer,
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
42 MediaSubsession* subsession, unsigned& flags);
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
43
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
44 // Flags that may be set by the above routines:
9565
e74916774667 Improved RTP packet buffering, by relying on the underlying OS's UDP
rsf
parents: 9250
diff changeset
45 #define RTPSTATE_IS_MPEG12_VIDEO 0x1 // is a MPEG-1 or 2 video stream
10476
1bc3ac054b08 Added support for checking whether a RTP demuxer had combined audio+video data.
rsf
parents: 9565
diff changeset
46 #define RTPSTATE_IS_MULTIPLEXED 0x2 // is a combined audio+video stream
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
47
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
48 // A routine to wait for the first packet of a RTP stream to arrive.
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
49 // (For some RTP payload formats, codecs cannot be fully initialized until
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
50 // we've started receiving data.)
9565
e74916774667 Improved RTP packet buffering, by relying on the underlying OS's UDP
rsf
parents: 9250
diff changeset
51 Boolean awaitRTPPacket(demuxer_t* demuxer, demux_stream_t* ds,
e74916774667 Improved RTP packet buffering, by relying on the underlying OS's UDP
rsf
parents: 9250
diff changeset
52 unsigned char*& packetData, unsigned& packetDataLen,
e74916774667 Improved RTP packet buffering, by relying on the underlying OS's UDP
rsf
parents: 9250
diff changeset
53 float& pts);
9250
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
54 // "streamType": 0 => video; 1 => audio
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
55 // This routine returns False if the input stream has closed
bb490ffeebf5 Restruct by Ross Finlayson <finlayson@live.com>
bertrand
parents:
diff changeset
56
26029
4129c8cfa742 Add MPLAYER_ prefix to multiple inclusion guards.
diego
parents: 25535
diff changeset
57 #endif /* MPLAYER_DEMUX_RTP_INTERNAL_H */