summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-03-14 14:33:57 -0300
committerThiago Santos <thiago.sousa.santos@collabora.co.uk>2011-03-23 16:13:32 -0300
commit223697c2b9ed31e6e86f18659c5701219113e7de (patch)
tree0dfa65ada87ef5ced515d669949d0ed0522ebf1b /gst
parenta50dca2752a001fe3f64b238fd0ecc6d44b6486f (diff)
camerabin2: More debug log
Small refactoring and adding more debug log to encodebin related paths
Diffstat (limited to 'gst')
-rw-r--r--gst/camerabin2/gstcamerabin2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c
index 32311da23..2b1318cc9 100644
--- a/gst/camerabin2/gstcamerabin2.c
+++ b/gst/camerabin2/gstcamerabin2.c
@@ -704,11 +704,15 @@ encodebin_element_added (GstElement * encodebin, GstElement * new_element,
#define VIDEO_PAD 1
#define AUDIO_PAD 2
static GstPad *
-encodebin_find_pad (GstElement * encodebin, gint pad_type)
+encodebin_find_pad (GstCameraBin * camera, gint pad_type)
{
GstPad *pad = NULL;
GstIterator *iter;
gboolean done;
+ GstElement *encodebin = camera->encodebin;
+
+ GST_DEBUG_OBJECT (camera, "Looking at encodebin pads, searching for %s pad",
+ VIDEO_PAD ? "video" : "audio");
iter = gst_element_iterate_sink_pads (encodebin);
done = FALSE;
@@ -717,11 +721,13 @@ encodebin_find_pad (GstElement * encodebin, gint pad_type)
case GST_ITERATOR_OK:
if (pad_type == VIDEO_PAD) {
if (strstr (GST_PAD_NAME (pad), "video") != NULL) {
+ GST_DEBUG_OBJECT (camera, "Found video pad %s", GST_PAD_NAME (pad));
done = TRUE;
break;
}
} else if (pad_type == AUDIO_PAD) {
if (strstr (GST_PAD_NAME (pad), "audio") != NULL) {
+ GST_DEBUG_OBJECT (camera, "Found audio pad %s", GST_PAD_NAME (pad));
done = TRUE;
break;
}
@@ -749,11 +755,14 @@ encodebin_find_pad (GstElement * encodebin, gint pad_type)
GstElementClass *klass;
GstPadTemplate *tmpl;
+ GST_DEBUG_OBJECT (camera, "No pads found, trying to request one");
+
klass = GST_ELEMENT_GET_CLASS (encodebin);
tmpl = gst_element_class_get_pad_template (klass, pad_type == VIDEO_PAD ?
"video_%d" : "audio_%d");
pad = gst_element_request_pad (encodebin, tmpl, NULL, NULL);
+ GST_DEBUG_OBJECT (camera, "Got pad: %s", pad ? GST_PAD_NAME (pad) : "null");
gst_object_unref (tmpl);
}
@@ -791,7 +800,10 @@ gst_camera_bin_link_encodebin (GstCameraBin * camera, GstElement * element,
GstPad *sinkpad = NULL;
srcpad = gst_element_get_static_pad (element, "src");
- sinkpad = encodebin_find_pad (camera->encodebin, padtype);
+ sinkpad = encodebin_find_pad (camera, padtype);
+
+ g_assert (srcpad != NULL);
+ g_assert (sinkpad != NULL);
ret = gst_pad_link (srcpad, sinkpad);
gst_object_unref (sinkpad);
@@ -910,6 +922,7 @@ gst_camera_bin_create_elements (GstCameraBin * camera)
g_object_set (camera->imagebin, "location", camera->image_location, NULL);
}
if (camera->profile_switch) {
+ GST_DEBUG_OBJECT (camera, "Switching encodebin's profile");
g_object_set (camera->encodebin, "profile", camera->video_profile, NULL);
gst_camera_bin_link_encodebin (camera, camera->videobin_capsfilter,
VIDEO_PAD);