*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#define HAVE_AV_CONFIG_H
#include "avformat.h"
#include <dlfcn.h>
#endif
+#include "version.h"
#include "ffserver.h"
/* maximum number of simultaneous HTTP connections */
struct sockaddr_in my_http_addr;
struct sockaddr_in my_rtsp_addr;
-char logfilename[1024];
-HTTPContext *first_http_ctx;
-FFStream *first_feed; /* contains only feeds */
-FFStream *first_stream; /* contains all streams, including feeds */
+static char logfilename[1024];
+static HTTPContext *first_http_ctx;
+static FFStream *first_feed; /* contains only feeds */
+static FFStream *first_stream; /* contains all streams, including feeds */
static void new_connection(int server_fd, int is_rtsp);
static void close_connection(HTTPContext *c);
static int no_launch;
static int need_to_start_children;
-int nb_max_connections;
-int nb_connections;
+static int nb_max_connections;
+static int nb_connections;
-int max_bandwidth;
-int current_bandwidth;
+static int max_bandwidth;
+static int current_bandwidth;
static long cur_time; // Making this global saves on passing it around everywhere
return ((count - drd->count1) * 1000) / (cur_time - drd->time1);
}
-static int get_longterm_datarate(DataRateData *drd, int64_t count)
-{
- /* You get the first 3 seconds flat out */
- if (cur_time - drd->time1 < 3000)
- return 0;
- return compute_datarate(drd, count);
-}
-
static void start_children(FFStream *feed)
{
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "Content-type: text/html\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "\r\n");
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<html><head><title>Too busy</title></head><body>\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "The server is too busy to serve your request at this time.<p>\r\n");
- q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "The bandwidth being served (including your stream) is %dkbit/sec, and this exceeds the limit of %dkbit/sec\r\n",
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<p>The server is too busy to serve your request at this time.</p>\r\n");
+ q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "<p>The bandwidth being served (including your stream) is %dkbit/sec, and this exceeds the limit of %dkbit/sec.</p>\r\n",
current_bandwidth, max_bandwidth);
q += snprintf(q, q - (char *) c->buffer + c->buffer_size, "</body></html>\r\n");
strcpy(eosf - 4, ".asx");
} else if (strcmp(eosf - 3, ".rm") == 0) {
strcpy(eosf - 3, ".ram");
- } else if (stream->fmt == &rtp_mux) {
+ } else if (stream->fmt == &rtp_muxer) {
/* generate a sample RTSP director if
unicast. Generate an SDP redirector if
multicast */
path++;
for(stream = first_stream; stream != NULL; stream = stream->next) {
- if (!stream->is_feed && stream->fmt == &rtp_mux &&
+ if (!stream->is_feed && stream->fmt == &rtp_muxer &&
!strcmp(path, stream->filename)) {
goto found;
}
/* now check each stream */
for(stream = first_stream; stream != NULL; stream = stream->next) {
- if (!stream->is_feed && stream->fmt == &rtp_mux) {
+ if (!stream->is_feed && stream->fmt == &rtp_muxer) {
/* accept aggregate filenames only if single stream */
if (!strcmp(path, stream->filename)) {
if (stream->nb_streams != 1) {
ctx = av_alloc_format_context();
if (!ctx)
return -1;
- ctx->oformat = &rtp_mux;
+ ctx->oformat = &rtp_muxer;
st = av_mallocz(sizeof(AVStream));
if (!st)
/* try to open the file */
/* open stream */
stream->ap_in = av_mallocz(sizeof(AVFormatParameters));
- if (stream->fmt == &rtp_mux) {
+ if (stream->fmt == &rtp_muxer) {
/* specific case : if transport stream output to RTP,
we use a raw transport stream reader */
stream->ap_in->mpeg2ts_raw = 1;
/* simplistic plugin support */
#ifdef CONFIG_HAVE_DLOPEN
-void load_module(const char *filename)
+static void load_module(const char *filename)
{
void *dll;
void (*init_func)(void);
video_enc.mb_decision = FF_MB_DECISION_BITS; //FIXME remove
video_enc.flags |= CODEC_FLAG_4MV;
}
+ } else if (!strcasecmp(cmd, "BitExact")) {
+ if (stream) {
+ video_enc.flags |= CODEC_FLAG_BITEXACT;
+ }
+ } else if (!strcasecmp(cmd, "DctFastint")) {
+ if (stream) {
+ video_enc.dct_algo = FF_DCT_FASTINT;
+ }
+ } else if (!strcasecmp(cmd, "IdctSimple")) {
+ if (stream) {
+ video_enc.idct_algo = FF_IDCT_SIMPLE;
+ }
+ } else if (!strcasecmp(cmd, "Qscale")) {
+ get_arg(arg, sizeof(arg), &p);
+ if (stream) {
+ video_enc.flags |= CODEC_FLAG_QSCALE;
+ video_enc.global_quality = FF_QP2LAMBDA * atoi(arg);
+ }
} else if (!strcasecmp(cmd, "VideoQDiff")) {
get_arg(arg, sizeof(arg), &p);
if (stream) {
"\n"
"You should have received a copy of the GNU Lesser General Public\n"
"License along with this library; if not, write to the Free Software\n"
- "Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
+ "Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA\n"
);
}