nx_server_plugin_sdk 1.0 Server Plugin SDK

axis_media_encoder.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 <vector>
6
7 #include <camera/camera_plugin.h>
8 #include <plugins/plugin_tools.h>
9
10 class AxisCameraManager;
11
13
16 class AxisMediaEncoder
17 :
18 public nxcip::CameraMediaEncoder
19 {
20 public:
22
25 AxisMediaEncoder( AxisCameraManager* const cameraManager );
26 virtual ~AxisMediaEncoder();
27
29 virtual void* queryInterface( const nxpl::NX_GUID& interfaceID ) override;
31 virtual int addRef() const override;
33 virtual int releaseRef() const override;
34
36 virtual int getMediaUrl( char* urlBuf ) const override;
38 virtual int getResolutionList( nxcip::ResolutionInfo* infoList, int* infoListCount ) const override;
40 virtual int getMaxBitrate( int* maxBitrate ) const override;
42 virtual int setResolution( const nxcip::Resolution& resolution ) override;
44 virtual int setFps( const float& fps, float* selectedFps ) override;
46 virtual int setBitrate( int bitrateKbps, int* selectedBitrateKbps ) override;
47
48 private:
49 nxpt::CommonRefManager m_refManager;
50 AxisCameraManager* m_cameraManager;
51 mutable std::vector<nxcip::ResolutionInfo> m_supportedResolutions;
52 nxcip::ResolutionInfo m_currentResolutionInfo;
53 float m_currentFps;
54 int m_currentBitrateKbps;
55 bool m_audioEnabled;
56 float m_maxAllowedFps;
57 mutable int m_rtspPort;
58
59 int fetchCameraResolutionList() const;
60 };
nxcip::CameraMediaEncoder
Provides encoder parameter configuration and media stream access (by providing media stream url) ...
Definition: camera_plugin.h:304
AxisMediaEncoder::getResolutionList
virtual int getResolutionList(nxcip::ResolutionInfo *infoList, int *infoListCount) const override
Implementation of nxcip::CameraMediaEncoder::getResolutionList.
Definition: axis_media_encoder.cpp:99
AxisMediaEncoder
Implementation of nxcip::CameraMediaEncoder.
Definition: axis_media_encoder.h:16
nxcip::ResolutionInfo
Contains resolution and maximum fps, supported by camera for this resolution.
Definition: camera_plugin.h:282
AxisMediaEncoder::queryInterface
virtual void * queryInterface(const nxpl::NX_GUID &interfaceID) override
Implementation of nxpl::PluginInterface::queryInterface.
Definition: axis_media_encoder.cpp:42
nxpl::NX_GUID
GUID of plugin interface.
Definition: plugin_api.h:26
AxisCameraManager
Provides access to camera&#39;s properties and instantiates other managers (implements nxcip::BaseCameraM...
Definition: axis_camera_manager.h:21
nxcip::Resolution
Resolution of video stream picture.
Definition: camera_plugin.h:266
nxpt::CommonRefManager
Definition: plugin_tools.h:67
AxisMediaEncoder::addRef
virtual int addRef() const override
Implementation of nxpl::PluginInterface::addRef.
Definition: axis_media_encoder.cpp:57
plugin_tools.h
AxisMediaEncoder::getMediaUrl
virtual int getMediaUrl(char *urlBuf) const override
Implementation of nxcip::CameraMediaEncoder::getMediaUrl.
Definition: axis_media_encoder.cpp:67
AxisMediaEncoder::setResolution
virtual int setResolution(const nxcip::Resolution &resolution) override
Implementation of nxcip::CameraMediaEncoder::setResolution.
Definition: axis_media_encoder.cpp:137
AxisMediaEncoder::AxisMediaEncoder
AxisMediaEncoder(AxisCameraManager *const cameraManager)
Initialization.
Definition: axis_media_encoder.cpp:19
AxisMediaEncoder::getMaxBitrate
virtual int getMaxBitrate(int *maxBitrate) const override
Implementation of nxcip::CameraMediaEncoder::getMaxBitrate.
Definition: axis_media_encoder.cpp:121
AxisMediaEncoder::releaseRef
virtual int releaseRef() const override
Implementation of nxpl::PluginInterface::releaseRef.
Definition: axis_media_encoder.cpp:62
AxisMediaEncoder::setFps
virtual int setFps(const float &fps, float *selectedFps) override
Implementation of nxcip::CameraMediaEncoder::setFps.
Definition: axis_media_encoder.cpp:156
AxisMediaEncoder::setBitrate
virtual int setBitrate(int bitrateKbps, int *selectedBitrateKbps) override
Implementation of nxcip::CameraMediaEncoder::setBitrate.
Definition: axis_media_encoder.cpp:165