camerabin2: Use full names in properties

Improve API by using source instead of src in properties
This commit is contained in:
Thiago Santos 2011-05-25 23:29:25 -03:00
parent 2a6d25659a
commit cff308eba2
4 changed files with 17 additions and 15 deletions

View file

@ -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));

View file

@ -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));

View file

@ -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) ==

View file

@ -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)) {