57 #ifndef _RNR_CAMERA_GST_H 58 #define _RNR_CAMERA_GST_H 64 #include "rnr/rnrconfig.h" 67 #include "opencv/cv.h" 94 CameraGst(
const std::string &strVideoDevName=
"/dev/video0",
253 static GstBusSyncReply gstBusSyncHandler(GstBus *bus,
282 static void clickCb(GstElement *element,
288 static gint64 onBlockVideoSelector(GstElement *element,
291 static gint64 onSwitchVideoSelector(GstElement *element,
308 #endif // _RNR_CAMERA_GST_H void stopPipeline()
Stop the camera and the pipeline.
virtual ~CameraGst()
Destructor.
int makePipeline()
Make gstreamer video pipeline.
GstElement * m_pElemCamFilter
camera properties element
GstElement * m_pBinImageSink
still image sink bin
GstElement * m_pElemImgSink
still image sink
const CamRes CamResDft
default resolution
gulong m_uVidWinXid
overlay window X-windows id
int makeCameraSrcBin()
Video source bin.
virtual void autoFocus()
Auto-focus camera.
char m_bufTmpName[PATH_MAX]
temporary file name buffer
virtual CamRes setCameraResolution(const CamRes &res)
Set the camera resolution in either video or still image mode.
const CamRes CamResQVGA
Quarter VGA 320 x 240 res.
GstElement * m_pBinVideoSink
video sink bin
Camera resolution structure.
int m_nSignalId
camera still image callback signal
void makeTmpFile()
Make unique temporary file.
void setTextOverlay(const char *sText)
Overlay text on video stream.
GstElement * m_pElemVidText
video text overlay
void clearTextOverlay()
Clear text overlay on video stream.
virtual int startVideo(const CamRes &resVideo=CamResDft)
Start the camera streaming video.
void setXid(gulong uXid)
Set X identifier associated with widget receiving streaming video.
GStreamer implementation of the camera class. The video is streamed via a Gstreamer/GTK callback mech...
GstElement * m_pPipeline
camera pipeline
virtual int clickImage(cv::Mat &img, const CamRes &resImage=CamResDft)
Take a still image.
GstElement * m_pBinCameraSrc
camera source bin
int makeVideoSinkBin()
Video sink bin.
void startPipeline()
Start the camera and the pipeline.
int makeImageSinkBin()
Image sink bin.
GstElement * m_pElemVidSink
video sink
virtual int grabFrame(cv::Mat &frame)
Grab a image frame from the video stream.
static void gstBusMsgCb(GstBus *bus, GstMessage *message, gpointer user_data)
Gstream pipeline synchronous bus handler.
virtual int stopVideo()
Stop the camera from streaming video.
const CamRes CamResVGA
VGA 640 x 480 resolution.
static void clickCb(GstElement *element, GstBuffer *buffer, GstPad *pad, void *user_data)
Still image capture asynchronouse callback.