mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
wrappercamerabinsrc: Add local mode
This commit is contained in:
parent
85bf8f2335
commit
b1a361b566
2 changed files with 11 additions and 3 deletions
|
@ -417,6 +417,9 @@ gst_wrapper_camera_bin_src_set_mode (GstBaseCameraSrc * bcamsrc,
|
||||||
GstCameraBinMode mode)
|
GstCameraBinMode mode)
|
||||||
{
|
{
|
||||||
GstPhotography *photography = gst_base_camera_src_get_photography (bcamsrc);
|
GstPhotography *photography = gst_base_camera_src_get_photography (bcamsrc);
|
||||||
|
GstWrapperCameraBinSrc *self = GST_WRAPPER_CAMERA_BIN_SRC (bcamsrc);
|
||||||
|
|
||||||
|
self->mode = mode;
|
||||||
|
|
||||||
if (photography) {
|
if (photography) {
|
||||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (photography),
|
if (g_object_class_find_property (G_OBJECT_GET_CLASS (photography),
|
||||||
|
@ -691,10 +694,10 @@ gst_wrapper_camera_bin_src_start_capture (GstBaseCameraSrc * camerasrc)
|
||||||
GstWrapperCameraBinSrc *src = GST_WRAPPER_CAMERA_BIN_SRC (camerasrc);
|
GstWrapperCameraBinSrc *src = GST_WRAPPER_CAMERA_BIN_SRC (camerasrc);
|
||||||
|
|
||||||
/* TODO shoud we access this directly? Maybe a macro is better? */
|
/* TODO shoud we access this directly? Maybe a macro is better? */
|
||||||
if (camerasrc->mode == MODE_IMAGE) {
|
if (src->mode == MODE_IMAGE) {
|
||||||
src->image_capture_count = 1;
|
src->image_capture_count = 1;
|
||||||
start_image_capture (src);
|
start_image_capture (src);
|
||||||
} else if (camerasrc->mode == MODE_VIDEO) {
|
} else if (src->mode == MODE_VIDEO) {
|
||||||
if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_DONE) {
|
if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_DONE) {
|
||||||
src->video_rec_status = GST_VIDEO_RECORDING_STATUS_STARTING;
|
src->video_rec_status = GST_VIDEO_RECORDING_STATUS_STARTING;
|
||||||
}
|
}
|
||||||
|
@ -711,7 +714,7 @@ gst_wrapper_camera_bin_src_stop_capture (GstBaseCameraSrc * camerasrc)
|
||||||
GstWrapperCameraBinSrc *src = GST_WRAPPER_CAMERA_BIN_SRC (camerasrc);
|
GstWrapperCameraBinSrc *src = GST_WRAPPER_CAMERA_BIN_SRC (camerasrc);
|
||||||
|
|
||||||
/* TODO shoud we access this directly? Maybe a macro is better? */
|
/* TODO shoud we access this directly? Maybe a macro is better? */
|
||||||
if (camerasrc->mode == MODE_VIDEO) {
|
if (src->mode == MODE_VIDEO) {
|
||||||
if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
|
if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
|
||||||
GST_DEBUG_OBJECT (src, "Aborting, had not started recording");
|
GST_DEBUG_OBJECT (src, "Aborting, had not started recording");
|
||||||
src->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
|
src->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
|
||||||
|
@ -794,6 +797,9 @@ gst_wrapper_camera_bin_src_init (GstWrapperCameraBinSrc * self,
|
||||||
/* TODO where are variables reset? */
|
/* TODO where are variables reset? */
|
||||||
self->image_capture_count = 0;
|
self->image_capture_count = 0;
|
||||||
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
|
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
|
||||||
|
self->video_renegotiate = FALSE;
|
||||||
|
self->image_renegotiate = FALSE;
|
||||||
|
self->mode = GST_BASE_CAMERA_SRC_CAST (self)->mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
|
|
|
@ -57,6 +57,8 @@ struct _GstWrapperCameraBinSrc
|
||||||
{
|
{
|
||||||
GstBaseCameraSrc parent;
|
GstBaseCameraSrc parent;
|
||||||
|
|
||||||
|
GstCameraBinMode mode;
|
||||||
|
|
||||||
GstPad *vfsrc;
|
GstPad *vfsrc;
|
||||||
GstPad *imgsrc;
|
GstPad *imgsrc;
|
||||||
GstPad *vidsrc;
|
GstPad *vidsrc;
|
||||||
|
|
Loading…
Reference in a new issue