Merge ../release/zoneminder_0.30.13~20170412162034-trusty.orig into storageareas
This commit is contained in:
commit
d8e27fe01a
|
@ -2,12 +2,11 @@
|
||||||
# Created by mastertheknife (Kfir Itzhak)
|
# Created by mastertheknife (Kfir Itzhak)
|
||||||
# For more information and installation, see the INSTALL file
|
# For more information and installation, see the INSTALL file
|
||||||
#
|
#
|
||||||
cmake_minimum_required (VERSION 3.1.0)
|
cmake_minimum_required (VERSION 2.8.7)
|
||||||
project (zoneminder)
|
project (zoneminder)
|
||||||
file (STRINGS "version" zoneminder_VERSION)
|
file (STRINGS "version" zoneminder_VERSION)
|
||||||
# make API version a minor of ZM version
|
# make API version a minor of ZM version
|
||||||
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
|
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
|
||||||
set (CMAKE_CXX_STANDARD 11)
|
|
||||||
|
|
||||||
# Make sure the submodules are there
|
# Make sure the submodules are there
|
||||||
if( NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php" )
|
if( NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php" )
|
||||||
|
|
|
@ -55,7 +55,7 @@ char Event::capture_file_format[PATH_MAX];
|
||||||
char Event::analyse_file_format[PATH_MAX];
|
char Event::analyse_file_format[PATH_MAX];
|
||||||
char Event::general_file_format[PATH_MAX];
|
char Event::general_file_format[PATH_MAX];
|
||||||
char Event::video_file_format[PATH_MAX];
|
char Event::video_file_format[PATH_MAX];
|
||||||
constexpr const char * Event::frame_type_names[3];
|
const char * Event::frame_type_names[3] = { "Normal", "Bulk", "Alarm" };
|
||||||
|
|
||||||
int Event::pre_alarm_count = 0;
|
int Event::pre_alarm_count = 0;
|
||||||
|
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Event {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef enum { NORMAL=0, BULK, ALARM } FrameType;
|
typedef enum { NORMAL=0, BULK, ALARM } FrameType;
|
||||||
static constexpr const char * frame_type_names[3] = { "Normal", "Bulk", "Alarm" };
|
static const char * frame_type_names[3];
|
||||||
|
|
||||||
struct PreAlarmData {
|
struct PreAlarmData {
|
||||||
Image *image;
|
Image *image;
|
||||||
|
|
|
@ -158,18 +158,10 @@ SWScale::SWScale() : gotdefaults(false), swscale_ctx(NULL), input_avframe(NULL),
|
||||||
SWScale::~SWScale() {
|
SWScale::~SWScale() {
|
||||||
|
|
||||||
/* Free up everything */
|
/* Free up everything */
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &input_avframe );
|
av_frame_free( &input_avframe );
|
||||||
#else
|
|
||||||
av_freep( &input_avframe );
|
|
||||||
#endif
|
|
||||||
//input_avframe = NULL;
|
//input_avframe = NULL;
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &output_avframe );
|
av_frame_free( &output_avframe );
|
||||||
#else
|
|
||||||
av_freep( &output_avframe );
|
|
||||||
#endif
|
|
||||||
//output_avframe = NULL;
|
//output_avframe = NULL;
|
||||||
|
|
||||||
if(swscale_ctx) {
|
if(swscale_ctx) {
|
||||||
|
|
|
@ -342,6 +342,9 @@ unsigned int zm_av_packet_ref( AVPacket *dst, AVPacket *src );
|
||||||
#define zm_av_frame_alloc() avcodec_alloc_frame()
|
#define zm_av_frame_alloc() avcodec_alloc_frame()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if ! LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
||||||
|
#define av_frame_free( input_avframe ) av_freep( input_avframe )
|
||||||
|
#endif
|
||||||
|
|
||||||
int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt);
|
int check_sample_fmt(AVCodec *codec, enum AVSampleFormat sample_fmt);
|
||||||
|
|
||||||
|
|
|
@ -458,13 +458,8 @@ int FfmpegCamera::CloseFfmpeg(){
|
||||||
|
|
||||||
mCanCapture = false;
|
mCanCapture = false;
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &mFrame );
|
av_frame_free( &mFrame );
|
||||||
av_frame_free( &mRawFrame );
|
av_frame_free( &mRawFrame );
|
||||||
#else
|
|
||||||
av_freep( &mFrame );
|
|
||||||
av_freep( &mRawFrame );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
if ( mConvertContext )
|
if ( mConvertContext )
|
||||||
|
@ -754,8 +749,11 @@ else if ( packet.pts && video_last_pts > packet.pts ) {
|
||||||
zm_av_packet_unref( &packet );
|
zm_av_packet_unref( &packet );
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
// avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height);
|
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
||||||
av_image_fill_arrays(mFrame->data, mFrame->linesize, directbuffer, imagePixFormat, width, height, 1);
|
av_image_fill_arrays(mFrame->data, mFrame->linesize, directbuffer, imagePixFormat, width, height, 1);
|
||||||
|
#else
|
||||||
|
avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
if (sws_scale(mConvertContext, mRawFrame->data, mRawFrame->linesize,
|
if (sws_scale(mConvertContext, mRawFrame->data, mRawFrame->linesize,
|
||||||
|
|
|
@ -677,11 +677,7 @@ LocalCamera::~LocalCamera()
|
||||||
sws_freeContext(imgConversionContext);
|
sws_freeContext(imgConversionContext);
|
||||||
imgConversionContext = NULL;
|
imgConversionContext = NULL;
|
||||||
|
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &tmpPicture );
|
av_frame_free( &tmpPicture );
|
||||||
#else
|
|
||||||
av_freep( &tmpPicture );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,11 +310,7 @@ void VideoStream::OpenStream( ) {
|
||||||
|
|
||||||
uint8_t *opicture_buf = (uint8_t *)av_malloc( size );
|
uint8_t *opicture_buf = (uint8_t *)av_malloc( size );
|
||||||
if ( !opicture_buf ) {
|
if ( !opicture_buf ) {
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &opicture );
|
av_frame_free( &opicture );
|
||||||
#else
|
|
||||||
av_freep( &opicture );
|
|
||||||
#endif
|
|
||||||
Panic( "Could not allocate opicture_buf" );
|
Panic( "Could not allocate opicture_buf" );
|
||||||
}
|
}
|
||||||
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
||||||
|
@ -345,11 +341,7 @@ void VideoStream::OpenStream( ) {
|
||||||
#endif
|
#endif
|
||||||
uint8_t *tmp_opicture_buf = (uint8_t *)av_malloc( size );
|
uint8_t *tmp_opicture_buf = (uint8_t *)av_malloc( size );
|
||||||
if ( !tmp_opicture_buf ) {
|
if ( !tmp_opicture_buf ) {
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &tmp_opicture );
|
av_frame_free( &tmp_opicture );
|
||||||
#else
|
|
||||||
av_freep( &tmp_opicture );
|
|
||||||
#endif
|
|
||||||
Panic( "Could not allocate tmp_opicture_buf" );
|
Panic( "Could not allocate tmp_opicture_buf" );
|
||||||
}
|
}
|
||||||
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
|
||||||
|
@ -491,18 +483,10 @@ VideoStream::~VideoStream( ) {
|
||||||
if ( ost ) {
|
if ( ost ) {
|
||||||
avcodec_close( ost->codec );
|
avcodec_close( ost->codec );
|
||||||
av_free( opicture->data[0] );
|
av_free( opicture->data[0] );
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &opicture );
|
av_frame_free( &opicture );
|
||||||
#else
|
|
||||||
av_freep( &opicture );
|
|
||||||
#endif
|
|
||||||
if ( tmp_opicture ) {
|
if ( tmp_opicture ) {
|
||||||
av_free( tmp_opicture->data[0] );
|
av_free( tmp_opicture->data[0] );
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &tmp_opicture );
|
av_frame_free( &tmp_opicture );
|
||||||
#else
|
|
||||||
av_freep( &tmp_opicture );
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
av_free( video_outbuf );
|
av_free( video_outbuf );
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,13 +81,8 @@ RemoteCameraRtsp::RemoteCameraRtsp( unsigned int p_monitor_id, const std::string
|
||||||
|
|
||||||
RemoteCameraRtsp::~RemoteCameraRtsp()
|
RemoteCameraRtsp::~RemoteCameraRtsp()
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
|
|
||||||
av_frame_free( &mFrame );
|
av_frame_free( &mFrame );
|
||||||
av_frame_free( &mRawFrame );
|
av_frame_free( &mRawFrame );
|
||||||
#else
|
|
||||||
av_freep( &mFrame );
|
|
||||||
av_freep( &mRawFrame );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
if ( mConvertContext )
|
if ( mConvertContext )
|
||||||
|
|
|
@ -393,7 +393,7 @@ void timespec_diff(struct timespec *start, struct timespec *end, struct timespec
|
||||||
char *timeval_to_string( struct timeval tv ) {
|
char *timeval_to_string( struct timeval tv ) {
|
||||||
time_t nowtime;
|
time_t nowtime;
|
||||||
struct tm *nowtm;
|
struct tm *nowtm;
|
||||||
char tmbuf[64], buf[64];
|
static char tmbuf[64], buf[64];
|
||||||
|
|
||||||
nowtime = tv.tv_sec;
|
nowtime = tv.tv_sec;
|
||||||
nowtm = localtime(&nowtime);
|
nowtm = localtime(&nowtime);
|
||||||
|
|
|
@ -406,14 +406,13 @@ bool VideoStore::setup_resampler() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug(1, "Audio output bit_rate (%d) sample_rate(%d) channels(%d) fmt(%d) layout(%d) frame_size(%d), refcounted_frames(%d)",
|
Debug(1, "Audio output bit_rate (%d) sample_rate(%d) channels(%d) fmt(%d) layout(%d) frame_size(%d)",
|
||||||
audio_output_context->bit_rate,
|
audio_output_context->bit_rate,
|
||||||
audio_output_context->sample_rate,
|
audio_output_context->sample_rate,
|
||||||
audio_output_context->channels,
|
audio_output_context->channels,
|
||||||
audio_output_context->sample_fmt,
|
audio_output_context->sample_fmt,
|
||||||
audio_output_context->channel_layout,
|
audio_output_context->channel_layout,
|
||||||
audio_output_context->frame_size,
|
audio_output_context->frame_size
|
||||||
audio_output_context->refcounted_frames
|
|
||||||
);
|
);
|
||||||
|
|
||||||
output_frame_size = audio_output_context->frame_size;
|
output_frame_size = audio_output_context->frame_size;
|
||||||
|
@ -426,7 +425,7 @@ bool VideoStore::setup_resampler() {
|
||||||
/** Create a new frame to store the audio samples. */
|
/** Create a new frame to store the audio samples. */
|
||||||
if (!(output_frame = zm_av_frame_alloc())) {
|
if (!(output_frame = zm_av_frame_alloc())) {
|
||||||
Error("Could not allocate output frame");
|
Error("Could not allocate output frame");
|
||||||
av_frame_free(&input_frame);
|
av_frame_free( &input_frame );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -715,8 +714,8 @@ int VideoStore::writeAudioFramePacket( AVPacket *ipkt ) {
|
||||||
Error( "Could not decode frame (error '%s')\n",
|
Error( "Could not decode frame (error '%s')\n",
|
||||||
av_make_error_string(ret).c_str());
|
av_make_error_string(ret).c_str());
|
||||||
dumpPacket( ipkt );
|
dumpPacket( ipkt );
|
||||||
av_frame_free(&input_frame);
|
av_frame_free( &input_frame );
|
||||||
zm_av_packet_unref(&opkt);
|
zm_av_packet_unref( &opkt );
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ( ! data_present ) {
|
if ( ! data_present ) {
|
||||||
|
|
|
@ -62,21 +62,23 @@ if [ "$TYPE" == "" ]; then
|
||||||
echo "Defaulting to source build"
|
echo "Defaulting to source build"
|
||||||
TYPE="source";
|
TYPE="source";
|
||||||
fi;
|
fi;
|
||||||
if [ "$GITHUB_FORK" == "" ]; then
|
|
||||||
echo "Defaulting to ZoneMinder upstream git"
|
|
||||||
GITHUB_FORK="ZoneMinder"
|
|
||||||
fi;
|
|
||||||
|
|
||||||
# Release is a special mode... it uploads to the release ppa and cannot have a snapshot
|
# Release is a special mode... it uploads to the release ppa and cannot have a snapshot
|
||||||
if [ "$RELEASE" != "" ]; then
|
if [ "$RELEASE" != "" ]; then
|
||||||
if [ "$SNAPSHOT" != "" ]; then
|
if [ "$SNAPSHOT" != "" ]; then
|
||||||
echo "Releases cannot have a snapshot.... exiting."
|
echo "Releases cannot have a snapshot.... exiting."
|
||||||
|
exit 0;
|
||||||
fi
|
fi
|
||||||
if [ "$GITHUB_FORK" != "" ]; then
|
if [ "$GITHUB_FORK" != "" ] && [ "$GITHUB_FORK" != "ZoneMinder" ]; then
|
||||||
echo "Releases cannot have a fork.... exiting."
|
echo "Releases cannot have a fork ($GITHUB_FORK).... exiting."
|
||||||
|
exit 0;
|
||||||
fi
|
fi
|
||||||
BRANCH=$RELEASE
|
BRANCH="release-$RELEASE"
|
||||||
else
|
else
|
||||||
|
if [ "$GITHUB_FORK" == "" ]; then
|
||||||
|
echo "Defaulting to ZoneMinder upstream git"
|
||||||
|
GITHUB_FORK="ZoneMinder"
|
||||||
|
fi;
|
||||||
if [ "$SNAPSHOT" == "stable" ]; then
|
if [ "$SNAPSHOT" == "stable" ]; then
|
||||||
if [ "$BRANCH" == "" ]; then
|
if [ "$BRANCH" == "" ]; then
|
||||||
BRANCH=$(git describe --tags $(git rev-list --tags --max-count=1));
|
BRANCH=$(git describe --tags $(git rev-list --tags --max-count=1));
|
||||||
|
@ -99,6 +101,8 @@ if [ ! -d "${GITHUB_FORK}_zoneminder_release" ]; then
|
||||||
if [ -d "${GITHUB_FORK}_ZoneMinder.git" ]; then
|
if [ -d "${GITHUB_FORK}_ZoneMinder.git" ]; then
|
||||||
echo "Using local clone ${GITHUB_FORK}_ZoneMinder.git to pull from."
|
echo "Using local clone ${GITHUB_FORK}_ZoneMinder.git to pull from."
|
||||||
cd "${GITHUB_FORK}_ZoneMinder.git"
|
cd "${GITHUB_FORK}_ZoneMinder.git"
|
||||||
|
echo "git pull..."
|
||||||
|
git pull
|
||||||
echo "git checkout $BRANCH"
|
echo "git checkout $BRANCH"
|
||||||
git checkout $BRANCH
|
git checkout $BRANCH
|
||||||
echo "git pull..."
|
echo "git pull..."
|
||||||
|
|
Loading…
Reference in New Issue