Instrument Neutral Distributed Interface INDI  1.9.2
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
INDI::StreamManagerPrivate Class Reference

#include <streammanager_p.h>

Classes

struct  FrameInfo
 
struct  TimeFrame
 

Public Types

enum  { RECORD_ON, RECORD_TIME, RECORD_FRAME, RECORD_OFF }
 
enum  { STREAM_EXPOSURE, STREAM_DIVISOR }
 
enum  { FPS_INSTANT, FPS_AVERAGE }
 
enum  { ENCODER_RAW, ENCODER_MJPEG }
 
enum  { RECORDER_RAW, RECORDER_OGV }
 
enum  { LIMITS_BUFFER_MAX, LIMITS_PREVIEW_FPS }
 

Public Member Functions

 StreamManagerPrivate (DefaultDevice *defaultDevice)
 
virtual ~StreamManagerPrivate ()
 
bool initProperties ()
 
void ISGetProperties (const char *dev)
 
bool ISNewText (const char *dev, const char *name, char *texts[], char *names[], int n)
 
bool ISNewSwitch (const char *dev, const char *name, ISState *states, char *names[], int n)
 
bool ISNewNumber (const char *dev, const char *name, double values[], char *names[], int n)
 
void newFrame (const uint8_t *buffer, uint32_t nbytes)
 
bool updateProperties ()
 
bool setStream (bool enable)
 
const char * getDeviceName () const
 
void setSize (uint16_t width, uint16_t height)
 
bool setPixelFormat (INDI_PIXEL_FORMAT pixelFormat, uint8_t pixelDepth)
 
void asyncStreamThread ()
 Thread processing frames and forwarding to recording and preview. More...
 
bool startRecording ()
 
bool stopRecording (bool force=false)
 
bool uploadStream (const uint8_t *buffer, uint32_t nbytes)
 uploadStream Upload frame to client using the selected encoder More...
 
bool recordStream (const uint8_t *buffer, uint32_t nbytes, double deltams)
 recordStream Calls the backend recorder to record a single frame. More...
 
void getStreamFrame (uint16_t *x, uint16_t *y, uint16_t *w, uint16_t *h) const
 
void setStreamFrame (uint16_t x, uint16_t y, uint16_t w, uint16_t h)
 
void setStreamFrame (const FrameInfo &frameInfo)
 
FrameInfo updateSourceFrameInfo ()
 

Static Public Member Functions

static std::string expand (const std::string &fname, const std::map< std::string, std::string > &patterns)
 
static void subframe (const uint8_t *srcBuffer, const FrameInfo &srcFrameInfo, uint8_t *dstBuffer, const FrameInfo &dstFrameInfo)
 

Public Attributes

DefaultDevicecurrentDevice = nullptr
 
FrameInfo dstFrameInfo
 
INDI::PropertySwitch StreamSP {2}
 
INDI::PropertyNumber StreamTimeNP {1}
 
INDI::PropertySwitch RecordStreamSP {4}
 
INDI::PropertyText RecordFileTP {2}
 
INDI::PropertyNumber StreamExposureNP {2}
 
INDI::PropertyNumber FpsNP {2}
 
INDI::PropertyNumber RecordOptionsNP {2}
 
INDI::PropertyNumber StreamFrameNP {4}
 
INDI::PropertyView< IBLOB > * imageBP {nullptr}
 
INDI::PropertySwitch EncoderSP {2}
 
INDI::PropertySwitch RecorderSP {2}
 
INDI::PropertyNumber LimitsNP {2}
 
std::atomic< bool > isStreaming { false }
 
std::atomic< bool > isRecording { false }
 
std::atomic< bool > isRecordingAboutToClose { false }
 
bool hasStreamingExposure { true }
 
RecorderManager recorderManager
 
RecorderInterfacerecorder = nullptr
 
bool direct_record = false
 
std::string recordfiledir
 
std::string recordfilename
 
EncoderManager encoderManager
 
EncoderInterfaceencoder = nullptr
 
FPSMeter FPSAverage
 
FPSMeter FPSFast
 
FPSMeter FPSPreview
 
FPSMeter FPSRecorder
 
uint32_t frameCountDivider = 0
 
INDI_PIXEL_FORMAT PixelFormat = INDI_MONO
 
uint8_t PixelDepth = 8
 
uint16_t rawWidth = 0
 
uint16_t rawHeight = 0
 
std::string Format
 
std::thread framesThread
 
std::atomic< bool > framesThreadTerminate {false}
 
UniqueQueue< TimeFrameframesIncoming
 
std::mutex fastFPSUpdate
 
std::mutex recordMutex
 
GammaLut16 gammaLut16
 

Detailed Description

Definition at line 48 of file streammanager_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
RECORD_ON 
RECORD_TIME 
RECORD_FRAME 
RECORD_OFF 

Definition at line 167 of file streammanager_p.h.

◆ anonymous enum

anonymous enum
Enumerator
STREAM_EXPOSURE 
STREAM_DIVISOR 

Definition at line 179 of file streammanager_p.h.

◆ anonymous enum

anonymous enum
Enumerator
FPS_INSTANT 
FPS_AVERAGE 

Definition at line 187 of file streammanager_p.h.

◆ anonymous enum

anonymous enum
Enumerator
ENCODER_RAW 
ENCODER_MJPEG 

Definition at line 200 of file streammanager_p.h.

◆ anonymous enum

anonymous enum
Enumerator
RECORDER_RAW 
RECORDER_OGV 

Definition at line 204 of file streammanager_p.h.

◆ anonymous enum

anonymous enum
Enumerator
LIMITS_BUFFER_MAX 
LIMITS_PREVIEW_FPS 

Definition at line 208 of file streammanager_p.h.

Constructor & Destructor Documentation

◆ StreamManagerPrivate()

INDI::StreamManagerPrivate::StreamManagerPrivate ( DefaultDevice defaultDevice)

Definition at line 44 of file streammanager.cpp.

◆ ~StreamManagerPrivate()

INDI::StreamManagerPrivate::~StreamManagerPrivate ( )
virtual

Definition at line 63 of file streammanager.cpp.

Member Function Documentation

◆ asyncStreamThread()

void INDI::StreamManagerPrivate::asyncStreamThread ( )

Thread processing frames and forwarding to recording and preview.

Definition at line 409 of file streammanager.cpp.

◆ expand()

std::string INDI::StreamManagerPrivate::expand ( const std::string &  fname,
const std::map< std::string, std::string > &  patterns 
)
static

Definition at line 590 of file streammanager.cpp.

◆ getDeviceName()

const char * INDI::StreamManagerPrivate::getDeviceName ( ) const

Definition at line 80 of file streammanager.cpp.

◆ getStreamFrame()

void INDI::StreamManagerPrivate::getStreamFrame ( uint16_t *  x,
uint16_t *  y,
uint16_t *  w,
uint16_t *  h 
) const

Definition at line 1136 of file streammanager.cpp.

◆ initProperties()

bool INDI::StreamManagerPrivate::initProperties ( )

Definition at line 91 of file streammanager.cpp.

◆ ISGetProperties()

void INDI::StreamManagerPrivate::ISGetProperties ( const char *  dev)

Definition at line 181 of file streammanager.cpp.

◆ ISNewNumber()

bool INDI::StreamManagerPrivate::ISNewNumber ( const char *  dev,
const char *  name,
double  values[],
char *  names[],
int  n 
)

Definition at line 928 of file streammanager.cpp.

◆ ISNewSwitch()

bool INDI::StreamManagerPrivate::ISNewSwitch ( const char *  dev,
const char *  name,
ISState states,
char *  names[],
int  n 
)

Definition at line 757 of file streammanager.cpp.

◆ ISNewText()

bool INDI::StreamManagerPrivate::ISNewText ( const char *  dev,
const char *  name,
char *  texts[],
char *  names[],
int  n 
)

Definition at line 898 of file streammanager.cpp.

◆ newFrame()

void INDI::StreamManagerPrivate::newFrame ( const uint8_t *  buffer,
uint32_t  nbytes 
)

Definition at line 264 of file streammanager.cpp.

◆ recordStream()

bool INDI::StreamManagerPrivate::recordStream ( const uint8_t *  buffer,
uint32_t  nbytes,
double  deltams 
)

recordStream Calls the backend recorder to record a single frame.

Parameters
deltamstime in milliseconds since last frame

Definition at line 581 of file streammanager.cpp.

◆ setPixelFormat()

bool INDI::StreamManagerPrivate::setPixelFormat ( INDI_PIXEL_FORMAT  pixelFormat,
uint8_t  pixelDepth 
)

Definition at line 539 of file streammanager.cpp.

◆ setSize()

void INDI::StreamManagerPrivate::setSize ( uint16_t  width,
uint16_t  height 
)

Definition at line 494 of file streammanager.cpp.

◆ setStream()

bool INDI::StreamManagerPrivate::setStream ( bool  enable)

Definition at line 1015 of file streammanager.cpp.

◆ setStreamFrame() [1/2]

void INDI::StreamManagerPrivate::setStreamFrame ( const FrameInfo frameInfo)

Definition at line 1152 of file streammanager.cpp.

◆ setStreamFrame() [2/2]

void INDI::StreamManagerPrivate::setStreamFrame ( uint16_t  x,
uint16_t  y,
uint16_t  w,
uint16_t  h 
)

Definition at line 1144 of file streammanager.cpp.

◆ startRecording()

bool INDI::StreamManagerPrivate::startRecording ( )

Definition at line 613 of file streammanager.cpp.

◆ stopRecording()

bool INDI::StreamManagerPrivate::stopRecording ( bool  force = false)

Definition at line 720 of file streammanager.cpp.

◆ subframe()

void INDI::StreamManagerPrivate::subframe ( const uint8_t *  srcBuffer,
const FrameInfo srcFrameInfo,
uint8_t *  dstBuffer,
const FrameInfo dstFrameInfo 
)
static

Definition at line 387 of file streammanager.cpp.

◆ updateProperties()

bool INDI::StreamManagerPrivate::updateProperties ( )

Definition at line 208 of file streammanager.cpp.

◆ updateSourceFrameInfo()

StreamManagerPrivate::FrameInfo INDI::StreamManagerPrivate::updateSourceFrameInfo ( )

Definition at line 349 of file streammanager.cpp.

◆ uploadStream()

bool INDI::StreamManagerPrivate::uploadStream ( const uint8_t *  buffer,
uint32_t  nbytes 
)

uploadStream Upload frame to client using the selected encoder

Parameters
bufferpointer to frame image buffer
nbytessize of frame in bytes
Returns
True if frame is encoded and sent to client, false otherwise.

Definition at line 1163 of file streammanager.cpp.

Member Data Documentation

◆ currentDevice

DefaultDevice* INDI::StreamManagerPrivate::currentDevice = nullptr

Definition at line 156 of file streammanager_p.h.

◆ direct_record

bool INDI::StreamManagerPrivate::direct_record = false

Definition at line 218 of file streammanager_p.h.

◆ dstFrameInfo

FrameInfo INDI::StreamManagerPrivate::dstFrameInfo

Definition at line 158 of file streammanager_p.h.

◆ encoder

EncoderInterface* INDI::StreamManagerPrivate::encoder = nullptr

Definition at line 223 of file streammanager_p.h.

◆ encoderManager

EncoderManager INDI::StreamManagerPrivate::encoderManager

Definition at line 222 of file streammanager_p.h.

◆ EncoderSP

INDI::PropertySwitch INDI::StreamManagerPrivate::EncoderSP {2}

Definition at line 199 of file streammanager_p.h.

◆ fastFPSUpdate

std::mutex INDI::StreamManagerPrivate::fastFPSUpdate

Definition at line 248 of file streammanager_p.h.

◆ Format

std::string INDI::StreamManagerPrivate::Format

Definition at line 236 of file streammanager_p.h.

◆ FPSAverage

FPSMeter INDI::StreamManagerPrivate::FPSAverage

Definition at line 226 of file streammanager_p.h.

◆ FPSFast

FPSMeter INDI::StreamManagerPrivate::FPSFast

Definition at line 227 of file streammanager_p.h.

◆ FpsNP

INDI::PropertyNumber INDI::StreamManagerPrivate::FpsNP {2}

Definition at line 186 of file streammanager_p.h.

◆ FPSPreview

FPSMeter INDI::StreamManagerPrivate::FPSPreview

Definition at line 228 of file streammanager_p.h.

◆ FPSRecorder

FPSMeter INDI::StreamManagerPrivate::FPSRecorder

Definition at line 229 of file streammanager_p.h.

◆ frameCountDivider

uint32_t INDI::StreamManagerPrivate::frameCountDivider = 0

Definition at line 231 of file streammanager_p.h.

◆ framesIncoming

UniqueQueue<TimeFrame> INDI::StreamManagerPrivate::framesIncoming

Definition at line 246 of file streammanager_p.h.

◆ framesThread

std::thread INDI::StreamManagerPrivate::framesThread

Definition at line 244 of file streammanager_p.h.

◆ framesThreadTerminate

std::atomic<bool> INDI::StreamManagerPrivate::framesThreadTerminate {false}

Definition at line 245 of file streammanager_p.h.

◆ gammaLut16

GammaLut16 INDI::StreamManagerPrivate::gammaLut16

Definition at line 251 of file streammanager_p.h.

◆ hasStreamingExposure

bool INDI::StreamManagerPrivate::hasStreamingExposure { true }

Definition at line 213 of file streammanager_p.h.

◆ imageBP

INDI::PropertyView<IBLOB>* INDI::StreamManagerPrivate::imageBP {nullptr}

Definition at line 196 of file streammanager_p.h.

◆ isRecording

std::atomic<bool> INDI::StreamManagerPrivate::isRecording { false }

Definition at line 211 of file streammanager_p.h.

◆ isRecordingAboutToClose

std::atomic<bool> INDI::StreamManagerPrivate::isRecordingAboutToClose { false }

Definition at line 212 of file streammanager_p.h.

◆ isStreaming

std::atomic<bool> INDI::StreamManagerPrivate::isStreaming { false }

Definition at line 210 of file streammanager_p.h.

◆ LimitsNP

INDI::PropertyNumber INDI::StreamManagerPrivate::LimitsNP {2}

Definition at line 207 of file streammanager_p.h.

◆ PixelDepth

uint8_t INDI::StreamManagerPrivate::PixelDepth = 8

Definition at line 234 of file streammanager_p.h.

◆ PixelFormat

INDI_PIXEL_FORMAT INDI::StreamManagerPrivate::PixelFormat = INDI_MONO

Definition at line 233 of file streammanager_p.h.

◆ rawHeight

uint16_t INDI::StreamManagerPrivate::rawHeight = 0

Definition at line 235 of file streammanager_p.h.

◆ rawWidth

uint16_t INDI::StreamManagerPrivate::rawWidth = 0

Definition at line 235 of file streammanager_p.h.

◆ recorder

RecorderInterface* INDI::StreamManagerPrivate::recorder = nullptr

Definition at line 217 of file streammanager_p.h.

◆ recorderManager

RecorderManager INDI::StreamManagerPrivate::recorderManager

Definition at line 216 of file streammanager_p.h.

◆ RecorderSP

INDI::PropertySwitch INDI::StreamManagerPrivate::RecorderSP {2}

Definition at line 203 of file streammanager_p.h.

◆ recordfiledir

std::string INDI::StreamManagerPrivate::recordfiledir

Definition at line 219 of file streammanager_p.h.

◆ recordfilename

std::string INDI::StreamManagerPrivate::recordfilename

Definition at line 219 of file streammanager_p.h.

◆ RecordFileTP

INDI::PropertyText INDI::StreamManagerPrivate::RecordFileTP {2}

Definition at line 176 of file streammanager_p.h.

◆ recordMutex

std::mutex INDI::StreamManagerPrivate::recordMutex

Definition at line 249 of file streammanager_p.h.

◆ RecordOptionsNP

INDI::PropertyNumber INDI::StreamManagerPrivate::RecordOptionsNP {2}

Definition at line 190 of file streammanager_p.h.

◆ RecordStreamSP

INDI::PropertySwitch INDI::StreamManagerPrivate::RecordStreamSP {4}

Definition at line 166 of file streammanager_p.h.

◆ StreamExposureNP

INDI::PropertyNumber INDI::StreamManagerPrivate::StreamExposureNP {2}

Definition at line 178 of file streammanager_p.h.

◆ StreamFrameNP

INDI::PropertyNumber INDI::StreamManagerPrivate::StreamFrameNP {4}

Definition at line 193 of file streammanager_p.h.

◆ StreamSP

INDI::PropertySwitch INDI::StreamManagerPrivate::StreamSP {2}

Definition at line 161 of file streammanager_p.h.

◆ StreamTimeNP

INDI::PropertyNumber INDI::StreamManagerPrivate::StreamTimeNP {1}

Definition at line 163 of file streammanager_p.h.


The documentation for this class was generated from the following files: