├── README.md ├── player ├── README ├── cross_compile_ffmpeg.sh ├── ext │ ├── FFMPEG-4.4 │ │ └── README │ ├── OpenSSL-1.0.1 │ │ └── README │ ├── PortAudio │ │ └── README │ └── pugixml │ │ └── README ├── prebuild.sh ├── prerun.sh ├── proj │ ├── ONVIFPlayer-MinGW │ │ └── ONVIFPlayer.pro │ ├── ONVIFPlayer-VS2019 │ │ ├── ONVIFPlayer-VS2019.sln │ │ ├── ONVIFPlayer.vcxproj │ │ └── ONVIFPlayer.vcxproj.filters │ └── tests │ │ ├── main.cpp │ │ └── tests.pro └── src │ ├── common │ ├── ONVIFSignInfo.h │ ├── crosscompilation_cxx11.h │ ├── crosscompilation_inttypes.h │ ├── defines.h │ ├── enums.h │ ├── ffmpeg.h │ ├── queue.h │ ├── segmentInfo.cpp │ ├── segmentInfo.h │ ├── signingInformation.h │ └── types.h │ ├── main.cpp │ ├── parser │ ├── additionalUserInformation.hpp │ ├── afIdentificationBox.hpp │ ├── basic │ │ ├── box.cpp │ │ ├── box.h │ │ ├── contentBox.hpp │ │ ├── dataBox.hpp │ │ ├── fileBox.hpp │ │ ├── fullBox.hpp │ │ ├── mandatoryBox.cpp │ │ ├── mandatoryBox.h │ │ ├── mixin │ │ │ ├── children.hpp │ │ │ ├── data.hpp │ │ │ └── table.hpp │ │ ├── superBox.hpp │ │ ├── superFullBox.hpp │ │ ├── tableBox.hpp │ │ ├── unknownBox.cpp │ │ └── unknownBox.h │ ├── boxFactory.cpp │ ├── boxFactory.h │ ├── cameraMicrophoneIdentificationBox.hpp │ ├── certificateBox.hpp │ ├── certificateStorage.cpp │ ├── certificateStorage.h │ ├── compactSampleSizeBox.hpp │ ├── consistencyChecker.cpp │ ├── consistencyChecker.h │ ├── correctstarttimebox.hpp │ ├── editListBox.hpp │ ├── fileTypeBox.hpp │ ├── fourcc.cpp │ ├── fourcc.h │ ├── helpers │ │ ├── endian.hpp │ │ ├── is_a.hpp │ │ ├── istream.hpp │ │ ├── optional.hpp │ │ ├── property.hpp │ │ └── uint24.hpp │ ├── mediaHeaderBox.hpp │ ├── mediaParser.cpp │ ├── mediaParser.h │ ├── movieExtendsHeaderBox.hpp │ ├── movieHeaderBox.hpp │ ├── oxfverifier.cpp │ ├── oxfverifier.h │ ├── sampleDependencyTypeBox.hpp │ ├── sampleSizeBox.hpp │ ├── segmentExtractor.cpp │ ├── segmentExtractor.h │ ├── signatureBox.hpp │ ├── signatureConfigurationBox.hpp │ ├── signatureExtractor.cpp │ ├── signatureExtractor.h │ ├── surveillanceExportBox.hpp │ ├── surveillanceMetadataSampleConfigBox.hpp │ ├── surveillanceMetadataSampleEntryBox.hpp │ ├── templateContentBoxes.hpp │ ├── templateFullBoxes.hpp │ ├── templateSuperBoxes.hpp │ ├── templateSuperFullBoxes.hpp │ ├── templateTableBoxes.hpp │ ├── trackFragmentHeaderBox.hpp │ ├── trackFragmentRandomAccessBox.hpp │ ├── trackHeaderBox.hpp │ ├── trackRunBox.hpp │ ├── validatorISO.cpp │ ├── validatorISO.h │ ├── validatorOXF.cpp │ ├── validatorOXF.h │ ├── validatorSurveillance.cpp │ └── validatorSurveillance.h │ ├── parserUI │ ├── certificateStorageDialog.cpp │ ├── certificateStorageDialog.h │ ├── certificateStorageDialog.ui │ ├── oxfverifier.cpp │ ├── oxfverifier.h │ ├── parserWidget.cpp │ ├── parserWidget.h │ ├── parserWidget.ui │ ├── verifyerdialog.cpp │ ├── verifyerdialog.h │ └── verifyerdialog.ui │ ├── player │ ├── audioContext.cpp │ ├── audioContext.h │ ├── audioPlayback.cpp │ ├── audioPlayback.h │ ├── avFrameWrapper.cpp │ ├── avFrameWrapper.h │ ├── basePlayback.h │ ├── controller.cpp │ ├── controller.h │ ├── decoder.h │ ├── engine.cpp │ ├── engine.h │ ├── portAudioPlayback.cpp │ ├── portAudioPlayback.h │ ├── portAudioThread.cpp │ ├── portAudioThread.h │ ├── queuedAudioDecoder.cpp │ ├── queuedAudioDecoder.h │ ├── queuedDecoder.h │ ├── queuedMetadataDecoder.cpp │ ├── queuedMetadataDecoder.h │ ├── queuedVideoDecoder.cpp │ ├── queuedVideoDecoder.h │ ├── streamReader.cpp │ ├── streamReader.h │ ├── syncThread.cpp │ ├── syncThread.h │ ├── videoContext.cpp │ ├── videoContext.h │ ├── videoPlayback.cpp │ └── videoPlayback.h │ ├── playerUI │ ├── clickableSlider.cpp │ ├── clickableSlider.h │ ├── controlsWidget.cpp │ ├── controlsWidget.h │ ├── controlsWidget.ui │ ├── fullscreenPlayerWidget.cpp │ ├── fullscreenPlayerWidget.h │ ├── movingOutArea.cpp │ ├── movingOutArea.h │ ├── playerWidget.cpp │ ├── playerWidget.h │ ├── playerWidget.ui │ ├── playerWidgetInterface.h │ ├── videoFrameWidget.cpp │ └── videoFrameWidget.h │ ├── resources │ ├── ONVIFPlayer.ico │ ├── ONVIFPlayer.rc │ ├── Onvif.png │ ├── fullscreen.png │ ├── media_next.png │ ├── media_pause.png │ ├── media_play.png │ ├── media_prev.png │ ├── media_stop.png │ ├── movie_frame.png │ ├── mute.png │ ├── resources.qrc │ └── volume.png │ └── tests │ ├── additionalUserInformationBoxTest.cpp │ ├── additionalUserInformationBoxTest.h │ ├── afIdentificationBoxTest.cpp │ ├── afIdentificationBoxTest.h │ ├── boxTestsCommon.h │ ├── cameraMicrophoneIdentificationBoxTest.cpp │ ├── cameraMicrophoneIdentificationBoxTest.h │ ├── certificateBoxTest.cpp │ ├── certificateBoxTest.h │ ├── certificateSSLTest.cpp │ ├── certificateSSLTest.h │ ├── compactSampleSizeBoxTest.cpp │ ├── compactSampleSizeBoxTest.h │ ├── editListBoxTest.cpp │ ├── editListBoxTest.h │ ├── engineTest.cpp │ ├── engineTest.h │ ├── mediaHeaderBoxTest.cpp │ ├── mediaHeaderBoxTest.h │ ├── movieExtendsHeaderBoxTest.cpp │ ├── movieExtendsHeaderBoxTest.h │ ├── movieHeaderBoxTest.cpp │ ├── movieHeaderBoxTest.h │ ├── ostream.hpp │ ├── sampleDependencyTypeBoxTest.cpp │ ├── sampleDependencyTypeBoxTest.h │ ├── sampleSizeBoxTest.cpp │ ├── sampleSizeBoxTest.h │ ├── signatureBoxTest.cpp │ ├── signatureBoxTest.h │ ├── signatureConfigurationBoxTest.cpp │ ├── signatureConfigurationBoxTest.h │ ├── surveillanceExportBoxTest.cpp │ ├── surveillanceExportBoxTest.h │ ├── surveillanceMetadataSampleConfigBoxTest.cpp │ ├── surveillanceMetadataSampleConfigBoxTest.h │ ├── surveillanceMetadataSampleEntryBoxTest.cpp │ ├── surveillanceMetadataSampleEntryBoxTest.h │ ├── trackFragmentHeaderBoxTest.cpp │ ├── trackFragmentHeaderBoxTest.h │ ├── trackFragmentRandomAccessBoxTest.cpp │ ├── trackFragmentRandomAccessBoxTest.h │ ├── trackHeaderBoxTest.cpp │ ├── trackHeaderBoxTest.h │ ├── trackRunBoxTest.cpp │ └── trackRunBoxTest.h └── setup ├── README.md ├── license.txt ├── setup.ico ├── setup_MinGW.iss ├── setup_VS.iss └── setup_private.iss /README.md: -------------------------------------------------------------------------------- 1 | # oxfplayer - ONVIF Export File Player 2 | 3 | Reference player for signed ONVIF export files with metadata. 4 | 5 | ![Screenshot](http://developer.onvif.org/pub/export/oxfplayer-1.jpg) 6 | 7 | ## Overview 8 | The reference player is provided by ONVIF as open source to ease third party verification of the cryptographic mechanism. 9 | It supports playback of mp4 and qt files with and without absolute timestamps. 10 | Authenticity of the media can be verified via signature verification. 11 | 12 | The player supports rendering of timed metadata bounding boxes and object shapes. 13 | Recorded metadata events are displayed in the left hand panel with on click timeline navigation. 14 | 15 | ## Environment 16 | The UI is based on Qt. Build envrionments are provided for Windows and Linux. 17 | ## License 18 | 19 | BSD 3 clause 20 | 21 | ## Binaries 22 | * [Version 2.1 (Windows)](https://github.com/onvif/oxfplayer/releases/download/2.1/ONVIFPlayerSetup-2.1.exe) 23 | * [Version 2.0 (Windows)](https://github.com/onvif/oxfplayer/releases/download/2.0/ONVIFPlayerSetup.exe) 24 | * [Version 1.1 (Windows)](https://github.com/onvif/oxfplayer/blob/1.1/ONVIFPlayerSetup.exe) 25 | 26 | ## References 27 | 28 | * [ISO/IEC 14496-12](https://www.iso.org/standard/68960.html) 29 | * [ONVIF Export File Format](https://www.onvif.org/specs/stream/ONVIF-ExportFileFormat-Spec.pdf) 30 | * [MP4RA Box registry](https://mp4ra.org/#/atoms) 31 | -------------------------------------------------------------------------------- /player/ext/FFMPEG-4.4/README: -------------------------------------------------------------------------------- 1 | For windows build either build from sources or obtain binaries from 2 | 3 | https://www.gyan.dev/ffmpeg/builds/#release-builds 4 | 5 | https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.4-full_build-shared.7z 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /player/ext/OpenSSL-1.0.1/README: -------------------------------------------------------------------------------- 1 | For windows build either build from sources or obtain binaries from 2 | 3 | https://indy.fulgan.com/SSL/LinkLibs/openssl-1.0.1u-x64_86-win64_LinkLibs.zip 4 | 5 | Additionally you need the include directory which may be taken from the respective branch at github: 6 | 7 | https://github.com/openssl/openssl 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /player/ext/PortAudio/README: -------------------------------------------------------------------------------- 1 | For windows build either build from sources or obtain binaries from 2 | 3 | https://raw.githubusercontent.com/adfernandes/precompiled-portaudio-windows/master/portaudio-r1891-build.zip 4 | 5 | https://indy.fulgan.com/SSL/LinkLibs/openssl-1.0.1u-x64_86-win64_LinkLibs.zip 6 | 7 | Additionally you need the include directory which may be taken from the respective branch at github: 8 | 9 | https://github.com/openssl/openssl 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /player/ext/pugixml/README: -------------------------------------------------------------------------------- 1 | Get sources https://pugixml.org/. 2 | 3 | Either copy the full tree including documentation here or just the sources to folder src. 4 | -------------------------------------------------------------------------------- /player/proj/ONVIFPlayer-VS2019/ONVIFPlayer-VS2019.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.31005.135 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ONVIFPlayer", "ONVIFPlayer.vcxproj", "{C10FDDC9-2312-384F-95D6-9D3E4DAD3CDA}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Release|x64 = Release|x64 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C10FDDC9-2312-384F-95D6-9D3E4DAD3CDA}.Debug|x64.ActiveCfg = Debug|x64 15 | {C10FDDC9-2312-384F-95D6-9D3E4DAD3CDA}.Debug|x64.Build.0 = Debug|x64 16 | {C10FDDC9-2312-384F-95D6-9D3E4DAD3CDA}.Release|x64.ActiveCfg = Release|x64 17 | {C10FDDC9-2312-384F-95D6-9D3E4DAD3CDA}.Release|x64.Build.0 = Release|x64 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | Qt5Version = 5.1.0 x86 24 | SolutionGuid = {15FA64A3-C474-4934-9F51-0B463A170D8A} 25 | EndGlobalSection 26 | EndGlobal 27 | -------------------------------------------------------------------------------- /player/src/common/ONVIFSignInfo.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef ONVIFSIGNINFO_H 29 | #define ONVIFSIGNINFO_H 30 | 31 | #include 32 | #include 33 | 34 | #include "signingInformation.h" 35 | 36 | //! Class describing ONVIF signing information. 37 | /*! 38 | * \brief Declared in Onvif Export File Format. \n 39 | */ 40 | class ONVIFSigningInformation 41 | { 42 | public: 43 | ONVIFSigningInformation() : m_signsList() {} 44 | 45 | //! 46 | void addSignature(const SigningInformation & signature) { m_signsList.push_back(signature); } 47 | 48 | //! This method returns how many times this particular file has been signed 49 | int getSignCount(void) const { return m_signsList.count(); } 50 | 51 | //! get signing information with specified index 52 | const SigningInformation& getSigningInformation(int indx) const { return m_signsList.at(indx); } 53 | 54 | private: 55 | QList m_signsList; 56 | 57 | }; 58 | 59 | typedef QMap SigningInformationMap; 60 | 61 | #endif // ONVIFSIGNINFO_H 62 | -------------------------------------------------------------------------------- /player/src/common/crosscompilation_cxx11.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CROSSCOMPILATION_CXX11_H 29 | #define CROSSCOMPILATION_CXX11_H 30 | 31 | #ifdef _MSC_VER 32 | # if (_MSC_VER <= 1600) 33 | # define CC_CXX11_EXPLICIT_CONVERSION 34 | # define CC_CXX11_FINAL 35 | # define CC_CXX11_OVERRIDE 36 | # define CC_MSSPEC_TUPLE_NIL std::tr1::_Nil 37 | # define _VARIADIC_MAX 10 38 | # include 39 | # elif (_MSC_VER <= 1700) 40 | # define CC_CXX11_EXPLICIT_CONVERSION 41 | # define CC_CXX11_FINAL final 42 | # define CC_CXX11_OVERRIDE override 43 | # define CC_MSSPEC_TUPLE_NIL std::_Nil 44 | # define _VARIADIC_MAX 10 45 | # include 46 | # else 47 | # define CC_CXX11_EXPLICIT_CONVERSION explicit 48 | # define CC_CXX11_FINAL final 49 | # define CC_CXX11_OVERRIDE override 50 | # define CC_CXX11_SUPPORT_VARIADIC_TEMPLATES 51 | # include 52 | # endif 53 | #else 54 | # define CC_CXX11_EXPLICIT_CONVERSION explicit 55 | # define CC_CXX11_FINAL final 56 | # define CC_CXX11_OVERRIDE override 57 | # define CC_CXX11_SUPPORT_VARIADIC_TEMPLATES 58 | # include 59 | #endif 60 | 61 | #endif // CROSSCOMPILATION_CXX11_H 62 | -------------------------------------------------------------------------------- /player/src/common/crosscompilation_inttypes.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CROSSCOMPILATION_INTTYPES_H 29 | #define CROSSCOMPILATION_INTTYPES_H 30 | 31 | #ifdef _MSC_VER 32 | #include 33 | #else 34 | #include 35 | #endif 36 | 37 | #endif // CROSSCOMPILATION_INTTYPES_H 38 | -------------------------------------------------------------------------------- /player/src/common/enums.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef ENUMS_H 29 | #define ENUMS_H 30 | 31 | //! Player state. 32 | enum PlayerState 33 | { 34 | Stopped, /*!< player stopped. */ 35 | Playing, /*!< player playing. */ 36 | Paused /*!< player paused. */ 37 | }; 38 | 39 | //! Moving direction. 40 | enum MovingDirection 41 | { 42 | Up, /*!< move up. */ 43 | Right, /*!< move right. */ 44 | Down, /*!< move down. */ 45 | Left /*!< move left. */ 46 | }; 47 | 48 | #endif // ENUMS_H 49 | -------------------------------------------------------------------------------- /player/src/common/ffmpeg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef FFMPEG_H 29 | #define FFMPEG_H 30 | 31 | #ifdef __cplusplus 32 | #define __STDC_CONSTANT_MACROS 33 | #ifdef _STDINT_H 34 | #undef _STDINT_H 35 | #endif 36 | #include 37 | #endif 38 | 39 | extern "C" 40 | { 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | } 48 | 49 | #endif // FFMPEG_H 50 | -------------------------------------------------------------------------------- /player/src/common/signingInformation.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SIGNINGINFORMATION_H 29 | #define SIGNINGINFORMATION_H 30 | 31 | #include 32 | #include 33 | 34 | #include "signatureBox.hpp" 35 | 36 | //! Class describing one particular sign. 37 | /*! 38 | * \brief Contains oinformation about one signing. \n 39 | */ 40 | class SigningInformation 41 | { 42 | public: 43 | SigningInformation(QByteArray certificate, QByteArray algorithm_id, QString user_information, SignatureBox * signature_box) 44 | : m_certificate(certificate) 45 | , m_algorithm_id(algorithm_id) 46 | , m_user_information(user_information) 47 | , m_signature_box(signature_box) 48 | {} 49 | 50 | 51 | public: 52 | SignatureBox* getSignatureBox() const { return m_signature_box; } 53 | QByteArray getCertificate(void) const { return m_certificate; } 54 | QByteArray getSignData(void) const { return m_signature_box->getSignature(); } 55 | QByteArray getAlgorithmId(void) const { return m_algorithm_id; } 56 | QString getUserInformation(void) const { return m_user_information; } 57 | 58 | //Size information getters and setters 59 | int64_t getTotalSize(void) const { return m_signature_box->getTotalSize(); } 60 | 61 | int64_t getOffsetToSignBox(void) const { return m_signature_box->getBoxOffset(); } 62 | 63 | int64_t getSignatureSize(void) const { return m_signature_box->getSignature().size(); } 64 | 65 | private: 66 | QByteArray m_certificate; 67 | QByteArray m_algorithm_id; 68 | QString m_user_information; 69 | SignatureBox* m_signature_box; 70 | }; 71 | 72 | #endif // SIGNINGINFORMATION_H 73 | -------------------------------------------------------------------------------- /player/src/main.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "crosscompilation_cxx11.h" 29 | 30 | #include 31 | 32 | #include "controller.h" 33 | int main(int argc, char *argv[]) 34 | { 35 | QApplication a(argc, argv); 36 | 37 | Engine engine; 38 | 39 | PlayerWidget player_widget; 40 | 41 | FullscreenPlayerWidget fullscreen_player_widget; 42 | 43 | ControlsWidget controls_widget; 44 | 45 | ParserWidget parser_widget; 46 | 47 | VerifyerDialog verifyer_dialog; 48 | 49 | MediaParser media_parser; 50 | 51 | Controller controller(engine, player_widget, fullscreen_player_widget, controls_widget, parser_widget, verifyer_dialog, media_parser); 52 | 53 | a.setWindowIcon(QIcon(":/icon")); 54 | player_widget.setWindowIcon(QIcon(":/icon")); 55 | fullscreen_player_widget.setWindowIcon(QIcon(":/icon")); 56 | 57 | return a.exec(); 58 | } 59 | 60 | #ifdef WIN32 61 | #include 62 | int CALLBACK WinMain(HINSTANCE , HINSTANCE , LPSTR pCmdLine, int ) 63 | { 64 | return main(1, &pCmdLine); 65 | } 66 | #endif 67 | -------------------------------------------------------------------------------- /player/src/parser/additionalUserInformation.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef ADDITIONAL_USER_INFORMATION_BOX_H 29 | #define ADDITIONAL_USER_INFORMATION_BOX_H 30 | 31 | #include "basic/dataBox.hpp" 32 | 33 | //! Class describing Additional User Information box. 34 | /*! 35 | * \brief Declared in Onvif Export Format. \n 36 | * Type: 'auib' \n 37 | * Container: SchemeInformationBox \n 38 | * Mandatory: No \n 39 | * Quantity: Zero or one 40 | */ 41 | class AdditionalUserInformationBox 42 | : public DataBox 43 | { 44 | public: 45 | typedef DataBox DataBoxType; 46 | 47 | public: 48 | explicit AdditionalUserInformationBox(ChildrenMixin * parent) 49 | : DataBoxType(parent) 50 | {} 51 | 52 | public: 53 | //! Returns the user information string. 54 | QString getUserInformation() 55 | { 56 | return std::get<0>(DataBoxType::m_data); 57 | } 58 | 59 | public: 60 | BOX_INFO("auib", "Additional User Information Box") 61 | 62 | protected: 63 | //! Registers properties for a box type. 64 | virtual void registerProperties() CC_CXX11_OVERRIDE 65 | { 66 | Box::registerProperties(); 67 | BOX_PROPERTY(UserInformation); 68 | } 69 | }; 70 | 71 | #endif // ADDITIONAL_USER_INFORMATION_BOX_H 72 | -------------------------------------------------------------------------------- /player/src/parser/basic/box.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "box.h" 29 | #include "mixin/children.hpp" 30 | 31 | Box::Box(ChildrenMixin * parent /*= nullptr*/) 32 | : m_size_error(SizeOk) 33 | , m_consistency_error(Consistent) 34 | , m_parent(parent) 35 | { 36 | if(nullptr != m_parent) 37 | { 38 | m_parent->addChild(this); 39 | } 40 | } 41 | 42 | void Box::initialize(LimitedStreamReader &stream) 43 | { 44 | Q_UNUSED(stream); 45 | m_offset = stream.getInitialOffset(); 46 | m_size = stream.getShortSize(); 47 | m_large_size = stream.getLongSize(); 48 | registerProperties(); 49 | } 50 | 51 | Box * Box::getParent() const 52 | { 53 | if(m_parent != nullptr) 54 | return m_parent->getThisBox(); 55 | return nullptr; 56 | } 57 | 58 | void Box::registerProperties() 59 | { 60 | BOX_PROPERTY(BoxSize); 61 | BOX_PROPERTY(BoxOffset); 62 | } 63 | 64 | void Box::registerProperty(QString property, PropertyGetter getter) 65 | { 66 | m_known_properties.append(property); 67 | m_property_map[property.toLower()] = getter; 68 | } 69 | -------------------------------------------------------------------------------- /player/src/parser/basic/contentBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_CONTENT_BOX_H 29 | #define BASIC_CONTENT_BOX_H 30 | 31 | #include "box.h" 32 | #include "fullBox.hpp" 33 | 34 | 35 | //! Base class for boxes containing codec media data and codec specific information, which is not really intersting for parser. 36 | class ContentBox 37 | : public Box 38 | { 39 | protected: 40 | ContentBox(ChildrenMixin * parent = nullptr) 41 | : Box(parent) 42 | {} 43 | 44 | public: 45 | //! Reads the box from the input stream. 46 | virtual void initialize(LimitedStreamReader &stream) 47 | { 48 | Box::initialize(stream); 49 | stream.moveToFinish(); 50 | } 51 | }; 52 | 53 | //! Base class for full boxes containing codec media data and codec specific information, which is not really intersting for parser. 54 | class ContentFullBox 55 | : public FullBox<> 56 | { 57 | protected: 58 | ContentFullBox(ChildrenMixin * parent = nullptr) 59 | : FullBox<>(parent) 60 | {} 61 | 62 | public: 63 | //! Reads the box from the input stream. 64 | virtual void initialize(LimitedStreamReader &stream) 65 | { 66 | FullBox<>::initialize(stream); 67 | stream.moveToFinish(); 68 | } 69 | }; 70 | 71 | #endif // BASIC_CONTENT_BOX_H 72 | -------------------------------------------------------------------------------- /player/src/parser/basic/dataBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_DATA_BOX_H 29 | #define BASIC_DATA_BOX_H 30 | 31 | #include "box.h" 32 | #include "mixin/data.hpp" 33 | 34 | //! Base box class for boxes containing data. 35 | /*! 36 | * \param TData... the list of data types that will be contained in a box. 37 | */ 38 | #ifdef CC_CXX11_SUPPORT_VARIADIC_TEMPLATES 39 | 40 | template 41 | class DataBox 42 | : public Box 43 | , public DataMixin 44 | { 45 | protected: 46 | DataBox(ChildrenMixin * parent = nullptr) 47 | : Box(parent) 48 | {} 49 | 50 | public: 51 | //! Reads the box and data from the input stream. 52 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 53 | { 54 | Box::initialize(stream); 55 | DataMixin::initialize(stream); 56 | } 57 | }; 58 | 59 | #else 60 | 61 | template 71 | class DataBox 72 | : public Box 73 | , public DataMixin 74 | { 75 | protected: 76 | DataBox(ChildrenMixin * parent = nullptr) 77 | : Box(parent) 78 | {} 79 | 80 | public: 81 | //! Reads the box and data from the input stream. 82 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 83 | { 84 | Box::initialize(stream); 85 | DataMixin::initialize(stream); 86 | } 87 | }; 88 | 89 | #endif 90 | 91 | #endif // BASIC_DATA_BOX_H 92 | -------------------------------------------------------------------------------- /player/src/parser/basic/fileBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_FILEBOX_H 29 | #define BASIC_FILEBOX_H 30 | 31 | #include "superBox.hpp" 32 | 33 | class FileBox 34 | : public SuperBox 35 | { 36 | public: 37 | FileBox() 38 | : SuperBox(nullptr) 39 | {} 40 | 41 | public: 42 | //! Reads the file contents from the input stream. 43 | virtual void initialize(LimitedStreamReader &stream) 44 | { 45 | Box::initialize(stream); 46 | bool run = false; 47 | do 48 | { 49 | run = BoxFactory::instance().parseBox(stream, this); 50 | } 51 | while(run); 52 | } 53 | 54 | //! Returns the file FourCC code, currently empty 55 | virtual FourCC getBoxFourCC() CC_CXX11_OVERRIDE 56 | { 57 | return FourCC(); 58 | } 59 | 60 | //! Returns the file description 61 | virtual QString getBoxDescription() CC_CXX11_OVERRIDE 62 | { 63 | return "file"; 64 | } 65 | }; 66 | 67 | #endif // BASIC_FILEBOX_H 68 | -------------------------------------------------------------------------------- /player/src/parser/basic/mandatoryBox.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "mandatoryBox.h" 29 | 30 | MandatoryBox::MandatoryBox(const FourCC & four_cc, ChildrenMixin * parent /*= nullptr*/) 31 | : Box(parent) 32 | , m_four_cc(four_cc) 33 | { 34 | m_consistency_error = IsMandatoryBox; 35 | } 36 | 37 | FourCC MandatoryBox::getBoxFourCC() 38 | { 39 | return m_four_cc; 40 | } 41 | 42 | QString MandatoryBox::getBoxDescription() 43 | { 44 | static QString name("Mandatory Box"); 45 | return name; 46 | } 47 | 48 | MandatoryBoxes::MandatoryBoxes(const QList & four_cc_codes, ChildrenMixin * parent /*= nullptr*/) 49 | : Box(parent) 50 | , m_four_cc_codes(four_cc_codes) 51 | { 52 | m_consistency_error = IsMandatoryBox; 53 | } 54 | 55 | FourCC MandatoryBoxes::getBoxFourCC() 56 | { 57 | return m_four_cc_codes.size() > 0 ? m_four_cc_codes.front() : FourCC(); 58 | } 59 | 60 | QString MandatoryBoxes::getBoxDescription() 61 | { 62 | static QString name("Mandatory Boxes"); 63 | return name; 64 | } 65 | 66 | QList MandatoryBoxes::getMandatoryFourCC() 67 | { 68 | return m_four_cc_codes; 69 | } 70 | -------------------------------------------------------------------------------- /player/src/parser/basic/mandatoryBox.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_MANDATORYBOX_H 29 | #define BASIC_MANDATORYBOX_H 30 | 31 | #include "contentBox.hpp" 32 | #include "helpers/optional.hpp" 33 | 34 | //! Box class for mandatory boxes. This box is a stub, created when a mandatory 'exactly one' or 'one or more' box is missing. 35 | class MandatoryBox CC_CXX11_FINAL 36 | : public Box 37 | { 38 | public: 39 | explicit MandatoryBox(const FourCC & fourCC, ChildrenMixin * parent = nullptr); 40 | 41 | public: 42 | //! Returns the FourCC code of a missing mandatory box. 43 | virtual FourCC getBoxFourCC() CC_CXX11_OVERRIDE; 44 | //! Returns the box description. 45 | virtual QString getBoxDescription() CC_CXX11_OVERRIDE; 46 | 47 | private: 48 | //! FourCC code for the box. 49 | FourCC m_four_cc; 50 | }; 51 | 52 | //! Box class for mandatory boxes. This box is a stub, created when a mandatory 'exactly one of' boxes are missing. 53 | class MandatoryBoxes CC_CXX11_FINAL 54 | : public Box 55 | { 56 | public: 57 | explicit MandatoryBoxes(const QList & four_cc_codes, ChildrenMixin * parent = nullptr); 58 | 59 | public: 60 | //! Returns the first FourCC code from the list of missing mandatory boxes. 61 | virtual FourCC getBoxFourCC() CC_CXX11_OVERRIDE; 62 | //! Returns the box description. 63 | virtual QString getBoxDescription() CC_CXX11_OVERRIDE; 64 | //! Returns the list of FourCC codes of missing mandatory boxes. 65 | QList getMandatoryFourCC(); 66 | 67 | private: 68 | //! FourCC code for the box. 69 | QList m_four_cc_codes; 70 | }; 71 | 72 | #endif // BASIC_MANDATORYBOX_H 73 | -------------------------------------------------------------------------------- /player/src/parser/basic/mixin/children.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_MIXIN_CHILDREN_H 29 | #define BASIC_MIXIN_CHILDREN_H 30 | 31 | #include "basic/box.h" 32 | #include "boxFactory.h" 33 | 34 | typedef QList BoxPtrList; 35 | 36 | //! Class that describes a box mix-in for containing other boxes. 37 | /*! 38 | * \brief This class is responsible for holding all boxes that are members of other boxes. 39 | */ 40 | class ChildrenMixin 41 | { 42 | public: 43 | //! Destroys all child boxes, when the class object is destroyed. 44 | ~ChildrenMixin() 45 | { 46 | for(auto it = m_children.begin(), end = m_children.end(); it != end; ++it) 47 | { 48 | Box * child = *it; 49 | delete child; 50 | } 51 | } 52 | 53 | public: 54 | //! Reads the boxes from the input stream. 55 | /*! 56 | * \param stream input stream 57 | * \param final_offset the offset at which reading should be stopped 58 | */ 59 | inline void initialize(LimitedStreamReader & stream) 60 | { 61 | while(stream.getCurrentOffset() < stream.getFinalOffset()) 62 | { 63 | BoxFactory::instance().parseBox(stream, this); 64 | } 65 | } 66 | 67 | //! Adds a child to a children list. 68 | inline void addChild(Box * child) 69 | { 70 | m_children.append(child); 71 | } 72 | 73 | //! Returns children list. 74 | inline BoxPtrList & getChildren() 75 | { 76 | return m_children; 77 | } 78 | 79 | public: 80 | //! Returns a pointer to this box. Must be CC_CXX11_OVERRIDEn in children boxes. 81 | virtual Box * getThisBox() = 0; 82 | //! Returns a const pointer to this box. 83 | virtual const Box * getThisBox() const = 0; 84 | 85 | protected: 86 | //! Children box list. 87 | BoxPtrList m_children; 88 | }; 89 | 90 | #endif // BASIC_MIXIN_CHILDREN_H 91 | -------------------------------------------------------------------------------- /player/src/parser/basic/superBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_SUPER_BOX_H 29 | #define BASIC_SUPER_BOX_H 30 | 31 | #include "box.h" 32 | #include "mixin/children.hpp" 33 | 34 | //! Base box class for box containing other boxes. 35 | class SuperBox 36 | : public Box 37 | , public ChildrenMixin 38 | { 39 | protected: 40 | SuperBox(ChildrenMixin * parent) 41 | : Box(parent) 42 | , ChildrenMixin() 43 | { 44 | } 45 | 46 | public: 47 | //! Reads the box and data from the input stream. 48 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 49 | { 50 | Box::initialize(stream); 51 | ChildrenMixin::initialize(stream); 52 | } 53 | 54 | //! Returns a pointer to this box. 55 | virtual Box * getThisBox() CC_CXX11_OVERRIDE 56 | { 57 | return this; 58 | } 59 | 60 | //! Returns a const pointer to this box. 61 | virtual const Box * getThisBox() const CC_CXX11_OVERRIDE 62 | { 63 | return this; 64 | } 65 | }; 66 | 67 | #endif // BASIC_SUPER_BOX_H 68 | -------------------------------------------------------------------------------- /player/src/parser/basic/tableBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_TABLE_BOX_H 29 | #define BASIC_TABLE_BOX_H 30 | 31 | #include "box.h" 32 | #include "mixin/children.hpp" 33 | #include "mixin/data.hpp" 34 | #include "mixin/table.hpp" 35 | 36 | //! Base box class for boxes containing tables of data. 37 | /*! 38 | * \param TContentType the data type of a table contents. 39 | */ 40 | template 41 | class TableBox 42 | : public Box 43 | , public FullBoxMixin<> 44 | , public TableMixin 45 | { 46 | protected: 47 | TableBox(ChildrenMixin * parent = nullptr) 48 | : Box(parent) 49 | , FullBoxMixin<>() 50 | , TableMixin() 51 | {} 52 | 53 | public: 54 | //! Reads the box and data from the input stream. 55 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 56 | { 57 | Box::initialize(stream); 58 | FullBoxMixin<>::initialize(stream); 59 | TableMixin::initialize(stream); 60 | } 61 | 62 | protected: 63 | //! Registeres properties for a box type. 64 | virtual void registerProperties() CC_CXX11_OVERRIDE 65 | { 66 | Box::registerProperties(); 67 | BOX_PROPERTY(Version); 68 | BOX_PROPERTY(Flags); 69 | BOX_PROPERTY(Table); 70 | } 71 | }; 72 | 73 | #endif // BASIC_TABLE_BOX_H 74 | -------------------------------------------------------------------------------- /player/src/parser/basic/unknownBox.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "unknownBox.h" 29 | 30 | UnknownBox::UnknownBox(const FourCC & four_cc, ChildrenMixin * parent /*= nullptr*/) 31 | : ContentBox(parent) 32 | , m_four_cc(four_cc) 33 | { 34 | } 35 | 36 | void UnknownBox::initialize(LimitedStreamReader &stream) 37 | { 38 | ContentBox::initialize(stream); 39 | } 40 | 41 | FourCC UnknownBox::getBoxFourCC() 42 | { 43 | return m_four_cc; 44 | } 45 | 46 | QString UnknownBox::getBoxDescription() 47 | { 48 | static QString name("Unknown Box"); 49 | return name; 50 | } 51 | -------------------------------------------------------------------------------- /player/src/parser/basic/unknownBox.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASIC_UNKNOWNBOX_H 29 | #define BASIC_UNKNOWNBOX_H 30 | 31 | #include "contentBox.hpp" 32 | #include "helpers/optional.hpp" 33 | 34 | //! Box class for unrecognized box types 35 | class UnknownBox CC_CXX11_FINAL 36 | : public ContentBox 37 | { 38 | public: 39 | explicit UnknownBox(const FourCC & fourCC, ChildrenMixin * parent = nullptr); 40 | 41 | public: 42 | //! Reads the box and data from the input stream. 43 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE; 44 | //! Returns the box FourCC code. 45 | virtual FourCC getBoxFourCC() CC_CXX11_OVERRIDE; 46 | //! Returns the box description. 47 | virtual QString getBoxDescription() CC_CXX11_OVERRIDE; 48 | 49 | private: 50 | //! FourCC code for the box. 51 | FourCC m_four_cc; 52 | }; 53 | 54 | #endif // BASIC_UNKNOWNBOX_H 55 | -------------------------------------------------------------------------------- /player/src/parser/cameraMicrophoneIdentificationBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CAMERA_MICROPHONE_IDENTIFICATION_BOX_H 29 | #define CAMERA_MICROPHONE_IDENTIFICATION_BOX_H 30 | 31 | #include "basic/dataBox.hpp" 32 | 33 | //! Class describing Camera Microphone Identification box. 34 | /*! 35 | * \brief Declared in Surveillance Application Format. \n 36 | * Type: 'cami' \n 37 | * Container: MetaBox, track level \n 38 | * Mandatory: Yes \n 39 | * Quantity: Exactly one (per media track) 40 | */ 41 | class CameraMicrophoneIdentificationBox 42 | : public DataBox 43 | { 44 | public: 45 | typedef DataBox DataBoxType; 46 | 47 | public: 48 | explicit CameraMicrophoneIdentificationBox(ChildrenMixin * parent = nullptr) 49 | : DataBoxType(parent) 50 | {} 51 | 52 | public: 53 | //! Returns identification UUID. 54 | QUuid getCamiUUID() 55 | { 56 | return std::get<0>(DataBoxType::m_data); 57 | } 58 | 59 | public: 60 | BOX_INFO("cami", "Camera Microphone Identification Box") 61 | 62 | protected: 63 | //! Registers properties for a box type. 64 | virtual void registerProperties() CC_CXX11_OVERRIDE 65 | { 66 | Box::registerProperties(); 67 | BOX_PROPERTY(CamiUUID); 68 | } 69 | }; 70 | 71 | #endif // CAMERA_MICROPHONE_IDENTIFICATION_BOX_H 72 | -------------------------------------------------------------------------------- /player/src/parser/certificateBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CERTIFICATE_BOX_H 29 | #define CERTIFICATE_BOX_H 30 | 31 | #include "basic/box.h" 32 | 33 | //! Class describing Certificate box. 34 | /*! 35 | * \brief Declared in Onvif Export Format. \n 36 | * Type: 'cert' \n 37 | * Container: SchemeInformationBox \n 38 | * Mandatory: Yes \n 39 | * Quantity: Exactly one 40 | */ 41 | class CertificateBox 42 | : public Box 43 | { 44 | public: 45 | explicit CertificateBox(ChildrenMixin * parent = nullptr) 46 | : Box(parent) 47 | {} 48 | 49 | public: 50 | //! Reads the box from the input stream. 51 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 52 | { 53 | Box::initialize(stream); 54 | size_t stream_size = stream.getFinalOffset() - stream.getCurrentOffset(); 55 | if(stream_size > 0) 56 | { 57 | m_data.resize(stream_size); 58 | stream.read(m_data.data(), stream_size); 59 | } 60 | } 61 | 62 | public: 63 | //! Returns the certificate data. 64 | QByteArray & getCertificateData() 65 | { 66 | return m_data; 67 | } 68 | 69 | public: 70 | BOX_INFO("cert", "Certificate Box") 71 | 72 | protected: 73 | //! Registers properties for a box type. 74 | virtual void registerProperties() CC_CXX11_OVERRIDE 75 | { 76 | Box::registerProperties(); 77 | BOX_PROPERTY(CertificateData); 78 | } 79 | 80 | public: 81 | //! Certificate data. 82 | QByteArray m_data; 83 | }; 84 | 85 | 86 | #endif // CERTIFICATE_BOX_H 87 | -------------------------------------------------------------------------------- /player/src/parser/certificateStorage.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CERTIFICATESTORAGE_H 29 | #define CERTIFICATESTORAGE_H 30 | 31 | #include 32 | 33 | //! Certificate storage. 34 | class CertificateStorage 35 | { 36 | public: 37 | CertificateStorage(); 38 | 39 | ~CertificateStorage(); 40 | 41 | //! Get folders with certificate. 42 | static QString getCertificateFolder(); 43 | 44 | //! Update certificate storage. 45 | void update(); 46 | 47 | //! Get sertificate files info. 48 | const QFileInfoList& getFilesList() { return m_files; } 49 | 50 | //! Remove certificate file. 51 | void removeCertificate(int index); 52 | 53 | //! Check if certificate known. 54 | bool isCertificateKnown(const QByteArray& binary_certificate); 55 | 56 | private: 57 | //! List of files 58 | QFileInfoList m_files; 59 | }; 60 | 61 | #endif // CERTIFICATESTORAGE_H 62 | -------------------------------------------------------------------------------- /player/src/parser/fourcc.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "fourcc.h" 29 | #include "helpers/istream.hpp" 30 | 31 | FourCC::FourCC(uint32_t code /*= 0*/) 32 | : m_code(code) 33 | { 34 | } 35 | 36 | FourCC::FourCC(const char (& code)[5]) 37 | { 38 | m_code = qFromBigEndian((const unsigned char*)code); 39 | } 40 | 41 | bool FourCC::isUuid() const 42 | { 43 | return m_code == sc_uuid; 44 | } 45 | 46 | FourCC FourCC::fromUuid(const QUuid &uuid) 47 | { 48 | static const uint64_t sc_uuid_final = 0x800000AA00389B71; 49 | if( (0x0011 == uuid.data2) && (0x0010 == uuid.data3) && (memcmp(uuid.data4, &sc_uuid_final, sizeof(uint64_t)) == 0) ) 50 | { 51 | return FourCC(uuid.data1); 52 | } 53 | else 54 | { 55 | return FourCC(sc_uuid); 56 | } 57 | } 58 | 59 | bool FourCC::operator == (const FourCC & right) const 60 | { 61 | return m_code == right.m_code; 62 | } 63 | 64 | bool FourCC::operator != (const FourCC & right) const 65 | { 66 | return m_code != right.m_code; 67 | } 68 | 69 | bool FourCC::operator < (const FourCC & right) const 70 | { 71 | return m_code < right.m_code; 72 | } 73 | 74 | FourCC::operator uint32_t() const 75 | { 76 | return m_code; 77 | } 78 | 79 | FourCC::operator QUuid() const 80 | { 81 | return QUuid(m_code, 0x0011, 0x0010, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71); 82 | } 83 | 84 | FourCC::operator QString() const 85 | { 86 | char code[5]; 87 | qToBigEndian(m_code, (unsigned char *)code); 88 | code[4] = 0; 89 | return code; 90 | } 91 | -------------------------------------------------------------------------------- /player/src/parser/fourcc.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef FOURCC_H 29 | #define FOURCC_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | #include "crosscompilation_inttypes.h" 33 | 34 | #include 35 | #include 36 | 37 | //! Class for working with FourCC codes. 38 | class FourCC CC_CXX11_FINAL 39 | { 40 | public: 41 | explicit FourCC(uint32_t code = 0); 42 | explicit FourCC(const char (& code)[5]); 43 | 44 | public: 45 | bool isUuid() const; 46 | 47 | public: 48 | static FourCC fromUuid(const QUuid & uuid); 49 | 50 | public: 51 | bool operator == (const FourCC & right) const; 52 | bool operator != (const FourCC & right) const; 53 | bool operator < (const FourCC & right) const; 54 | //! Converts the FourCC code to uint32_t. 55 | CC_CXX11_EXPLICIT_CONVERSION operator uint32_t() const; 56 | //! Converts the FourCC code to the UUID. 57 | CC_CXX11_EXPLICIT_CONVERSION operator QUuid() const; 58 | //! Converts the FourCC code to the string. 59 | CC_CXX11_EXPLICIT_CONVERSION operator QString() const; 60 | 61 | private: 62 | //! FourCC code. 63 | uint32_t m_code; 64 | 65 | private: 66 | //! FourCC code for the "uuid" FourCC. 67 | static const uint32_t sc_uuid = 0x75756964; 68 | }; 69 | 70 | inline QDebug operator <<(QDebug debug, const FourCC & four_cc) 71 | { 72 | return debug << (QString)four_cc; 73 | } 74 | 75 | #endif // FOURCC_H 76 | -------------------------------------------------------------------------------- /player/src/parser/helpers/is_a.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef HELPERS_IS_A_H 29 | #define HELPERS_IS_A_H 30 | 31 | //! Function, performing a runtime check, if an object pointer can be cast to a WantedType. Can be used, if someone does not need a pointer of WantedType for futher usage. 32 | template 33 | bool is_a(CheckType * pointer) 34 | { 35 | return nullptr != dynamic_cast(pointer); 36 | } 37 | 38 | //! Function, performing a runtime check, if an const object poiner can be cast to a WantedType. Can be used, if someone does not need a pointer of WantedType for futher usage. 39 | template 40 | bool is_a(const CheckType * pointer) 41 | { 42 | return nullptr != dynamic_cast(pointer); 43 | } 44 | 45 | #endif // IS_A_H 46 | -------------------------------------------------------------------------------- /player/src/parser/helpers/optional.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef HELPERS_OPTIONAL_H 29 | #define HELPERS_OPTIONAL_H 30 | 31 | #include 32 | 33 | //! Class, containing optional values. 34 | template 35 | class optional CC_CXX11_FINAL 36 | { 37 | public: 38 | optional() 39 | : m_value(nullptr) 40 | {} 41 | 42 | optional(const T & value) 43 | : m_value(new T(value)) 44 | {} 45 | 46 | optional(const optional & right) 47 | : m_value(right.hasValue() ? new T(right.value()) : nullptr) 48 | {} 49 | 50 | public: 51 | optional & operator =(const optional & right) 52 | { 53 | m_value.reset(right.hasValue() ? new T(right.value()) : nullptr); 54 | return *this; 55 | } 56 | 57 | T & operator *() 58 | { 59 | return *m_value; 60 | } 61 | 62 | const T & operator *() const 63 | { 64 | return *m_value; 65 | } 66 | 67 | T * operator ->() 68 | { 69 | return m_value.operator ->(); 70 | } 71 | 72 | const T * operator ->() const 73 | { 74 | return m_value.operator ->(); 75 | } 76 | 77 | public: 78 | //! Clears the value of the object, if it is present; 79 | void reset() 80 | { 81 | m_value.reset(); 82 | } 83 | 84 | //! Checks if the object has its value. 85 | bool hasValue() const 86 | { 87 | return m_value != nullptr; 88 | } 89 | 90 | //! Returns reference to the contained value. 91 | T & value() 92 | { 93 | return *m_value; 94 | } 95 | 96 | //! Returns const reference to the contained value. 97 | const T & value() const 98 | { 99 | return *m_value; 100 | } 101 | 102 | private: 103 | std::unique_ptr m_value; 104 | }; 105 | 106 | #endif // HELPERS_OPTIONAL_H 107 | -------------------------------------------------------------------------------- /player/src/parser/helpers/uint24.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef HELPERS_UINT24_H 29 | #define HELPERS_UINT24_H 30 | 31 | //! Union describing uint24_t data type. 32 | union U_UInt24 33 | { 34 | struct { 35 | unsigned char skip; 36 | unsigned char m_bytes[3]; 37 | } bytes_representation; 38 | uint32_t m_value; 39 | 40 | //! Widens uint24_t to uint32_t value. 41 | operator uint32_t() 42 | { 43 | return m_value; 44 | } 45 | }; 46 | 47 | #endif // HELPERS_UINT24_H 48 | -------------------------------------------------------------------------------- /player/src/parser/segmentExtractor.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef FRAGMENTEXTRACTOR_H 29 | #define FRAGMENTEXTRACTOR_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | #include "basic/box.h" 35 | #include "../common/segmentInfo.h" 36 | 37 | /** 38 | * Class performing the extraction of file segments. 39 | * Segments are either ISO 23000-10 fragments or CMAF segments. 40 | * CMAF support tbd. 41 | */ 42 | class SegmentExtractor : public QObject 43 | { 44 | Q_OBJECT 45 | public: 46 | explicit SegmentExtractor(QObject *parent = nullptr); 47 | 48 | public: 49 | //! Returns the Surveillance fragments list. 50 | SegmentList getSegments(); 51 | 52 | signals: 53 | 54 | public slots: 55 | //! This slot is called when the fileset information is cleared. 56 | void onContentsCleared(); 57 | //! This slot is called when the file is being added to a fileset. 58 | void onFileOpened(QString path); 59 | //! This slot is called when the file parsing was finished. 60 | void onFileClosed(); 61 | //! This slot is called when the box is created. 62 | void onBoxCreated(Box *box); 63 | 64 | private: 65 | //! Flag indicating, that all fragments in the fileset are Surveillance files. 66 | bool m_fragments_have_surveillance_boxes; 67 | //! Surveillance fragments list for a fileset. 68 | SegmentList m_segments; 69 | }; 70 | 71 | #endif // FRAGMENTEXTRACTOR_H 72 | -------------------------------------------------------------------------------- /player/src/parser/signatureConfigurationBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SIGNATURE_CONFIGURATION_BOX_H 29 | #define SIGNATURE_CONFIGURATION_BOX_H 30 | 31 | #include "basic/box.h" 32 | 33 | //! Class describing Signature Configuration box. 34 | /*! 35 | * \brief Declared in Onvif Export Format. \n 36 | * Type: 'sigC' \n 37 | * Container: SchemeInformationBox \n 38 | * Mandatory: No \n 39 | * Quantity: Zero or one 40 | */ 41 | class SignatureConfigurationBox 42 | : public Box 43 | { 44 | public: 45 | explicit SignatureConfigurationBox(ChildrenMixin * parent = nullptr) 46 | : Box(parent) 47 | {} 48 | 49 | public: 50 | //! Reads the box from the input stream. 51 | virtual void initialize(LimitedStreamReader &stream) CC_CXX11_OVERRIDE 52 | { 53 | Box::initialize(stream); 54 | size_t stream_size = stream.getFinalOffset() - stream.getCurrentOffset(); 55 | if(stream_size > 0) 56 | { 57 | m_algorithm_identifier.resize(stream_size); 58 | stream.read(m_algorithm_identifier.data(), stream_size); 59 | } 60 | } 61 | 62 | public: 63 | //! Returns the algorithm identifier data. 64 | QByteArray & getAlgorithmIdentifier() 65 | { 66 | return m_algorithm_identifier; 67 | } 68 | 69 | public: 70 | BOX_INFO("sigC", "Signature Configuration Box") 71 | 72 | protected: 73 | //! Registers properties for a box type. 74 | virtual void registerProperties() CC_CXX11_OVERRIDE 75 | { 76 | Box::registerProperties(); 77 | BOX_PROPERTY(AlgorithmIdentifier); 78 | } 79 | 80 | private: 81 | //! Algorithm identifier data. 82 | QByteArray m_algorithm_identifier; 83 | }; 84 | 85 | #endif // SIGNATURE_CONFIGURATION_BOX_H 86 | -------------------------------------------------------------------------------- /player/src/parser/surveillanceMetadataSampleConfigBox.hpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SURVEILLANCE_METADATA_SAMPLE_CONFIG_BOX_H 29 | #define SURVEILLANCE_METADATA_SAMPLE_CONFIG_BOX_H 30 | 31 | #include "basic/fullBox.hpp" 32 | 33 | //! Class describing Surveillance Metadata Sample Config box. 34 | /*! 35 | * \brief Declared in Surveillance Application Format. \n 36 | * Type: 'vcmC' \n 37 | * Container: SurveillanceMetadataSampleEntryBox \n 38 | * Mandatory: Yes \n 39 | * Quantity: Exactly one (per instance) 40 | */ 41 | class SurveillanceMetadataSampleConfigBox 42 | : public FullBox 43 | { 44 | public: 45 | typedef FullBox FullBoxType; 46 | 47 | public: 48 | explicit SurveillanceMetadataSampleConfigBox(ChildrenMixin * parent = nullptr) 49 | : FullBoxType(parent) 50 | {} 51 | 52 | public: 53 | //! Returns the Surveillance Metadata Sample Config version. 54 | uint8_t getSMSCVersion() 55 | { 56 | return std::get<2>(FullBoxType::m_data); 57 | } 58 | 59 | public: 60 | BOX_INFO("vcmC", "Surveillance Metadata Sample Config Box") 61 | 62 | protected: 63 | //! Registers properties for a box type. 64 | virtual void registerProperties() CC_CXX11_OVERRIDE 65 | { 66 | Box::registerProperties(); 67 | BOX_PROPERTY(Version); 68 | BOX_PROPERTY(Flags); 69 | BOX_PROPERTY(SMSCVersion); 70 | } 71 | }; 72 | 73 | #endif // SURVEILLANCE_METADATA_SAMPLE_CONFIG_BOX_H 74 | -------------------------------------------------------------------------------- /player/src/parser/validatorOXF.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "validatorOXF.h" 29 | 30 | #include "certificateBox.hpp" 31 | #include "signatureBox.hpp" 32 | #include "surveillanceExportBox.hpp" 33 | 34 | ValidatorOXF::ValidatorOXF(QObject *parent) : 35 | QObject(parent) 36 | { 37 | } 38 | 39 | bool ValidatorOXF::isValidFile() 40 | { 41 | return ((m_fileset_information.size() == 1) && (m_fileset_information.begin()->isValid())); 42 | } 43 | 44 | bool ValidatorOXF::isValidFileset() const 45 | { 46 | for(auto it = m_fileset_information.begin(), end = m_fileset_information.end(); it != end; ++it) 47 | { 48 | const OXFFileInformation & info = *it; 49 | if(info.isValid() == false) 50 | return false; 51 | } 52 | return (m_fileset_information.isEmpty() == false); 53 | } 54 | 55 | void ValidatorOXF::onContentsCleared() 56 | { 57 | m_fileset_information.clear(); 58 | } 59 | 60 | void ValidatorOXF::onFileOpened(QString path) 61 | { 62 | m_fileset_information.insert(path, OXFFileInformation()); 63 | m_current_file = path; 64 | } 65 | 66 | void ValidatorOXF::onFileClosed() 67 | { 68 | m_current_file.clear(); 69 | } 70 | 71 | void ValidatorOXF::onBoxCreated(Box *box) 72 | { 73 | static const FourCC sc_sibo_four_cc(SignatureBox::getFourCC()) 74 | , sc_cert_four_cc(CertificateBox::getFourCC()) 75 | , sc_suep_four_cc(SurveillanceExportBox::getFourCC()); 76 | 77 | FourCC four_cc = box->getBoxFourCC(); 78 | 79 | if(!m_current_file.isEmpty()) 80 | { 81 | if(four_cc == sc_sibo_four_cc) 82 | { 83 | m_fileset_information[m_current_file].m_signature_box_count++; 84 | } 85 | else if(four_cc == sc_cert_four_cc) 86 | { 87 | m_fileset_information[m_current_file].m_certificate_box_count++; 88 | } 89 | else if(four_cc == sc_suep_four_cc) 90 | { 91 | m_fileset_information[m_current_file].m_surveillance_export_box_count++; 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /player/src/parserUI/certificateStorageDialog.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CERTIFICATESTORAGEDIALOG_H 29 | #define CERTIFICATESTORAGEDIALOG_H 30 | 31 | #include 32 | 33 | #include "certificateStorage.h" 34 | 35 | namespace Ui { 36 | class CertificateStorageDialog; 37 | } 38 | 39 | //! Dialog that will work with certificate storage. 40 | class CertificateStorageDialog : public QDialog 41 | { 42 | private: 43 | Q_OBJECT 44 | 45 | public: 46 | explicit CertificateStorageDialog(QWidget* parent = 0); 47 | 48 | ~CertificateStorageDialog(); 49 | 50 | private: 51 | //! Fill files list. 52 | void fillFilesList(); 53 | 54 | private slots: 55 | //! Add certificate. 56 | void onAdd(); 57 | 58 | //!Remove certificate. 59 | void onRemove(); 60 | 61 | private: 62 | //! UI. 63 | Ui::CertificateStorageDialog* m_ui; 64 | //! Certificate storage. 65 | CertificateStorage m_storage; 66 | }; 67 | 68 | #endif // CERTIFICATESTORAGEDIALOG_H 69 | -------------------------------------------------------------------------------- /player/src/parserUI/certificateStorageDialog.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | CertificateStorageDialog 4 | 5 | 6 | 7 | 0 8 | 0 9 | 400 10 | 343 11 | 12 | 13 | 14 | Certificate Storage 15 | 16 | 17 | 18 | 19 | 20 | Remove 21 | 22 | 23 | 24 | 25 | 26 | 27 | Add 28 | 29 | 30 | 31 | 32 | 33 | 34 | Qt::Vertical 35 | 36 | 37 | 38 | 20 39 | 40 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | QAbstractItemView::NoEditTriggers 48 | 49 | 50 | 51 | 52 | 53 | 54 | add 55 | remove 56 | files_tree 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /player/src/parserUI/parserWidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef PARSERWIDGET_H 29 | #define PARSERWIDGET_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | #include 35 | #include 36 | #include 37 | 38 | #include "../parser/mediaParser.h" 39 | 40 | namespace Ui { 41 | class parserWidget; 42 | } 43 | 44 | //! Dialog window showing the fileset information. 45 | class ParserWidget : public QDialog 46 | { 47 | Q_OBJECT 48 | 49 | public: 50 | explicit ParserWidget(QWidget *parent = 0); 51 | ~ParserWidget(); 52 | 53 | public: 54 | //! Shows the fileset parsing tree. 55 | void showFilesetInformation(FilesetInformation fileset_information); 56 | //! Clears the fileset parsing tree. 57 | void clearContents(); 58 | 59 | public slots: 60 | //! This slot is called when the box is selected and we need to show its content. 61 | void onItemChanged(QTreeWidgetItem * item); 62 | 63 | private: 64 | //! Creates a tree item for a box. 65 | QTreeWidgetItem * createBoxItem(Box *box, QTreeWidgetItem *parent = nullptr); 66 | //! Creates a tree item for a box property. 67 | QTreeWidgetItem * createPropertyItem(QString name, const Property & value, QTreeWidgetItem *parent = nullptr); 68 | //! Generates a list of errors for a box 69 | QStringList generateErrorList(Box *box); 70 | //! Resizes a specified tree widget columns to fit its content 71 | void resizeTreeToContents(QTreeWidget *widget); 72 | 73 | private: 74 | //! UI 75 | Ui::parserWidget* m_ui; 76 | //! Fileset information. 77 | FilesetInformation m_fileset_information; 78 | }; 79 | 80 | #endif // PARSERWIDGET_H 81 | -------------------------------------------------------------------------------- /player/src/player/audioContext.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef AUDIO_CONTEXT_H 29 | #define AUDIO_CONTEXT_H 30 | 31 | #include 32 | 33 | #include "types.h" 34 | 35 | class StreamReader; 36 | 37 | //! Class that contains and initialiaze main audio parameters. 38 | class AudioContext 39 | { 40 | public: 41 | AudioContext(); 42 | 43 | ~AudioContext(); 44 | 45 | //! Init class using audio stream from Maincontext. 46 | /*! 47 | * \param main_context main context 48 | * \param audio_stream_index index of audio stream in main context 49 | * \return 50 | */ 51 | bool init(AVCodecContext *codecContext); 52 | 53 | //! Clear parameters. 54 | void clear(); 55 | 56 | //! Audio parameters used to convert file audio data to hardware audio format and to setup audio device. 57 | AudioParams m_audio_params; 58 | }; 59 | 60 | #endif //AUDIO_CONTEXT_H 61 | -------------------------------------------------------------------------------- /player/src/player/audioPlayback.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "audioPlayback.h" 29 | 30 | #include "portAudioPlayback.h" 31 | 32 | AudioPlayback::AudioPlayback() : 33 | BasePlayback() 34 | { 35 | m_impl = new PortAudioPlayback(); 36 | QObject::connect(m_impl, SIGNAL(played(BasePlayback*)), this, SIGNAL(played(BasePlayback*))); 37 | QObject::connect(m_impl, SIGNAL(playbackFinished()), this, SIGNAL(playbackFinished())); 38 | } 39 | 40 | AudioPlayback::~AudioPlayback() 41 | { 42 | m_impl->stop(); 43 | m_impl->clear(); 44 | delete m_impl; 45 | } 46 | -------------------------------------------------------------------------------- /player/src/player/avFrameWrapper.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "avFrameWrapper.h" 29 | 30 | AVFrameWrapper::AVFrameWrapper() : 31 | m_frame(av_frame_alloc()) 32 | { 33 | av_frame_unref(m_frame); 34 | } 35 | 36 | AVFrameWrapper::~AVFrameWrapper() 37 | { 38 | av_frame_free(&m_frame); 39 | } 40 | -------------------------------------------------------------------------------- /player/src/player/avFrameWrapper.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef AVFRAMEWRAPPER_H 29 | #define AVFRAMEWRAPPER_H 30 | 31 | #include "ffmpeg.h" 32 | 33 | //! Special wrapper to simplify ffmpeg AVFrame allocation and destroing. 34 | class AVFrameWrapper 35 | { 36 | public: 37 | AVFrameWrapper(); 38 | 39 | ~AVFrameWrapper(); 40 | 41 | //! Get allocated AVFrame. 42 | AVFrame* get() { return m_frame; } 43 | 44 | private: 45 | //! Wrapped AVFrame. 46 | AVFrame* m_frame; 47 | }; 48 | 49 | #include 50 | 51 | typedef QSharedPointer AVFrameWrapperPtr; 52 | 53 | #endif // AVFRAMEWRAPPER_H 54 | -------------------------------------------------------------------------------- /player/src/player/basePlayback.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef BASEPLAYBACK_H 29 | #define BASEPLAYBACK_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | 35 | //! Base class for all playback classes. 36 | class BasePlayback : public QObject 37 | { 38 | private: 39 | Q_OBJECT 40 | 41 | public: 42 | BasePlayback() : QObject(), m_is_playing(false) {} 43 | 44 | virtual ~BasePlayback() {} 45 | 46 | //! Start playback. 47 | virtual void start() = 0; 48 | 49 | //! Pause playback. 50 | virtual void pause() = 0; 51 | 52 | //! Resume playback after pause. 53 | virtual void resume() = 0; 54 | 55 | //! Stop playback. 56 | virtual void stop() = 0; 57 | 58 | //! Start and then pause playback. 59 | virtual void startAndPause() = 0; 60 | 61 | //! Clear playback data. 62 | virtual void clear() = 0; 63 | 64 | //! Get current time. 65 | virtual int getPlayingTime() const = 0; 66 | 67 | signals: 68 | //! This signal will be seent time by time. 69 | void played(BasePlayback* playback); 70 | 71 | //! This signal will be emitted when audio playback has reached the end of the file. 72 | void playbackFinished(); 73 | 74 | protected: 75 | bool m_is_playing; 76 | }; 77 | 78 | #endif // BASEPLAYBACK_H 79 | -------------------------------------------------------------------------------- /player/src/player/decoder.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef DECODER_H 29 | #define DECODER_H 30 | 31 | #include "ffmpeg.h" 32 | #include "streamReader.h" 33 | 34 | #include 35 | 36 | //! Base class for decoder. 37 | template 38 | class Decoder : public StreamReader 39 | { 40 | public: 41 | Decoder(AVMediaType type) : StreamReader(type) 42 | , m_streamIndex(0) 43 | {} 44 | 45 | virtual ~Decoder() 46 | { 47 | stop(); 48 | clear(); 49 | } 50 | 51 | //! Start decoder. 52 | virtual void start() 53 | {} 54 | 55 | //! Get (read and decode) next frame. 56 | virtual bool getNextFrame(T& decoded_frame, void* additional_data = 0) = 0; 57 | 58 | //! Stop decoder. 59 | virtual void stop() 60 | {} 61 | 62 | //! Get internal buffers size. 63 | virtual int buffersSize() const 64 | { 65 | return 0; 66 | } 67 | 68 | //! Clear temporally buffers if exists. 69 | virtual void clearBuffers() 70 | {} 71 | 72 | //! Clear. 73 | virtual void clear() 74 | { 75 | StreamReader::clear(); 76 | stop(); 77 | 78 | m_stream = nullptr; 79 | m_streamIndex = 0; 80 | } 81 | 82 | //! Get the zero based streaming index. 83 | int getIndex() const { return m_streamIndex; } 84 | 85 | 86 | protected: 87 | //! Stream to read from. 88 | AVStream* m_stream; 89 | //! Skip threshols. 90 | int m_streamIndex; 91 | }; 92 | 93 | #endif // DECODER_H 94 | -------------------------------------------------------------------------------- /player/src/player/portAudioPlayback.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef PORTAUDIOPLAYBACK_H 29 | #define PORTAUDIOPLAYBACK_H 30 | 31 | #include "audioPlayback.h" 32 | 33 | #include "portAudioThread.h" 34 | 35 | //! Implementation of audio playback using PortAudio library. 36 | class PortAudioPlayback : public AudioPlaybackImpl 37 | { 38 | private: 39 | Q_OBJECT 40 | 41 | public: 42 | PortAudioPlayback(); 43 | 44 | ~PortAudioPlayback(); 45 | 46 | virtual void start(); 47 | 48 | virtual void pause(); 49 | 50 | virtual void resume(); 51 | 52 | virtual void stop(); 53 | 54 | virtual void startAndPause(); 55 | 56 | virtual void clear(); 57 | 58 | virtual int getPlayingTime() const; 59 | 60 | virtual void setVolume(double volume); 61 | 62 | private slots: 63 | void onPlayed(); 64 | 65 | private: 66 | //! Audio thread. 67 | PortAudioThread m_audio_thread; 68 | }; 69 | 70 | #endif // PORTAUDIOPLAYBACK_H 71 | -------------------------------------------------------------------------------- /player/src/player/queuedAudioDecoder.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef QUEUEDAUDIODECODER_H 29 | #define QUEUEDAUDIODECODER_H 30 | 31 | #include "queuedDecoder.h" 32 | #include "audioContext.h" 33 | 34 | #include "types.h" 35 | 36 | class QueuedAudioDecoder : public QueuedDecoder 37 | { 38 | public: 39 | QueuedAudioDecoder(); 40 | 41 | ~QueuedAudioDecoder(); 42 | 43 | void setIndex(int index = -1); 44 | //! Set audio parameters used resample readed audio data. 45 | const AudioParams &getParams() { return m_context.m_audio_params; } 46 | virtual void clear(); 47 | 48 | protected: 49 | virtual void processPacket(AVPacket* packet, int timestamp_ms); 50 | 51 | private: 52 | //! Init resample context. 53 | void initSwrContext(AVFrame* frame); 54 | 55 | //! Clear resample context. 56 | void cleatSwrContext(); 57 | 58 | private: 59 | //! Audio context. 60 | AudioContext m_context; 61 | //! Resampling context. 62 | SwrContext* m_swr_context; 63 | }; 64 | 65 | #endif // QUEUEDAUDIODECODER_H 66 | -------------------------------------------------------------------------------- /player/src/player/queuedMetadataDecoder.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2021 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef QUEUEDMETADATADECODER_H 29 | #define QUEUEDMETADATADECODER_H 30 | #include 31 | 32 | #include "queuedVideoDecoder.h" 33 | #include "videoContext.h" 34 | 35 | #include "types.h" 36 | 37 | class EventItem : public QTreeWidgetItem 38 | { 39 | public: 40 | EventItem(int t, size_t ha) : hash(ha) { 41 | m_time = t; 42 | } 43 | int m_time; 44 | size_t hash; 45 | }; 46 | 47 | class MetadataDecoder : public QueuedVideoDecoder 48 | { 49 | public: 50 | MetadataDecoder(QueuedVideoDecoder* vc) : QueuedVideoDecoder(AVMEDIA_TYPE_DATA) { m_decoder = vc; } 51 | 52 | Queue m_eventQueue; 53 | protected: 54 | virtual void processPacket(AVPacket* packet, int timestamp_ms); 55 | 56 | private: 57 | //! Try to parse metadata 58 | void parseMetadata(VideoFrame& frame, const unsigned char* buffer, size_t bytes, int time); 59 | QueuedVideoDecoder* m_decoder; 60 | }; 61 | 62 | #endif // QUEUEDMETADATADECODER_H 63 | -------------------------------------------------------------------------------- /player/src/player/queuedVideoDecoder.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef QUEUEDVIDEODECODER_H 29 | #define QUEUEDVIDEODECODER_H 30 | 31 | #include "queuedDecoder.h" 32 | #include "videoContext.h" 33 | 34 | #include "types.h" 35 | 36 | class QueuedVideoDecoder : public QueuedDecoder 37 | { 38 | public: 39 | QueuedVideoDecoder(AVMediaType type = AVMEDIA_TYPE_VIDEO); 40 | 41 | ~QueuedVideoDecoder(); 42 | 43 | virtual void clear(); 44 | 45 | //! Video context. 46 | VideoContext m_context; 47 | void setStream(int index, double fps = 0.0); 48 | 49 | int frameWidth() const { return m_frame_width; } 50 | int frameHeight() const { return m_frame_height; } 51 | 52 | protected: 53 | virtual void processPacket(AVPacket* packet, int timestamp_ms); 54 | 55 | private: 56 | //! Init scale context. 57 | void initSwsContext(AVFrame* frame); 58 | 59 | //! Clear scale context. 60 | void clearSwsContext(); 61 | 62 | protected: 63 | //! Scale context. 64 | SwsContext* m_sws_context; 65 | //! RGB frame used for conversion. 66 | AVFrame* m_frame_RGB; 67 | //! Temp buffer size. 68 | int m_buffer_size; 69 | //! Temp buffer for conversion. 70 | uint8_t* m_buffer; 71 | int m_frame_width, m_frame_height; 72 | 73 | }; 74 | 75 | #endif // QUEUEDVIDEODECODER_H 76 | -------------------------------------------------------------------------------- /player/src/player/syncThread.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "syncThread.h" 29 | 30 | #include "defines.h" 31 | 32 | SyncThread::SyncThread(int sleep_timeout_ms, QThread::Priority priority) : 33 | QThread(), 34 | m_is_running(false), 35 | m_is_finished(false), 36 | m_quit(false), 37 | m_sleep_timeout_ms(sleep_timeout_ms), 38 | c_priority(priority) 39 | { 40 | if(m_sleep_timeout_ms < 0) 41 | m_sleep_timeout_ms = 0; 42 | } 43 | 44 | SyncThread::~SyncThread() 45 | { 46 | stop(); 47 | } 48 | 49 | void SyncThread::start() 50 | { 51 | if(m_is_running) 52 | return; 53 | m_quit = false; 54 | m_is_running = true; 55 | m_is_finished = false; 56 | QThread::start(c_priority); 57 | } 58 | 59 | void SyncThread::stop() 60 | { 61 | if(!m_is_running) 62 | return; 63 | m_quit = true; 64 | wait(); 65 | while(m_is_running) 66 | msleep(WAIT_TREAD); 67 | } 68 | 69 | void SyncThread::run() 70 | { 71 | 72 | threadStarted(); 73 | 74 | for(; m_quit != true; ) 75 | { 76 | if(!threadBody()) 77 | m_quit = true; 78 | else if(m_sleep_timeout_ms) 79 | msleep(m_sleep_timeout_ms); 80 | } 81 | 82 | threadFinished(); 83 | 84 | m_is_running = false; 85 | m_is_finished = true; 86 | } 87 | -------------------------------------------------------------------------------- /player/src/player/syncThread.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SYNCTHREAD_H 29 | #define SYNCTHREAD_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | 35 | //! Base class for all threads that want's to have sync start and stop. 36 | class SyncThread : public QThread 37 | { 38 | public: 39 | SyncThread(int sleep_timeout_ms, QThread::Priority priority = QThread::NormalPriority); 40 | 41 | virtual ~SyncThread(); 42 | 43 | //! Start thread. 44 | virtual void start(); 45 | 46 | //! Stop thread; 47 | virtual void stop(); 48 | 49 | protected: 50 | virtual void run(); 51 | 52 | //! This will be called when thread started. 53 | virtual void threadStarted() {} 54 | 55 | //! Define this function. It will be called in infinity circle. 56 | virtual bool threadBody() = 0; 57 | 58 | //! This function will be called after thread end. 59 | virtual void threadFinished() {} 60 | 61 | //! Get started state. 62 | bool isRunning() const { return m_is_running; } 63 | 64 | private: 65 | //! Flag that thread is running. 66 | bool m_is_running; 67 | //! Flag that thread finished. 68 | bool m_is_finished; 69 | //! Quit from thread. 70 | volatile bool m_quit; 71 | //! How long should we sleep after each circle. 72 | int m_sleep_timeout_ms; 73 | //! Priority for this new thread. 74 | QThread::Priority c_priority; 75 | }; 76 | 77 | #endif // SYNCTHREAD_H 78 | -------------------------------------------------------------------------------- /player/src/player/videoContext.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "streamReader.h" 29 | 30 | #include "videoContext.h" 31 | 32 | #include 33 | 34 | VideoContext::VideoContext() 35 | { 36 | clear(); 37 | } 38 | 39 | VideoContext::~VideoContext() 40 | { 41 | 42 | } 43 | 44 | bool VideoContext::open(AVStream* stream, double fpsHint) 45 | { 46 | m_video_stream = stream; 47 | if(m_video_stream == nullptr) return false; 48 | if (fpsHint != 0.0) m_fps = fpsHint; 49 | if (m_video_stream->avg_frame_rate.num != 0) { 50 | m_fps = av_q2d(m_video_stream->avg_frame_rate); 51 | } 52 | m_current_fps = m_fps; 53 | 54 | qDebug() << "FPS" << m_fps; 55 | 56 | return true; 57 | } 58 | 59 | void VideoContext::clear() 60 | { 61 | m_video_stream = nullptr; 62 | m_fps = 1.0; 63 | m_current_fps = 1.0; 64 | } 65 | 66 | void VideoContext::increaseFps() 67 | { 68 | m_current_fps += 1.0; 69 | } 70 | 71 | void VideoContext::decreaseFps() 72 | { 73 | m_current_fps -= 1.0; 74 | if(m_current_fps < 1.0) 75 | m_current_fps += 1.0; 76 | } 77 | 78 | void VideoContext::flushCurrentFps() 79 | { 80 | m_current_fps = m_fps; 81 | } 82 | 83 | int VideoContext::getTimerDelay() 84 | { 85 | return (int)(1000.0 / m_current_fps); 86 | } 87 | -------------------------------------------------------------------------------- /player/src/player/videoContext.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef VIDEOCONTEXT_H 29 | #define VIDEOCONTEXT_H 30 | 31 | class StreamReader; 32 | struct AVStream; 33 | class VideoDecodeThread; 34 | class SegmentInfo; 35 | 36 | //! Class that contains and initialiaze main video parameters. 37 | class VideoContext 38 | { 39 | public: 40 | VideoContext(); 41 | 42 | ~VideoContext(); 43 | 44 | //! Init class using video stream from Maincontext. 45 | /*! 46 | * \param main_context main context 47 | * \param video_stream_index index of video stream in main context 48 | * \param fpsHint Hint for frame per seconds to be used in cases duration is not set 49 | * \return 50 | */ 51 | bool open(AVStream *stream, double fpsHint); 52 | 53 | //! Clear parameters. 54 | void clear(); 55 | 56 | //! Increase current fps by 1.0. 57 | void increaseFps(); 58 | 59 | //! Decrease current fps by 1.0. fps can't be less then 0. 60 | void decreaseFps(); 61 | 62 | //! Set current fps equal to standart fps. 63 | void flushCurrentFps(); 64 | 65 | //! Calculate next frame delay using current fps. 66 | int getTimerDelay(); 67 | 68 | SegmentInfo *m_segment; 69 | private: 70 | //! Video stream. 71 | AVStream* m_video_stream; 72 | //! Fps readed from stream info. Average fps. 73 | double m_fps; 74 | //! Fps used for playing. Can be greater or smaller then fps. 75 | double m_current_fps; 76 | }; 77 | 78 | #endif // VIDEOCONTEXT_H 79 | -------------------------------------------------------------------------------- /player/src/playerUI/clickableSlider.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CLICKABLESLIDER_H 29 | #define CLICKABLESLIDER_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | 35 | #include "segmentInfo.h" 36 | 37 | //! Custom slider that can send signal by mose click. 38 | class ClickableSlider : public QSlider 39 | { 40 | private: 41 | Q_OBJECT 42 | 43 | public: 44 | ClickableSlider(QWidget* parent = 0); 45 | 46 | ~ClickableSlider(); 47 | 48 | void setFragmentsList(const SegmentList& fragments_list, int fragment_index = -1); 49 | 50 | signals: 51 | void newValue(int value); 52 | 53 | protected: 54 | virtual void mousePressEvent(QMouseEvent* event); 55 | 56 | virtual void mouseMoveEvent(QMouseEvent* event); 57 | 58 | virtual void mouseReleaseEvent(QMouseEvent* event); 59 | 60 | private: 61 | int calcValue(QMouseEvent* event); 62 | 63 | private: 64 | //! List of fragments - used to define tooltip message. 65 | SegmentList m_segments; 66 | //! Index of fragment to use to define tooltip message. 67 | int m_segment_index; 68 | //! Was mouse pressed or not. 69 | bool m_mouse_pressed; 70 | }; 71 | 72 | #endif // CLICKABLESLIDER_H 73 | -------------------------------------------------------------------------------- /player/src/playerUI/fullscreenPlayerWidget.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "fullscreenPlayerWidget.h" 29 | 30 | #include 31 | #include 32 | 33 | FullscreenPlayerWidget::FullscreenPlayerWidget(QWidget*parent) : 34 | QWidget(parent), 35 | PlayerWidgetInterface(), 36 | m_video_frame(this), 37 | m_controls_moving_area(0, Up, this) 38 | { 39 | m_video_frame.show(); 40 | m_controls_moving_area.move(0, 0); 41 | m_controls_moving_area.resize(0, 0); 42 | m_controls_moving_area.show(); 43 | } 44 | 45 | FullscreenPlayerWidget::~FullscreenPlayerWidget() 46 | { 47 | 48 | } 49 | 50 | void FullscreenPlayerWidget::setControls(ControlsWidget* controls) 51 | { 52 | PlayerWidgetInterface::setControls(controls); 53 | m_controls_moving_area.setSubWidget(m_controls); 54 | } 55 | 56 | void FullscreenPlayerWidget::removeControls() 57 | { 58 | m_controls_moving_area.removeSubWidget(); 59 | PlayerWidgetInterface::removeControls(); 60 | } 61 | 62 | void FullscreenPlayerWidget::relocateControls() 63 | { 64 | m_controls_moving_area.resize(width(), 150); 65 | m_controls_moving_area.move(0, height() - 150); 66 | } 67 | 68 | void FullscreenPlayerWidget::closeEvent(QCloseEvent* event) 69 | { 70 | event->ignore(); 71 | } 72 | 73 | void FullscreenPlayerWidget::resizeEvent(QResizeEvent* event) 74 | { 75 | m_video_frame.resize(event->size()); 76 | m_video_frame.move(0, 0); 77 | relocateControls(); 78 | } 79 | 80 | void FullscreenPlayerWidget::showEvent(QShowEvent* event) 81 | { 82 | Q_UNUSED(event); 83 | 84 | m_video_frame.grabKeyboard(); 85 | } 86 | 87 | void FullscreenPlayerWidget::hideEvent(QHideEvent* event) 88 | { 89 | Q_UNUSED(event); 90 | 91 | m_video_frame.releaseKeyboard(); 92 | } 93 | -------------------------------------------------------------------------------- /player/src/playerUI/fullscreenPlayerWidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef FULLSCREENPLAYERWIDGET_H 29 | #define FULLSCREENPLAYERWIDGET_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | #include "playerWidgetInterface.h" 35 | 36 | #include "controlsWidget.h" 37 | #include "videoFrameWidget.h" 38 | #include "movingOutArea.h" 39 | 40 | class FullscreenPlayerWidget : public QWidget, public PlayerWidgetInterface 41 | { 42 | private: 43 | Q_OBJECT 44 | 45 | public: 46 | FullscreenPlayerWidget(QWidget* parent = 0); 47 | 48 | ~FullscreenPlayerWidget(); 49 | 50 | virtual VideoFrameWidget* getVideoWidget() { return &m_video_frame; } 51 | 52 | virtual void setControls(ControlsWidget* controls); 53 | 54 | virtual void removeControls(); 55 | 56 | //! Recalc controls placement. 57 | void relocateControls(); 58 | 59 | protected: 60 | //! On close event. 61 | virtual void closeEvent(QCloseEvent* event); 62 | 63 | //! On resize event. 64 | virtual void resizeEvent(QResizeEvent* event); 65 | 66 | //! On show event. 67 | virtual void showEvent(QShowEvent* event); 68 | 69 | //! On hide event. 70 | virtual void hideEvent(QHideEvent* event); 71 | 72 | private: 73 | //! Video view UI. 74 | VideoFrameWidget m_video_frame; 75 | //! Moving areas for conrols. 76 | MovingOutArea m_controls_moving_area; 77 | }; 78 | 79 | #endif // FULLSCREENPLAYERWIDGET_H 80 | -------------------------------------------------------------------------------- /player/src/playerUI/movingOutArea.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef MOVINGOUTAREA_H 29 | #define MOVINGOUTAREA_H 30 | 31 | #include 32 | #include 33 | 34 | #include "enums.h" 35 | 36 | //! This widget will slowly show sub_widget by mouse move. 37 | //! Do not put this widget to layout. 38 | //! Sub widget can be NULL and can be setuped or removed later. 39 | class MovingOutArea : public QWidget 40 | { 41 | private: 42 | Q_OBJECT 43 | 44 | public: 45 | MovingOutArea(QWidget* sub_widget, MovingDirection moving_direction, QWidget* parent = 0); 46 | 47 | ~MovingOutArea(); 48 | 49 | //! Setup sub widget. 50 | void setSubWidget(QWidget* sub_widget); 51 | 52 | //! Remove sub widget. 53 | void removeSubWidget(); 54 | 55 | protected: 56 | virtual void mouseMoveEvent(QMouseEvent* event); 57 | 58 | virtual void resizeEvent(QResizeEvent* event); 59 | 60 | private: 61 | //! Set sub widget start position. 62 | void setSubWidgetPosition(); 63 | 64 | private slots: 65 | //! On in timer. 66 | void onInTimer(); 67 | 68 | //! On out timer. 69 | void onOutTimer(); 70 | 71 | //! On show timer. 72 | void onShowTimer(); 73 | 74 | //! When mouse moved over sub widget. 75 | void onMouseMove(); 76 | 77 | private: 78 | //! Kill all timers. 79 | void killTimers(); 80 | 81 | private: 82 | //! Sub widget. 83 | QWidget* m_sub_widget; 84 | //! Moving direction. 85 | MovingDirection m_direction; 86 | //! Moving in timer. 87 | QTimer m_move_in_timer; 88 | //! Moving out timer. 89 | QTimer m_move_out_timer; 90 | //! Showing timer. 91 | QTimer m_show_timer; 92 | }; 93 | 94 | #endif // MOVINGOUTAREA_H 95 | -------------------------------------------------------------------------------- /player/src/playerUI/playerWidgetInterface.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef PLAYERWIDGETINTERFACE_H 29 | #define PLAYERWIDGETINTERFACE_H 30 | 31 | class ControlsWidget; 32 | class VideoFrameWidget; 33 | 34 | class PlayerWidgetInterface 35 | { 36 | public: 37 | PlayerWidgetInterface() : 38 | m_controls(0) 39 | {} 40 | 41 | virtual ~PlayerWidgetInterface() {} 42 | 43 | virtual class QTreeWidget* getEventTreeWidget() { return 0; } 44 | 45 | virtual VideoFrameWidget* getVideoWidget() { return 0; } 46 | 47 | virtual void setControls(ControlsWidget* controls) { m_controls = controls; } 48 | 49 | virtual void removeControls() { m_controls = 0; } 50 | 51 | protected: 52 | ControlsWidget* m_controls; 53 | }; 54 | 55 | #endif // PLAYERWIDGETINTERFACE_H 56 | -------------------------------------------------------------------------------- /player/src/playerUI/videoFrameWidget.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef VIDEOFRAMEWIDGET_H 29 | #define VIDEOFRAMEWIDGET_H 30 | 31 | #include "crosscompilation_cxx11.h" 32 | 33 | #include 34 | 35 | //! Widget that will draw video frame. 36 | class VideoFrameWidget : public QWidget 37 | { 38 | private: 39 | Q_OBJECT 40 | 41 | public: 42 | VideoFrameWidget(QWidget* parent = 0); 43 | 44 | ~VideoFrameWidget(); 45 | 46 | //! Set image to present. 47 | void setDrawImage(const QImage& image); 48 | 49 | //! Clear UI. 50 | void clear(); 51 | 52 | signals: 53 | //! Notify that widget was double clicked. 54 | void doubleClick(); 55 | 56 | //! Notify that escape was pressed. 57 | void escapePressed(); 58 | 59 | //! Notify that space pressed. 60 | void spacePressed(); 61 | 62 | protected: 63 | //! Paint event. 64 | virtual void paintEvent(QPaintEvent* event); 65 | 66 | //! Resize event. 67 | virtual void resizeEvent(QResizeEvent* event); 68 | 69 | //! Mouse clicked event. 70 | virtual void mouseDoubleClickEvent(QMouseEvent* event); 71 | 72 | //! Keyboard pressed event. 73 | virtual void keyPressEvent(QKeyEvent* event); 74 | 75 | private: 76 | //! Source image. 77 | QImage m_source_image; 78 | //! Scaled image. 79 | QImage m_draw_image; 80 | }; 81 | 82 | #endif // VIDEOFRAMEWIDGET_H 83 | -------------------------------------------------------------------------------- /player/src/resources/ONVIFPlayer.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/ONVIFPlayer.ico -------------------------------------------------------------------------------- /player/src/resources/ONVIFPlayer.rc: -------------------------------------------------------------------------------- 1 | 1 ICON DISCARDABLE "ONVIFPlayer.ico" -------------------------------------------------------------------------------- /player/src/resources/Onvif.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/Onvif.png -------------------------------------------------------------------------------- /player/src/resources/fullscreen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/fullscreen.png -------------------------------------------------------------------------------- /player/src/resources/media_next.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/media_next.png -------------------------------------------------------------------------------- /player/src/resources/media_pause.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/media_pause.png -------------------------------------------------------------------------------- /player/src/resources/media_play.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/media_play.png -------------------------------------------------------------------------------- /player/src/resources/media_prev.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/media_prev.png -------------------------------------------------------------------------------- /player/src/resources/media_stop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/media_stop.png -------------------------------------------------------------------------------- /player/src/resources/movie_frame.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/movie_frame.png -------------------------------------------------------------------------------- /player/src/resources/mute.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/mute.png -------------------------------------------------------------------------------- /player/src/resources/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | media_next.png 4 | media_pause.png 5 | media_play.png 6 | media_prev.png 7 | media_stop.png 8 | movie_frame.png 9 | mute.png 10 | volume.png 11 | Onvif.png 12 | fullscreen.png 13 | 14 | 15 | -------------------------------------------------------------------------------- /player/src/resources/volume.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/player/src/resources/volume.png -------------------------------------------------------------------------------- /player/src/tests/additionalUserInformationBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef ADDITIONALUSERINFORMATIONBOXTEST_H 29 | #define ADDITIONALUSERINFORMATIONBOXTEST_H 30 | 31 | #include 32 | 33 | class AdditionalUserInformationBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | AdditionalUserInformationBoxTest(); 39 | 40 | private Q_SLOTS: 41 | void readingTest_data(); 42 | void readingTest(); 43 | }; 44 | 45 | #endif // ADDITIONALUSERINFORMATIONBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/afIdentificationBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef AFIDENTIFICATIONBOXTEST_H 29 | #define AFIDENTIFICATIONBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class AfIdentificationBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | AfIdentificationBoxTest(); 39 | 40 | private Q_SLOTS: 41 | void readingTest_data(); 42 | void readingTest(); 43 | }; 44 | 45 | #endif // AFIDENTIFICATIONBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/cameraMicrophoneIdentificationBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CAMERAMICROPHONEIDENTIFICATIONBOXTEST_H 29 | #define CAMERAMICROPHONEIDENTIFICATIONBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class CameraMicrophoneIdentificationBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit CameraMicrophoneIdentificationBoxTest(); 38 | 39 | private slots: 40 | void readingTest_data(); 41 | void readingTest(); 42 | 43 | }; 44 | 45 | #endif // CAMERAMICROPHONEIDENTIFICATIONBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/certificateBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef CERTIFICATEBOXTEST_H 29 | #define CERTIFICATEBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class CertificateBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit CertificateBoxTest(); 38 | 39 | private slots: 40 | void readingTest_data(); 41 | void readingTest(); 42 | 43 | }; 44 | 45 | #endif // CERTIFICATEBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/certificateSSLTest.h: -------------------------------------------------------------------------------- 1 | #ifndef CERTIFICATESSLTEST_H 2 | #define CERTIFICATESSLTEST_H 3 | 4 | #include 5 | 6 | 7 | class CertificateSSLTest : public QObject 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | CertificateSSLTest(); 13 | 14 | private Q_SLOTS: 15 | void testCertToPem(); 16 | void testCertProperties(); 17 | 18 | private: 19 | 20 | }; 21 | 22 | 23 | #endif // CERTIFICATESSLTEST_H 24 | -------------------------------------------------------------------------------- /player/src/tests/compactSampleSizeBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef COMPACTSAMPLESIZEBOXTEST_H 29 | #define COMPACTSAMPLESIZEBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class CompactSampleSizeBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit CompactSampleSizeBoxTest(); 38 | 39 | private Q_SLOTS: 40 | void readingTest_data(); 41 | void readingTest(); 42 | }; 43 | 44 | #endif // COMPACTSAMPLESIZEBOXTEST_H 45 | -------------------------------------------------------------------------------- /player/src/tests/editListBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef EDITLISTBOXTEST_H 29 | #define EDITLISTBOXTEST_H 30 | 31 | #include 32 | 33 | #include "editListBox.hpp" 34 | 35 | class EditListBoxTest : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | EditListBoxTest(); 41 | 42 | private Q_SLOTS: 43 | void readingTestv0_data(); 44 | void readingTestv0(); 45 | void readingTestv1_data(); 46 | void readingTestv1(); 47 | 48 | private: 49 | void fillData(); 50 | const int ROWS = 3; 51 | QList data; 52 | }; 53 | 54 | #endif // EDITLISTBOXTEST_H 55 | -------------------------------------------------------------------------------- /player/src/tests/engineTest.cpp: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #include "engineTest.h" 29 | 30 | #include "types.h" 31 | 32 | EngineTest::EngineTest() 33 | { 34 | } 35 | 36 | void EngineTest::testCalcTime() 37 | { 38 | VideoFrame frame; 39 | AVRational time_base; 40 | time_base.num = 1; 41 | time_base.den = 25; 42 | frame.calcTime(0, 0, time_base); 43 | QVERIFY(frame.m_time == 0); 44 | frame.calcTime(AV_NOPTS_VALUE, AV_NOPTS_VALUE, time_base); 45 | QVERIFY(frame.m_time == 0); 46 | frame.calcTime(1, AV_NOPTS_VALUE, time_base); 47 | QVERIFY(frame.m_time == 40); 48 | frame.calcTime(AV_NOPTS_VALUE, 1, time_base); 49 | QVERIFY(frame.m_time == 40); 50 | } 51 | -------------------------------------------------------------------------------- /player/src/tests/engineTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef ENGINETEST_H 29 | #define ENGINETEST_H 30 | 31 | #include 32 | 33 | class EngineTest : public QObject 34 | { 35 | private: 36 | Q_OBJECT 37 | 38 | public: 39 | EngineTest(); 40 | 41 | private Q_SLOTS: 42 | void testCalcTime(); 43 | }; 44 | 45 | #endif // ENGINETEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/mediaHeaderBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | #ifndef MEDIAHEADERBOXTEST_H 28 | #define MEDIAHEADERBOXTEST_H 29 | 30 | #include "boxTestsCommon.h" 31 | 32 | template 33 | class MediaHeaderBoxTestLocal 34 | { 35 | public: 36 | void localTest_Data(); 37 | void localTest(); 38 | }; 39 | 40 | 41 | class MediaHeaderBoxTest64 42 | : public QObject, public MediaHeaderBoxTestLocal 43 | { 44 | Q_OBJECT 45 | 46 | public: 47 | explicit MediaHeaderBoxTest64() {} 48 | 49 | private Q_SLOTS: 50 | void readingTest_data(); 51 | void readingTest(); 52 | }; 53 | 54 | 55 | class MediaHeaderBoxTest32 56 | : public QObject, public MediaHeaderBoxTestLocal 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | explicit MediaHeaderBoxTest32() {} 62 | 63 | private Q_SLOTS: 64 | void readingTest_data(); 65 | void readingTest(); 66 | }; 67 | 68 | 69 | #endif // MEDIAHEADERBOXTEST_H 70 | -------------------------------------------------------------------------------- /player/src/tests/movieExtendsHeaderBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | #ifndef MOVIEEXTENDSHEADERBOXTEST_H 28 | #define MOVIEEXTENDSHEADERBOXTEST_H 29 | 30 | #include "boxTestsCommon.h" 31 | 32 | template< typename DATA_TYPE > 33 | class MovieExtendsHeaderBoxTest 34 | { 35 | public: 36 | explicit MovieExtendsHeaderBoxTest() {} 37 | 38 | void localTest_data(); 39 | void localTest(); 40 | }; 41 | 42 | 43 | class MovieExtendsHeaderBoxTest64 44 | : public QObject, public MovieExtendsHeaderBoxTest 45 | { 46 | Q_OBJECT 47 | 48 | public: 49 | 50 | private Q_SLOTS: 51 | void readingTest_data(); 52 | void readingTest(); 53 | }; 54 | 55 | class MovieExtendsHeaderBoxTest32 56 | : public QObject, public MovieExtendsHeaderBoxTest 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | 62 | private Q_SLOTS: 63 | void readingTest_data(); 64 | void readingTest(); 65 | }; 66 | 67 | #endif // MOVIEEXTENDSHEADERBOXTEST_H 68 | -------------------------------------------------------------------------------- /player/src/tests/movieHeaderBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | #ifndef MOVIEHEADERBOXTEST_H 28 | #define MOVIEHEADERBOXTEST_H 29 | 30 | #include "boxTestsCommon.h" 31 | 32 | 33 | template 34 | class MovieHeaderBoxTestLocal 35 | { 36 | public: 37 | void localTest_Data(); 38 | void localTest(); 39 | }; 40 | 41 | 42 | class MovieHeaderBoxTest32 43 | : public QObject, public MovieHeaderBoxTestLocal 44 | { 45 | Q_OBJECT 46 | 47 | public: 48 | explicit MovieHeaderBoxTest32() {} 49 | 50 | private Q_SLOTS: 51 | void readingTest_data(); 52 | void readingTest(); 53 | }; 54 | 55 | class MovieHeaderBoxTest64 56 | : public QObject, public MovieHeaderBoxTestLocal 57 | { 58 | Q_OBJECT 59 | 60 | public: 61 | explicit MovieHeaderBoxTest64() {} 62 | 63 | private Q_SLOTS: 64 | void readingTest_data(); 65 | void readingTest(); 66 | }; 67 | 68 | #endif // MOVIEHEADERBOXTEST_H 69 | -------------------------------------------------------------------------------- /player/src/tests/sampleDependencyTypeBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SAMPLEDEPENDENCYTYPEBOXTEST_H 29 | #define SAMPLEDEPENDENCYTYPEBOXTEST_H 30 | 31 | #include 32 | 33 | class SampleDependencyTypeBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | 37 | public: 38 | SampleDependencyTypeBoxTest(); 39 | 40 | private Q_SLOTS: 41 | void readingTest_data(); 42 | void readingTest(); 43 | 44 | private: 45 | const int DATA_SIZE = 10; 46 | const int SHORT_DATA_SIZE = 5; 47 | 48 | QList table_data; 49 | QList short_table_data; 50 | 51 | void fillData(); 52 | }; 53 | 54 | #endif // SAMPLEDEPENDENCYTYPEBOXTEST_H 55 | -------------------------------------------------------------------------------- /player/src/tests/sampleSizeBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SAMPLESIZEBOXTEST_H 29 | #define SAMPLESIZEBOXTEST_H 30 | 31 | #include 32 | 33 | #include "sampleSizeBox.hpp" 34 | 35 | class SampleSizeBoxTest : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | SampleSizeBoxTest(); 41 | 42 | private Q_SLOTS: 43 | void readingTest_data(); 44 | void readingTest(); 45 | 46 | private: 47 | void fillData(); 48 | const int ROWS = 3; 49 | QList data; 50 | }; 51 | 52 | #endif // SAMPLESIZEBOXTEST_H 53 | -------------------------------------------------------------------------------- /player/src/tests/signatureBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SIGNATUREBOXTEST_H 29 | #define SIGNATUREBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class SignatureBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit SignatureBoxTest(); 38 | 39 | private slots: 40 | void readingTest_data(); 41 | void readingTest(); 42 | 43 | }; 44 | 45 | #endif // SIGNATUREBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/signatureConfigurationBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SIGNATURECONFIGURATIONBOXTEST_H 29 | #define SIGNATURECONFIGURATIONBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class SignatureConfigurationBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit SignatureConfigurationBoxTest(); 38 | 39 | private slots: 40 | void readingTest_data(); 41 | void readingTest(); 42 | 43 | }; 44 | 45 | #endif // SIGNATURECONFIGURATIONBOXTEST_H 46 | -------------------------------------------------------------------------------- /player/src/tests/surveillanceExportBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SURVEILLANCEEXPORTBOXTEST_H 29 | #define SURVEILLANCEEXPORTBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class SurveillanceExportBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit SurveillanceExportBoxTest(); 38 | 39 | private Q_SLOTS: 40 | void readingTest_data(); 41 | void readingTest(); 42 | }; 43 | 44 | #endif // SURVEILLANCEEXPORTBOXTEST_H 45 | -------------------------------------------------------------------------------- /player/src/tests/surveillanceMetadataSampleConfigBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef SURVEILLANCEMETADATASAMPLECONFIGBOXTEST_H 29 | #define SURVEILLANCEMETADATASAMPLECONFIGBOXTEST_H 30 | 31 | #include 32 | 33 | #include "surveillanceMetadataSampleConfigBox.hpp" 34 | 35 | class SurveillanceMetadataSampleConfigBoxTest : public QObject 36 | { 37 | Q_OBJECT 38 | 39 | public: 40 | SurveillanceMetadataSampleConfigBoxTest(); 41 | 42 | private Q_SLOTS: 43 | void readingTest_data(); 44 | void readingTest(); 45 | }; 46 | 47 | #endif // SURVEILLANCEMETADATASAMPLECONFIGBOXTEST_H 48 | -------------------------------------------------------------------------------- /player/src/tests/surveillanceMetadataSampleEntryBoxTest.h: -------------------------------------------------------------------------------- 1 | #ifndef SURVEILLANCEMETADATASAMPLEENTRYBOX_H 2 | #define SURVEILLANCEMETADATASAMPLEENTRYBOX_H 3 | 4 | #include "boxTestsCommon.h" 5 | 6 | class SurveillanceMetadataSampleEntryBoxTest : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit SurveillanceMetadataSampleEntryBoxTest(); 11 | 12 | private Q_SLOTS: 13 | void readingTest_data(); 14 | void readingTest(); 15 | }; 16 | 17 | #endif // SURVEILLANCEMETADATASAMPLEENTRYBOX_H 18 | -------------------------------------------------------------------------------- /player/src/tests/trackFragmentHeaderBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef TRACKFRAGMENTHEADERBOXTEST_H 29 | #define TRACKFRAGMENTHEADERBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class TrackFragmentHeaderBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit TrackFragmentHeaderBoxTest(); 38 | 39 | private Q_SLOTS: 40 | void readingTest_data(); 41 | void readingTest(); 42 | }; 43 | 44 | #endif // TRACKFRAGMENTHEADERBOXTEST_H 45 | -------------------------------------------------------------------------------- /player/src/tests/trackFragmentRandomAccessBoxTest.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | * Copyright (c) 2013 ONVIF. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are met: 7 | * * Redistributions of source code must retain the above copyright 8 | * notice, this list of conditions and the following disclaimer. 9 | * * Redistributions in binary form must reproduce the above copyright 10 | * notice, this list of conditions and the following disclaimer in the 11 | * documentation and/or other materials provided with the distribution. 12 | * * Neither the name of ONVIF nor the names of its contributors may be 13 | * used to endorse or promote products derived from this software 14 | * without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | * DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ************************************************************************************/ 27 | 28 | #ifndef TRACKFRAGMENTRANDOMACCESSBOXTEST_H 29 | #define TRACKFRAGMENTRANDOMACCESSBOXTEST_H 30 | 31 | #include "boxTestsCommon.h" 32 | 33 | class TrackFragmentRandomAccessBoxTest : public QObject 34 | { 35 | Q_OBJECT 36 | public: 37 | explicit TrackFragmentRandomAccessBoxTest(); 38 | 39 | private Q_SLOTS: 40 | void readingTest_data(); 41 | void readingTest(); 42 | }; 43 | 44 | #endif // TRACKFRAGMENTRANDOMACCESSBOXTEST_H 45 | -------------------------------------------------------------------------------- /player/src/tests/trackHeaderBoxTest.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKHEADERBOXTEST_H 2 | #define TRACKHEADERBOXTEST_H 3 | 4 | #include "boxTestsCommon.h" 5 | 6 | class TrackHeaderBoxTest : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit TrackHeaderBoxTest(); 11 | 12 | private Q_SLOTS: 13 | void readingTest_data(); 14 | void readingTest(); 15 | }; 16 | 17 | #endif // TRACKHEADERBOXTEST_H 18 | -------------------------------------------------------------------------------- /player/src/tests/trackRunBoxTest.h: -------------------------------------------------------------------------------- 1 | #ifndef TRACKRUNBOXTEST_H 2 | #define TRACKRUNBOXTEST_H 3 | 4 | #include "boxTestsCommon.h" 5 | 6 | class TrackRunBoxTest : public QObject 7 | { 8 | Q_OBJECT 9 | public: 10 | explicit TrackRunBoxTest(); 11 | 12 | private Q_SLOTS: 13 | void readingTest_data(); 14 | void readingTest(); 15 | }; 16 | 17 | #endif // TRACKRUNBOXTEST_H 18 | -------------------------------------------------------------------------------- /setup/README.md: -------------------------------------------------------------------------------- 1 | # Building the installer 2 | This file contains how_to_build instructions for ONVIF Export Player Installer 3 | 4 | ## 1. Get Inno Setup 5 | 6 | Get and install Inno Setup from http://www.jrsoftware.org/download.php/is.exe 7 | 8 | 9 | ## 2. Add executable and dlls to the 'input' folder 10 | 11 | Make sure that you added all required binaries to the "input" folder: 12 | 13 | * player executable; 14 | * Qt libraries with 'platforms' subfolder (can be found in plugins folder); 15 | * FFMpeg dlls; 16 | * PortAudio dll; 17 | * OpenSLL dlls; 18 | 19 | Check: You can verify that all files are added if you can start player executable from 'input' folder successfully. 20 | 21 | ## 3. Compile installer 22 | 23 | Open setup_MinGW.iss or setup_VS.iss file using Inno Setup and compile it (Ctrl+F9). 24 | 25 | 26 | ## 4. Result 27 | 28 | Result file named ONVIFPlayerSetup.exe will appear in "output" folder. 29 | 30 | -------------------------------------------------------------------------------- /setup/setup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/onvif/oxfplayer/eca9694c37a054749d0a58524ca711acb7341e86/setup/setup.ico -------------------------------------------------------------------------------- /setup/setup_MinGW.iss: -------------------------------------------------------------------------------- 1 | ;/************************************************************************************ 2 | ;* Copyright (c) 2013 ONVIF. 3 | ;* All rights reserved. 4 | ;* 5 | ;* Redistribution and use in source and binary forms, with or without 6 | ;* modification, are permitted provided that the following conditions are met: 7 | ;* * Redistributions of source code must retain the above copyright 8 | ;* notice, this list of conditions and the following disclaimer. 9 | ;* * Redistributions in binary form must reproduce the above copyright 10 | ;* notice, this list of conditions and the following disclaimer in the 11 | ;* documentation and/or other materials provided with the distribution. 12 | ;* * Neither the name of ONVIF nor the names of its contributors may be 13 | ;* used to endorse or promote products derived from this software 14 | ;* without specific prior written permission. 15 | ;* 16 | ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ;* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | ;* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | ;* DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | ;* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | ;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ;* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ;* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | ;* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ;************************************************************************************/ 27 | 28 | #define NormalSetup 29 | 30 | #define MinGW 31 | 32 | #include "setup_private.iss" 33 | 34 | 35 | -------------------------------------------------------------------------------- /setup/setup_VS.iss: -------------------------------------------------------------------------------- 1 | ;/************************************************************************************ 2 | ;* Copyright (c) 2013 ONVIF. 3 | ;* All rights reserved. 4 | ;* 5 | ;* Redistribution and use in source and binary forms, with or without 6 | ;* modification, are permitted provided that the following conditions are met: 7 | ;* * Redistributions of source code must retain the above copyright 8 | ;* notice, this list of conditions and the following disclaimer. 9 | ;* * Redistributions in binary form must reproduce the above copyright 10 | ;* notice, this list of conditions and the following disclaimer in the 11 | ;* documentation and/or other materials provided with the distribution. 12 | ;* * Neither the name of ONVIF nor the names of its contributors may be 13 | ;* used to endorse or promote products derived from this software 14 | ;* without specific prior written permission. 15 | ;* 16 | ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ;* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | ;* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | ;* DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | ;* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | ;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ;* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ;* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | ;* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ;************************************************************************************/ 27 | 28 | #define NormalSetup 29 | 30 | #define VS 31 | 32 | #include "setup_private.iss" 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /setup/setup_private.iss: -------------------------------------------------------------------------------- 1 | ;/************************************************************************************ 2 | ;* Copyright (c) 2013 ONVIF. 3 | ;* All rights reserved. 4 | ;* 5 | ;* Redistribution and use in source and binary forms, with or without 6 | ;* modification, are permitted provided that the following conditions are met: 7 | ;* * Redistributions of source code must retain the above copyright 8 | ;* notice, this list of conditions and the following disclaimer. 9 | ;* * Redistributions in binary form must reproduce the above copyright 10 | ;* notice, this list of conditions and the following disclaimer in the 11 | ;* documentation and/or other materials provided with the distribution. 12 | ;* * Neither the name of ONVIF nor the names of its contributors may be 13 | ;* used to endorse or promote products derived from this software 14 | ;* without specific prior written permission. 15 | ;* 16 | ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ;* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | ;* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | ;* DISCLAIMED. IN NO EVENT SHALL ONVIF BE LIABLE FOR ANY DIRECT, INDIRECT, 20 | ;* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 21 | ;* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | ;* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ;* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | ;* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | ;* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | ;************************************************************************************/ 27 | 28 | #ifndef NormalSetup 29 | #error You should not execute this file directly. Call one of the custom specific setup files to build a setup (MinGW or VS) 30 | #endif 31 | 32 | [Setup] 33 | AppName = ONVIFPlayer 34 | AppVersion = 2.0 beta 35 | DefaultDirName = {pf}\ONVIF\ONVIFPlayer 36 | DefaultGroupName = ONVIFPlayer 37 | LicenseFile = license.txt 38 | OutputDir = output 39 | OutputBaseFilename = ONVIFPlayerSetup 40 | SetupIconFile = setup.ico 41 | 42 | [Files] 43 | ; exe 44 | Source: "input/ONVIFPlayer.exe"; DestDir: "{app}" 45 | ; dlls 46 | ; Qt 47 | Source: "input/Qt*.dll"; DestDir: "{app}" 48 | Source: "input/plugins/platforms/*.*"; DestDir: "{app}/plugins/platforms" 49 | #ifdef MinGW 50 | Source: "input/D3DCompiler_*.dll"; DestDir: "{app}" 51 | #endif 52 | ; FFMpeg 53 | Source: "input/av*.dll"; DestDir: "{app}" 54 | Source: "input/sw*.dll"; DestDir: "{app}" 55 | #ifdef MinGW 56 | ; MinGW 57 | Source: "input/libgcc_s_sjlj-1.dll"; DestDir: "{app}" 58 | Source: "input/libstdc++-6.dll"; DestDir: "{app}" 59 | Source: "input/libwinpthread-1.dll"; DestDir: "{app}" 60 | #endif 61 | ; PortAudio 62 | Source: "input/portaudio*.dll"; DestDir: "{app}" 63 | ; OpenSSL 64 | Source: "input/libeay32.dll"; DestDir: "{app}" 65 | Source: "input/ssleay32.dll"; DestDir: "{app}" 66 | ;Licenses 67 | Source: "license.txt"; DestDir: "{app}" 68 | 69 | [Tasks] 70 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}" 71 | 72 | [Icons] 73 | Name: "{group}\ONVIFPlayer"; Filename: "{app}\ONVIFPlayer.exe"; WorkingDir: "{app}" 74 | Name: "{commondesktop}\ONVIFPlayer"; Filename: "{app}\ONVIFPlayer.exe"; WorkingDir: "{app}"; Tasks: desktopicon 75 | Name: "{group}\Uninstall ONVIFPlayer"; Filename: "{uninstallexe}"; WorkingDir: "{app}" 76 | 77 | [Run] 78 | Filename: "{app}\ONVIFPlayer.exe"; Flags: postinstall nowait 79 | 80 | 81 | 82 | --------------------------------------------------------------------------------