* @param supported None-zero if software supports the camera
* @param detected None-zero if a camera has been detected
*/
-static void raspicamcontrol_get_camera(int *supported, int *detected)
+void raspicamcontrol_get_camera(int *supported, int *detected)
{
char response[80] = "";
if (vc_gencmd(response, sizeof response, "get_camera") == 0)
void raspicamcontrol_set_defaults(RASPICAM_CAMERA_PARAMETERS *params);
void raspicamcontrol_check_configuration(int min_gpu_mem);
+void raspicamcontrol_get_camera(int *supported, int *detected);
// Individual setting functions
int raspicamcontrol_set_saturation(MMAL_COMPONENT_T *camera, int saturation);
#if GST_CHECK_VERSION (1,4,0)
+#include "RaspiCapture.h"
+
/* FIXME: translations */
#define _(s) s
static void
gst_rpi_cam_src_device_provider_init (GstRpiCamSrcDeviceProvider * provider)
{
- /* nothing to do here yet */
+ raspicapture_init ();
}
static GList *
gst_rpi_cam_src_device_provider_probe (GstDeviceProvider * provider)
{
GstRpiCamSrcDevice *device;
+ int supported = 0, detected = 0;
+
+ raspicamcontrol_get_camera (&supported, &detected);
+
+ if (!detected) {
+ GST_INFO ("No Raspberry Pi camera module detected.");
+ return NULL;
+ } else if (!supported) {
+ GST_WARNING ("Raspberry Pi camera module not supported, make sure to enable it.");
+ return NULL;
+ }
+
+ GST_INFO ("Raspberry Pi camera module detected and supported.");
- /* FIXME: check if camera module is usable and supported */
device = gst_rpi_cam_src_device_new ();
return g_list_append (NULL, device);