77 ctx_array[0] = &sdp_ctx;
84 "Content-Type: application/sdp\r\n",
85 reply,
NULL, sdp, strlen(sdp));
117 "Range: npt=0.000-\r\n");
147 uint8_t *interleave_header, *interleaved_packet;
153 uint32_t packet_len =
AV_RB32(ptr);
160 interleaved_packet = interleave_header = ptr;
163 if (packet_len > size || packet_len < 2)
169 interleave_header[0] =
'$';
170 interleave_header[1] =
id;
171 AV_WB16(interleave_header + 2, packet_len);
193 if (p.revents & POLLIN) {
253 .priv_class = &rtsp_muxer_class,
static void write_packet(OutputFile *of, AVPacket *pkt, OutputStream *ost, int unqueue)
void ff_rtsp_skip_packet(AVFormatContext *s)
Skip a RTP/TCP interleaved packet.
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
int64_t start_time_realtime
Start time of the stream in real world time, in microseconds since the Unix epoch (00:00 1st January ...
int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer)
Return the written size and a pointer to the buffer.
#define LIBAVUTIL_VERSION_INT
int ffurl_write(URLContext *h, const unsigned char *buf, int size)
Write size bytes from buf to the resource accessed by h.
const char * av_default_item_name(void *ptr)
Return the context name.
void ff_network_close(void)
initialized and sending/receiving data
void * av_mallocz(size_t size)
Allocate a memory block with alignment suitable for all memory accesses (including vectors if availab...
int ff_rtsp_connect(AVFormatContext *s)
Connect to the RTSP server and set up the individual media streams.
const char * class_name
The name of the class; usually it is the same name as the context structure type to which the AVClass...
miscellaneous OS support macros and functions.
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
URLContext * rtsp_hd_out
Additional output handle, used when input and output are done separately, eg for HTTP tunneling...
Describe a single stream, as identified by a single m= line block in the SDP content.
#define AV_LOG_VERBOSE
Detailed information.
int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
Generate an SDP for an RTP session.
int ff_rtsp_send_cmd(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr)
Send a command to the RTSP server and wait for the reply.
static int ff_rtsp_averror(enum RTSPStatusCode status_code, int default_averror)
Private data for the RTSP demuxer.
AVOutputFormat ff_rtsp_muxer
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
char * url
input or output URL.
const AVOption ff_rtsp_options[]
int ff_rtsp_tcp_write_packet(AVFormatContext *s, RTSPStream *rtsp_st)
Send buffered packets over TCP.
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
struct RTSPStream ** rtsp_streams
streams in this session
int stream_index
corresponding stream index, if any.
static int rtsp_write_close(AVFormatContext *s)
static int rtsp_write_header(AVFormatContext *s)
unsigned int nb_streams
Number of elements in AVFormatContext.streams.
char control_uri[MAX_URL_SIZE]
some MS RTSP streams contain a URL in the SDP that we need to use for all subsequent RTSP requests...
int nb_rtsp_streams
number of items in the 'rtsp_streams' variable
int ffio_open_dyn_packet_buf(AVIOContext **s, int max_packet_size)
Open a write only packetized memory stream with a maximum packet size of 'max_packet_size'.
#define RTSP_TCP_MAX_PACKET_SIZE
static int write_trailer(AVFormatContext *s1)
static int rtsp_write_record(AVFormatContext *s)
int ffurl_get_file_handle(URLContext *h)
Return the file descriptor associated with this URL.
int64_t av_gettime(void)
Get the current time in microseconds.
int ff_url_join(char *str, int size, const char *proto, const char *authorization, const char *hostname, int port, const char *fmt,...)
enum RTSPLowerTransport lower_transport
the negotiated network layer transport protocol; e.g.
void ff_rtsp_undo_setup(AVFormatContext *s, int send_packets)
Undo the effect of ff_rtsp_make_setup_request, close the transport_priv and rtp_handle fields...
AVIOContext * pb
I/O context.
Describe the class of an AVClass context structure.
size_t av_strlcatf(char *dst, size_t size, const char *fmt,...)
void ff_rtsp_close_streams(AVFormatContext *s)
Close and free all streams within the RTSP (de)muxer.
#define RTP_PT_IS_RTCP(x)
#define flags(name, subs,...)
enum RTSPClientState state
indicator of whether we are currently receiving data from the server.
int ff_rtsp_send_cmd_with_content(AVFormatContext *s, const char *method, const char *url, const char *headers, RTSPMessageHeader *reply, unsigned char **content_ptr, const unsigned char *send_content, int send_content_length)
Send a command to the RTSP server and wait for the reply.
int ff_rtsp_read_reply(AVFormatContext *s, RTSPMessageHeader *reply, unsigned char **content_ptr, int return_on_interleaved_data, const char *method)
Read a RTSP message from the server, or prepare to read data packets if we're reading data interleave...
int ff_rtsp_send_cmd_async(AVFormatContext *s, const char *method, const char *url, const char *headers)
Send a command to the RTSP server without waiting for the reply.
TCP; interleaved in RTSP.
int ff_rtsp_setup_output_streams(AVFormatContext *s, const char *addr)
Announce the stream to the server and set up the RTSPStream child objects for each media stream...
void * priv_data
Format private data.
static void write_header(FFV1Context *f)
static int rtsp_write_packet(AVFormatContext *s, AVPacket *pkt)
unbuffered private I/O API
char control_url[MAX_URL_SIZE]
url for this stream (from SDP)
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later.That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another.Frame references ownership and permissions
static const AVClass rtsp_muxer_class
int interleaved_min
interleave IDs; copies of RTSPTransportField->interleaved_min/max for the selected transport...
This structure stores compressed data.
void ff_rtsp_close_connections(AVFormatContext *s)
Close all connection handles within the RTSP (de)muxer.
#define AV_NOPTS_VALUE
Undefined timestamp value.
void * transport_priv
RTP/RDT parse context if input, RTP AVFormatContext if output.