Instrument Neutral Distributed Interface INDI 2.2.5
streammanager.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2020 by Pawel Soja <[email protected]>
3 Copyright (C) 2015 by Jasem Mutlaq <[email protected]>
4 Copyright (C) 2014 by geehalel <[email protected]>
5
6 Stream Recorder
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Lesser General Public
10 License as published by the Free Software Foundation; either
11 version 2.1 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
17
18 You should have received a copy of the GNU Lesser General Public
19 License along with this library; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
22*/
23
24#pragma once
25
26#include "indidevapi.h"
27#include "indibasetypes.h"
28#include "indimacros.h"
29#include <cstdint>
30#include <memory>
31
88namespace INDI
89{
90
91class CCD;
92class SensorInterface;
93class RecorderInterface;
94class StreamManagerPrivate;
95class DefaultDevice;
96
98{
99 DECLARE_PRIVATE(StreamManager)
100
101 public:
102 StreamManager(DefaultDevice *currentDevice);
103 virtual ~StreamManager();
104
105 public:
106 virtual void ISGetProperties(const char *dev);
107 virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n);
108 virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n);
109 virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n);
110
111 virtual bool initProperties();
112 virtual bool updateProperties();
113 virtual bool saveConfigItems(FILE *fp);
114
115 public:
119 void newFrame(const uint8_t *buffer, uint32_t nbytes, uint64_t timestamp = 0);
120
121 bool close();
122
123 public:
128 void setStreamingExposureEnabled(bool enable);
129
135 bool setStream(bool enable);
136 void setSize(uint16_t width, uint16_t height = 1);
137 bool setPixelFormat(INDI_PIXEL_FORMAT pixelFormat, uint8_t pixelDepth = 8);
138
139 public:
140 bool isDirectRecording() const;
141 bool isStreaming() const;
142 bool isRecording() const;
143 bool isBusy() const;
144
145 public:
146 double getTargetFPS() const;
147 double getTargetExposure() const;
148
149 void getStreamFrame(uint16_t *x, uint16_t *y, uint16_t *w, uint16_t *h) const;
151
152 const char *getDeviceName() const;
153
154 protected:
155 std::shared_ptr<StreamManagerPrivate> d_ptr;
156};
157
158}
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
The RecorderInterface class is the base class for recorders.
void setSize(uint16_t width, uint16_t height=1)
bool isDirectRecording() const
void getStreamFrame(uint16_t *x, uint16_t *y, uint16_t *w, uint16_t *h) const
void newFrame(const uint8_t *buffer, uint32_t nbytes, uint64_t timestamp=0)
newFrame CCD drivers call this function when a new frame is received. It is then streamed,...
void setStreamingExposureEnabled(bool enable)
setStreamingExposureEnabled Can stream exposure time be changed?
std::shared_ptr< StreamManagerPrivate > d_ptr
bool setPixelFormat(INDI_PIXEL_FORMAT pixelFormat, uint8_t pixelDepth=8)
double getTargetExposure() const
bool setStream(bool enable)
setStream Enables (starts) or disables (stops) streaming.
double getTargetFPS() const
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n)
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n)
virtual void ISGetProperties(const char *dev)
virtual bool initProperties()
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n)
virtual bool saveConfigItems(FILE *fp)
RecorderInterface * getRecorder() const
virtual bool updateProperties()
const char * getDeviceName() const
ISState
Switch state.
Definition indiapi.h:148
INDI_PIXEL_FORMAT
Interface to the reference INDI C API device implementation on the Device Driver side.
Namespace to encapsulate INDI client, drivers, and mediator classes.