camerabin: remove abbreviations from the property names. Fixes #573370 (partialy)

Also rename their use in tests and examples.
This commit is contained in:
Stefan Kost 2009-10-19 14:54:59 +03:00
parent e1dccb6fd7
commit 8c0203ec36
5 changed files with 117 additions and 108 deletions

View file

@ -42,35 +42,36 @@
* <refsect2>
* <title>Image capture</title>
* <para>
* Taking still images is initiated with the #GstCameraBin::user-start action
* Taking still images is initiated with the #GstCameraBin::capture-start action
* signal. Once the image has been captured, "image-captured" gst message is
* posted to the bus and capturing another image is possible. If application
* has set #GstCameraBin:preview-caps property, then a "preview-image" gst
* message is posted to bus containing preview image formatted according to
* specified caps. Eventually when image has been saved #GstCameraBin::img-done
* signal is emitted.
* specified caps. Eventually when image has been saved
* #GstCameraBin::image-done signal is emitted.
*
* Available resolutions can be taken from the #GstCameraBin:inputcaps property.
* Image capture resolution can be set with #GstCameraBin::user-image-res
* action signal.
* Available resolutions can be taken from the #GstCameraBin:video-source-caps
* property. Image capture resolution can be set with
* #GstCameraBin::set-image-resolution action signal.
* </para>
* </refsect2>
* <refsect2>
* <title>Video capture</title>
* <para>
* Video capture is started with the #GstCameraBin::user-start action signal too.
* In addition to image capture one can use #GstCameraBin::user-pause to
* pause recording and #GstCameraBin::user-stop to end recording.
* Video capture is started with the #GstCameraBin::capture-start action signal
* too. In addition to image capture one can use #GstCameraBin::capture-pause to
* pause recording and #GstCameraBin::capture-stop to end recording.
*
* Available resolutions and fps can be taken from the #GstCameraBin:inputcaps
* property. #GstCameraBin::user-res-fps action signal can be used to set frame
* rate and resolution for the video recording and view finder as well.
* Available resolutions and fps can be taken from the
* #GstCameraBin:video-source-caps property.
* #GstCameraBin::set-video-resolution-fps action signal can be used to set
* frame rate and resolution for the video recording and view finder as well.
* </para>
* </refsect2>
* <refsect2>
* <title>Photography interface</title>
* <para>
* GstCameraBin implements gst photography interface, which can be used to set
* GstCameraBin implements #GstPhotography interface, which can be used to set
* and get different settings related to digital imaging. Since currently many
* of these settings require low-level support the photography interface support
* is dependent on video src element. In practice photography interface settings
@ -85,9 +86,9 @@
* Elements within GstCameraBin are created and destroyed when switching
* between NULL and READY states. Therefore element properties should be set
* in NULL state. User set elements are not unreffed until GstCameraBin is
* unreffed or replaced by a new user set element. Initially only elements needed
* for view finder mode are created to speed up startup. Image bin and video bin
* elements are created when setting the mode or starting capture.
* unreffed or replaced by a new user set element. Initially only elements
* needed for view finder mode are created to speed up startup. Image bin and
* video bin elements are created when setting the mode or starting capture.
* </para>
* </refsect2>
* <refsect2>
@ -113,8 +114,8 @@
* has been disabled, and then in order to record video, you MUST ensure that
* there is enough CPU to encode the video. Thus choose smart resolution and
* frames per second values. It is also highly recommended to avoid color
* conversions; make sure all the elements involved work with the same colorspace
* (i.e. rgb or yuv i420 or whatelse).
* conversions; make sure all the elements involved work with the same
* colorspace (i.e. rgb or yuv i420 or whatelse).
* </para>
* </note>
* </refsect2>
@ -2022,7 +2023,7 @@ gst_camerabin_do_stop (GstCameraBin * camera)
* @camera: camerabin object
* @fname: filename of the recently saved image
*
* Default handler for #GstCameraBin::img-done signal,
* Default handler for #GstCameraBin::image-done signal,
* stops always capture.
*
* Returns: FALSE always
@ -2408,19 +2409,20 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
MIN_ZOOM, MAX_ZOOM, DEFAULT_ZOOM, G_PARAM_READWRITE));
/**
* GstCameraBin:imagepp:
* GstCameraBin:image-post-processing:
*
* Set up an element to do image post processing.
* This property can only be set while #GstCameraBin is in NULL state.
* The ownership of the element will be taken by #GstCameraBin.
*/
g_object_class_install_property (gobject_class, ARG_IMAGE_POST,
g_param_spec_object ("imagepp", "Image post processing element",
g_param_spec_object ("image-post-processing",
"Image post processing element",
"Image Post-Processing GStreamer element (default is NULL)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:imageenc:
* GstCameraBin:image-encoder:
*
* Set up an image encoder (for example, jpegenc or pngenc) element.
* This property can only be set while #GstCameraBin is in NULL state.
@ -2428,12 +2430,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_IMAGE_ENC,
g_param_spec_object ("imageenc", "Image encoder",
g_param_spec_object ("image-encoder", "Image encoder",
"Image encoder GStreamer element (default is jpegenc)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:videopp:
* GstCameraBin:video-post-processing:
*
* Set up an element to do video post processing.
* This property can only be set while #GstCameraBin is in NULL state.
@ -2441,12 +2443,13 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_VIDEO_POST,
g_param_spec_object ("videopp", "Video post processing element",
g_param_spec_object ("video-post-processing",
"Video post processing element",
"Video post processing GStreamer element (default is NULL)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:videoenc:
* GstCameraBin:video-encoder:
*
* Set up a video encoder element.
* This property can only be set while #GstCameraBin is in NULL state.
@ -2454,12 +2457,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_VIDEO_ENC,
g_param_spec_object ("videoenc", "Video encoder",
g_param_spec_object ("video-encoder", "Video encoder",
"Video encoder GStreamer element (default is theoraenc)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:audioenc:
* GstCameraBin:audio-encoder:
*
* Set up an audio encoder element.
* This property can only be set while #GstCameraBin is in NULL state.
@ -2467,12 +2470,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_AUDIO_ENC,
g_param_spec_object ("audioenc", "Audio encoder",
g_param_spec_object ("audio-encoder", "Audio encoder",
"Audio encoder GStreamer element (default is vorbisenc)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:videomux:
* GstCameraBin:video-muxer:
*
* Set up a video muxer element.
* This property can only be set while #GstCameraBin is in NULL state.
@ -2480,12 +2483,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_VIDEO_MUX,
g_param_spec_object ("videomux", "Video muxer",
g_param_spec_object ("video-muxer", "Video muxer",
"Video muxer GStreamer element (default is oggmux)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:vfsink:
* GstCameraBin:viewfinder-sink:
*
* Set up a sink element to render frames in view finder.
* By default "autovideosink" or DEFAULT_VIDEOSINK will be used.
@ -2494,12 +2497,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_VF_SINK,
g_param_spec_object ("vfsink", "View finder sink",
"View finder sink GStreamer element (NULL = default video sink)",
g_param_spec_object ("viewfinder-sink", "Viewfinder sink",
"Viewfinder sink GStreamer element (NULL = default video sink)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:videosrc:
* GstCameraBin:video-source:
*
* Set up a video source element.
* By default "autovideosrc" or DEFAULT_VIDEOSRC will be used.
@ -2508,11 +2511,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_VIDEO_SRC,
g_param_spec_object ("videosrc", "Video source element",
g_param_spec_object ("video-source", "Video source element",
"Video source GStreamer element (NULL = default video src)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:audiosrc:
* GstCameraBin:audio-source:
*
* Set up an audio source element.
* By default "autoaudiosrc" or DEFAULT_AUDIOSRC will be used.
@ -2521,12 +2524,12 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_AUDIO_SRC,
g_param_spec_object ("audiosrc", "Audio source element",
g_param_spec_object ("audio-source", "Audio source element",
"Audio source GStreamer element (NULL = default audio src)",
GST_TYPE_ELEMENT, G_PARAM_READWRITE));
/**
* GstCameraBin:inputcaps:
* GstCameraBin:video-source-caps:
*
* The allowed modes of operation of the video source. Have in mind that it
* doesn't mean #GstCameraBin can operate in all those modes,
@ -2535,7 +2538,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
g_object_class_install_property (gobject_class, ARG_INPUT_CAPS,
g_param_spec_boxed ("inputcaps", "Input caps",
g_param_spec_boxed ("video-source-caps", "Video source caps",
"The allowed modes of the video source operation",
GST_TYPE_CAPS, G_PARAM_READABLE));
@ -2568,7 +2571,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
GST_TYPE_CAPS, G_PARAM_READWRITE));
/**
* GstCameraBin::user-start:
* GstCameraBin::capture-start:
* @camera: the camera bin element
*
* Starts image capture or video recording depending on the Mode.
@ -2577,14 +2580,14 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[USER_START_SIGNAL] =
g_signal_new ("user-start",
g_signal_new ("capture-start",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstCameraBinClass, user_start),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* GstCameraBin::user-stop:
* GstCameraBin::capture-stop:
* @camera: the camera bin element
*
* Stops still image preview, continuous image capture and video
@ -2592,14 +2595,14 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[USER_STOP_SIGNAL] =
g_signal_new ("user-stop",
g_signal_new ("capture-stop",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstCameraBinClass, user_stop),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* GstCameraBin::user-pause:
* GstCameraBin::capture-pause:
* @camera: the camera bin element
*
* Pauses video recording or resumes paused video recording.
@ -2607,14 +2610,14 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[USER_PAUSE_SIGNAL] =
g_signal_new ("user-pause",
g_signal_new ("capture-pause",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstCameraBinClass, user_pause),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* GstCameraBin::user-res-fps:
* GstCameraBin::set-video-resolution-fps:
* @camera: the camera bin element
* @width: number of horizontal pixels
* @height: number of vertical pixels
@ -2630,7 +2633,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[USER_RES_FPS_SIGNAL] =
g_signal_new ("user-res-fps",
g_signal_new ("set-video-resolution-fps",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstCameraBinClass, user_res_fps),
@ -2638,7 +2641,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
/**
* GstCameraBin::user-image-res:
* GstCameraBin::set-image-resolution:
* @camera: the camera bin element
* @width: number of horizontal pixels
* @height: number of vertical pixels
@ -2648,7 +2651,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[USER_IMAGE_RES_SIGNAL] =
g_signal_new ("user-image-res",
g_signal_new ("set-image-resolution",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
G_STRUCT_OFFSET (GstCameraBinClass, user_image_res),
@ -2656,7 +2659,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
G_TYPE_INT, G_TYPE_INT);
/**
* GstCameraBin::img-done:
* GstCameraBin::image-done:
* @camera: the camera bin element
* @filename: the name of the file just saved
*
@ -2667,7 +2670,7 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
*/
camerabin_signals[IMG_DONE_SIGNAL] =
g_signal_new ("img-done", G_TYPE_FROM_CLASS (klass),
g_signal_new ("image-done", G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GstCameraBinClass, img_done),
g_signal_accumulator_true_handled, NULL,
__gst_camerabin_marshal_BOOLEAN__STRING, G_TYPE_BOOLEAN, 1,
@ -3132,7 +3135,7 @@ gst_camerabin_imgbin_finished (gpointer u_data)
gst_element_set_state (camera->imgbin, GST_STATE_READY);
GST_DEBUG_OBJECT (camera, "Image pipeline set to READY");
/* Send img-done signal */
/* Send image-done signal */
gst_camerabin_image_capture_continue (camera, filename);
g_free (filename);
@ -3224,7 +3227,7 @@ gst_camerabin_user_start (GstCameraBin * camera)
GST_WARNING_OBJECT (camera, "capturing \"%s\" ongoing, set new filename",
camera->filename->str);
/* FIXME: we need to send something more to the app, so that it does not for
* for img-done */
* for image-done */
g_mutex_unlock (camera->capture_mutex);
return;
}

View file

@ -393,7 +393,7 @@ gst_camerabin_handle_scene_mode (GstCameraBin * camera, GstSceneMode scene_mode)
/* Remember frame rate before setting night mode */
camera->pre_night_fps_n = camera->fps_n;
camera->pre_night_fps_d = camera->fps_d;
g_signal_emit_by_name (camera, "user-res-fps", camera->width,
g_signal_emit_by_name (camera, "set-video-resolution-fps", camera->width,
camera->height, 0, 0, 0);
} else {
GST_DEBUG ("night mode already enabled");
@ -403,7 +403,7 @@ gst_camerabin_handle_scene_mode (GstCameraBin * camera, GstSceneMode scene_mode)
GST_DEBUG ("disabling night mode, restoring fps to %d/%d",
camera->pre_night_fps_n, camera->pre_night_fps_d);
camera->night_mode = FALSE;
g_signal_emit_by_name (camera, "user-res-fps", camera->width,
g_signal_emit_by_name (camera, "set-video-resolution-fps", camera->width,
camera->height, camera->pre_night_fps_n, camera->pre_night_fps_d, 0);
}
}

View file

@ -84,16 +84,16 @@ handle_image_captured_cb (gpointer data)
g_object_set (camera, "mode", 1,
"filename", make_test_file_name (CYCLE_VIDEO_FILENAME), NULL);
/* Record video */
g_signal_emit_by_name (camera, "user-start", NULL);
g_signal_emit_by_name (camera, "capture-start", NULL);
g_usleep (G_USEC_PER_SEC);
g_signal_emit_by_name (camera, "user-stop", NULL);
g_signal_emit_by_name (camera, "capture-stop", NULL);
GST_DEBUG ("video captured");
/* Set still image mode */
g_object_set (camera, "mode", 0,
"filename", make_test_file_name (CYCLE_IMAGE_FILENAME), NULL);
/* Take a picture */
g_signal_emit_by_name (camera, "user-start", NULL);
g_signal_emit_by_name (camera, "capture-start", NULL);
cycle_count--;
GST_DEBUG ("next cycle: %d", cycle_count);
@ -136,9 +136,9 @@ setup_camerabin_elements (GstElement * camera)
if (vfsink && audiosrc && videosrc && audioenc && videoenc && videomux
&& imageenc) {
g_object_set (camera, "vfsink", vfsink, "audiosrc", audiosrc, "videosrc",
videosrc, "audioenc", audioenc, "videoenc", videoenc, "imageenc",
imageenc, "videomux", videomux, NULL);
g_object_set (camera, "viewfinder-sink", vfsink, "audio-source", audiosrc,
"video-source", videosrc, "audio-encoder", audioenc, "video-encoder",
videoenc, "image-encoder", imageenc, "video-muxer", videomux, NULL);
} else {
GST_WARNING ("error setting up test plugins");
}
@ -210,7 +210,7 @@ setup (void)
setup_camerabin_elements (camera);
g_signal_connect (camera, "img-done", G_CALLBACK (capture_done), main_loop);
g_signal_connect (camera, "image-done", G_CALLBACK (capture_done), main_loop);
bus = gst_pipeline_get_bus (GST_PIPELINE (camera));
gst_bus_add_watch (bus, (GstBusFunc) capture_bus_cb, main_loop);
@ -222,7 +222,8 @@ setup (void)
/* force a low framerate here to not timeout the tests because of the
* encoders */
g_signal_emit_by_name (camera, "user-res-fps", 320, 240, 5, 1, NULL);
g_signal_emit_by_name (camera, "set-video-resolution-fps", 320, 240, 5, 1,
NULL);
/* Set some default tags */
setter = GST_TAG_SETTER (camera);
@ -411,7 +412,7 @@ GST_START_TEST (test_single_image_capture)
test_photography_settings (camera);
GST_INFO ("starting capture");
g_signal_emit_by_name (camera, "user-start", NULL);
g_signal_emit_by_name (camera, "capture-start", NULL);
g_main_loop_run (main_loop);
}
@ -428,10 +429,10 @@ GST_START_TEST (test_video_recording)
"filename", make_test_file_name (VIDEO_FILENAME), NULL);
GST_INFO ("starting capture");
g_signal_emit_by_name (camera, "user-start", NULL);
g_signal_emit_by_name (camera, "capture-start", NULL);
/* Record for one seconds */
g_usleep (G_USEC_PER_SEC);
g_signal_emit_by_name (camera, "user-stop", NULL);
g_signal_emit_by_name (camera, "capture-stop", NULL);
}
GST_END_TEST;
@ -448,7 +449,7 @@ GST_START_TEST (test_image_video_cycle)
"filename", make_test_file_name (CYCLE_IMAGE_FILENAME), NULL);
GST_INFO ("starting capture");
g_signal_emit_by_name (camera, "user-start", NULL);
g_signal_emit_by_name (camera, "capture-start", NULL);
g_main_loop_run (main_loop);
}

View file

@ -197,7 +197,7 @@ pad_has_buffer (GstPad * pad, GstBuffer * buf, gpointer user_data)
case 8: // video recording start
DIFF_TIME (t_final[num_pics_cont], t_initial, diff);
result.avg = result.min = result.max = diff;
//g_signal_emit_by_name (camera_bin, "user-stop", 0);
//g_signal_emit_by_name (camera_bin, "capture-stop", 0);
print_and_restart = TRUE;
break;
default:
@ -223,7 +223,7 @@ element_added (GstBin * bin, GstElement * element, gpointer user_data)
}
if (need_vmux_pad_probe) {
g_object_get (camera_bin, "videomux", &elem, NULL);
g_object_get (camera_bin, "video-muxer", &elem, NULL);
if (elem) {
need_vmux_pad_probe = FALSE;
GST_INFO_OBJECT (elem, "got default video muxer");
@ -235,7 +235,7 @@ element_added (GstBin * bin, GstElement * element, gpointer user_data)
}
}
if (need_ienc_pad_probe) {
g_object_get (camera_bin, "imageenc", &elem, NULL);
g_object_get (camera_bin, "image-encoder", &elem, NULL);
if (elem) {
need_ienc_pad_probe = FALSE;
GST_INFO_OBJECT (elem, "got default image encoder");
@ -291,7 +291,7 @@ img_capture_done (GstElement * camera, GString * fname, gpointer user_data)
// but this needs sync so that we have received "image-captured" message already
if (have_img_captured) {
have_img_captured = FALSE;
g_signal_emit_by_name (camera_bin, "user-start", NULL);
g_signal_emit_by_name (camera_bin, "capture-start", NULL);
} else {
have_img_done = TRUE;
}
@ -416,7 +416,7 @@ bus_callback (GstBus * bus, GstMessage * message, gpointer data)
// we need to have this received before we can take next one
if (have_img_done) {
have_img_done = FALSE;
g_signal_emit_by_name (camera_bin, "user-start", NULL);
g_signal_emit_by_name (camera_bin, "capture-start", NULL);
} else {
have_img_captured = TRUE;
}
@ -538,7 +538,8 @@ setup_pipeline (void)
goto error;
}
g_signal_connect (camera_bin, "img-done", (GCallback) img_capture_done, NULL);
g_signal_connect (camera_bin, "image-done", (GCallback) img_capture_done,
NULL);
bus = gst_pipeline_get_bus (GST_PIPELINE (camera_bin));
gst_bus_add_watch (bus, bus_callback, NULL);
@ -547,13 +548,13 @@ setup_pipeline (void)
GST_INFO_OBJECT (camera_bin, "camerabin created");
/* configure used elements */
res &= setup_pipeline_element ("vfsink", "fakesink", &sink);
res &= setup_pipeline_element ("audiosrc", audiosrc_name, NULL);
res &= setup_pipeline_element ("videosrc", videosrc_name, NULL);
res &= setup_pipeline_element ("audioenc", audioenc_name, NULL);
res &= setup_pipeline_element ("videoenc", videoenc_name, NULL);
res &= setup_pipeline_element ("imageenc", imageenc_name, &ienc);
res &= setup_pipeline_element ("videomux", videomux_name, &vmux);
res &= setup_pipeline_element ("viewfinder-sink", "fakesink", &sink);
res &= setup_pipeline_element ("audio-source", audiosrc_name, NULL);
res &= setup_pipeline_element ("video-source", videosrc_name, NULL);
res &= setup_pipeline_element ("audio-encoder", audioenc_name, NULL);
res &= setup_pipeline_element ("video-encoder", videoenc_name, NULL);
res &= setup_pipeline_element ("image-encoder", imageenc_name, &ienc);
res &= setup_pipeline_element ("video-muxer", videomux_name, &vmux);
if (!res) {
goto error;
}
@ -597,7 +598,7 @@ setup_pipeline (void)
goto error;
}
if (!vmux) {
g_object_get (camera_bin, "videomux", &vmux, NULL);
g_object_get (camera_bin, "video-muxer", &vmux, NULL);
if (!vmux) {
need_pad_probe = need_vmux_pad_probe = TRUE;
/* only run the test if we later get the element */
@ -612,7 +613,7 @@ setup_pipeline (void)
}
}
if (!ienc) {
g_object_get (camera_bin, "imageenc", &ienc, NULL);
g_object_get (camera_bin, "image-encoder", &ienc, NULL);
if (!ienc) {
need_pad_probe = need_ienc_pad_probe = TRUE;
/* only run the test if we later get the element */
@ -634,12 +635,12 @@ setup_pipeline (void)
/* configure a resolution and framerate for video and viewfinder */
if (image_width && image_height) {
g_signal_emit_by_name (camera_bin, "user-image-res", image_width,
g_signal_emit_by_name (camera_bin, "set-image-resolution", image_width,
image_height, NULL);
}
/* configure a resolution and framerate for video and viewfinder */
if (video_width && video_height && view_framerate_num && view_framerate_den) {
g_signal_emit_by_name (camera_bin, "user-res-fps", video_width,
g_signal_emit_by_name (camera_bin, "set-video-resolution-fps", video_width,
video_height, view_framerate_num, view_framerate_den, NULL);
}
@ -706,7 +707,7 @@ test_03 (void)
g_object_set (camera_bin, "mode", 0, NULL);
g_object_set (camera_bin, "filename", filename->str, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in bus_callback::preview-image */
result.times = 1;
@ -723,7 +724,7 @@ test_04 (void)
/* switch to image mode */
g_object_set (camera_bin, "mode", 0, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in bus_callback::image-captured */
result.times = 1;
@ -743,7 +744,7 @@ test_05 (void)
/* switch to image mode */
g_object_set (camera_bin, "mode", 0, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in img_capture_done */
result.times = CONT_SHOTS;
@ -764,7 +765,7 @@ test_06 (void)
g_object_set (camera_bin, "mode", 0, NULL);
g_object_set (camera_bin, "filename", filename->str, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in pad_has_buffer */
result.times = 1;
@ -786,7 +787,7 @@ test_07 (void)
g_object_set (camera_bin, "mode", 0, NULL);
g_object_set (camera_bin, "filename", filename->str, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in img_capture_done */
result.times = 1;
return FALSE;
@ -851,7 +852,7 @@ test_09 (void)
g_object_set (camera_bin, "mode", 1, NULL);
g_object_set (camera_bin, "filename", filename->str, NULL);
GET_TIME (t_initial);
g_signal_emit_by_name (camera_bin, "user-start", 0);
g_signal_emit_by_name (camera_bin, "capture-start", 0);
/* the actual results are fetched in pad_has_buffer */
result.times = 1;

View file

@ -424,7 +424,7 @@ stop_image_preview (gpointer data)
{
g_return_val_if_fail (data != NULL, FALSE);
g_signal_emit_by_name (data, "user-stop", 0);
g_signal_emit_by_name (data, "capture-stop", 0);
return FALSE;
}
@ -511,7 +511,8 @@ me_gst_setup_pipeline_create_post_bin (const gchar * post, gboolean video)
gst_element_add_pad (bin, gst_ghost_pad_new ("src", pad));
gst_object_unref (GST_OBJECT (pad));
g_object_set (gst_camera_bin, (video ? "videopp" : "imagepp"), bin, NULL);
g_object_set (gst_camera_bin,
(video ? "video-post-processing" : "image-post-processing"), bin, NULL);
return TRUE;
done:
return FALSE;
@ -521,13 +522,13 @@ static void
me_gst_setup_pipeline_create_codecs (void)
{
#ifdef USE_MP4
g_object_set (gst_camera_bin, "videoenc",
g_object_set (gst_camera_bin, "video-encoder",
gst_element_factory_make ("omx_mpeg4enc", NULL), NULL);
g_object_set (gst_camera_bin, "audioenc",
g_object_set (gst_camera_bin, "audio-encoder",
gst_element_factory_make ("omx_aacenc", NULL), NULL);
g_object_set (gst_camera_bin, "videomux",
g_object_set (gst_camera_bin, "video-muxer",
gst_element_factory_make ("hantromp4mux", NULL), NULL);
#else
/* using defaults theora, vorbis, ogg */
@ -561,7 +562,7 @@ me_gst_setup_pipeline (const gchar * imagepost, const gchar * videopost)
goto done;
}
g_signal_connect (gst_camera_bin, "img-done",
g_signal_connect (gst_camera_bin, "image-done",
(GCallback) me_image_capture_done, NULL);
preview_caps = gst_caps_from_string (PREVIEW_CAPS);
@ -578,7 +579,8 @@ me_gst_setup_pipeline (const gchar * imagepost, const gchar * videopost)
gst_videosrc = gst_element_factory_make (CAMERA_APP_VIDEOSRC, NULL);
if (gst_videosrc) {
g_object_set (G_OBJECT (gst_camera_bin), "videosrc", gst_videosrc, NULL);
g_object_set (G_OBJECT (gst_camera_bin), "video-source", gst_videosrc,
NULL);
}
if (imagepost) {
@ -589,7 +591,8 @@ me_gst_setup_pipeline (const gchar * imagepost, const gchar * videopost)
GstElement *ipp =
gst_element_factory_make (CAMERA_APP_IMAGE_POSTPROC, NULL);
if (ipp) {
g_object_set (G_OBJECT (gst_camera_bin), "imagepp", ipp, NULL);
g_object_set (G_OBJECT (gst_camera_bin), "image-post-processing", ipp,
NULL);
}
}
@ -606,7 +609,8 @@ me_gst_setup_pipeline (const gchar * imagepost, const gchar * videopost)
}
if (!gst_videosrc) {
g_object_get (G_OBJECT (gst_camera_bin), "videosrc", &gst_videosrc, NULL);
g_object_get (G_OBJECT (gst_camera_bin), "video-source", &gst_videosrc,
NULL);
}
init_view_finder_resolution_combobox ();
@ -733,15 +737,15 @@ capture_mode_set_state (CaptureState state)
g_object_set (gst_camera_bin, "mode", 0, NULL);
else { /* state == CAP_STATE_VIDEO_RECORDING */
g_object_set (gst_camera_bin, "mode", 1, NULL);
g_signal_emit_by_name (gst_camera_bin, "user-start", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-start", 0);
}
break;
case CAP_STATE_VIDEO_PAUSED:
if (state == CAP_STATE_VIDEO_RECORDING) {
g_signal_emit_by_name (gst_camera_bin, "user-start", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-start", 0);
capture_state = CAP_STATE_VIDEO_RECORDING;
} else {
g_signal_emit_by_name (gst_camera_bin, "user-stop", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-stop", 0);
capture_state = CAP_STATE_VIDEO_STOPED;
if (state == CAP_STATE_IMAGE)
capture_mode_set_state (state);
@ -749,10 +753,10 @@ capture_mode_set_state (CaptureState state)
break;
case CAP_STATE_VIDEO_RECORDING:
if (state == CAP_STATE_VIDEO_PAUSED) {
g_signal_emit_by_name (gst_camera_bin, "user-pause", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-pause", 0);
capture_state = CAP_STATE_VIDEO_PAUSED;
} else {
g_signal_emit_by_name (gst_camera_bin, "user-stop", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-stop", 0);
capture_state = CAP_STATE_VIDEO_STOPED;
if (state == CAP_STATE_IMAGE)
capture_mode_set_state (state);
@ -813,7 +817,7 @@ on_buttonShot_clicked (GtkButton * button, gpointer user_data)
g_object_set (gst_camera_bin, "filename", filename->str, NULL);
set_metadata ();
g_signal_emit_by_name (gst_camera_bin, "user-start", 0);
g_signal_emit_by_name (gst_camera_bin, "capture-start", 0);
}
break;
case CAP_STATE_VIDEO_STOPED:
@ -1271,7 +1275,7 @@ init_view_finder_resolution_combobox ()
{
GstCaps *input_caps = NULL, *default_caps = NULL, *intersect = NULL;
g_object_get (gst_camera_bin, "inputcaps", &input_caps, NULL);
g_object_get (gst_camera_bin, "video-source-caps", &input_caps, NULL);
if (input_caps) {
fill_resolution_combo (input_caps);
}
@ -1621,7 +1625,7 @@ capture_image_res_toggled_cb (GtkRadioMenuItem * menuitem, gpointer user_data)
for (i = 0; i < G_N_ELEMENTS (image_resolution_label_map); i++) {
if (g_str_equal (label, image_resolution_label_map[i].label)) {
/* set found values */
g_signal_emit_by_name (gst_camera_bin, "user-image-res",
g_signal_emit_by_name (gst_camera_bin, "set-image-resolution",
image_resolution_label_map[i].width,
image_resolution_label_map[i].height, 0);
break;