camerabin2: More debug logs

Sprinkle some more debugging logs
This commit is contained in:
Thiago Santos 2010-12-03 12:12:32 -03:00
parent 397f7fcceb
commit 5776a17c86
2 changed files with 8 additions and 2 deletions

View file

@ -150,6 +150,8 @@ gst_camera_bin_change_mode (GstCameraBin * camerabin, gint mode)
if (mode == camerabin->mode)
return;
GST_DEBUG_OBJECT (camerabin, "Changing mode to %d", mode);
/* stop any ongoing capture */
gst_camera_bin_stop_capture (camerabin);
camerabin->mode = mode;
@ -172,6 +174,7 @@ gst_camera_bin_src_notify_readyforcapture (GObject * obj, GParamSpec * pspec,
/* a video recording is about to start, we reset the videobin */
gst_element_set_state (camera->vidbin, GST_STATE_NULL);
location = g_strdup_printf (camera->vid_location, camera->vid_index++);
GST_DEBUG_OBJECT (camera, "Switching vidbin location to %s", location);
g_object_set (camera->vidbin, "location", location, NULL);
g_free (location);
gst_element_set_state (camera->vidbin, GST_STATE_PLAYING);
@ -400,6 +403,8 @@ gst_camera_bin_change_state (GstElement * element, GstStateChange trans)
static void
gst_camera_bin_set_location (GstCameraBin * camera, const gchar * location)
{
GST_DEBUG_OBJECT (camera, "Setting mode %d location to %s", camera->mode,
location);
if (camera->mode == MODE_IMAGE) {
if (camera->imgbin)
g_object_set (camera->imgbin, "location", location, NULL);

View file

@ -166,7 +166,6 @@ gst_v4l2_camera_src_imgsrc_probe (GstPad * pad, GstBuffer * buffer,
GstV4l2CameraSrc *self = GST_V4L2_CAMERA_SRC (data);
gboolean ret = FALSE;
GST_DEBUG_OBJECT (self, "pass buffer: %d", self->mode == MODE_IMAGE);
g_mutex_lock (self->capturing_mutex);
if (self->image_capture_count > 0) {
ret = TRUE;
@ -202,12 +201,14 @@ gst_v4l2_camera_src_vidsrc_probe (GstPad * pad, GstBuffer * buffer,
/* NOP */
} else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
/* send the newseg */
GST_DEBUG_OBJECT (self, "Starting video recording, pushing newsegment");
gst_pad_push_event (pad, gst_event_new_new_segment (FALSE, 1.0,
GST_FORMAT_TIME, GST_BUFFER_TIMESTAMP (buffer), -1, 0));
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_RUNNING;
ret = TRUE;
} else if (self->video_rec_status == GST_VIDEO_RECORDING_STATUS_FINISHING) {
/* send eos */
GST_DEBUG_OBJECT (self, "Finishing video recording, pushing eos");
gst_pad_push_event (pad, gst_event_new_eos ());
self->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
self->capturing = FALSE;
@ -1081,7 +1082,7 @@ gst_v4l2_camera_src_stop_capture (GstV4l2CameraSrc * src)
}
if (src->mode == MODE_VIDEO) {
if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_STARTING) {
GST_DEBUG_OBJECT (src, "Aborting not started recording");
GST_DEBUG_OBJECT (src, "Aborting, had not started recording");
src->video_rec_status = GST_VIDEO_RECORDING_STATUS_DONE;
} else if (src->video_rec_status == GST_VIDEO_RECORDING_STATUS_RUNNING) {