Merge ../release/zoneminder_0.30.13~20170412162034-trusty.orig into storageareas

This commit is contained in:
Isaac Connor 2017-04-13 09:48:56 -04:00
commit d8e27fe01a
12 changed files with 27 additions and 57 deletions

View File

@ -2,12 +2,11 @@
# Created by mastertheknife (Kfir Itzhak)
# 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)
file (STRINGS "version" zoneminder_VERSION)
# make API version a minor of ZM version
set(zoneminder_API_VERSION "${zoneminder_VERSION}.1")
set (CMAKE_CXX_STANDARD 11)
# Make sure the submodules are there
if( NOT EXISTS "${CMAKE_SOURCE_DIR}/web/api/app/Plugin/Crud/Lib/CrudControllerTrait.php" )

View File

@ -55,7 +55,7 @@ char Event::capture_file_format[PATH_MAX];
char Event::analyse_file_format[PATH_MAX];
char Event::general_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;

View File

@ -66,7 +66,7 @@ class Event {
protected:
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 {
Image *image;

View File

@ -158,18 +158,10 @@ SWScale::SWScale() : gotdefaults(false), swscale_ctx(NULL), input_avframe(NULL),
SWScale::~SWScale() {
/* Free up everything */
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &input_avframe );
#else
av_freep( &input_avframe );
#endif
//input_avframe = NULL;
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &output_avframe );
#else
av_freep( &output_avframe );
#endif
//output_avframe = NULL;
if(swscale_ctx) {

View File

@ -342,6 +342,9 @@ unsigned int zm_av_packet_ref( AVPacket *dst, AVPacket *src );
#define zm_av_frame_alloc() avcodec_alloc_frame()
#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);

View File

@ -458,13 +458,8 @@ int FfmpegCamera::CloseFfmpeg(){
mCanCapture = false;
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &mFrame );
av_frame_free( &mRawFrame );
#else
av_freep( &mFrame );
av_freep( &mRawFrame );
#endif
#if HAVE_LIBSWSCALE
if ( mConvertContext )
@ -754,8 +749,11 @@ else if ( packet.pts && video_last_pts > packet.pts ) {
zm_av_packet_unref( &packet );
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);
#else
avpicture_fill( (AVPicture *)mFrame, directbuffer, imagePixFormat, width, height);
#endif
if (sws_scale(mConvertContext, mRawFrame->data, mRawFrame->linesize,

View File

@ -677,11 +677,7 @@ LocalCamera::~LocalCamera()
sws_freeContext(imgConversionContext);
imgConversionContext = NULL;
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &tmpPicture );
#else
av_freep( &tmpPicture );
#endif
}
#endif
}

View File

@ -310,11 +310,7 @@ void VideoStream::OpenStream( ) {
uint8_t *opicture_buf = (uint8_t *)av_malloc( size );
if ( !opicture_buf ) {
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &opicture );
#else
av_freep( &opicture );
#endif
Panic( "Could not allocate opicture_buf" );
}
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
@ -345,11 +341,7 @@ void VideoStream::OpenStream( ) {
#endif
uint8_t *tmp_opicture_buf = (uint8_t *)av_malloc( size );
if ( !tmp_opicture_buf ) {
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &tmp_opicture );
#else
av_freep( &tmp_opicture );
#endif
Panic( "Could not allocate tmp_opicture_buf" );
}
#if LIBAVUTIL_VERSION_CHECK(54, 6, 0, 6, 0)
@ -491,18 +483,10 @@ VideoStream::~VideoStream( ) {
if ( ost ) {
avcodec_close( ost->codec );
av_free( opicture->data[0] );
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &opicture );
#else
av_freep( &opicture );
#endif
if ( tmp_opicture ) {
av_free( tmp_opicture->data[0] );
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &tmp_opicture );
#else
av_freep( &tmp_opicture );
#endif
}
av_free( video_outbuf );
}

View File

@ -81,13 +81,8 @@ RemoteCameraRtsp::RemoteCameraRtsp( unsigned int p_monitor_id, const std::string
RemoteCameraRtsp::~RemoteCameraRtsp()
{
#if LIBAVCODEC_VERSION_CHECK(55, 28, 1, 45, 101)
av_frame_free( &mFrame );
av_frame_free( &mRawFrame );
#else
av_freep( &mFrame );
av_freep( &mRawFrame );
#endif
#if HAVE_LIBSWSCALE
if ( mConvertContext )

View File

@ -393,7 +393,7 @@ void timespec_diff(struct timespec *start, struct timespec *end, struct timespec
char *timeval_to_string( struct timeval tv ) {
time_t nowtime;
struct tm *nowtm;
char tmbuf[64], buf[64];
static char tmbuf[64], buf[64];
nowtime = tv.tv_sec;
nowtm = localtime(&nowtime);

View File

@ -406,14 +406,13 @@ bool VideoStore::setup_resampler() {
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->sample_rate,
audio_output_context->channels,
audio_output_context->sample_fmt,
audio_output_context->channel_layout,
audio_output_context->frame_size,
audio_output_context->refcounted_frames
audio_output_context->frame_size
);
output_frame_size = audio_output_context->frame_size;

View File

@ -62,21 +62,23 @@ if [ "$TYPE" == "" ]; then
echo "Defaulting to source build"
TYPE="source";
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
if [ "$RELEASE" != "" ]; then
if [ "$SNAPSHOT" != "" ]; then
echo "Releases cannot have a snapshot.... exiting."
exit 0;
fi
if [ "$GITHUB_FORK" != "" ]; then
echo "Releases cannot have a fork.... exiting."
if [ "$GITHUB_FORK" != "" ] && [ "$GITHUB_FORK" != "ZoneMinder" ]; then
echo "Releases cannot have a fork ($GITHUB_FORK).... exiting."
exit 0;
fi
BRANCH=$RELEASE
BRANCH="release-$RELEASE"
else
if [ "$GITHUB_FORK" == "" ]; then
echo "Defaulting to ZoneMinder upstream git"
GITHUB_FORK="ZoneMinder"
fi;
if [ "$SNAPSHOT" == "stable" ]; then
if [ "$BRANCH" == "" ]; then
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
echo "Using local clone ${GITHUB_FORK}_ZoneMinder.git to pull from."
cd "${GITHUB_FORK}_ZoneMinder.git"
echo "git pull..."
git pull
echo "git checkout $BRANCH"
git checkout $BRANCH
echo "git pull..."