Small code fixes

This commit is contained in:
Kfir Itzhak 2011-06-14 20:38:18 +03:00
parent eab09844de
commit 11029d57b6
4 changed files with 1463 additions and 1460 deletions

View File

@ -1,5 +1,5 @@
//
// ZoneMinder Event Class Implementation, $Date$, $Revision$
// ZoneMinder Event Class Implementation, $Date: 2010-11-11 12:22:35 +0000 (Thu, 11 Nov 2010) $, $Revision: 3189 $
// Copyright (C) 2001-2008 Philip Coombes
//
// This program is free software; you can redistribute it and/or
@ -28,8 +28,6 @@
#include <arpa/inet.h>
#include <glob.h>
#include <sys/sendfile.h>
#include "zm.h"
#include "zm_db.h"
#include "zm_time.h"
@ -40,6 +38,10 @@
#include "zmf.h"
#if HAVE_SYS_SENDFILE_H
#include <sys/sendfile.h>
#endif
//#define USE_PREPARED_SQL 1
bool Event::initialised = false;
@ -1446,4 +1448,3 @@ void EventStream::runStream()
closeComms();
}

View File

@ -51,7 +51,7 @@ static delta_fptr_t fptr_delta8_abgr;
static delta_fptr_t fptr_delta8_gray8;
/* Pointer to image buffer memory copy function */
static imgbufcpy_fptr_t fptr_imgbufcpy;
imgbufcpy_fptr_t fptr_imgbufcpy;
Image::Image()
{

View File

@ -44,6 +44,13 @@ extern "C"
#define ZM_BUFTYPE_AVMALLOC 3
#define ZM_BUFTYPE_ZM 4
typedef void (*blend_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long, double);
typedef void (*delta_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long);
typedef void (*convert_fptr_t)(const uint8_t*, uint8_t*, unsigned long);
typedef void* (*imgbufcpy_fptr_t)(void*, const void*, size_t);
extern imgbufcpy_fptr_t fptr_imgbufcpy;
/* Should be called from Image class functions */
inline static uint8_t* AllocBuffer(size_t p_bufsize) {
@ -68,6 +75,7 @@ inline static void DumpBuffer(uint8_t* buffer, int buffertype) {
}
}
//
// This is image class, and represents a frame captured from a
// camera in raw form.
@ -181,13 +189,13 @@ public:
{
if ( image.size != size )
{
Panic( "Attempt to copy different size image buffers, expected %d, got %d", size, image.size );
Panic( "Attempt to copy different size image buffers, expected %d, got %d", size, image.size );
}
sse2_aligned_memcpy( buffer, image.buffer, size );
(*fptr_imgbufcpy)(buffer, image.buffer, size);
}
inline Image &operator=( const unsigned char *new_buffer )
{
sse2_aligned_memcpy( buffer, new_buffer, size );
(*fptr_imgbufcpy)(buffer, new_buffer, size);
return( *this );
}
@ -238,12 +246,6 @@ public:
#endif // ZM_IMAGE_H
typedef void (*blend_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long, double);
typedef void (*delta_fptr_t)(const uint8_t*, const uint8_t*, uint8_t*, unsigned long);
typedef void (*convert_fptr_t)(const uint8_t*, uint8_t*, unsigned long);
typedef void* (*imgbufcpy_fptr_t)(void*, const void*, size_t);
/* Blend functions */
void sse2_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent);
void std_fastblend(const uint8_t* col1, const uint8_t* col2, uint8_t* result, unsigned long count, double blendpercent);

View File

@ -1901,8 +1901,8 @@ int LocalCamera::Capture( Image &image )
Debug( 3, "Captured %d for channel %d", capture_frame, channel );
buffer = v4l1_data.bufptr+v4l1_data.frames.offsets[capture_frame];
#endif // ZM_HAS_V4L1
}
#endif // ZM_HAS_V4L1
} /* prime capture */
if(conversion_type != 0) {