From a9e3baa1f3b00e5217af395854ec4ce1b1907a0d Mon Sep 17 00:00:00 2001 From: Stephen Rhodes Date: Tue, 13 Dec 2022 19:35:23 -0500 Subject: [PATCH 1/3] cleanup settings panel for windows --- libavio/src/Reader.cpp | 3 ++- onvif-gui/include/settingspanel.h | 1 - onvif-gui/src/settingspanel.cpp | 18 +++++++++++------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/libavio/src/Reader.cpp b/libavio/src/Reader.cpp index 93ba18ca..c7f3bc91 100644 --- a/libavio/src/Reader.cpp +++ b/libavio/src/Reader.cpp @@ -55,10 +55,11 @@ Reader::Reader(const char* filename) #else av_dict_set(&opts, "stimeout", "5000000", 0); #endif + ex.ck(avformat_open_input(&fmt_ctx, filename, NULL, &opts), CmdTag::AOI); + av_dict_free(&opts); timeout_start = time(NULL); - AVIOInterruptCB cb = { interrupt_callback, this }; fmt_ctx->interrupt_callback = cb; diff --git a/onvif-gui/include/settingspanel.h b/onvif-gui/include/settingspanel.h index 9a0483bb..8cd81181 100644 --- a/onvif-gui/include/settingspanel.h +++ b/onvif-gui/include/settingspanel.h @@ -52,7 +52,6 @@ class SettingsPanel : public QWidget QLineEdit *commonUsername; QLineEdit *commonPassword; QCheckBox *lowLatency; - QCheckBox *hardwareDecoding; QComboBox *hardwareDecoders; QSlider *zoom; QSlider *panX; diff --git a/onvif-gui/src/settingspanel.cpp b/onvif-gui/src/settingspanel.cpp index f5f58924..e5324dee 100644 --- a/onvif-gui/src/settingspanel.cpp +++ b/onvif-gui/src/settingspanel.cpp @@ -71,16 +71,16 @@ SettingsPanel::SettingsPanel(QMainWindow* parent) QStringList decoders = { "NONE", - "VDPAU", "CUDA", "VAAPI", + "VDPAU", "DXVA2", - "QSV", - "VIDEOTOOLBOX", "D3D11VA", + "QSV", "DRM", "OPENCL", - "MEDIACODEC" +// "MEDIACODEC" +// "VIDEOTOOLBOX", }; listDecoders = new QListWidget(this); @@ -305,6 +305,7 @@ void SettingsPanel::getActiveNetworkInterfaces() PIP_ADAPTER_INFO pAdapter = NULL; DWORD dwRetVal = 0; //UINT i; + QStringList args; ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO); pAdapterInfo = (IP_ADAPTER_INFO *) malloc(sizeof (IP_ADAPTER_INFO)); @@ -329,11 +330,15 @@ void SettingsPanel::getActiveNetworkInterfaces() char interface_info[1024]; sprintf(interface_info, "%s - %s", pAdapter->IpAddressList.IpAddress.String, pAdapter->Description); emit msg(QString("Network interface info %1").arg(interface_info)); - networkInterfaces->addItem(QString(interface_info)); + args.push_back(interface_info); } pAdapter = pAdapter->Next; } - } else { + interfaces->addItems(args); + networkInterfaces->setModel(interfaces->model()); + networkInterfaces->setView(interfaces); + } + else { emit msg(QString("GetAdaptersInfo failed with error: %1").arg(dwRetVal)); } if (pAdapterInfo) @@ -372,7 +377,6 @@ void SettingsPanel::getActiveNetworkInterfaces() label += " - "; label += ifa->ifa_name; emit msg(label); - //networkInterfaces->addItem(label); args.push_back(label); } From 08262357ce5292d6967d82f73448b59e52b34b75 Mon Sep 17 00:00:00 2001 From: sr99622 <54281528+sr99622@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:21:52 -0500 Subject: [PATCH 2/3] Update README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7c13f45..33e58c27 100644 --- a/README.md +++ b/README.md @@ -55,8 +55,9 @@ refer to the link https://docs.anaconda.com/anaconda/install/windows/. Once anaconda has been installed, launch a conda prompt and then use the following commands to build. You will need to have Microsoft Visual Studio installed with the C++ compiler. After the build, the executable files can be found in -the Release directory. The conda environment must be active when running the -program. +the Release directory. The cmake installer will integrate the executables and +development files into the conda environment. The conda environment must be +active when running the executables. ```bash conda create --name onvif -c conda-forge qt libxml2 ffmpeg sdl2 git cmake @@ -65,8 +66,9 @@ git clone https://github.com/sr99622/libonvif.git cd libonvif mkdir build cd build -cmake -DBUILD_GUI=ON .. +cmake -DBUILD_GUI=ON -DCMAKE_INSTALL_PREFIX=%CONDA_PREFIX%\Library .. cmake --build . --config Release +cmake --install . ``` ALTERNATE WINDOWS BUILD From 79dd93b96f14bdf0e1a73ec06ea6ceb851d90a87 Mon Sep 17 00:00:00 2001 From: sr99622 <54281528+sr99622@users.noreply.github.com> Date: Tue, 13 Dec 2022 21:27:29 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 33e58c27..7848ffce 100644 --- a/README.md +++ b/README.md @@ -54,13 +54,12 @@ environment to install dependencies. To install anaconda on Windows, please refer to the link https://docs.anaconda.com/anaconda/install/windows/. Once anaconda has been installed, launch a conda prompt and then use the following commands to build. You will need to have Microsoft Visual Studio installed -with the C++ compiler. After the build, the executable files can be found in -the Release directory. The cmake installer will integrate the executables and -development files into the conda environment. The conda environment must be -active when running the executables. +with the C++ compiler, as well as git and cmake. The cmake installer will +integrate the executables and development files into the conda environment. +The conda environment must be active when running the executables. ```bash -conda create --name onvif -c conda-forge qt libxml2 ffmpeg sdl2 git cmake +conda create --name onvif -c conda-forge qt libxml2 ffmpeg sdl2 conda activate onvif git clone https://github.com/sr99622/libonvif.git cd libonvif