PROP_DRAW_CORNER_MARKERS,
} GstV4L2CamSrcProperties;
-
-static GstStaticPadTemplate gst_v4l2camsrc_template =
- GST_STATIC_PAD_TEMPLATE ("src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS ("video/x-raw-yuv, "
- "format = (fourcc) NV12, "
- "framerate = (fraction) [ 0, 200 ], "
- "width = (int) [ 1, MAX ], "
- "height = (int) [ 1, MAX ];"
- "video/x-raw-yuv, "
- "format = (fourcc) I420, "
- "framerate = (fraction) [ 0, 200 ], "
- "width = (int) [ 1, MAX ], "
- "height = (int) [ 1, MAX ];"
- "video/x-raw-bayer, "
- "format = (fourcc) BA10, "
- "framerate = (fraction) [ 0, 200 ], "
- "width = (int) [ 1, MAX ], "
- "height = (int) [ 1, MAX ];"
- "video/x-vaapi-sharing, "
- "type = vaapi, "
- "width = (int) [ 1, MAX ], "
- "height = (int) [ 1, MAX ], "
- "framerate = (fraction) [ 0, MAX ]"));
+#define GST_V4L2_CAMSRC_PAD_TEMPLATE(padname) \
+ GST_STATIC_PAD_TEMPLATE (padname, \
+ GST_PAD_SRC, \
+ GST_PAD_ALWAYS, \
+ GST_STATIC_CAPS ("video/x-raw-yuv, " \
+ "format = (fourcc) NV12, " \
+ "framerate = (fraction) [ 0, 200 ], " \
+ "width = (int) [ 1, MAX ], " \
+ "height = (int) [ 1, MAX ];" \
+ "video/x-raw-yuv, " \
+ "format = (fourcc) I420, " \
+ "framerate = (fraction) [ 0, 200 ], " \
+ "width = (int) [ 1, MAX ], " \
+ "height = (int) [ 1, MAX ];" \
+ "video/x-raw-bayer, " \
+ "format = (fourcc) BA10, " \
+ "framerate = (fraction) [ 0, 200 ], " \
+ "width = (int) [ 1, MAX ], " \
+ "height = (int) [ 1, MAX ];" \
+ "video/x-vaapi-sharing, " \
+ "type = vaapi, " \
+ "width = (int) [ 1, MAX ], " \
+ "height = (int) [ 1, MAX ], " \
+ "framerate = (fraction) [ 0, MAX ]"))
+
+static GstStaticPadTemplate gst_v4l2camsrc_src_template =
+ GST_V4L2_CAMSRC_PAD_TEMPLATE("src");
+
+static GstStaticPadTemplate gst_v4l2camsrc_second_template =
+ GST_V4L2_CAMSRC_PAD_TEMPLATE("second");
#define DEFAULT_PROP_DEVICE_NAME NULL
#define DEFAULT_PROP_DEVICE "/dev/video0"
"Maemo Multimedia <multimedia@maemo.org>");
gst_element_class_add_pad_template (element_class,
- gst_static_pad_template_get (&gst_v4l2camsrc_template));
+ gst_static_pad_template_get (&gst_v4l2camsrc_src_template));
+ gst_element_class_add_pad_template (element_class,
+ gst_static_pad_template_get (&gst_v4l2camsrc_second_template));
}
gboolean gst_v4l2camsrc_set_autofocus (GstCameraSrc * camsrc, gboolean on);
gboolean
gst_v4l2camsrc_set_AeAafwindow (GstCameraSrc * camsrc, GstCameraSrc3a_window window);
+static gboolean
+gst_v4l2camsrc_is_second_open(GstCameraSrc *base)
+{
+ GstMFLDV4l2CamSrc *v4l2camsrc = GST_V4L2CAMSRC_CAST (base);
+ return GST_V4L2CAMSRC_IS_SECOND_OPEN(v4l2camsrc);
+}
+
/*
* gst_v4l2camsrc_class_init:
* @klass: #GstMFLDV4l2CamSrcClass.
camera_class->unlock = GST_DEBUG_FUNCPTR (gst_v4l2camsrc_unlock);
camera_class->unlock_stop = GST_DEBUG_FUNCPTR (gst_v4l2camsrc_unlock_stop);
+ /* second stream */
+ //camera_class->get_second_caps = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_get_second_caps);
+ camera_class->open_second = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_open_second);
+ camera_class->is_second_open = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_is_second_open);
+ camera_class->close_second = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_close_second);
+ camera_class->set_second_capture_mode =
+ GST_DEBUG_FUNCPTR(gst_v4l2camsrc_set_second_capture_mode);
+ camera_class->set_second_capture =
+ GST_DEBUG_FUNCPTR(gst_v4l2camsrc_set_second_capture);
+ camera_class->start_second = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_start_second);
+ camera_class->create_second_buffer =
+ GST_DEBUG_FUNCPTR(gst_v4l2camsrc_create_second_buffer);
+
camera_class->set_capture_mode =
GST_DEBUG_FUNCPTR (gst_v4l2camsrc_set_capture_mode);
// camera_class->set_vfinder_mode = GST_DEBUG_FUNCPTR(gst_v4l2camsrc_set_viewfinder_mode);
v4l2camsrc->af_window.y_top = 0;
v4l2camsrc->af_window.weight= 0x8000;
+ /* second stream */
+ v4l2camsrc->second_video_fd = -1;
+ v4l2camsrc->second_frame_byte_size = 0;
+ v4l2camsrc->second_poll = gst_poll_new (TRUE);
+ v4l2camsrc->second_num_buffers = 4;
+ v4l2camsrc->second_pool = NULL;
+
libmfld_cam_init (v4l2camsrc->mfldadvci);
GST_DEBUG ("initialized to commit %s", MFLD_V4L2CAMSRC_VERSION);
gst_poll_free (v4l2camsrc->poll);
}
+ if (v4l2camsrc->second_poll) {
+ gst_poll_free (v4l2camsrc->second_poll);
+ }
+
g_mutex_free (v4l2camsrc->device_mutex);
G_OBJECT_CLASS (parent_class)->dispose (object);