{
vid->filename = g_string_new ("");
- vid->user_post = NULL;
- vid->user_vid_enc = NULL;
- vid->user_aud_enc = NULL;
- vid->user_aud_src = NULL;
- vid->user_mux = NULL;
+ vid->app_post = NULL;
+ vid->app_vid_enc = NULL;
+ vid->app_aud_enc = NULL;
+ vid->app_aud_src = NULL;
+ vid->app_mux = NULL;
vid->aud_src = NULL;
vid->sink = NULL;
vid->vid_sink_probe_id = 0;
}
- if (vid->user_post) {
- gst_object_unref (vid->user_post);
- vid->user_post = NULL;
+ if (vid->app_post) {
+ gst_object_unref (vid->app_post);
+ vid->app_post = NULL;
}
- if (vid->user_vid_enc) {
- gst_object_unref (vid->user_vid_enc);
- vid->user_vid_enc = NULL;
+ if (vid->app_vid_enc) {
+ gst_object_unref (vid->app_vid_enc);
+ vid->app_vid_enc = NULL;
}
- if (vid->user_aud_enc) {
- gst_object_unref (vid->user_aud_enc);
- vid->user_aud_enc = NULL;
+ if (vid->app_aud_enc) {
+ gst_object_unref (vid->app_aud_enc);
+ vid->app_aud_enc = NULL;
}
- if (vid->user_aud_src) {
- gst_object_unref (vid->user_aud_src);
- vid->user_aud_src = NULL;
+ if (vid->app_aud_src) {
+ gst_object_unref (vid->app_aud_src);
+ vid->app_aud_src = NULL;
}
- if (vid->user_mux) {
- gst_object_unref (vid->user_mux);
- vid->user_mux = NULL;
+ if (vid->app_mux) {
+ gst_object_unref (vid->app_mux);
+ vid->app_mux = NULL;
}
G_OBJECT_CLASS (parent_class)->dispose ((GObject *) vid);
vid->calculate_adjust_ts_aud = FALSE;
/* Add video post processing element if any */
- if (vid->user_post) {
- if (!gst_camerabin_add_element (vidbin, vid->user_post)) {
+ if (vid->app_post) {
+ if (!gst_camerabin_add_element (vidbin, vid->app_post)) {
goto error;
}
- vid_sinkpad = gst_element_get_static_pad (vid->user_post, "sink");
+ vid_sinkpad = gst_element_get_static_pad (vid->app_post, "sink");
}
/* Add tee element */
G_CALLBACK (camerabin_video_pad_tee_src0_have_buffer), vid);
/* Add user set or default video encoder element */
- if (vid->user_vid_enc) {
- vid->vid_enc = vid->user_vid_enc;
+ if (vid->app_vid_enc) {
+ vid->vid_enc = vid->app_vid_enc;
if (!gst_camerabin_add_element (vidbin, vid->vid_enc)) {
goto error;
}
goto error;
}
- /* Add user set or default muxer element */
- if (vid->user_mux) {
- vid->muxer = vid->user_mux;
+ /* Add application set or default muxer element */
+ if (vid->app_mux) {
+ vid->muxer = vid->app_mux;
if (!gst_camerabin_add_element (vidbin, vid->muxer)) {
goto error;
}
NULL);
if (!(vid->flags & GST_CAMERABIN_FLAG_DISABLE_AUDIO)) {
- /* Add user set or default audio source element */
+ /* Add application set or default audio source element */
if (!(vid->aud_src = gst_camerabin_setup_default_element (vidbin,
- vid->user_aud_src, "autoaudiosrc", DEFAULT_AUDIOSRC))) {
+ vid->app_aud_src, "autoaudiosrc", DEFAULT_AUDIOSRC))) {
vid->aud_src = NULL;
goto error;
} else {
g_object_set (vid->volume, "mute", vid->mute, NULL);
}
- /* Add user set or default audio encoder element */
- if (vid->user_aud_enc) {
- vid->aud_enc = vid->user_aud_enc;
+ /* Add application set or default audio encoder element */
+ if (vid->app_aud_enc) {
+ vid->aud_enc = vid->app_aud_enc;
if (!gst_camerabin_add_element (vidbin, vid->aud_enc)) {
goto error;
}
void
gst_camerabin_video_set_post (GstCameraBinVideo * vid, GstElement * post)
{
- GstElement **user_post;
+ GstElement **app_post;
GST_DEBUG_OBJECT (vid, "setting video post processing: %" GST_PTR_FORMAT,
post);
GST_OBJECT_LOCK (vid);
- user_post = &vid->user_post;
- gst_object_replace ((GstObject **) user_post, GST_OBJECT (post));
+ app_post = &vid->app_post;
+ gst_object_replace ((GstObject **) app_post, GST_OBJECT (post));
GST_OBJECT_UNLOCK (vid);
}
gst_camerabin_video_set_video_enc (GstCameraBinVideo * vid,
GstElement * video_enc)
{
- GstElement **user_vid_enc;
+ GstElement **app_vid_enc;
GST_DEBUG_OBJECT (vid, "setting video encoder: %" GST_PTR_FORMAT, video_enc);
GST_OBJECT_LOCK (vid);
- user_vid_enc = &vid->user_vid_enc;
- gst_object_replace ((GstObject **) user_vid_enc, GST_OBJECT (video_enc));
+ app_vid_enc = &vid->app_vid_enc;
+ gst_object_replace ((GstObject **) app_vid_enc, GST_OBJECT (video_enc));
GST_OBJECT_UNLOCK (vid);
}
gst_camerabin_video_set_audio_enc (GstCameraBinVideo * vid,
GstElement * audio_enc)
{
- GstElement **user_aud_enc;
+ GstElement **app_aud_enc;
GST_DEBUG_OBJECT (vid, "setting audio encoder: %" GST_PTR_FORMAT, audio_enc);
GST_OBJECT_LOCK (vid);
- user_aud_enc = &vid->user_aud_enc;
- gst_object_replace ((GstObject **) user_aud_enc, GST_OBJECT (audio_enc));
+ app_aud_enc = &vid->app_aud_enc;
+ gst_object_replace ((GstObject **) app_aud_enc, GST_OBJECT (audio_enc));
GST_OBJECT_UNLOCK (vid);
}
void
gst_camerabin_video_set_muxer (GstCameraBinVideo * vid, GstElement * muxer)
{
- GstElement **user_mux;
+ GstElement **app_mux;
GST_DEBUG_OBJECT (vid, "setting muxer: %" GST_PTR_FORMAT, muxer);
GST_OBJECT_LOCK (vid);
- user_mux = &vid->user_mux;
- gst_object_replace ((GstObject **) user_mux, GST_OBJECT (muxer));
+ app_mux = &vid->app_mux;
+ gst_object_replace ((GstObject **) app_mux, GST_OBJECT (muxer));
GST_OBJECT_UNLOCK (vid);
}
gst_camerabin_video_set_audio_src (GstCameraBinVideo * vid,
GstElement * audio_src)
{
- GstElement **user_aud_src;
+ GstElement **app_aud_src;
GST_DEBUG_OBJECT (vid, "setting audio source: %" GST_PTR_FORMAT, audio_src);
GST_OBJECT_LOCK (vid);
- user_aud_src = &vid->user_aud_src;
- gst_object_replace ((GstObject **) user_aud_src, GST_OBJECT (audio_src));
+ app_aud_src = &vid->app_aud_src;
+ gst_object_replace ((GstObject **) app_aud_src, GST_OBJECT (audio_src));
GST_OBJECT_UNLOCK (vid);
}
GstElement *
gst_camerabin_video_get_post (GstCameraBinVideo * vid)
{
- return vid->user_post;
+ return vid->app_post;
}
GstElement *
gst_camerabin_video_get_video_enc (GstCameraBinVideo * vid)
{
- return vid->vid_enc ? vid->vid_enc : vid->user_vid_enc;
+ return vid->vid_enc ? vid->vid_enc : vid->app_vid_enc;
}
GstElement *
gst_camerabin_video_get_audio_enc (GstCameraBinVideo * vid)
{
- return vid->aud_enc ? vid->aud_enc : vid->user_aud_enc;
+ return vid->aud_enc ? vid->aud_enc : vid->app_aud_enc;
}
GstElement *
gst_camerabin_video_get_muxer (GstCameraBinVideo * vid)
{
- return vid->muxer ? vid->muxer : vid->user_mux;
+ return vid->muxer ? vid->muxer : vid->app_mux;
}
GstElement *
gst_camerabin_video_get_audio_src (GstCameraBinVideo * vid)
{
- return vid->aud_src ? vid->aud_src : vid->user_aud_src;
+ return vid->aud_src ? vid->aud_src : vid->app_aud_src;
}
enum
{
/* action signals */
- USER_START_SIGNAL,
- USER_STOP_SIGNAL,
- USER_PAUSE_SIGNAL,
- USER_RES_FPS_SIGNAL,
- USER_IMAGE_RES_SIGNAL,
+ CAPTURE_START_SIGNAL,
+ CAPTURE_STOP_SIGNAL,
+ CAPTURE_PAUSE_SIGNAL,
+ SET_VIDEO_RESOLUTION_FPS_SIGNAL,
+ SET_IMAGE_RESOLUTION_SIGNAL,
/* emit signals */
IMG_DONE_SIGNAL,
LAST_SIGNAL
* Action signal function declarations
*/
-static void gst_camerabin_user_start (GstCameraBin * camera);
+static void gst_camerabin_capture_start (GstCameraBin * camera);
-static void gst_camerabin_user_stop (GstCameraBin * camera);
+static void gst_camerabin_capture_stop (GstCameraBin * camera);
-static void gst_camerabin_user_pause (GstCameraBin * camera);
+static void gst_camerabin_capture_pause (GstCameraBin * camera);
static void
gst_camerabin_set_image_capture_caps (GstCameraBin * camera, gint width,
gint height);
static void
-gst_camerabin_user_res_fps (GstCameraBin * camera, gint width, gint height,
- gint fps_n, gint fps_d);
+gst_camerabin_set_video_resolution_fps (GstCameraBin * camera, gint width,
+ gint height, gint fps_n, gint fps_d);
static void
-gst_camerabin_user_image_res (GstCameraBin * camera, gint width, gint height);
+gst_camerabin_set_image_resolution (GstCameraBin * camera, gint width,
+ gint height);
/*
GstBin *cbin = GST_BIN (camera);
gchar *driver_name = NULL;
- /* Add user set or default video src element */
+ /* Add application set or default video src element */
if (!(camera->src_vid_src = gst_camerabin_setup_default_element (cbin,
- camera->user_vid_src, "autovideosrc", DEFAULT_VIDEOSRC))) {
+ camera->app_vid_src, "autovideosrc", DEFAULT_VIDEOSRC))) {
camera->src_vid_src = NULL;
goto done;
} else {
goto error;
}
}
- /* Add user set or default video sink element */
+ /* Add application set or default video sink element */
if (!(camera->view_sink = gst_camerabin_setup_default_element (cbin,
- camera->user_vf_sink, "autovideosink", DEFAULT_VIDEOSINK))) {
+ camera->app_vf_sink, "autovideosink", DEFAULT_VIDEOSINK))) {
camera->view_sink = NULL;
goto error;
} else {
g_string_free (camera->filename, TRUE);
camera->filename = NULL;
}
- /* Unref user set elements */
- if (camera->user_vf_sink) {
- gst_object_unref (camera->user_vf_sink);
- camera->user_vf_sink = NULL;
+ /* Unref application set elements */
+ if (camera->app_vf_sink) {
+ gst_object_unref (camera->app_vf_sink);
+ camera->app_vf_sink = NULL;
}
- if (camera->user_vid_src) {
- gst_object_unref (camera->user_vid_src);
- camera->user_vid_src = NULL;
+ if (camera->app_vid_src) {
+ gst_object_unref (camera->app_vid_src);
+ camera->app_vid_src = NULL;
}
if (camera->app_video_filter) {
g_return_val_if_fail (camera != NULL, NULL);
- videosrc = camera->src_vid_src ? camera->src_vid_src : camera->user_vid_src;
+ videosrc = camera->src_vid_src ? camera->src_vid_src : camera->app_vid_src;
if (!videosrc) {
GST_WARNING_OBJECT (camera, "no videosrc, can't get allowed caps");
* Resumes video recording if it has been paused.
*/
- camerabin_signals[USER_START_SIGNAL] =
+ camerabin_signals[CAPTURE_START_SIGNAL] =
g_signal_new ("capture-start",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (GstCameraBinClass, user_start),
+ G_STRUCT_OFFSET (GstCameraBinClass, capture_start),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* recording and returns to the view finder mode.
*/
- camerabin_signals[USER_STOP_SIGNAL] =
+ camerabin_signals[CAPTURE_STOP_SIGNAL] =
g_signal_new ("capture-stop",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (GstCameraBinClass, user_stop),
+ G_STRUCT_OFFSET (GstCameraBinClass, capture_stop),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* If in image mode or not recording, does nothing.
*/
- camerabin_signals[USER_PAUSE_SIGNAL] =
+ camerabin_signals[CAPTURE_PAUSE_SIGNAL] =
g_signal_new ("capture-pause",
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (GstCameraBinClass, user_pause),
+ G_STRUCT_OFFSET (GstCameraBinClass, capture_pause),
NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
/**
* given resolution, unless in night mode when minimum is configured.
*/
- camerabin_signals[USER_RES_FPS_SIGNAL] =
+ camerabin_signals[SET_VIDEO_RESOLUTION_FPS_SIGNAL] =
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),
+ G_STRUCT_OFFSET (GstCameraBinClass, set_video_resolution_fps),
NULL, NULL, __gst_camerabin_marshal_VOID__INT_INT_INT_INT, G_TYPE_NONE, 4,
G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT);
* Does not affect view finder mode and video recording.
*/
- camerabin_signals[USER_IMAGE_RES_SIGNAL] =
+ camerabin_signals[SET_IMAGE_RESOLUTION_SIGNAL] =
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),
+ G_STRUCT_OFFSET (GstCameraBinClass, set_image_resolution),
NULL, NULL, __gst_camerabin_marshal_VOID__INT_INT, G_TYPE_NONE, 2,
G_TYPE_INT, G_TYPE_INT);
gst_camerabin_override_photo_properties (gobject_class);
- klass->user_start = gst_camerabin_user_start;
- klass->user_stop = gst_camerabin_user_stop;
- klass->user_pause = gst_camerabin_user_pause;
- klass->user_res_fps = gst_camerabin_user_res_fps;
- klass->user_image_res = gst_camerabin_user_image_res;
+ klass->capture_start = gst_camerabin_capture_start;
+ klass->capture_stop = gst_camerabin_capture_stop;
+ klass->capture_pause = gst_camerabin_capture_pause;
+ klass->set_video_resolution_fps = gst_camerabin_set_video_resolution_fps;
+ klass->set_image_resolution = gst_camerabin_set_image_resolution;
klass->img_done = gst_camerabin_default_signal_img_done;
camera->aspect_filter = NULL;
camera->view_sink = NULL;
- camera->user_vf_sink = NULL;
+ camera->app_vf_sink = NULL;
/* source elements */
camera->src_vid_src = NULL;
camera->src_out_sel = NULL;
camera->app_video_filter = NULL;
- camera->user_vid_src = NULL;
camera->active_bin = NULL;
("camerabin must be in NULL state when setting the view finder element"),
(NULL));
} else {
- if (camera->user_vf_sink)
- gst_object_unref (camera->user_vf_sink);
- camera->user_vf_sink = g_value_get_object (value);
- gst_object_ref (camera->user_vf_sink);
+ if (camera->app_vf_sink)
+ gst_object_unref (camera->app_vf_sink);
+ camera->app_vf_sink = g_value_get_object (value);
+ gst_object_ref (camera->app_vf_sink);
}
break;
case ARG_VIDEO_SRC:
("camerabin must be in NULL state when setting the video source element"),
(NULL));
} else {
- if (camera->user_vid_src)
- gst_object_unref (camera->user_vid_src);
- camera->user_vid_src = g_value_get_object (value);
- gst_object_ref (camera->user_vid_src);
+ if (camera->app_vid_src)
+ gst_object_unref (camera->app_vid_src);
+ camera->app_vid_src = g_value_get_object (value);
+ gst_object_ref (camera->app_vid_src);
}
break;
case ARG_AUDIO_SRC:
if (camera->view_sink)
g_value_set_object (value, camera->view_sink);
else
- g_value_set_object (value, camera->user_vf_sink);
+ g_value_set_object (value, camera->app_vf_sink);
break;
case ARG_VIDEO_SRC:
if (camera->src_vid_src)
g_value_set_object (value, camera->src_vid_src);
else
- g_value_set_object (value, camera->user_vid_src);
+ g_value_set_object (value, camera->app_vid_src);
break;
case ARG_AUDIO_SRC:
g_value_set_object (value,
*/
static void
-gst_camerabin_user_start (GstCameraBin * camera)
+gst_camerabin_capture_start (GstCameraBin * camera)
{
GST_INFO_OBJECT (camera, "starting capture");
if (camera->paused) {
- gst_camerabin_user_pause (camera);
+ gst_camerabin_capture_pause (camera);
return;
}
}
static void
-gst_camerabin_user_stop (GstCameraBin * camera)
+gst_camerabin_capture_stop (GstCameraBin * camera)
{
if (camera->active_bin == camera->vidbin) {
GST_INFO_OBJECT (camera, "stopping video capture");
}
static void
-gst_camerabin_user_pause (GstCameraBin * camera)
+gst_camerabin_capture_pause (GstCameraBin * camera)
{
if (camera->active_bin == camera->vidbin) {
if (!camera->paused) {
}
static void
-gst_camerabin_user_res_fps (GstCameraBin * camera, gint width, gint height,
- gint fps_n, gint fps_d)
+gst_camerabin_set_video_resolution_fps (GstCameraBin * camera, gint width,
+ gint height, gint fps_n, gint fps_d)
{
GstState state, pending;
GstPad *activepad = NULL;
}
static void
-gst_camerabin_user_image_res (GstCameraBin * camera, gint width, gint height)
+gst_camerabin_set_image_resolution (GstCameraBin * camera, gint width,
+ gint height)
{
/* Set the caps now already, if possible */
gst_camerabin_set_image_capture_caps (camera, width, height);