FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ffserver_config.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 #ifndef FFSERVER_CONFIG_H
22 #define FFSERVER_CONFIG_H
23 
24 #include "libavutil/dict.h"
25 #include "libavformat/avformat.h"
26 #include "libavformat/network.h"
27 
28 #define FFSERVER_MAX_STREAMS 20
29 
30 /* each generated stream is described here */
35 };
36 
38  IP_ALLOW = 1,
40 };
41 
42 typedef struct FFServerIPAddressACL {
45  /* These are in host order */
46  struct in_addr first;
47  struct in_addr last;
49 
50 /* description of each stream of the ffserver.conf file */
51 typedef struct FFServerStream {
53  char filename[1024]; /* stream filename */
54  struct FFServerStream *feed; /* feed we are using (can be null if coming from file) */
55  AVDictionary *in_opts; /* input parameters */
56  AVDictionary *metadata; /* metadata to set on the stream */
57  AVInputFormat *ifmt; /* if non NULL, force input format */
60  char dynamic_acl[1024];
62  int prebuffer; /* Number of milliseconds early to start */
63  int64_t max_time; /* Number of milliseconds to run */
66  int feed_streams[FFSERVER_MAX_STREAMS]; /* index of streams in the feed */
67  char feed_filename[1024]; /* file name of the feed storage, or
68  input file name for a stream */
69  pid_t pid; /* Of ffmpeg process */
70  time_t pid_start; /* Of ffmpeg process */
71  char **child_argv;
73  unsigned bandwidth; /* bandwidth, in kbits/s */
74  /* RTSP options */
75  char *rtsp_option;
76  /* multicast specific */
78  struct in_addr multicast_ip;
79  int multicast_port; /* first port used for multicast */
81  int loop; /* if true, send the stream in loops (only meaningful if file) */
82  char single_frame; /* only single frame */
83 
84  /* feed specific */
85  int feed_opened; /* true if someone is writing to the feed */
86  int is_feed; /* true if it is a feed */
87  int readonly; /* True if writing is prohibited to the file */
88  int truncate; /* True if feeder connection truncate the feed file */
90  int64_t bytes_served;
91  int64_t feed_max_size; /* maximum storage size, zero means unlimited */
92  int64_t feed_write_index; /* current write position in feed (it wraps around) */
93  int64_t feed_size; /* current size of feed */
96 
97 typedef struct FFServerConfig {
98  char *filename;
99  FFServerStream *first_feed; /* contains only feeds */
100  FFServerStream *first_stream; /* contains all streams, including feeds */
102  unsigned int nb_max_connections;
103  uint64_t max_bandwidth;
104  int debug;
105  char logfilename[1024];
106  struct sockaddr_in http_addr;
107  struct sockaddr_in rtsp_addr;
108  int errors;
109  int warnings;
111  // Following variables MUST NOT be used outside configuration parsing code.
114  AVDictionary *video_opts; /* AVOptions for video encoder */
115  AVDictionary *audio_opts; /* AVOptions for audio encoder */
116  AVCodecContext *dummy_actx; /* Used internally to test audio AVOptions. */
117  AVCodecContext *dummy_vctx; /* Used internally to test video AVOptions. */
118  int no_audio;
119  int no_video;
120  int line_num;
123 
124 void ffserver_get_arg(char *buf, int buf_size, const char **pp);
125 
127  FFServerIPAddressACL *ext_acl,
128  const char *p, const char *filename, int line_num);
129 
130 int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config);
131 
132 void ffserver_free_child_args(void *argsp);
133 
134 #endif /* FFSERVER_CONFIG_H */
struct in_addr last
struct sockaddr_in http_addr
FFServerIPAddressACL * acl
FFServerStreamType
unsigned int nb_max_connections
static FFServerConfig config
Definition: ffserver.c:202
FFServerIPAddressAction
AVInputFormat * ifmt
int64_t bytes_served
AVCodecContext * dummy_vctx
AVCodecContext * dummy_actx
struct FFServerStream * next
Public dictionary API.
AVOutputFormat * fmt
enum AVCodecID guessed_video_codec_id
uint64_t max_bandwidth
enum AVCodecID guessed_audio_codec_id
char logfilename[1024]
int feed_streams[FFSERVER_MAX_STREAMS]
AVDictionary * metadata
AVStream * streams[FFSERVER_MAX_STREAMS]
void ffserver_free_child_args(void *argsp)
int64_t feed_max_size
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:191
#define FFSERVER_MAX_STREAMS
enum FFServerStreamType stream_type
char dynamic_acl[1024]
char feed_filename[1024]
struct FFServerStream * next_feed
struct FFServerIPAddressACL * next
AVDictionary * video_opts
int64_t feed_write_index
void ffserver_get_arg(char *buf, int buf_size, const char **pp)
Stream structure.
Definition: avformat.h:889
char filename[1024]
main external API structure.
Definition: avcodec.h:1676
AVDictionary * audio_opts
struct sockaddr_in rtsp_addr
void * buf
Definition: avisynth_c.h:690
unsigned bandwidth
FFServerStream * first_feed
AVDictionary * in_opts
struct FFServerStream * feed
Main libavformat public API header.
struct in_addr multicast_ip
FFServerStream * first_stream
void ffserver_parse_acl_row(FFServerStream *stream, FFServerStream *feed, FFServerIPAddressACL *ext_acl, const char *p, const char *filename, int line_num)
unsigned int nb_max_http_connections
int ffserver_parse_ffconfig(const char *filename, FFServerConfig *config)
struct in_addr first
enum FFServerIPAddressAction action