Merge branch 'master' into replace_function_concept
This commit is contained in:
commit
524662e6c7
|
@ -2,8 +2,7 @@ name: Create packages
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches: [ master ]
|
||||||
- '*'
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
|
|
|
@ -2013,14 +2013,14 @@ bool Monitor::Analyse() {
|
||||||
} else {
|
} else {
|
||||||
event->addNote(SIGNAL_CAUSE, "Reacquired");
|
event->addNote(SIGNAL_CAUSE, "Reacquired");
|
||||||
}
|
}
|
||||||
if (snap->in_frame && (
|
if (0 and snap->in_frame && (
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
||||||
||
|
||
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
||||||
) ) {
|
) ) {
|
||||||
Debug(1, "assigning refimage from v-channel");
|
Debug(1, "assigning refimage from v-channel");
|
||||||
Image v_image(snap->in_frame->width,
|
Image v_image(snap->in_frame->width,
|
||||||
snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
|
snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[0], 0);
|
||||||
ref_image.Assign(v_image);
|
ref_image.Assign(v_image);
|
||||||
} else if (snap->image) {
|
} else if (snap->image) {
|
||||||
Debug(1, "assigning refimage from snap->image");
|
Debug(1, "assigning refimage from snap->image");
|
||||||
|
@ -2104,13 +2104,13 @@ bool Monitor::Analyse() {
|
||||||
// decoder may not have been able to provide an image
|
// decoder may not have been able to provide an image
|
||||||
if (!ref_image.Buffer()) {
|
if (!ref_image.Buffer()) {
|
||||||
Debug(1, "Assigning instead of Detecting");
|
Debug(1, "Assigning instead of Detecting");
|
||||||
if (snap->in_frame && (
|
if (0 and snap->in_frame && (
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
||||||
||
|
||
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
||||||
) ) {
|
) ) {
|
||||||
Debug(1, "assigning refimage from v-channel");
|
Debug(1, "assigning refimage from v-channel");
|
||||||
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
|
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[0], 0);
|
||||||
ref_image.Assign(v_image);
|
ref_image.Assign(v_image);
|
||||||
} else {
|
} else {
|
||||||
Debug(1, "assigning refimage from snap->image");
|
Debug(1, "assigning refimage from snap->image");
|
||||||
|
@ -2120,12 +2120,12 @@ bool Monitor::Analyse() {
|
||||||
} else if (!(analysis_image_count % (motion_frame_skip+1))) {
|
} else if (!(analysis_image_count % (motion_frame_skip+1))) {
|
||||||
Debug(1, "Detecting motion on image %d, image %p", snap->image_index, snap->image);
|
Debug(1, "Detecting motion on image %d, image %p", snap->image_index, snap->image);
|
||||||
// Get new score.
|
// Get new score.
|
||||||
if (snap->in_frame && (
|
if (0 and snap->in_frame && (
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
||||||
||
|
||
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
||||||
) ) {
|
) ) {
|
||||||
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
|
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[0], 0);
|
||||||
snap->score = DetectMotion(v_image, zoneSet);
|
snap->score = DetectMotion(v_image, zoneSet);
|
||||||
} else {
|
} else {
|
||||||
snap->score = DetectMotion(*(snap->image), zoneSet);
|
snap->score = DetectMotion(*(snap->image), zoneSet);
|
||||||
|
@ -2344,20 +2344,20 @@ bool Monitor::Analyse() {
|
||||||
|
|
||||||
if ((analysing == ANALYSING_ALWAYS) and snap->image) {
|
if ((analysing == ANALYSING_ALWAYS) and snap->image) {
|
||||||
if (!ref_image.Buffer()) {
|
if (!ref_image.Buffer()) {
|
||||||
if (snap->in_frame && (
|
if (0 and snap->in_frame && (
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
||||||
||
|
||
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUVJ420P)
|
||||||
) ) {
|
) ) {
|
||||||
Debug(1, "Assigning from vchannel");
|
Debug(1, "Assigning from vchannel");
|
||||||
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
|
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[0], 0);
|
||||||
ref_image.Assign(v_image);
|
ref_image.Assign(v_image);
|
||||||
} else if (snap->image) {
|
} else if (snap->image) {
|
||||||
Debug(1, "Assigning");
|
Debug(1, "Assigning");
|
||||||
ref_image.Assign(*(snap->image));
|
ref_image.Assign(*(snap->image));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (snap->in_frame &&
|
if (0 and snap->in_frame &&
|
||||||
(
|
(
|
||||||
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
((AVPixelFormat)snap->in_frame->format == AV_PIX_FMT_YUV420P)
|
||||||
||
|
||
|
||||||
|
@ -2365,7 +2365,7 @@ bool Monitor::Analyse() {
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
Debug(1, "Blending from vchannel");
|
Debug(1, "Blending from vchannel");
|
||||||
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[2], 0);
|
Image v_image(snap->in_frame->width, snap->in_frame->height, 1, ZM_SUBPIX_ORDER_NONE, snap->in_frame->data[0], 0);
|
||||||
ref_image.Blend(v_image, ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc ));
|
ref_image.Blend(v_image, ( state==ALARM ? alarm_ref_blend_perc : ref_blend_perc ));
|
||||||
} else if (snap->image) {
|
} else if (snap->image) {
|
||||||
Debug(1, "Blending because %p and format %d != %d, %d", snap->in_frame,
|
Debug(1, "Blending because %p and format %d != %d, %d", snap->in_frame,
|
||||||
|
|
|
@ -109,7 +109,7 @@ void ZoneMinderFifoSource::WriteRun() {
|
||||||
fuNal.buffer()[2] = fuNal.buffer()[2]&~0x80; // FU header (no S bit)
|
fuNal.buffer()[2] = fuNal.buffer()[2]&~0x80; // FU header (no S bit)
|
||||||
headerSize = 3;
|
headerSize = 3;
|
||||||
}
|
}
|
||||||
while (nalRemaining) {
|
while (nalRemaining && !stop_) {
|
||||||
if ( nalRemaining < maxNalSize ) {
|
if ( nalRemaining < maxNalSize ) {
|
||||||
// This is the last fragment:
|
// This is the last fragment:
|
||||||
fuNal.buffer()[headerSize-1] |= 0x40; // set the E bit in the FU header
|
fuNal.buffer()[headerSize-1] |= 0x40; // set the E bit in the FU header
|
||||||
|
@ -166,7 +166,7 @@ int ZoneMinderFifoSource::getNextFrame() {
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug(3, "%s bytes read %d bytes, buffer size %u", m_fifo.c_str(), bytes_read, m_buffer.size());
|
Debug(3, "%s bytes read %d bytes, buffer size %u", m_fifo.c_str(), bytes_read, m_buffer.size());
|
||||||
while (m_buffer.size()) {
|
while (m_buffer.size() and !stop_) {
|
||||||
unsigned int data_size = 0;
|
unsigned int data_size = 0;
|
||||||
int64_t pts;
|
int64_t pts;
|
||||||
unsigned char *header_end = nullptr;
|
unsigned char *header_end = nullptr;
|
||||||
|
@ -224,7 +224,7 @@ int ZoneMinderFifoSource::getNextFrame() {
|
||||||
int bytes_needed = data_size - (m_buffer.size() - header_size);
|
int bytes_needed = data_size - (m_buffer.size() - header_size);
|
||||||
if (bytes_needed > 0) {
|
if (bytes_needed > 0) {
|
||||||
Debug(4, "Need another %d bytes. Trying to read them", bytes_needed);
|
Debug(4, "Need another %d bytes. Trying to read them", bytes_needed);
|
||||||
while (bytes_needed) {
|
while (bytes_needed and !stop_) {
|
||||||
bytes_read = m_buffer.read_into(m_fd, bytes_needed);
|
bytes_read = m_buffer.read_into(m_fd, bytes_needed);
|
||||||
if (bytes_read <= 0) {
|
if (bytes_read <= 0) {
|
||||||
Debug(1, "Failed to read another %d bytes, got %d.", bytes_needed, bytes_read);
|
Debug(1, "Failed to read another %d bytes, got %d.", bytes_needed, bytes_read);
|
||||||
|
@ -252,13 +252,14 @@ int ZoneMinderFifoSource::getNextFrame() {
|
||||||
{
|
{
|
||||||
std::unique_lock<std::mutex> lck(mutex_);
|
std::unique_lock<std::mutex> lck(mutex_);
|
||||||
Debug(3, "have lock");
|
Debug(3, "have lock");
|
||||||
while (framesList.size()) {
|
while (!stop_ && framesList.size()) {
|
||||||
std::pair<unsigned char*, size_t> nal = framesList.front();
|
std::pair<unsigned char*, size_t> nal = framesList.front();
|
||||||
framesList.pop_front();
|
framesList.pop_front();
|
||||||
NAL_Frame *Nal = new NAL_Frame(nal.first, nal.second, pts);
|
NAL_Frame *Nal = new NAL_Frame(nal.first, nal.second, pts);
|
||||||
m_nalQueue.push(Nal);
|
m_nalQueue.push(Nal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Debug(3, "notifying");
|
||||||
condition_.notify_all();
|
condition_.notify_all();
|
||||||
} // end while m_buffer.size()
|
} // end while m_buffer.size()
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue