24 #include <libplayercore/playercore.h>
26 #include "v4lcapture.h"
28 #define PLAYER_CAMERA_FORMAT_RGB 6
29 #define PLAYER_CAMERA_FORMAT_YUV420P 7
56 void YUV422toRGB(uint8_t* argInputData, uint8_t* argOutputData);
58 inline double LimitPan(
double argP)
59 {
return (argP < mPanMin) ? mPanMin : ((argP > mPanMax) ? mPanMax : argP);};
60 inline double LimitTilt(
double argT)
61 {
return (argT < mTiltMin) ? mTiltMin : ((argT > mTiltMax) ? mTiltMax : argT);};
65 player_camera_data_t mCameraData;
68 player_ptz_data_t mPtzData;
69 player_ptz_cmd_t mPtzCmd;
73 int32_t mShutterSpeed;
74 int32_t mCompressionPreference;
75 int32_t mAutomaticGain;
79 int32_t mNoiseReduction;
80 int32_t mDumpSettings;
82 const char *mAutomaticWb;
102 int32_t mFrameNumber;
105 int32_t mWidth, mHeight;
T min(T a, T b)
Return the minimum of a, b.
Definition: utility.h:113
virtual void Publish(player_devaddr_t addr, QueuePointer &queue, uint8_t type, uint8_t subtype, void *src=NULL, size_t deprecated=0, double *timestamp=NULL, bool copy=true)
Publish a message via one of this driver's interfaces.
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
int AddInterface(player_devaddr_t addr)
Add an interface.
Generic message header.
Definition: player.h:162
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
uint8_t type
Message type; must be one of PLAYER_MSGTYPE_*.
Definition: player.h:166
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:75
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
virtual void Main(void)=0
Main method for driver thread.
int ReadInt(int section, const char *name, int value)
Read an integer value.
void ProcessMessages(void)
Process pending messages.
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
Definition: sphere_mixed.h:34
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
void YUV422toRGB(uint8_t *argInputData, uint8_t *argOutputData)
Conversion of YUV422 pixel data into RGB ( CCIR 601 )
Definition: sphere_mixed.cc:671
void MainQuit()
Cleanup method for driver thread (called when main exits)
Definition: sphere_mixed.cc:362
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: sphere_mixed.cc:405
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
Class for loading configuration file information.
Definition: configfile.h:197
int ReadTupleInt(int section, const char *name, int index, int value)
Read an integer from a tuple field.
A device address.
Definition: player.h:146
An autopointer for the message queue.
Definition: message.h:74
Definition: v4lcapture.h:100
Definition: v4lframe.h:64
void SetError(int code)
Set/reset error code.
Definition: driver.h:145
#define PLAYER_ERROR1(msg, a)
Error message macros.
Definition: error.h:82
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:81
player_devaddr_t device_addr
Default device address (single-interface drivers)
Definition: driver.h:269
Base class for drivers which oeprate with a thread.
Definition: driver.h:553
int MainSetup()
Sets up the resources needed by the driver thread.
Definition: sphere_mixed.cc:276
uint32_t size
Size in bytes of the payload to follow.
Definition: player.h:174
SphereDriver(ConfigFile *cf, int section)
Definition: sphere_mixed.cc:200
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
Base class for all drivers.
Definition: driver.h:109
virtual void Main()
Main method for driver thread.
Definition: sphere_mixed.cc:382
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76
T max(T a, T b)
Return the maximum of a, b.
Definition: utility.h:126