Instrument Neutral Distributed Interface INDI  2.0.2
encoderinterface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2017 by Jasem Mutlaq <mutlaqja@ikarustech.com>
3 
4  Encoder Interface
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 
20 */
21 
22 #pragma once
23 
24 #include "indidevapi.h"
25 #include "indibasetypes.h"
26 #include "indiwidgetview.h"
27 
28 #include <stdio.h>
29 #include <cstdlib>
30 #include <stdint.h>
31 
32 #include <vector>
33 
34 namespace INDI
35 {
36 
37 class DefaultDevice;
38 class CCD;
39 class Detector;
40 
45 {
46  public:
47  EncoderInterface() = default;
48  virtual ~EncoderInterface() = default;
49 
50  virtual void init(INDI::DefaultDevice *mainDevice);
51 
53 
54  virtual bool setSize(uint16_t width, uint16_t height);
55 
56  virtual bool upload(INDI::WidgetViewBlob *bp, const uint8_t *buffer, uint32_t nbytes, bool isCompressed = false) = 0;
57 
58  const char *getName();
59 
60  protected:
62  const char *name;
63  INDI_PIXEL_FORMAT pixelFormat; // INDI Pixel Format
64  uint8_t pixelDepth = 8; // Bits per Pixels
65  uint16_t rawWidth, rawHeight;
66 };
67 
68 }
Class to provide extended functionality for devices in addition to the functionality provided by INDI...
The EncoderInterface class is the base class for video streaming encoders.
virtual bool setSize(uint16_t width, uint16_t height)
virtual void init(INDI::DefaultDevice *mainDevice)
INDI::DefaultDevice * currentDevice
virtual bool setPixelFormat(INDI_PIXEL_FORMAT pixelFormat, uint8_t pixelDepth)
INDI_PIXEL_FORMAT pixelFormat
virtual ~EncoderInterface()=default
virtual bool upload(INDI::WidgetViewBlob *bp, const uint8_t *buffer, uint32_t nbytes, bool isCompressed=false)=0
INDI_PIXEL_FORMAT
Definition: indibasetypes.h:70
Interface to the reference INDI C API device implementation on the Device Driver side.
std::vector< uint8_t > buffer
Namespace to encapsulate INDI client, drivers, and mediator classes.