#include "libavformat/rtpdec.h"
#include "libavformat/rtpproto.h"
#include "libavformat/rtsp.h"
+#include "libavformat/rtspcodes.h"
#include "libavformat/avio_internal.h"
#include "libavformat/internal.h"
#include "libavformat/url.h"
IPAddressACL *acl;
char dynamic_acl[1024];
int nb_streams;
- int prebuffer; /* Number of millseconds early to start */
+ int prebuffer; /* Number of milliseconds early to start */
int64_t max_time; /* Number of milliseconds to run */
int send_on_key;
AVStream *streams[MAX_STREAMS];
get_arg(arg, sizeof(arg), &p);
if (resolve_host(&acl.first, arg) != 0) {
- fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
+ fprintf(stderr, "%s:%d: ACL refers to invalid host or IP address '%s'\n",
filename, line_num, arg);
errors++;
} else
if (arg[0]) {
if (resolve_host(&acl.last, arg) != 0) {
- fprintf(stderr, "%s:%d: ACL refers to invalid host or ip address '%s'\n",
+ fprintf(stderr, "%s:%d: ACL refers to invalid host or IP address '%s'\n",
filename, line_num, arg);
errors++;
}
*p = '\0';
snprintf(q, c->buffer_size,
"HTTP/1.0 200 RTSP Redirect follows\r\n"
- /* XXX: incorrect mime type ? */
+ /* XXX: incorrect MIME type ? */
"Content-type: application/x-rtsp\r\n"
"\r\n"
"rtsp://%s:%d/%s\r\n", hostname, ntohs(my_rtsp_addr.sin_port), filename);
/* if post, it means a feed is being sent */
if (!stream->is_feed) {
/* However it might be a status report from WMP! Let us log the
- * data as it might come in handy one day. */
+ * data as it might come handy one day. */
const char *logline = 0;
int client_id = 0;
c->fmt_ctx.pb->seekable = 0;
/*
- * HACK to avoid mpeg ps muxer to spit many underflow errors
+ * HACK to avoid MPEG-PS muxer to spit many underflow errors
* Default value from FFmpeg
* Try to set it using configuration option
*/
struct tm *tm;
char buf2[32];
- switch(error_number) {
- case RTSP_STATUS_OK:
- str = "OK";
- break;
- case RTSP_STATUS_METHOD:
- str = "Method Not Allowed";
- break;
- case RTSP_STATUS_BANDWIDTH:
- str = "Not Enough Bandwidth";
- break;
- case RTSP_STATUS_SESSION:
- str = "Session Not Found";
- break;
- case RTSP_STATUS_STATE:
- str = "Method Not Valid in This State";
- break;
- case RTSP_STATUS_AGGREGATE:
- str = "Aggregate operation not allowed";
- break;
- case RTSP_STATUS_ONLY_AGGREGATE:
- str = "Only aggregate operation allowed";
- break;
- case RTSP_STATUS_TRANSPORT:
- str = "Unsupported transport";
- break;
- case RTSP_STATUS_INTERNAL:
- str = "Internal Server Error";
- break;
- case RTSP_STATUS_SERVICE:
- str = "Service Unavailable";
- break;
- case RTSP_STATUS_VERSION:
- str = "RTSP Version not supported";
- break;
- default:
+ str = RTSP_STATUS_CODE2STRING(error_number);
+ if (!str)
str = "Unknown Error";
- break;
- }
avio_printf(c->pb, "RTSP/1.0 %d %s\r\n", error_number, str);
avio_printf(c->pb, "CSeq: %d\r\n", c->seq);
socklen_t len;
struct sockaddr_in my_addr;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
return;
found:
- /* prepare the media description in sdp format */
+ /* prepare the media description in SDP format */
/* get the host IP */
len = sizeof(my_addr);
struct sockaddr_in dest_addr;
RTSPActionServerSetup setup;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
random0, random1);
}
- /* find rtp session, and create it if none found */
+ /* find RTP session, and create it if none found */
rtp_c = find_rtp_session(h->session_id);
if (!rtp_c) {
/* always prefer UDP */
}
-/* find an rtp connection by using the session ID. Check consistency
+/* find an RTP connection by using the session ID. Check consistency
with filename */
static HTTPContext *find_rtp_session_with_url(const char *url,
const char *session_id)
if (!rtp_c)
return NULL;
- /* find which url is asked */
+ /* find which URL is asked */
av_url_split(NULL, 0, NULL, 0, NULL, 0, NULL, path1, sizeof(path1), url);
path = path1;
if (*path == '/')
}
}
-/* specific mpeg4 handling : we extract the raw parameters */
+/* specific MPEG4 handling : we extract the raw parameters */
static void extract_mpeg4_header(AVFormatContext *infile)
{
int mpeg4_count, i, size;
http_log("Container doesn't support the required parameters\n");
exit(1);
}
- /* XXX: need better api */
+ /* XXX: need better API */
av_freep(&s->priv_data);
avio_close(s->pb);
s->streams = NULL;
stream->fmt = NULL;
} else {
stream->stream_type = STREAM_TYPE_LIVE;
- /* jpeg cannot be used here, so use single frame jpeg */
+ /* JPEG cannot be used here, so use single frame MJPEG */
if (!strcmp(arg, "jpeg"))
strcpy(arg, "mjpeg");
stream->fmt = ffserver_guess_format(arg, NULL, NULL);