~ubuntu-branches/ubuntu/natty/zoneminder/natty

« back to all changes in this revision

Viewing changes to src/zms.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Peter Howard
  • Date: 2009-09-11 07:02:50 UTC
  • mfrom: (1.2.2 upstream)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20090911070250-k6rtdg43xi46nix4
Tags: 1.24.2-1
Initial release of zoneminder 1.24.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// ZoneMinder Streaming Server, $Date: 2008-10-29 23:08:21 +0000 (Wed, 29 Oct 2008) $, $Revision: 2679 $
 
2
// ZoneMinder Streaming Server, $Date: 2009-05-25 19:03:46 +0100 (Mon, 25 May 2009) $, $Revision: 2890 $
3
3
// Copyright (C) 2001-2008 Philip Coombes
4
4
// 
5
5
// This program is free software; you can redistribute it and/or
52
52
 
53
53
int main( int argc, const char *argv[] )
54
54
{
 
55
    srand( getpid() * time( 0 ) );
 
56
 
55
57
        enum { ZMS_MONITOR, ZMS_EVENT } source = ZMS_MONITOR;
56
58
        enum { ZMS_JPEG, ZMS_MPEG, ZMS_RAW, ZMS_ZIP, ZMS_SINGLE } mode = ZMS_JPEG;
57
59
        char format[32] = "";
61
63
        int frame_id = 1;
62
64
        unsigned int scale = 100;
63
65
        unsigned int rate = 100;
64
 
        unsigned int maxfps = 10;
 
66
        double maxfps = 10.0;
65
67
        unsigned int bitrate = 100000;
66
68
        unsigned int ttl = 0;
67
69
    EventStream::StreamMode replay = EventStream::MODE_SINGLE;
73
75
 
74
76
        bool nph = false;
75
77
        const char *basename = strrchr( argv[0], '/' );
 
78
        if (basename) //if we found a / lets skip past it
 
79
                basename++;
 
80
        else //argv[0] will not always contain the full path, but rather just the script name
 
81
                basename = argv[0];
76
82
        const char *nph_prefix = "nph-";
77
 
        if ( basename && !strncmp( basename+1, nph_prefix, strlen(nph_prefix) ) )
 
83
        if ( basename && !strncmp( basename, nph_prefix, strlen(nph_prefix) ) )
78
84
        {
79
85
                nph = true;
80
86
        }
134
140
                        else if ( !strcmp( name, "rate" ) )
135
141
                                rate = atoi( value );
136
142
                        else if ( !strcmp( name, "maxfps" ) )
137
 
                                maxfps = atoi( value );
 
143
                                maxfps = atof( value );
138
144
                        else if ( !strcmp( name, "bitrate" ) )
139
145
                                bitrate = atoi( value );
140
146
                        else if ( !strcmp( name, "ttl" ) )