libavformat/rtsp.h

Go to the documentation of this file.
00001 /*
00002  * RTSP definitions
00003  * Copyright (c) 2002 Fabrice Bellard
00004  *
00005  * This file is part of FFmpeg.
00006  *
00007  * FFmpeg is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2.1 of the License, or (at your option) any later version.
00011  *
00012  * FFmpeg is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with FFmpeg; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
00020  */
00021 #ifndef FFMPEG_RTSP_H
00022 #define FFMPEG_RTSP_H
00023 
00024 #include <stdint.h>
00025 #include "avformat.h"
00026 #include "rtspcodes.h"
00027 #include "rtpdec.h"
00028 #include "network.h"
00029 
00033 enum RTSPLowerTransport {
00034 RTSP_LOWER_TRANSPORT_UDP = 0, 
00035 RTSP_LOWER_TRANSPORT_TCP = 1, 
00036 RTSP_LOWER_TRANSPORT_UDP_MULTICAST = 2, 
00037 RTSP_LOWER_TRANSPORT_NB
00038 };
00039 
00045 enum RTSPTransport {
00046 RTSP_TRANSPORT_RTP, 
00047 RTSP_TRANSPORT_RDT, 
00048 RTSP_TRANSPORT_NB
00049 };
00050 
00051 #define RTSP_DEFAULT_PORT 554
00052 #define RTSP_MAX_TRANSPORTS 8
00053 #define RTSP_TCP_MAX_PACKET_SIZE 1472
00054 #define RTSP_DEFAULT_NB_AUDIO_CHANNELS 2
00055 #define RTSP_DEFAULT_AUDIO_SAMPLERATE 44100
00056 #define RTSP_RTP_PORT_MIN 5000
00057 #define RTSP_RTP_PORT_MAX 10000
00058 
00066 typedef struct RTSPTransportField {
00071 int interleaved_min, interleaved_max;
00072 
00075 int port_min, port_max;
00076 
00079 int client_port_min, client_port_max;
00080 
00083 int server_port_min, server_port_max;
00084 
00087 int ttl;
00088 
00089 uint32_t destination; 
00092 enum RTSPTransport transport;
00093 
00095 enum RTSPLowerTransport lower_transport;
00096 } RTSPTransportField;
00097 
00101 typedef struct RTSPMessageHeader {
00103 int content_length;
00104 
00105 enum RTSPStatusCode status_code; 
00108 int nb_transports;
00109 
00112 int64_t range_start, range_end;
00113 
00116 RTSPTransportField transports[RTSP_MAX_TRANSPORTS];
00117 
00118 int seq; 
00122 char session_id[512];
00123 
00125 char real_challenge[64];
00126 
00134 char server[64];
00135 } RTSPMessageHeader;
00136 
00142 enum RTSPClientState {
00143 RTSP_STATE_IDLE, 
00144 RTSP_STATE_PLAYING, 
00145 RTSP_STATE_PAUSED, 
00146 };
00147 
00152 enum RTSPServerType {
00153 RTSP_SERVER_RTP, 
00154 RTSP_SERVER_REAL, 
00155 RTSP_SERVER_WMS, 
00156 RTSP_SERVER_NB
00157 };
00158 
00162 typedef struct RTSPState {
00163 URLContext *rtsp_hd; /* RTSP TCP connexion handle */
00164 
00166 int nb_rtsp_streams;
00167 
00168 struct RTSPStream **rtsp_streams; 
00174 enum RTSPClientState state;
00175 
00182 int64_t seek_timestamp;
00183 
00184 /* XXX: currently we use unbuffered input */
00185 // ByteIOContext rtsp_gb;
00186 
00187 int seq; 
00191 char session_id[512];
00192 
00194 enum RTSPTransport transport;
00195 
00198 enum RTSPLowerTransport lower_transport;
00199 
00203 enum RTSPServerType server_type;
00204 
00206 char last_reply[2048]; /* XXX: allocate ? */
00207 
00210 void *cur_transport_priv;
00211 
00215 int need_subscription;
00216 
00219 enum AVDiscard real_setup_cache[MAX_STREAMS];
00220 
00224 char last_subscription[1024];
00226 } RTSPState;
00227 
00234 typedef struct RTSPStream {
00235 URLContext *rtp_handle; 
00236 void *transport_priv; 
00239 int stream_index;
00240 
00243 int interleaved_min, interleaved_max;
00244 
00245 char control_url[1024]; 
00249 int sdp_port; 
00250 struct in_addr sdp_ip; 
00251 int sdp_ttl; 
00252 int sdp_payload_type; 
00254 
00258 RTPPayloadData rtp_payload_data;
00259 
00263 RTPDynamicProtocolHandler *dynamic_handler;
00264 
00266 PayloadContext *dynamic_protocol_context;
00268 } RTSPStream;
00269 
00270 int rtsp_init(void);
00271 void rtsp_parse_line(RTSPMessageHeader *reply, const char *buf);
00272 
00273 #if LIBAVFORMAT_VERSION_INT < (53 << 16)
00274 extern int rtsp_default_protocols;
00275 #endif
00276 extern int rtsp_rtp_port_min;
00277 extern int rtsp_rtp_port_max;
00278 
00279 int rtsp_pause(AVFormatContext *s);
00280 int rtsp_resume(AVFormatContext *s);
00281 
00282 #endif /* FFMPEG_RTSP_H */

Generated on Fri Oct 26 02:35:41 2012 for FFmpeg by doxygen 1.5.8

AltStyle によって変換されたページ (->オリジナル) /