Merge branch 'release-1.34'

This commit is contained in:
Isaac Connor 2020-07-29 16:27:01 -04:00
commit 2f57ccc9b9
7 changed files with 37 additions and 25 deletions

View File

@ -4,13 +4,13 @@
"Jan Hochstein" "Jan Hochstein"
], ],
"dynamic_config" : 0, "dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
"license" : [ "license" : [
"unknown" "unknown"
], ],
"meta-spec" : { "meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2" "version" : 2
}, },
"name" : "ONVIF", "name" : "ONVIF",
"no_index" : { "no_index" : {
@ -36,5 +36,5 @@
}, },
"release_status" : "stable", "release_status" : "stable",
"version" : "", "version" : "",
"x_serialization_backend" : "JSON::PP version 2.27400_02" "x_serialization_backend" : "JSON::PP version 4.02"
} }

View File

@ -7,7 +7,7 @@ build_requires:
configure_requires: configure_requires:
ExtUtils::MakeMaker: '0' ExtUtils::MakeMaker: '0'
dynamic_config: 0 dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
license: unknown license: unknown
meta-spec: meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html url: http://module-build.sourceforge.net/META-spec-v1.4.html

View File

@ -4,13 +4,13 @@
"Jan Hochstein" "Jan Hochstein"
], ],
"dynamic_config" : 0, "dynamic_config" : 0,
"generated_by" : "ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010", "generated_by" : "ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010",
"license" : [ "license" : [
"unknown" "unknown"
], ],
"meta-spec" : { "meta-spec" : {
"url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
"version" : "2" "version" : 2
}, },
"name" : "ONVIF", "name" : "ONVIF",
"no_index" : { "no_index" : {
@ -36,5 +36,5 @@
}, },
"release_status" : "stable", "release_status" : "stable",
"version" : "", "version" : "",
"x_serialization_backend" : "JSON::PP version 2.27400_02" "x_serialization_backend" : "JSON::PP version 4.02"
} }

View File

@ -7,7 +7,7 @@ build_requires:
configure_requires: configure_requires:
ExtUtils::MakeMaker: '0' ExtUtils::MakeMaker: '0'
dynamic_config: 0 dynamic_config: 0
generated_by: 'ExtUtils::MakeMaker version 7.24, CPAN::Meta::Converter version 2.150010' generated_by: 'ExtUtils::MakeMaker version 7.34, CPAN::Meta::Converter version 2.150010'
license: unknown license: unknown
meta-spec: meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html url: http://module-build.sourceforge.net/META-spec-v1.4.html

View File

@ -810,29 +810,38 @@ bool EventStream::sendFrame(int delta_us) {
if ( send_raw ) { if ( send_raw ) {
#if HAVE_SENDFILE #if HAVE_SENDFILE
fprintf(stdout, "Content-Length: %d\r\n\r\n", (int)filestat.st_size); if ( 0 > fprintf(stdout, "Content-Length: %d\r\n\r\n", (int)filestat.st_size) ) {
fclose(fdj); /* Close the file handle */
Info("Unable to send raw frame %u: %s", curr_frame_id, strerror(errno));
return false;
}
if ( zm_sendfile(fileno(stdout), fileno(fdj), 0, (int)filestat.st_size) != (int)filestat.st_size ) { if ( zm_sendfile(fileno(stdout), fileno(fdj), 0, (int)filestat.st_size) != (int)filestat.st_size ) {
/* sendfile() failed, use standard way instead */ /* sendfile() failed, use standard way instead */
img_buffer_size = fread(img_buffer, 1, sizeof(temp_img_buffer), fdj); img_buffer_size = fread(img_buffer, 1, sizeof(temp_img_buffer), fdj);
if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) {
fclose(fdj); /* Close the file handle */ fclose(fdj); /* Close the file handle */
Error("Unable to send raw frame %u: %s", curr_frame_id, strerror(errno)); Info("Unable to send raw frame %u: %s", curr_frame_id, strerror(errno));
return false; return false;
} }
} }
#else #else
fprintf(stdout, "Content-Length: %d\r\n\r\n", img_buffer_size); if (
if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { (0 > fprintf(stdout, "Content-Length: %d\r\n\r\n", img_buffer_size) )
||
( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 )
) {
fclose(fdj); /* Close the file handle */ fclose(fdj); /* Close the file handle */
Error("Unable to send raw frame %u: %s", curr_frame_id, strerror(errno)); Info("Unable to send raw frame %u: %s", curr_frame_id, strerror(errno));
return false; return false;
} }
#endif #endif
fclose(fdj); /* Close the file handle */ fclose(fdj); /* Close the file handle */
} else { } else {
Debug(3, "Content length: %d", img_buffer_size); Debug(3, "Content length: %d", img_buffer_size);
fprintf(stdout, "Content-Length: %d\r\n\r\n", img_buffer_size); if (
if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { (0 > fprintf(stdout, "Content-Length: %d\r\n\r\n", img_buffer_size) )
||
( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) ) {
Error("Unable to send stream frame: %s", strerror(errno)); Error("Unable to send stream frame: %s", strerror(errno));
return false; return false;
} }

View File

@ -2073,7 +2073,7 @@ void Image::Annotate( const char *p_text, const Coord &coord, const unsigned int
} }
} else { } else {
Panic("Annotate called with unexpected colours: %d",colours); Error("Annotate called with unexpected colours: %d", colours);
return; return;
} }

View File

@ -328,11 +328,12 @@ bool MonitorStream::sendFrame(const char *filepath, struct timeval *timestamp) {
struct timeval frameStartTime; struct timeval frameStartTime;
gettimeofday(&frameStartTime, NULL); gettimeofday(&frameStartTime, NULL);
fputs("--" BOUNDARY "\r\nContent-Type: image/jpeg\r\n", stdout); if (
fprintf(stdout, "Content-Length: %d\r\n" (0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %d.%06d\r\n\r\n",
"X-Timestamp: %d.%06d\r\n" img_buffer_size, (int)timestamp->tv_sec, (int)timestamp->tv_usec))
"\r\n", img_buffer_size, (int)timestamp->tv_sec, (int)timestamp->tv_usec); ||
if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { (fwrite(img_buffer, img_buffer_size, 1, stdout) != 1)
) {
if ( !zm_terminate ) if ( !zm_terminate )
Warning("Unable to send stream frame: %s", strerror(errno)); Warning("Unable to send stream frame: %s", strerror(errno));
return false; return false;
@ -413,10 +414,12 @@ bool MonitorStream::sendFrame(Image *image, struct timeval *timestamp) {
Error("Unexpected frame type %d", type); Error("Unexpected frame type %d", type);
return false; return false;
} }
fprintf(stdout, "Content-Length: %d\r\n" if (
"X-Timestamp: %d.%06d\r\n" ( 0 > fprintf(stdout, "Content-Length: %d\r\nX-Timestamp: %d.%06d\r\n\r\n",
"\r\n", img_buffer_size, (int)timestamp->tv_sec, (int)timestamp->tv_usec); img_buffer_size, (int)timestamp->tv_sec, (int)timestamp->tv_usec) )
if ( fwrite(img_buffer, img_buffer_size, 1, stdout) != 1 ) { ||
(fwrite(img_buffer, img_buffer_size, 1, stdout) != 1)
) {
if ( !zm_terminate ) { if ( !zm_terminate ) {
// If the pipe was closed, we will get signalled SIGPIPE to exit, which will set zm_terminate // If the pipe was closed, we will get signalled SIGPIPE to exit, which will set zm_terminate
Warning("Unable to send stream frame: %s", strerror(errno)); Warning("Unable to send stream frame: %s", strerror(errno));