nx_server_plugin_sdk 1.0 Server Plugin SDK

archive_reader.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <memory>
6 #include <string>
7
8 #include <camera/camera_plugin.h>
9 #include <plugins/plugin_tools.h>
10
11 #include "stream_reader.h"
12
13 class DirContentsManager;
14
15 class ArchiveReader
16 :
17 public nxcip::DtsArchiveReader
18 {
19 public:
20 ArchiveReader(
21 DirContentsManager* const dirContentsManager,
22 unsigned int frameDurationUsec );
23 virtual ~ArchiveReader();
24
26 virtual void* queryInterface( const nxpl::NX_GUID& interfaceID ) override;
28 virtual int addRef() const override;
30 virtual int releaseRef() const override;
31
33 virtual unsigned int getCapabilities() const override;
35 virtual int open() override;
37 virtual nxcip::StreamReader* getStreamReader() override;
39 virtual nxcip::UsecUTCTimestamp startTime() const override;
41 virtual nxcip::UsecUTCTimestamp endTime() const override;
43 virtual int seek(
44 unsigned int cSeq,
45 nxcip::UsecUTCTimestamp timestamp,
46 bool findKeyFrame,
47 nxcip::UsecUTCTimestamp* selectedPosition ) override;
49 virtual int setReverseMode(
50 unsigned int cSeq,
51 bool isReverse,
52 nxcip::UsecUTCTimestamp timestamp,
53 nxcip::UsecUTCTimestamp* selectedPosition ) override;
55 virtual bool isReverseModeEnabled() const override;
57 virtual int setMotionDataEnabled( bool motionPresent ) override;
59 virtual int setQuality( nxcip::MediaStreamQuality quality, bool waitForKeyFrame ) override;
61 virtual int playRange(
62 unsigned int cSeq,
63 nxcip::UsecUTCTimestamp start,
64 nxcip::UsecUTCTimestamp endTimeHint,
65 unsigned int step ) override;
67 virtual void getLastErrorString( char* errorString ) const override;
68
69 private:
70 nxpt::CommonRefManager m_refManager;
71 std::unique_ptr<StreamReader> m_streamReader;
72 DirContentsManager* const m_dirContentsManager;
73 };
ArchiveReader::setMotionDataEnabled
virtual int setMotionDataEnabled(bool motionPresent) override
Implementation of nxcip::DtsArchiveReader::toggleMotionData.
Definition: archive_reader.cpp:121
DirContentsManager
Manages information about image directory contents: Provides file list, generates timestamps of files...
Definition: dir_contents_manager.h:13
ArchiveReader::open
virtual int open() override
Implementation of nxcip::DtsArchiveReader::open.
Definition: archive_reader.cpp:66
ArchiveReader
Definition: archive_reader.h:15
ArchiveReader::setQuality
virtual int setQuality(nxcip::MediaStreamQuality quality, bool waitForKeyFrame) override
Implementation of nxcip::DtsArchiveReader::setQuality.
Definition: archive_reader.cpp:127
nxcip::StreamReader
Used for reading media stream from camera.
Definition: camera_plugin.h:1168
ArchiveReader::endTime
virtual nxcip::UsecUTCTimestamp endTime() const override
Implementation of nxcip::DtsArchiveReader::endTime.
Definition: archive_reader.cpp:85
ArchiveReader::isReverseModeEnabled
virtual bool isReverseModeEnabled() const override
Implementation of nxcip::DtsArchiveReader::isReverseModeEnabled.
Definition: archive_reader.cpp:115
ArchiveReader::seek
virtual int seek(unsigned int cSeq, nxcip::UsecUTCTimestamp timestamp, bool findKeyFrame, nxcip::UsecUTCTimestamp *selectedPosition) override
Implementation of nxcip::DtsArchiveReader::seek.
Definition: archive_reader.cpp:91
nxcip::DtsArchiveReader
Provides access to archive, stored on camera.
Definition: camera_plugin.h:1219
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
ArchiveReader::getCapabilities
virtual unsigned int getCapabilities() const override
Implementation of nxcip::DtsArchiveReader::getCapabilities.
Definition: archive_reader.cpp:60
ArchiveReader::getStreamReader
virtual nxcip::StreamReader * getStreamReader() override
Implementation of nxcip::DtsArchiveReader::getStreamReader.
Definition: archive_reader.cpp:72
ArchiveReader::setReverseMode
virtual int setReverseMode(unsigned int cSeq, bool isReverse, nxcip::UsecUTCTimestamp timestamp, nxcip::UsecUTCTimestamp *selectedPosition) override
Implementation of nxcip::DtsArchiveReader::toggleReverseMode.
Definition: archive_reader.cpp:105
nxpt::CommonRefManager
Definition: plugin_tools.h:67
ArchiveReader::releaseRef
virtual int releaseRef() const override
Implementation of nxpl::PluginInterface::releaseRef.
Definition: archive_reader.cpp:54
ArchiveReader::startTime
virtual nxcip::UsecUTCTimestamp startTime() const override
Implementation of nxcip::DtsArchiveReader::startTime.
Definition: archive_reader.cpp:79
plugin_tools.h
ArchiveReader::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Implementation of nxpl::PluginInterface::queryInterface.
Definition: archive_reader.cpp:32
ArchiveReader::playRange
virtual int playRange(unsigned int cSeq, nxcip::UsecUTCTimestamp start, nxcip::UsecUTCTimestamp endTimeHint, unsigned int step) override
Implementation of nxcip::DtsArchiveReader::setSkipFrames.
Definition: archive_reader.cpp:134
ArchiveReader::addRef
virtual int addRef() const override
Implementation of nxpl::PluginInterface::addRef.
Definition: archive_reader.cpp:48
ArchiveReader::getLastErrorString
virtual void getLastErrorString(char *errorString) const override
Implementation of nxcip::DtsArchiveReader::getLastErrorString.
Definition: archive_reader.cpp:144
nxcip::MediaStreamQuality
MediaStreamQuality
Definition: camera_plugin.h:1189