Skip to content

Commit

Permalink
Long Term Stability Testing, OpenVINO support
Browse files Browse the repository at this point in the history
  • Loading branch information
sr99622 committed Jul 1, 2024
1 parent 978a3df commit 8d0a495
Show file tree
Hide file tree
Showing 36 changed files with 1,046 additions and 624 deletions.
218 changes: 109 additions & 109 deletions README.md

Large diffs are not rendered by default.

Binary file modified assets/images/media_tab.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/settings_panel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/yolox.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions assets/scripts/build_pkgs.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ cd ..
cd onvif-gui
python -m build
cd ..
for /R libonvif\dist %%F in (*.whl) do pip install %%F
for /R libavio\dist %%F in (*.whl) do pip install %%F
for /R onvif-gui\dist %%F in (*.whl) do pip install %%F
for /R libonvif\dist %%F in (*.whl) do pip install "%%F"
for /R libavio\dist %%F in (*.whl) do pip install "%%F"
for /R onvif-gui\dist %%F in (*.whl) do pip install "%%F"
38 changes: 29 additions & 9 deletions assets/scripts/clean
Original file line number Diff line number Diff line change
@@ -1,14 +1,34 @@
#!/bin/bash
find . -type f -name '._*' -delete
cd libonvif
rm -R build
rm -R libonvif.egg-info
rm -R dist

FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=libonvif.egg-info
if [ -d "$FILE" ]; then
rm -R libonvif.egg-info
fi

cd ../libavio
rm -R build
rm -R avio.egg-info
rm -R dist
FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=avio.egg-info
if [ -d "$FILE" ]; then
rm -R avio.egg-info
fi

cd ../onvif-gui
rm -R build
rm -R onvif_gui.egg-info
rm -R dist
FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=onvif_gui.egg-info
if [ -d "$FILE" ]; then
rm -R onvif_gui.egg-info
fi

cd ..
27 changes: 18 additions & 9 deletions assets/scripts/clean.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
cd libonvif
rmdir /q /s build
rmdir /q /s libonvif.egg-info
rmdir /q /s dist
if exist build\ (
rmdir /s /q build
)
if exist libonvif.egg-info\ (
rmdir /s /q libonvif.egg-info
)
cd ../libavio
rmdir /q /s build
rmdir /q /s avio.egg-info
rmdir /q /s dist
if exist build\ (
rmdir /s /q build
)
if exist avio.egg-info\ (
rmdir /s /q avio.egg-info
)
cd ../onvif-gui
rmdir /q /s build
rmdir /q /s onvif_gui.egg-info
rmdir /q /s dist
if exist build\ (
rmdir /s /q build
)
if exist onvif_gui.egg-info\ (
rmdir /s /q onvif_gui.egg-info
)
cd ..
34 changes: 28 additions & 6 deletions assets/scripts/compile
Original file line number Diff line number Diff line change
@@ -1,14 +1,36 @@
#!/bin/bash

cd libonvif
rm -R build
rm -R libonvif.egg-info

FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=libonvif.egg-info
if [ -d "$FILE" ]; then
rm -R libonvif.egg-info
fi
pip install -v .

cd ../libavio
rm -R build
rm -R avio.egg-info
FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=avio.egg-info
if [ -d "$FILE" ]; then
rm -R avio.egg-info
fi
pip install -v .

cd ../onvif-gui
rm -R build
rm -R onvif_gui.egg-info
FILE=build
if [ -d "$FILE" ]; then
rm -R build
fi
FILE=onvif_gui.egg-info
if [ -d "$FILE" ]; then
rm -R onvif_gui.egg-info
fi
pip install .
cd ..
24 changes: 18 additions & 6 deletions assets/scripts/compile.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
cd libonvif
rmdir /s /q build
rmdir /s /q libonvif.egg-info
if exist build\ (
rmdir /s /q build
)
if exist libonvif.egg-info\ (
rmdir /s /q libonvif.egg-info
)
pip install -v .
cd ../libavio
rmdir /s /q build
rmdir /s /q avio.egg-info
if exist build\ (
rmdir /s /q build
)
if exist avio.egg-info\ (
rmdir /s /q avio.egg-info
)
pip install -v .
cd ../onvif-gui
rmdir /s /q build
rmdir /s /q onvif_gui.egg-info
if exist build\ (
rmdir /s /q build
)
if exist onvif_gui.egg-info\ (
rmdir /s /q onvif_gui.egg-info
)
pip install .
cd ..
19 changes: 17 additions & 2 deletions libonvif/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,27 @@ IF (NOT WITHOUT_PYTHON)
${LIBXML2_LIBRARIES}
)

message("-- LIBXML2_INCLUDE_DIRS: "${LIBXML2_INCLUDE_DIRS})
message("-- LIBXML2_LIBRARIES: "${LIBXML2_LIBRARIES})
message("-- LIBXML2_INCLUDE_DIRS: " ${LIBXML2_INCLUDE_DIRS})
message("-- LIBXML2_LIBRARIES: " ${LIBXML2_LIBRARIES})

target_include_directories(pyonvif PUBLIC
include
${LIBXML2_INCLUDE_DIRS}
)

endif()

IF (BUILD_TEST)
add_executable(onvif-test
test/onvif-test.cpp
)

target_link_libraries(onvif-test PRIVATE
libonvif
)

target_include_directories(onvif-test PUBLIC
include
)

endif()
2 changes: 2 additions & 0 deletions libonvif/include/onvif.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ struct OnvifData {
bool analyze_audio;
int desired_aspect;
bool hidden;
int cache_max;
bool sync_audio;
};

struct OnvifSession {
Expand Down
42 changes: 42 additions & 0 deletions libonvif/include/onvif_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ class Data
Data profile(*this);
getProfileToken(profile, index);
if (profile.profile().length() == 0)

break;
getStreamUri(profile.data);
profiles.push_back(profile);
Expand Down Expand Up @@ -677,6 +678,21 @@ class Data
bool audio_multicast_auto_start() { return data->audio_multicast_auto_start; }

//GUI INTERFACE

/*
Please note that this class is intended to be self contained within the C++ domain. It will not
behave as expected if the calling python program attempts to extend the functionality of the
class by adding member variables in the python domain. This was done so that the profile could
be copied or filled with data by the C++ class exclusively, removing the need for additional
synchronization code in the python domain.
The effect of this decision is that GUI persistence for profiles must be implemented in this
C++ class directly. The member variables are added to the OnvifData structure in onvif.h and
the copyData and clearData functions in onvif.c. GUI persistence is handled by passing setSetting
and getSetting from the calling python program for writing variable states to disk.
*/


bool getDisableVideo() {
std::stringstream str;
str << serial_number() << "/" << profile() << "/DisableVideo";
Expand Down Expand Up @@ -721,6 +737,17 @@ class Data
str << serial_number() << "/" << profile() << "/AnalyzeAudio";
setSetting(str.str(), arg ? "1" : "0");
}
bool getSyncAudio() {
std::stringstream str;
str << serial_number() << "/" << profile() << "/SyncAudio";
return getSetting(str.str(), "0") == "1";
}
void setSyncAudio(bool arg) {
data->sync_audio = arg;
std::stringstream str;
str << serial_number() << "/" << profile() << "/SyncAudio";
setSetting(str.str(), arg ? "1" : "0");
}
bool getHidden() {
std::stringstream str;
str << serial_number() << "/" << profile() << "/Hidden";
Expand Down Expand Up @@ -748,6 +775,21 @@ class Data
str_val << arg;
setSetting(str_key.str(), str_val.str());
}
int getCacheMax() {
std::stringstream str_key, str_val;
str_key << serial_number() << "/" << profile() << "/CacheMax";
str_val << getSetting(str_key.str(), "100");
int result = 100;
str_val >> result;
return result;
}
void setCacheMax(int arg) {
data->cache_max = arg;
std::stringstream str_key, str_val;
str_key << serial_number() << "/" << profile() << "/CacheMax";
str_val << arg;
setSetting(str_key.str(), str_val.str());
}

};

Expand Down
2 changes: 1 addition & 1 deletion libonvif/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "libonvif"
version = "3.1.1"
version = "3.2.0"
authors = [
{ name="Stephen Rhodes", email="[email protected]" },
]
Expand Down
24 changes: 13 additions & 11 deletions libonvif/setup.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
#*******************************************************************************
# libonvif/setup.py
#
# Copyright (c) 2024 Stephen Rhodes
# Copyright (c) 2023, 2024 Stephen Rhodes
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# http://www.apache.org/licenses/LICENSE-2.0
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
#******************************************************************************/

Expand All @@ -26,7 +28,7 @@
from setuptools.command.build_ext import build_ext

PKG_NAME = "libonvif"
VERSION = "3.1.1"
VERSION = "3.2.0"

class CMakeExtension(Extension):
def __init__(self, name, sourcedir=""):
Expand Down
Loading

0 comments on commit 8d0a495

Please sign in to comment.