rtspdec.c File Reference
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/time.h"
#include "avformat.h"
#include "internal.h"
#include "network.h"
#include "os_support.h"
#include "rtsp.h"
#include "rdt.h"
#include "url.h"
Include dependency graph for rtspdec.c:

Go to the source code of this file.

Data Structures

struct  RTSPStatusMessage
 

Functions

static int rtsp_read_close (AVFormatContext *s)
 
static int read_line (AVFormatContext *s, char *rbuf, const int rbufsize, int *rbuflen)
 
static int rtsp_send_reply (AVFormatContext *s, enum RTSPStatusCode code, const char *extracontent, uint16_t seq)
 
static int check_sessionid (AVFormatContext *s, RTSPMessageHeader *request)
 
static int rtsp_read_request (AVFormatContext *s, RTSPMessageHeader *request, const char *method)
 
static int rtsp_read_announce (AVFormatContext *s)
 
static int rtsp_read_options (AVFormatContext *s)
 
static int rtsp_read_setup (AVFormatContext *s, char *host, char *controlurl)
 
static int rtsp_read_record (AVFormatContext *s)
 
static int parse_command_line (AVFormatContext *s, const char *line, int linelen, char *uri, int urisize, char *method, int methodsize, enum RTSPMethod *methodcode)
 
int ff_rtsp_parse_streaming_commands (AVFormatContext *s)
 Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in listen mode. More...
 
static int rtsp_read_play (AVFormatContext *s)
 
static int rtsp_read_pause (AVFormatContext *s)
 
int ff_rtsp_setup_input_streams (AVFormatContext *s, RTSPMessageHeader *reply)
 Get the description of the stream and set up the RTSPStream child objects. More...
 
static int rtsp_listen (AVFormatContext *s)
 
static int rtsp_probe (AVProbeData *p)
 
static int rtsp_read_header (AVFormatContext *s)
 
int ff_rtsp_tcp_read_packet (AVFormatContext *s, RTSPStream **prtsp_st, uint8_t *buf, int buf_size)
 Receive one RTP packet from an TCP interleaved RTSP stream. More...
 
static int resetup_tcp (AVFormatContext *s)
 
static int rtsp_read_packet (AVFormatContext *s, AVPacket *pkt)
 
static int rtsp_read_seek (AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
 

Variables

static const struct RTSPStatusMessage status_messages []
 
static const AVClass rtsp_demuxer_class
 
AVInputFormat ff_rtsp_demuxer
 

Function Documentation

static int check_sessionid ( AVFormatContext s,
RTSPMessageHeader request 
)
inlinestatic

Definition at line 121 of file rtspdec.c.

Referenced by rtsp_read_record(), and rtsp_read_request().

int ff_rtsp_parse_streaming_commands ( AVFormatContext s)

Parse RTSP commands (OPTIONS, PAUSE and TEARDOWN) during streaming in listen mode.

Definition at line 451 of file rtspdec.c.

Referenced by ff_rtsp_open_transport_ctx().

int ff_rtsp_setup_input_streams ( AVFormatContext s,
RTSPMessageHeader reply 
)

Get the description of the stream and set up the RTSPStream child objects.

The Require: attribute is needed for proper streaming from Realmedia servers.

Definition at line 567 of file rtspdec.c.

Referenced by ff_rtsp_open_transport_ctx().

int ff_rtsp_tcp_read_packet ( AVFormatContext s,
RTSPStream **  prtsp_st,
uint8_t buf,
int  buf_size 
)

Receive one RTP packet from an TCP interleaved RTSP stream.

Definition at line 713 of file rtspdec.c.

Referenced by ff_rtsp_open_transport_ctx().

static int parse_command_line ( AVFormatContext s,
const char *  line,
int  linelen,
char *  uri,
int  urisize,
char *  method,
int  methodsize,
enum RTSPMethod methodcode 
)
inlinestatic

Definition at line 354 of file rtspdec.c.

Referenced by ff_rtsp_parse_streaming_commands(), and rtsp_listen().

static int read_line ( AVFormatContext s,
char *  rbuf,
const int  rbufsize,
int *  rbuflen 
)
inlinestatic

Definition at line 69 of file rtspdec.c.

Referenced by ff_rtsp_parse_streaming_commands(), rtsp_listen(), and rtsp_read_request().

static int resetup_tcp ( AVFormatContext s)
static

Definition at line 763 of file rtspdec.c.

Referenced by rtsp_read_packet().

static int rtsp_listen ( AVFormatContext s)
static

Definition at line 604 of file rtspdec.c.

Referenced by rtsp_read_header().

static int rtsp_probe ( AVProbeData p)
static

Definition at line 669 of file rtspdec.c.

static int rtsp_read_announce ( AVFormatContext s)
static

Definition at line 169 of file rtspdec.c.

Referenced by rtsp_listen().

static int rtsp_read_close ( AVFormatContext s)
static

Definition at line 54 of file rtspdec.c.

static int rtsp_read_header ( AVFormatContext s)
static

Definition at line 676 of file rtspdec.c.

static int rtsp_read_options ( AVFormatContext s)
static

Definition at line 210 of file rtspdec.c.

Referenced by rtsp_listen().

static int rtsp_read_packet ( AVFormatContext s,
AVPacket pkt 
)
static

Definition at line 776 of file rtspdec.c.

static int rtsp_read_pause ( AVFormatContext s)
static

Definition at line 550 of file rtspdec.c.

Referenced by rtsp_read_packet(), and rtsp_read_seek().

static int rtsp_read_play ( AVFormatContext s)
static

Definition at line 492 of file rtspdec.c.

Referenced by rtsp_read_header(), rtsp_read_packet(), and rtsp_read_seek().

static int rtsp_read_record ( AVFormatContext s)
static

Definition at line 332 of file rtspdec.c.

Referenced by rtsp_listen().

static int rtsp_read_request ( AVFormatContext s,
RTSPMessageHeader request,
const char *  method 
)
inlinestatic
static int rtsp_read_seek ( AVFormatContext s,
int  stream_index,
int64_t  timestamp,
int  flags 
)
static

Definition at line 891 of file rtspdec.c.

static int rtsp_read_setup ( AVFormatContext s,
char *  host,
char *  controlurl 
)
static

Definition at line 228 of file rtspdec.c.

Referenced by rtsp_listen().

static int rtsp_send_reply ( AVFormatContext s,
enum RTSPStatusCode  code,
const char *  extracontent,
uint16_t  seq 
)
static

Variable Documentation

AVInputFormat ff_rtsp_demuxer
Initial value:
= {
.name = "rtsp",
.long_name = NULL_IF_CONFIG_SMALL("RTSP input"),
.priv_data_size = sizeof(RTSPState),
.read_play = rtsp_read_play,
.read_pause = rtsp_read_pause,
.priv_class = &rtsp_demuxer_class,
}
static int rtsp_read_close(AVFormatContext *s)
Definition: rtspdec.c:54
static int rtsp_read_header(AVFormatContext *s)
Definition: rtspdec.c:676
static int read_seek(AVFormatContext *ctx, int stream_index, int64_t timestamp, int flags)
Definition: libcdio.c:153
static int rtsp_probe(AVProbeData *p)
Definition: rtspdec.c:669
static int rtsp_read_pause(AVFormatContext *s)
Definition: rtspdec.c:550
static int rtsp_read_packet(AVFormatContext *s, AVPacket *pkt)
Definition: rtspdec.c:776
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:145
static int rtsp_read_play(AVFormatContext *s)
Definition: rtspdec.c:492
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int read_probe(AVProbeData *pd)
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:517
static int read_packet(AVFormatContext *ctx, AVPacket *pkt)
Definition: libcdio.c:114
struct RTSPState RTSPState
Private data for the RTSP demuxer.
static int flags
Definition: cpu.c:23
static const AVClass rtsp_demuxer_class
Definition: rtspdec.c:917
#define AVFMT_NOFILE
Demuxer will use avio_open, no opened file should be provided by the caller.
Definition: avformat.h:345
static int rtsp_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
Definition: rtspdec.c:891

Definition at line 924 of file rtspdec.c.

const AVClass rtsp_demuxer_class
static
Initial value:
= {
.class_name = "RTSP demuxer",
.item_name = av_default_item_name,
.option = ff_rtsp_options,
}
av_default_item_name
const AVOption ff_rtsp_options[]
Definition: rtsp.c:81
LIBAVUTIL_VERSION_INT
Definition: eval.c:55

Definition at line 917 of file rtspdec.c.

const struct RTSPStatusMessage status_messages[]
static
Initial value:
= {
{ RTSP_STATUS_OK, "OK" },
{ RTSP_STATUS_METHOD, "Method Not Allowed" },
{ RTSP_STATUS_BANDWIDTH, "Not Enough Bandwidth" },
{ RTSP_STATUS_SESSION, "Session Not Found" },
{ RTSP_STATUS_STATE, "Method Not Valid in This State" },
{ RTSP_STATUS_AGGREGATE, "Aggregate operation not allowed" },
{ RTSP_STATUS_ONLY_AGGREGATE, "Only aggregate operation allowed" },
{ RTSP_STATUS_TRANSPORT, "Unsupported transport" },
{ RTSP_STATUS_INTERNAL, "Internal Server Error" },
{ RTSP_STATUS_SERVICE, "Service Unavailable" },
{ RTSP_STATUS_VERSION, "RTSP Version not supported" },
{ 0, "NULL" }
}
Aggregate operation not allowed.
Definition: rtspcodes.h:32
Service Unavailable.
Definition: rtspcodes.h:36
Only aggregate operation allowed.
Definition: rtspcodes.h:33
Method Not Allowed.
Definition: rtspcodes.h:28
Not Enough Bandwidth.
Definition: rtspcodes.h:29
Unsupported transport.
Definition: rtspcodes.h:34
Method Not Valid in This State.
Definition: rtspcodes.h:31
RTSP Version not supported.
Definition: rtspcodes.h:37
Internal Server Error.
Definition: rtspcodes.h:35
Session Not Found.
Definition: rtspcodes.h:30

Referenced by rtsp_send_reply().