From e30fc4ac2c9b6cafd252566de1d401db70de2719 Mon Sep 17 00:00:00 2001 From: stan Date: Fri, 5 Mar 2004 10:40:45 +0000 Subject: [PATCH] Changed bit_rate to bitrate git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@927 e3e1d417-86f3-4887-817a-d78f3d33393f --- src/zm_event.cpp | 4 ++-- src/zm_event.h | 2 +- src/zm_monitor.cpp | 4 ++-- src/zm_monitor.h | 2 +- src/zm_mpeg.cpp | 8 ++++---- src/zm_mpeg.h | 4 ++-- src/zms.cpp | 10 +++++----- web/zm_html_view_event.php | 2 +- web/zm_html_view_montagefeed.php | 2 +- web/zm_html_view_watchfeed.php | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/zm_event.cpp b/src/zm_event.cpp index 6818c2a69..1064046ee 100644 --- a/src/zm_event.cpp +++ b/src/zm_event.cpp @@ -482,7 +482,7 @@ void Event::StreamEvent( int event_id, int rate, int scale ) #if HAVE_LIBAVCODEC -void Event::StreamMpeg( int event_id, const char *format, int bit_rate, int rate, int scale ) +void Event::StreamMpeg( int event_id, const char *format, int bitrate, int rate, int scale ) { static char sql[BUFSIZ]; static char eventpath[PATH_MAX]; @@ -551,7 +551,7 @@ void Event::StreamMpeg( int event_id, const char *format, int bit_rate, int rate if ( !vid_stream ) { - vid_stream = new VideoStream( "pipe:", format, bit_rate, fps, image.Colours(), (image.Width()*scale)/ZM_SCALE_SCALE, (image.Height()*scale)/ZM_SCALE_SCALE ); + vid_stream = new VideoStream( "pipe:", format, bitrate, fps, image.Colours(), (image.Width()*scale)/ZM_SCALE_SCALE, (image.Height()*scale)/ZM_SCALE_SCALE ); } if ( scale != 100 ) diff --git a/src/zm_event.h b/src/zm_event.h index ce1710f36..20895b71f 100644 --- a/src/zm_event.h +++ b/src/zm_event.h @@ -93,7 +93,7 @@ public: static void StreamEvent( int event_id, int rate=100, int scale=100 ); #if HAVE_LIBAVCODEC - static void StreamMpeg( int event_id, const char *format, int bit_rate=100000, int rate=100, int scale=100 ); + static void StreamMpeg( int event_id, const char *format, int bitrate=100000, int rate=100, int scale=100 ); #endif // HAVE_LIBAVCODEC }; diff --git a/src/zm_monitor.cpp b/src/zm_monitor.cpp index 6dff654dd..ac65f1391 100644 --- a/src/zm_monitor.cpp +++ b/src/zm_monitor.cpp @@ -1137,7 +1137,7 @@ void Monitor::StreamImages( unsigned long idle, unsigned long refresh, time_t tt #if HAVE_LIBAVCODEC -void Monitor::StreamMpeg( const char *format, int bit_rate, int scale, int buffer ) +void Monitor::StreamMpeg( const char *format, int bitrate, int scale, int buffer ) { fprintf( stdout, "Content-type: video/x-ms-asf\r\n\r\n"); @@ -1145,7 +1145,7 @@ void Monitor::StreamMpeg( const char *format, int bit_rate, int scale, int buffe if ( !fps ) fps = 5; - VideoStream vid_stream( "pipe:", format, bit_rate, fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE ); + VideoStream vid_stream( "pipe:", format, bitrate, fps, camera->Colours(), (width*scale)/ZM_SCALE_SCALE, (height*scale)/ZM_SCALE_SCALE ); int last_read_index = image_buffer_count; diff --git a/src/zm_monitor.h b/src/zm_monitor.h index b38be3f1f..50222f2d9 100644 --- a/src/zm_monitor.h +++ b/src/zm_monitor.h @@ -289,7 +289,7 @@ public: static Monitor *Load( int id, bool load_zones=false, Purpose purpose=QUERY ); void StreamImages( unsigned long idle=5000, unsigned long refresh=50, time_t ttl=0, int scale=100 ); #if HAVE_LIBAVCODEC - void StreamMpeg( const char *format, int bit_rate=100000, int scale=100, int buffer=0 ); + void StreamMpeg( const char *format, int bitrate=100000, int scale=100, int buffer=0 ); #endif // HAVE_LIBAVCODEC }; diff --git a/src/zm_mpeg.cpp b/src/zm_mpeg.cpp index bca81b67b..c7ab46055 100644 --- a/src/zm_mpeg.cpp +++ b/src/zm_mpeg.cpp @@ -59,7 +59,7 @@ void VideoStream::SetupFormat( const char *p_filename, const char *format ) snprintf(ofc->filename, sizeof(ofc->filename), "%s", filename); } -void VideoStream::SetupCodec( int colours, int width, int height, int bit_rate, int frame_rate ) +void VideoStream::SetupCodec( int colours, int width, int height, int bitrate, int frame_rate ) { pf = (colours==1?PIX_FMT_GRAY8:PIX_FMT_RGB24); @@ -79,7 +79,7 @@ void VideoStream::SetupCodec( int colours, int width, int height, int bit_rate, c->codec_type = CODEC_TYPE_VIDEO; /* put sample parameters */ - c->bit_rate = bit_rate; + c->bit_rate = bitrate; /* resolution must be a multiple of two */ c->width = width; c->height = height; @@ -190,7 +190,7 @@ void VideoStream::OpenStream() av_write_header(ofc); } -VideoStream::VideoStream( const char *filename, const char *format, int bit_rate, int frame_rate, int colours, int width, int height ) +VideoStream::VideoStream( const char *filename, const char *format, int bitrate, int frame_rate, int colours, int width, int height ) { if ( !initialised ) { @@ -198,7 +198,7 @@ VideoStream::VideoStream( const char *filename, const char *format, int bit_rate } SetupFormat( filename, format ); - SetupCodec( colours, width, height, bit_rate, frame_rate ); + SetupCodec( colours, width, height, bitrate, frame_rate ); SetParameters(); OpenStream(); } diff --git a/src/zm_mpeg.h b/src/zm_mpeg.h index 64e07153e..15d333ef6 100644 --- a/src/zm_mpeg.h +++ b/src/zm_mpeg.h @@ -47,12 +47,12 @@ protected: static void Initialise(); void SetupFormat( const char *p_filename, const char *format ); - void SetupCodec( int colours, int width, int height, int bit_rate, int frame_rate ); + void SetupCodec( int colours, int width, int height, int bitrate, int frame_rate ); void SetParameters(); void OpenStream(); public: - VideoStream( const char *filename, const char *format, int bit_rate, int frame_rate, int colours, int width, int height ); + VideoStream( const char *filename, const char *format, int bitrate, int frame_rate, int colours, int width, int height ); ~VideoStream(); double EncodeFrame( uint8_t *buffer, int buffer_size ); }; diff --git a/src/zms.cpp b/src/zms.cpp index 0533bb928..f1dece10b 100644 --- a/src/zms.cpp +++ b/src/zms.cpp @@ -27,7 +27,7 @@ int main(void ) char format[32] = ""; int id = 1; int event = 0; - unsigned int bit_rate = 100000; + unsigned int bitrate = 100000; unsigned int rate = 100; unsigned int scale = 100; unsigned int buffer = 0; @@ -63,8 +63,8 @@ int main(void ) event = strtoull( value, (char **)NULL, 10 ); else if ( !strcmp( name, "format" ) ) strncpy( format, value, sizeof(format) ); - else if ( !strcmp( name, "bit_rate" ) ) - bit_rate = atoi( value ); + else if ( !strcmp( name, "bitrate" ) ) + bitrate = atoi( value ); else if ( !strcmp( name, "rate" ) ) rate = atoi( value ); else if ( !strcmp( name, "scale" ) ) @@ -112,7 +112,7 @@ int main(void ) else { #if HAVE_LIBAVCODEC - monitor->StreamMpeg( format, bit_rate, scale, buffer ); + monitor->StreamMpeg( format, bitrate, scale, buffer ); #else // HAVE_LIBAVCODEC Error(( "MPEG streaming of '%s' attempted while disabled", query )); fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" ); @@ -130,7 +130,7 @@ int main(void ) else { #if HAVE_LIBAVCODEC - Event::StreamMpeg( event, format, bit_rate, rate, scale ); + Event::StreamMpeg( event, format, bitrate, rate, scale ); #else // HAVE_LIBAVCODEC Error(( "MPEG streaming of '%s' attempted while disabled", query )); fprintf( stderr, "MPEG streaming is disabled.\nYou should configure with the --with-ffmpeg option and rebuild to use this functionality.\n" ); diff --git a/web/zm_html_view_event.php b/web/zm_html_view_event.php index 04c7560ae..80edb1461 100644 --- a/web/zm_html_view_event.php +++ b/web/zm_html_view_event.php @@ -247,7 +247,7 @@ if ( $mode == "stream" )