add plugin camera desktop
This commit is contained in:
18
plugins/camera_desktop/linux/photo_handler.h
Normal file
18
plugins/camera_desktop/linux/photo_handler.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef PHOTO_HANDLER_H_
|
||||
#define PHOTO_HANDLER_H_
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <string>
|
||||
|
||||
class PhotoHandler {
|
||||
public:
|
||||
// Captures a still image from the appsink's last-sample property (read-only,
|
||||
// no consumer conflict with the preview stream). Converts the RGBA frame to
|
||||
// JPEG via gst_video_convert_sample and writes it to |output_path|.
|
||||
// Returns true on success; sets |error| on failure.
|
||||
static bool TakePicture(GstElement* appsink,
|
||||
const std::string& output_path,
|
||||
GError** error);
|
||||
};
|
||||
|
||||
#endif // PHOTO_HANDLER_H_
|
||||
Reference in New Issue
Block a user