From cff308eba24444f3752a58c557bdcdadfb0325c4 Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 25 May 2011 23:29:25 -0300 Subject: [PATCH] camerabin2: Use full names in properties Improve API by using source instead of src in properties --- gst/camerabin2/gstcamerabin2.c | 4 ++-- gst/camerabin2/gstwrappercamerabinsrc.c | 2 +- tests/check/elements/camerabin2.c | 6 +++--- .../examples/camerabin2/gst-camerabin2-test.c | 20 ++++++++++--------- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/gst/camerabin2/gstcamerabin2.c b/gst/camerabin2/gstcamerabin2.c index 76daf9ea3d..9df16a1ddc 100644 --- a/gst/camerabin2/gstcamerabin2.c +++ b/gst/camerabin2/gstcamerabin2.c @@ -497,13 +497,13 @@ gst_camera_bin_class_init (GstCameraBinClass * klass) DEFAULT_IMG_LOCATION, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_CAMERA_SRC, - g_param_spec_object ("camera-src", "Camera source", + g_param_spec_object ("camera-source", "Camera source", "The camera source element to be used. It is only taken into use on" " the next null to ready transition", GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); g_object_class_install_property (object_class, PROP_AUDIO_SRC, - g_param_spec_object ("audio-src", "Audio source", + g_param_spec_object ("audio-source", "Audio source", "The audio source element to be used on video recordings. It is only" " taken into use on the next null to ready transition", GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 2cf6ac4cc6..bc5bd4c5c9 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -1099,7 +1099,7 @@ gst_wrapper_camera_bin_src_class_init (GstWrapperCameraBinSrcClass * klass) /* g_object_class_install_property .... */ g_object_class_install_property (gobject_class, PROP_VIDEO_SRC, - g_param_spec_object ("video-src", "Video source", + g_param_spec_object ("video-source", "Video source", "The video source element to be used", GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); diff --git a/tests/check/elements/camerabin2.c b/tests/check/elements/camerabin2.c index 84184f3227..f0639e4375 100644 --- a/tests/check/elements/camerabin2.c +++ b/tests/check/elements/camerabin2.c @@ -343,8 +343,8 @@ setup_wrappercamerabinsrc_videotestsrc (void) 320, "height", G_TYPE_INT, 240, NULL); g_object_set (G_OBJECT (testsrc), "is-live", TRUE, "peer-alloc", FALSE, NULL); - g_object_set (G_OBJECT (src), "video-src", testsrc, NULL); - g_object_set (G_OBJECT (camera), "camera-src", src, "preview-caps", + g_object_set (G_OBJECT (src), "video-source", testsrc, NULL); + g_object_set (G_OBJECT (camera), "camera-source", src, "preview-caps", preview_caps, NULL); gst_object_unref (src); gst_object_unref (testsrc); @@ -1004,7 +1004,7 @@ GST_START_TEST (test_supported_caps) return; src = g_object_new (GST_TYPE_TEST_CAMERA_SRC, NULL); - g_object_set (camera, "camera-src", src, NULL); + g_object_set (camera, "camera-source", src, NULL); gst_object_unref (src); if (gst_element_set_state (GST_ELEMENT (camera), GST_STATE_PLAYING) == diff --git a/tests/examples/camerabin2/gst-camerabin2-test.c b/tests/examples/camerabin2/gst-camerabin2-test.c index bb0976ea8b..55d1a04d1f 100644 --- a/tests/examples/camerabin2/gst-camerabin2-test.c +++ b/tests/examples/camerabin2/gst-camerabin2-test.c @@ -532,13 +532,13 @@ setup_pipeline (void) else wrapper = gst_element_factory_make ("wrappercamerabinsrc", NULL); - if (setup_pipeline_element (wrapper, "video-src", videosrc_name, NULL)) { - g_object_set (camerabin, "camera-src", wrapper, NULL); + if (setup_pipeline_element (wrapper, "video-source", videosrc_name, NULL)) { + g_object_set (camerabin, "camera-source", wrapper, NULL); } else { GST_WARNING ("Failed to set videosrc to %s", videosrc_name); } - g_object_get (wrapper, "video-src", &videosrc, NULL); + g_object_get (wrapper, "video-source", &videosrc, NULL); if (videosrc && videodevice_name && g_object_class_find_property (G_OBJECT_GET_CLASS (videosrc), "device")) { @@ -547,11 +547,13 @@ setup_pipeline (void) } /* configure used elements */ - res &= setup_pipeline_element (camerabin, "audio-src", audiosrc_name, NULL); - res &= setup_pipeline_element (camerabin, "viewfinder-sink", vfsink_name, - &sink); - res &= setup_pipeline_element (camerabin, "viewfinder-filter", - viewfinder_filter, NULL); + res &= + setup_pipeline_element (camerabin, "audio-source", audiosrc_name, NULL); + res &= + setup_pipeline_element (camerabin, "viewfinder-sink", vfsink_name, &sink); + res &= + setup_pipeline_element (camerabin, "viewfinder-filter", viewfinder_filter, + NULL); if (imagepp_name) { ipp = create_ipp_bin (); @@ -719,7 +721,7 @@ run_pipeline (gpointer user_data) g_object_set (camerabin, "location", filename_str, NULL); g_free (filename_str); - g_object_get (camerabin, "camera-src", &video_source, NULL); + g_object_get (camerabin, "camera-source", &video_source, NULL); if (video_source) { if (GST_IS_ELEMENT (video_source) && gst_element_implements_interface (video_source, GST_TYPE_PHOTOGRAPHY)) {