apps/sctl/sctl.cgi.cpp File Reference

#include <iostream>
#include <string>
#include <map>
#include <list>
#include <fstream>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <syslog.h>
#include <sys/socket.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <net/if.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <linux/if_ether.h>
#include <sched.h>

Include dependency graph for sctl.cgi.cpp:

Go to the source code of this file.

Defines

#define _KILLALL   "/usr/bin/killall"
#define _FPCF   "/usr/local/bin/fpcf"
#define _STR   "/usr/local/bin/str"
#define _CONF_RUN   "/var/state/streamer.conf"
#define _CONF   "/etc/streamer.conf"
#define _STATUS_XML   "/var/state/streamer.xml"
#define HEADER_TEXT   0x00
#define HEADER_XML   0x01
#define STREAMER_ELF   "str"
#define STREAMER_LOCK   "/dev/stream"
#define DEFAULT_PORT   "20000"
#define DEFAULT_ADDR   "232.0.0.1"
#define CMOSCAM_IOCTYPE   124
#define IO_CCAM_JPEG   0x08

Functions

void header (int type)
bool parse_string (const string &str, char delimiter, string &left, string &right)
bool streamer_start (map< string, string >)
bool streamer_stop (void)
void stream_status (void)
bool conf_save (map< string, string >)
void conf_load (ostream &stream)
string get_self_ip (string)
void stream_status_to_file (map< string, string > opts)
int main (int argc, char *argv[])
bool streamer_is_run (void)
bool run_daemon (string prog, list< string > args)
void stop_compressor (void)


Define Documentation

#define _CONF   "/etc/streamer.conf"

Definition at line 31 of file sctl.cgi.cpp.

Referenced by conf_load().

#define _CONF_RUN   "/var/state/streamer.conf"

Definition at line 30 of file sctl.cgi.cpp.

Referenced by conf_save().

#define _FPCF   "/usr/local/bin/fpcf"

Definition at line 28 of file sctl.cgi.cpp.

#define _KILLALL   "/usr/bin/killall"

Definition at line 27 of file sctl.cgi.cpp.

Referenced by streamer_stop().

#define _STATUS_XML   "/var/state/streamer.xml"

Definition at line 32 of file sctl.cgi.cpp.

Referenced by stream_status(), and stream_status_to_file().

#define _STR   "/usr/local/bin/str"

Definition at line 29 of file sctl.cgi.cpp.

Referenced by streamer_start().

#define CMOSCAM_IOCTYPE   124

Definition at line 239 of file sctl.cgi.cpp.

Referenced by grab_and_send(), i2c_ioctl(), main(), send_html_data(), send_quicktime(), send_quicktime_clip(), sendLastFrame(), Video::Start(), and stop_compressor().

#define DEFAULT_ADDR   "232.0.0.1"

Definition at line 41 of file sctl.cgi.cpp.

Referenced by conf_save().

#define DEFAULT_PORT   "20000"

Definition at line 40 of file sctl.cgi.cpp.

Referenced by conf_save().

#define HEADER_TEXT   0x00

Definition at line 34 of file sctl.cgi.cpp.

Referenced by header(), and main().

#define HEADER_XML   0x01

Definition at line 35 of file sctl.cgi.cpp.

Referenced by header(), and main().

#define IO_CCAM_JPEG   0x08

Definition at line 240 of file sctl.cgi.cpp.

Referenced by ccam_DMA_ioctl(), grab_and_send(), main(), send_quicktime(), send_quicktime_clip(), Video::Start(), and stop_compressor().

#define STREAMER_ELF   "str"

Definition at line 37 of file sctl.cgi.cpp.

#define STREAMER_LOCK   "/dev/stream"

Definition at line 38 of file sctl.cgi.cpp.

Referenced by streamer_is_run().


Function Documentation

void conf_load ( ostream &  stream  ) 

Definition at line 319 of file sctl.cgi.cpp.

References _CONF, and parse_string().

bool conf_save ( map< string, string >   ) 

Definition at line 280 of file sctl.cgi.cpp.

References _CONF_RUN, DEFAULT_ADDR, and DEFAULT_PORT.

Referenced by streamer_start().

string get_self_ip ( string   ) 

Definition at line 399 of file sctl.cgi.cpp.

References fd, and memset().

Referenced by stream_status(), and stream_status_to_file().

void header ( int  type  ) 

Definition at line 43 of file sctl.cgi.cpp.

References HEADER_TEXT, and HEADER_XML.

int main ( int  argc,
char *  argv[] 
)

Definition at line 77 of file sctl.cgi.cpp.

References cmd, header, HEADER_TEXT, HEADER_XML, autoexp_t::left, method, parse_string(), query, stream_status(), stream_status_to_file(), streamer_start(), streamer_stop(), and uri.

bool parse_string ( const string &  str,
char  delimiter,
string &  left,
string &  right 
)

Definition at line 53 of file sctl.cgi.cpp.

Referenced by conf_load(), and main().

bool run_daemon ( string  prog,
list< string >  args 
)

Definition at line 141 of file sctl.cgi.cpp.

References malloc(), stderr, stdout, and streamer_is_run().

Referenced by streamer_start(), and streamer_stop().

void stop_compressor ( void   ) 

Definition at line 241 of file sctl.cgi.cpp.

References CMOSCAM_IOCTYPE, and IO_CCAM_JPEG.

Referenced by streamer_stop().

void stream_status ( void   ) 

Definition at line 370 of file sctl.cgi.cpp.

References _STATUS_XML, get_self_ip(), and streamer_is_run().

Referenced by main().

void stream_status_to_file ( map< string, string >  opts  ) 

Definition at line 343 of file sctl.cgi.cpp.

References _STATUS_XML, and get_self_ip().

Referenced by main().

bool streamer_is_run ( void   ) 

Definition at line 133 of file sctl.cgi.cpp.

References fd, and STREAMER_LOCK.

Referenced by run_daemon(), stream_status(), streamer_start(), and streamer_stop().

bool streamer_start ( map< string, string >   ) 

Definition at line 186 of file sctl.cgi.cpp.

References _STR, conf_save(), run_daemon(), and streamer_is_run().

Referenced by main().

bool streamer_stop ( void   ) 

Definition at line 247 of file sctl.cgi.cpp.

References _KILLALL, run_daemon(), stop_compressor(), and streamer_is_run().

Referenced by main().


Generated on Thu Aug 7 16:19:51 2008 for elphel by  doxygen 1.5.1