Browse code

Merge commit 'bf5f46b4cc47b7a4568119f224057d4ff91b6cdd'

* commit 'bf5f46b4cc47b7a4568119f224057d4ff91b6cdd':
APIChanges: add entry for av_read_packet deprecation
mxfdec: fix typo in mxf_read_seek()
avserver: use freopen to redirect stdin/out/err to /dev/null
avserver: remove daemon mode
configure: Check for -Werror parameters on clang
doxygen: remove obsolete options from Doxyfile
configure: Add option to disable all command line programs

Conflicts:
Changelog
configure
doc/APIchanges
doc/ffserver.conf
doc/ffserver.texi
ffserver.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/11/16 21:07:10
Showing 7 changed files
... ...
@@ -23,6 +23,7 @@ version <next>:
23 23
 - field filter ported from libmpcodecs
24 24
 - AVR demuxer
25 25
 - geq filter ported from libmpcodecs
26
+- remove ffserver daemon mode
26 27
 
27 28
 
28 29
 version 1.0:
... ...
@@ -101,6 +101,13 @@ Configuration options:
101 101
   --enable-gray            enable full grayscale support (slower color)
102 102
   --disable-swscale-alpha  disable alpha channel support in swscale
103 103
 
104
+Program options:
105
+  --disable-programs       do not build command line programs
106
+  --disable-ffmpeg         disable ffmpeg build
107
+  --disable-ffplay         disable ffplay build
108
+  --disable-ffprobe        disable ffprobe build
109
+  --disable-ffserver       disable ffserver build
110
+
104 111
 Documentation options:
105 112
   --disable-doc            do not build documentation
106 113
   --disable-htmlpages      do not build HTML documentation pages
... ...
@@ -109,10 +116,6 @@ Documentation options:
109 109
   --disable-txtpages       do not build text documentation pages
110 110
 
111 111
 Component options:
112
-  --disable-ffmpeg         disable ffmpeg build
113
-  --disable-ffplay         disable ffplay build
114
-  --disable-ffprobe        disable ffprobe build
115
-  --disable-ffserver       disable ffserver build
116 112
   --disable-avdevice       disable libavdevice build
117 113
   --disable-avcodec        disable libavcodec build
118 114
   --disable-avformat       disable libavformat build
... ...
@@ -2200,6 +2203,9 @@ for opt do
2200 2200
     ;;
2201 2201
     --enable-debug=*) debuglevel="$optval"
2202 2202
     ;;
2203
+    --disable-programs)
2204
+    disable $PROGRAM_LIST
2205
+    ;;
2203 2206
     --disable-everything)
2204 2207
     map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
2205 2208
     ;;
... ...
@@ -3954,6 +3960,8 @@ elif enabled llvm_gcc; then
3954 3954
 elif enabled clang; then
3955 3955
     check_cflags -mllvm -stack-alignment=16
3956 3956
     check_cflags -Qunused-arguments
3957
+    check_cflags -Werror=implicit-function-declaration
3958
+    check_cflags -Werror=missing-prototypes
3957 3959
 elif enabled armcc; then
3958 3960
     # 2523: use of inline assembler is deprecated
3959 3961
     add_cflags -W${armcc_opt},--diag_suppress=2523
... ...
@@ -291,6 +291,10 @@ API changes, most recent first:
291 291
 2012-01-24 - 0c3577b - lavfi 2.60.100
292 292
   Add avfilter_graph_dump.
293 293
 
294
+2012-03-20 - 3c90cc2 - lavfo 54.2.0
295
+  Deprecate av_read_packet(), use av_read_frame() with
296
+  AVFMT_FLAG_NOPARSE | AVFMT_FLAG_NOFILLIN in AVFormatContext.flags
297
+
294 298
 2012-03-05 - lavc 54.8.0
295 299
   6699d07 Add av_get_exact_bits_per_sample()
296 300
   9524cf7 Add av_get_audio_frame_duration()
... ...
@@ -489,12 +489,6 @@ MAX_INITIALIZER_LINES  = 30
489 489
 
490 490
 SHOW_USED_FILES        = YES
491 491
 
492
-# If the sources in your project are distributed over multiple directories
493
-# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
494
-# in the documentation. The default is NO.
495
-
496
-SHOW_DIRECTORIES       = NO
497
-
498 492
 # Set the SHOW_FILES tag to NO to disable the generation of the Files page.
499 493
 # This will remove the Files entry from the Quick Index and from the
500 494
 # Folder Tree View (if specified). The default is YES.
... ...
@@ -847,12 +841,6 @@ HTML_COLORSTYLE_GAMMA  = 80
847 847
 
848 848
 HTML_TIMESTAMP         = YES
849 849
 
850
-# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
851
-# files or namespaces will be aligned in HTML using tables. If set to
852
-# NO a bullet list will be used.
853
-
854
-HTML_ALIGN_MEMBERS     = YES
855
-
856 850
 # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
857 851
 # documentation will contain sections that can be hidden and shown after the
858 852
 # page has loaded. For this to work a browser that supports
... ...
@@ -1033,11 +1021,6 @@ ENUM_VALUES_PER_LINE   = 4
1033 1033
 
1034 1034
 GENERATE_TREEVIEW      = NO
1035 1035
 
1036
-# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
1037
-# and Class Hierarchy pages using a tree view instead of an ordered list.
1038
-
1039
-USE_INLINE_TREES       = NO
1040
-
1041 1036
 # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
1042 1037
 # used to set the initial width (in pixels) of the frame in which the tree
1043 1038
 # is shown.
... ...
@@ -25,10 +25,6 @@ MaxBandwidth 1000
25 25
 # '-' is the standard output.
26 26
 CustomLog -
27 27
 
28
-# Suppress that if you want to launch ffserver as a daemon.
29
-NoDaemon
30
-
31
-
32 28
 ##################################################################
33 29
 # Definition of the live feeds. Each live feed contains one video
34 30
 # and/or audio sequence coming from an ffmpeg encoder or another
... ...
@@ -28,11 +28,6 @@ several live feeds, streaming from files and time shifting on live feeds
28 28
 (you can seek to positions in the past on each live feed, provided you
29 29
 specify a big enough feed storage in ffserver.conf).
30 30
 
31
-ffserver runs in daemon mode by default; that is, it puts itself in
32
-the background and detaches from its TTY, unless it is launched in
33
-debug mode or a NoDaemon option is specified in the configuration
34
-file.
35
-
36 31
 This documentation covers only the streaming aspects of ffserver /
37 32
 ffmpeg. All questions about parameters for ffmpeg, codec questions,
38 33
 etc. are not covered here. Read @file{ffmpeg.html} for more
... ...
@@ -267,8 +262,7 @@ within the various <Stream> sections. Since ffserver will not launch
267 267
 any ffmpeg instances, you will have to launch them manually.
268 268
 @item -d
269 269
 Enable debug mode. This option increases log verbosity, directs log
270
-messages to stdout and causes ffserver to run in the foreground
271
-rather than as a daemon.
270
+messages to stdout.
272 271
 @end table
273 272
 @c man end
274 273
 
... ...
@@ -29,6 +29,7 @@
29 29
 #endif
30 30
 #include <string.h>
31 31
 #include <stdlib.h>
32
+#include <stdio.h>
32 33
 #include "libavformat/avformat.h"
33 34
 // FIXME those are internal headers, ffserver _really_ shouldn't use them
34 35
 #include "libavformat/ffm.h"
... ...
@@ -306,12 +307,10 @@ static int rtp_new_av_stream(HTTPContext *c,
306 306
                              HTTPContext *rtsp_c);
307 307
 
308 308
 static const char *my_program_name;
309
-static const char *my_program_dir;
310 309
 
311 310
 static const char *config_filename = "/etc/ffserver.conf";
312 311
 
313 312
 static int ffserver_debug;
314
-static int ffserver_daemon;
315 313
 static int no_launch;
316 314
 static int need_to_start_children;
317 315
 
... ...
@@ -522,19 +521,12 @@ static void start_children(FFStream *feed)
522 522
                     close(i);
523 523
 
524 524
                 if (!ffserver_debug) {
525
-                    i = open("/dev/null", O_RDWR);
526
-                    if (i != -1) {
527
-                        dup2(i, 0);
528
-                        dup2(i, 1);
529
-                        dup2(i, 2);
530
-                        close(i);
531
-                    }
532
-                }
533
-
534
-                /* This is needed to make relative pathnames work */
535
-                if (chdir(my_program_dir) < 0) {
536
-                    http_log("chdir failed\n");
537
-                    exit(1);
525
+                    if (!freopen("/dev/null", "r", stdin))
526
+                        http_log("failed to redirect STDIN to /dev/null\n;");
527
+                    if (!freopen("/dev/null", "w", stdout))
528
+                        http_log("failed to redirect STDOUT to /dev/null\n;");
529
+                    if (!freopen("/dev/null", "w", stderr))
530
+                        http_log("failed to redirect STDERR to /dev/null\n;");
538 531
                 }
539 532
 
540 533
                 signal(SIGPIPE, SIG_DFL);
... ...
@@ -4122,8 +4114,6 @@ static int parse_ffconfig(const char *filename)
4122 4122
             if (resolve_host(&my_http_addr.sin_addr, arg) != 0) {
4123 4123
                 ERROR("%s:%d: Invalid host/IP address: %s\n", arg);
4124 4124
             }
4125
-        } else if (!av_strcasecmp(cmd, "NoDaemon")) {
4126
-            ffserver_daemon = 0;
4127 4125
         } else if (!av_strcasecmp(cmd, "RTSPPort")) {
4128 4126
             get_arg(arg, sizeof(arg), &p);
4129 4127
             val = atoi(arg);
... ...
@@ -4694,7 +4684,6 @@ static void handle_child_exit(int sig)
4694 4694
 static void opt_debug(void)
4695 4695
 {
4696 4696
     ffserver_debug = 1;
4697
-    ffserver_daemon = 0;
4698 4697
     logfilename[0] = '-';
4699 4698
 }
4700 4699
 
... ...
@@ -4725,8 +4714,6 @@ int main(int argc, char **argv)
4725 4725
     show_banner(argc, argv, options);
4726 4726
 
4727 4727
     my_program_name = argv[0];
4728
-    my_program_dir = getcwd(0, 0);
4729
-    ffserver_daemon = 1;
4730 4728
 
4731 4729
     parse_options(NULL, argc, argv, options, NULL);
4732 4730
 
... ...
@@ -4758,37 +4745,9 @@ int main(int argc, char **argv)
4758 4758
 
4759 4759
     compute_bandwidth();
4760 4760
 
4761
-    /* put the process in background and detach it from its TTY */
4762
-    if (ffserver_daemon) {
4763
-        int pid;
4764
-
4765
-        pid = fork();
4766
-        if (pid < 0) {
4767
-            perror("fork");
4768
-            exit(1);
4769
-        } else if (pid > 0) {
4770
-            /* parent : exit */
4771
-            exit(0);
4772
-        } else {
4773
-            /* child */
4774
-            setsid();
4775
-            close(0);
4776
-            open("/dev/null", O_RDWR);
4777
-            if (strcmp(logfilename, "-") != 0) {
4778
-                close(1);
4779
-                dup(0);
4780
-            }
4781
-            close(2);
4782
-            dup(0);
4783
-        }
4784
-    }
4785
-
4786 4761
     /* signal init */
4787 4762
     signal(SIGPIPE, SIG_IGN);
4788 4763
 
4789
-    if (ffserver_daemon)
4790
-        chdir("/");
4791
-
4792 4764
     if (http_server() < 0) {
4793 4765
         http_log("Could not start server\n");
4794 4766
         exit(1);