Skip to content

Commit

Permalink
Corrections on cpp and h files
Browse files Browse the repository at this point in the history
  • Loading branch information
criadoperez committed Aug 12, 2023
1 parent a5d83e6 commit 543683a
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion src/bindings.h
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class tev__Capabilities
/// Attribute "EventBrokerProtocols" of type xs:string.
@ std::string* EventBrokerProtocols 0; ///< Optional attribute.
/// <PRE><BLOCKQUOTE>
/// Maxiumum number of event broker configurations that can be added to the device.
/// Maximum number of event broker configurations that can be added to the device.
/// </BLOCKQUOTE></PRE>
///
/// Attribute "MaxEventBrokers" of type xs:int.
Expand Down
2 changes: 1 addition & 1 deletion src/zm_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ int Buffer::read_into(int sd, unsigned int bytes, Microseconds timeout) {
Error("Error %d %s from select", errno, strerror(errno));
return rv;
} else if (rv == 0) {
Debug(1, "timeout"); /* a timeout occured */
Debug(1, "timeout"); /* a timeout occurred */
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion src/zm_crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ bool verifyPassword(const char *username, const char *input_password, const char

bool password_correct = false;
if ( strlen(db_password_hash) < 4 ) {
// actually, shoud be more, but this is min. for next code
// actually, should be more, but this is min. for next code
Error("DB Password is too short or invalid to check");
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions src/zm_curl_camera.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,10 +534,10 @@ void* cURLCamera::thread_func() {
Error("Failed setting password: %s", (*curl_easy_strerror_f)(cRet));
}

/* Authenication preference */
/* Authentication preference */
cRet = (*curl_easy_setopt_f)(c, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
if (cRet != CURLE_OK)
Warning("Failed setting libcurl acceptable http authenication methods: %s", (*curl_easy_strerror_f)(cRet));
Warning("Failed setting libcurl acceptable http authentication methods: %s", (*curl_easy_strerror_f)(cRet));


/* Work loop */
Expand Down
2 changes: 1 addition & 1 deletion src/zm_event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ void Event::Run() {
if (packet_queue.empty()) {
if (terminate_ or zm_terminate) break;
packet_queue_condition.wait(lck);
// Neccessary because we don't hold the lock in the while condition
// Necessary because we don't hold the lock in the while condition
}
if (!packet_queue.empty()) {
packet = packet_queue.front();
Expand Down
4 changes: 2 additions & 2 deletions src/zm_ffmpeg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ int zm_send_packet_receive_frame(AVCodecContext *context, AVFrame *frame, AVPack
// The codec may need more samples than it has, perfectly valid
Debug(2, "Codec not ready to give us a frame");
} else {
Error("Could not recieve frame (error %d = '%s')", ret,
Error("Could not receive frame (error %d = '%s')", ret,
av_make_error_string(ret).c_str());
}
return ret;
Expand All @@ -422,7 +422,7 @@ int zm_send_frame_receive_packet(AVCodecContext *ctx, AVFrame *frame, AVPacket &
return 0;
} else if (frame) {
// May get EOF if frame is NULL because it signals flushing
Error("Could not recieve packet (error %d = '%s')", ret,
Error("Could not receive packet (error %d = '%s')", ret,
av_make_error_string(ret).c_str());
}
zm_av_packet_unref(&packet);
Expand Down
24 changes: 12 additions & 12 deletions src/zm_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ void Image::Overlay( const Image &image ) {
subpixelorder, image.subpixelorder);
}

/* Grayscale ontop of grayscale - complete */
/* Grayscale on top of grayscale - complete */
if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_GRAY8 ) {
const uint8_t* const max_ptr = buffer+size;
const uint8_t* psrc = image.buffer;
Expand All @@ -1618,7 +1618,7 @@ void Image::Overlay( const Image &image ) {
psrc++;
}

/* RGB24 ontop of grayscale - convert to same format first - complete */
/* RGB24 on top of grayscale - convert to same format first - complete */
} else if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB24 ) {
Colourise(image.colours, image.subpixelorder);

Expand All @@ -1636,7 +1636,7 @@ void Image::Overlay( const Image &image ) {
psrc += 3;
}

/* RGB32 ontop of grayscale - convert to same format first - complete */
/* RGB32 on top of grayscale - convert to same format first - complete */
} else if ( colours == ZM_COLOUR_GRAY8 && image.colours == ZM_COLOUR_RGB32 ) {
Colourise(image.colours, image.subpixelorder);

Expand Down Expand Up @@ -1664,7 +1664,7 @@ void Image::Overlay( const Image &image ) {
}
}

/* Grayscale ontop of RGB24 - complete */
/* Grayscale on top of RGB24 - complete */
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_GRAY8 ) {
const uint8_t* const max_ptr = buffer+size;
const uint8_t* psrc = image.buffer;
Expand All @@ -1678,7 +1678,7 @@ void Image::Overlay( const Image &image ) {
psrc++;
}

/* RGB24 ontop of RGB24 - not complete. need to take care of different subpixel orders */
/* RGB24 on top of RGB24 - not complete. need to take care of different subpixel orders */
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB24 ) {
const uint8_t* const max_ptr = buffer+size;
const uint8_t* psrc = image.buffer;
Expand All @@ -1694,11 +1694,11 @@ void Image::Overlay( const Image &image ) {
psrc += 3;
}

/* RGB32 ontop of RGB24 - TO BE DONE */
/* RGB32 on top of RGB24 - TO BE DONE */
} else if ( colours == ZM_COLOUR_RGB24 && image.colours == ZM_COLOUR_RGB32 ) {
Error("Overlay of RGB32 ontop of RGB24 is not supported.");
Error("Overlay of RGB32 on top of RGB24 is not supported.");

/* Grayscale ontop of RGB32 - complete */
/* Grayscale on top of RGB32 - complete */
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_GRAY8 ) {
const Rgb* const max_ptr = (Rgb*)(buffer+size);
Rgb* prdest = (Rgb*)buffer;
Expand All @@ -1724,11 +1724,11 @@ void Image::Overlay( const Image &image ) {
}
}

/* RGB24 ontop of RGB32 - TO BE DONE */
/* RGB24 on top of RGB32 - TO BE DONE */
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB24 ) {
Error("Overlay of RGB24 ontop of RGB32 is not supported.");
Error("Overlay of RGB24 on top of RGB32 is not supported.");

/* RGB32 ontop of RGB32 - not complete. need to take care of different subpixel orders */
/* RGB32 on top of RGB32 - not complete. need to take care of different subpixel orders */
} else if ( colours == ZM_COLOUR_RGB32 && image.colours == ZM_COLOUR_RGB32 ) {
const Rgb* const max_ptr = (Rgb*)(buffer+size);
Rgb* prdest = (Rgb*)buffer;
Expand Down Expand Up @@ -1940,7 +1940,7 @@ Image *Image::Highlight( unsigned int n_images, Image *images[], const Rgb thres
return result;
}

/* New function to allow buffer re-using instead of allocationg memory for the delta image every time */
/* New function to allow buffer re-using instead of allocating memory for the delta image every time */
void Image::Delta(const Image &image, Image* targetimage) const {
if ( !(width == image.width && height == image.height && colours == image.colours && subpixelorder == image.subpixelorder) ) {
Panic( "Attempt to get delta of different sized images, expected %dx%dx%d %d, got %dx%dx%d %d",
Expand Down
2 changes: 1 addition & 1 deletion src/zm_logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ void Logger::logPrint(bool hex, const char *filepath, int line, int level, const
if (level <= mFileLevel) {
if (!mLogFileFP) {
// FIXME unlocking here is a problem. Another thread could sneak in.
// We are using a recursive mutex so unlocking shouldn't be neccessary
// We are using a recursive mutex so unlocking shouldn't be necessary
//log_mutex.unlock();
// We do this here so that we only create the file if we ever write to it.
openFile();
Expand Down
2 changes: 1 addition & 1 deletion src/zm_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct Namespace namespaces[] =
#endif

// This is the official SQL (and ordering of the fields) to load a Monitor.
// It will be used whereever a Monitor dbrow is needed. WHERE conditions can be appended
// It will be used wherever a Monitor dbrow is needed. WHERE conditions can be appended
std::string load_monitor_sql =
"SELECT `Id`, `Name`, `Deleted`, `ServerId`, `StorageId`, `Type`, `Capturing`+0, `Analysing`+0, `AnalysisSource`+0, `AnalysisImage`+0,"
"`Recording`+0, `RecordingSource`+0, `Decoding`+0, `RTSP2WebEnabled`, `RTSP2WebType`,"
Expand Down
4 changes: 2 additions & 2 deletions src/zm_monitorstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ void MonitorStream::runStream() {
}

if (!sendFrame(send_image, last_frame_timestamp)) {
Debug(2, "sendFrame failed, quiting.");
Debug(2, "sendFrame failed, quitting.");
zm_terminate = true;
break;
}
Expand All @@ -722,7 +722,7 @@ void MonitorStream::runStream() {
// Chrome will not display the first frame until it receives another.
// Firefox is fine. So just send the first frame twice.
if (!sendFrame(send_image, last_frame_timestamp)) {
Debug(2, "sendFrame failed, quiting.");
Debug(2, "sendFrame failed, quitting.");
zm_terminate = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/zm_mqtt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void MQTT::addValue(std::string name, double value) {
sensorListIterator = sensorList.find(name);
Debug(1, "found sensor: %s", sensorListIterator->first.c_str());
// if(it == sensorList.end()) {
// clog<<__FUNCTION__<<" Could not find coresponding sensor name"<<endl;
// clog<<__FUNCTION__<<" Could not find corresponding sensor name"<<endl;
// } else {
//
// }
Expand Down
2 changes: 1 addition & 1 deletion src/zm_remote_camera_http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,7 @@ int RemoteCameraHttp::GetResponse() {
content_length = start_ptr - (char *)buffer;
Debug(2, "Got end of image by pattern (crlf--), content-length = %d", content_length);
} else {
Debug(2, "Did not find end of image by patten (crlf--) yet, content-length = %d", content_length);
Debug(2, "Did not find end of image by pattern (crlf--) yet, content-length = %d", content_length);
}
} // end if MULTI_IMAGE
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/zm_rtsp_server_device_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ZoneMinderDeviceSource: public FramedSource {
// split packet in frames
virtual std::list< std::pair<unsigned char*, size_t> > splitFrames(unsigned char* frame, unsigned frameSize);

// overide FramedSource
// override FramedSource
virtual void doGetNextFrame();
virtual void doStopGettingFrames();
virtual unsigned char *extractFrame(unsigned char *data, size_t& size, size_t& outsize);
Expand Down
4 changes: 2 additions & 2 deletions src/zm_rtsp_server_fifo_h264_source.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class H264_ZoneMinderFifoSource : public H26X_ZoneMinderFifoSource {
const std::string &fifo
);

// overide ZoneMinderFifoSource
// override ZoneMinderFifoSource
virtual std::list< std::pair<unsigned char*,size_t> > splitFrames(unsigned char* frame, size_t &frameSize) override;
};

Expand All @@ -66,7 +66,7 @@ class H265_ZoneMinderFifoSource : public H26X_ZoneMinderFifoSource {
const std::string &fifo
);

// overide ZoneMinderFifoSource
// override ZoneMinderFifoSource
virtual std::list< std::pair<unsigned char*,size_t> > splitFrames(unsigned char* frame, size_t &frameSize) override;

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/zm_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ void StreamBase::closeComms() {
}
// Can't delete any files because another zms might have come along and opened them and is waiting on the lock.
if ( lock_fd > 0 ) {
close(lock_fd); //close it rather than unlock it incase it got deleted.
close(lock_fd); //close it rather than unlock it in case it got deleted.
}
}
} // end void StreamBase::closeComms
Expand Down
2 changes: 1 addition & 1 deletion src/zm_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ std::string mask_authentication(const std::string &url) {
std::size_t password_at = masked_url.rfind(":", at_at);

if (password_at == std::string::npos) {
// no : means no http:// either so something liek [email protected]
// no : means no http:// either so something like [email protected]
masked_url.replace(0, at_at, at_at, '*');
} else if (masked_url[password_at+1] == '/') {
// no password, something like http://[email protected]
Expand Down
8 changes: 4 additions & 4 deletions src/zm_videostore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ bool VideoStore::open() {

ret = avcodec_parameters_from_context(video_out_stream->codecpar, video_out_ctx);
if (ret < 0) {
Error("Could not initialize stream parameteres");
Error("Could not initialize stream parameters");
}
av_dict_free(&opts);
// Reload it for next attempt and/or avformat open
Expand Down Expand Up @@ -431,7 +431,7 @@ bool VideoStore::open() {
video_out_stream = avformat_new_stream(oc, nullptr);
ret = avcodec_parameters_from_context(video_out_stream->codecpar, video_out_ctx);
if (ret < 0) {
Error("Could not initialize stream parameteres");
Error("Could not initialize stream parameters");
return false;
}
} // end if copying or transcoding
Expand Down Expand Up @@ -510,7 +510,7 @@ bool VideoStore::open() {
}

#if LIBAVUTIL_VERSION_CHECK(57, 28, 100, 28, 0)
/* Seems like technically we could have multple channels, so let's not implement this for ffmpeg 5 */
/* Seems like technically we could have multiple channels, so let's not implement this for ffmpeg 5 */
#else
if (audio_out_ctx->channels > 1) {
Warning("Audio isn't mono, changing it.");
Expand Down Expand Up @@ -869,7 +869,7 @@ bool VideoStore::setup_resampler() {

audio_out_stream->time_base = (AVRational){1, audio_out_ctx->sample_rate};
if ((ret = avcodec_parameters_from_context(audio_out_stream->codecpar, audio_out_ctx)) < 0) {
Error("Could not initialize stream parameteres");
Error("Could not initialize stream parameters");
return false;
}
zm_dump_codecpar(audio_out_stream->codecpar);
Expand Down

0 comments on commit 543683a

Please sign in to comment.