3 INDI Interface
for V4L2 devices
4 Copyright (C) 2003 - 2005 Jasem Mutlaq (mutlaqja@ikarustech.com)
5 Copyright (C) 2013 Geehalel (geehalel@gmail.com)
7 This library is free software;
8 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;
12 version 2.1 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT
ANY WARRANTY;
16 without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License
for more details.
20 You should have received a copy of the GNU Lesser General Public
21 License along with
this library;
22 if not, write to the Free Software
23 Foundation, 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
38 #define ERRMSGSIZ 1024
40 #define TEMPFILE_LEN 16
43 typedef unsigned long ulong;
52 explicit V4L2_Driver(std::string label, std::string path);
57 virtual bool ISNewSwitch(
const char *dev,
const char *name,
ISState *states,
char *names[],
int n)
override;
58 virtual bool ISNewText(
const char *dev,
const char *name,
char *texts[],
char *names[],
int n)
override;
59 virtual bool ISNewNumber(
const char *dev,
const char *name,
double values[],
char *names[],
int n)
override;
70 virtual bool Connect()
override;
Class to provide general functionality of CCD cameras with a single CCD sensor, or a primary CCD sens...
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
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.
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]
unsigned int non_capture_frames
virtual bool initProperties() override
Initilize properties initial state and value. The child class must implement this function.
struct timeval frame_duration
struct timeval capture_start
ISwitchVectorProperty CaptureSizesSP
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
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 ...
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
ISwitchVectorProperty StackModeSP
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.