3INDI Interface
for V4L2 devices
7 This library is free software;
8you can redistribute it and / or
9modify it under the terms of the GNU Lesser General Public
10License as published by the Free Software Foundation;
12version 2.1 of the License, or (at your option) any later version.
14This library is distributed in the hope that it will be useful,
15 but WITHOUT
ANY WARRANTY;
16without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18Lesser General Public License
for more details.
20You should have received a copy of the GNU Lesser General Public
21License along with
this library;
22if not, write to the Free Software
23Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110 - 1301 USA
32#define IMAGE_CONTROL "Image Control"
33#define IMAGE_GROUP "V4L2 Control"
34#define IMAGE_BOOLEAN "V4L2 Options"
35#define CAPTURE_FORMAT "Capture Options"
37#define MAX_PIXELS 4096
40#define TEMPFILE_LEN 16
43typedef unsigned long ulong;
65 explicit V4L2_Driver(std::string label, std::string path);
70 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
71 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
72 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
83 virtual bool Connect()
override;
Class to provide general functionality of CCD cameras with a single CCD sensor, or a primary CCD sens...
The Timer class provides repetitive and single-shot timers.
bool setManualExposure(double duration)
ITextVectorProperty camNameTP
virtual bool StopStreaming() override
StopStreaming Stop live video streaming.
virtual const char * getDefaultName() override
virtual bool StartStreaming() override
StartStreaming Start live video streaming.
ITextVectorProperty CaptureColorSpaceTP
INDI::PropertySwitch StackModeSP
INumberVectorProperty FrameRateNP
virtual void getBasicData()
struct timeval getElapsedExposure() const
struct timeval exposure_duration
virtual bool Connect() override
Connect to the device. INDI::DefaultDevice implementation connects to appropriate connection interfac...
INumberVectorProperty CaptureSizesNP
struct timeval frame_received
bool setShutter(double duration)
ISwitchVectorProperty FrameRatesSP
virtual void updateV4L2Controls()
virtual bool Disconnect() override
Disconnect from device.
void resetDevice(int bus_num, int dev_num)
INumberVectorProperty ImageAdjustNP
ISwitchVectorProperty InputsSP
bool startlongexposure(double timeinsec)
ISwitchVectorProperty CaptureFormatsSP
virtual bool ISNewText(const char *dev, const char *name, char *texts[], char *names[], int n) override
Process the client newSwitch command.
virtual bool UpdateCCDFrame(int x, int y, int w, int h) override
CCD calls this function when CCD Frame dimension needs to be updated in the hardware....
ITextVectorProperty PortTP
virtual void initCamBase()
virtual bool ISNewSwitch(const char *dev, const char *name, ISState *states, char *names[], int n) override
Process the client newSwitch command.
virtual bool ISNewNumber(const char *dev, const char *name, double values[], char *names[], int n) override
Process the client newNumber command.
virtual bool AbortExposure() override
Abort ongoing exposure.
ISwitchVectorProperty ImageDepthSP
virtual bool updateProperties() override
updateProperties is called whenever there is a change in the CONNECTION status of the driver....
virtual bool StartExposure(float duration) override
Start exposing primary CCD chip.
char defaultVideoPort[256]
bool valid_frame_has_arrived
unsigned int non_capture_frames
virtual bool initProperties() override
Initialize properties initial state and value. The child class must implement this function.
struct timeval frame_duration
struct timeval capture_start
ISwitchVectorProperty CaptureSizesSP
bool updateCaptureSize(uint32_t width, uint32_t height)
struct timeval elapsed_exposure
ISwitchVectorProperty ColorProcessingSP
virtual void ISGetProperties(const char *dev) override
define the driver's properties to the client. Usually, only a minimum set of properties are defined t...
ISwitchVectorProperty * ManualExposureSP
void iOptronWatchdogCallback()
virtual ~V4L2_Driver() override
virtual bool UpdateCCDBin(int hor, int ver) override
CCD calls this function when CCD Binning needs to be updated in the hardware. Derived classes should ...
INDI::Timer ioptron_watchdog_timer
IText CaptureColorSpaceT[3]
bool start_capturing(bool do_stream)
virtual bool SetCaptureFormat(uint8_t index) override
SetCaptureFormat Set Active Capture format.
INDI::V4L2_Base * v4l_base
static void stdtimerCallback(void *userpointer)
unsigned int v4ladjustments
bool getPixelFormat(uint32_t v4l2format, INDI_PIXEL_FORMAT &pixelFormat, uint8_t &pixelDepth)
float getRemainingExposure() const
static void lxtimerCallback(void *userpointer)
char device_name[MAXINDIDEVICE]
virtual bool saveConfigItems(FILE *fp) override
saveConfigItems Save configuration items in XML file.
ISwitch ColorProcessingS[3]
ISwitchVectorProperty * Options
Namespace to encapsulate INDI client, drivers, and mediator classes.
unsigned char * RGB24Buffer
unsigned char * compressedFrame
Number vector property descriptor.
Switch vector property descriptor.
Text vector property descriptor.