mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
camerabin: rename function and variable names, update documentation
Get rid of user_* prefix internally, use app_* instead.
This commit is contained in:
parent
d25a9ca8aa
commit
e2438e6cf1
6 changed files with 139 additions and 139 deletions
|
@ -147,7 +147,7 @@ gst_camerabin_image_init (GstCameraBinImage * img,
|
|||
|
||||
img->post = NULL;
|
||||
img->enc = NULL;
|
||||
img->user_enc = NULL;
|
||||
img->app_enc = NULL;
|
||||
img->meta_mux = NULL;
|
||||
img->sink = NULL;
|
||||
|
||||
|
@ -167,9 +167,9 @@ gst_camerabin_image_dispose (GstCameraBinImage * img)
|
|||
g_string_free (img->filename, TRUE);
|
||||
img->filename = NULL;
|
||||
|
||||
if (img->user_enc) {
|
||||
gst_object_unref (img->user_enc);
|
||||
img->user_enc = NULL;
|
||||
if (img->app_enc) {
|
||||
gst_object_unref (img->app_enc);
|
||||
img->app_enc = NULL;
|
||||
}
|
||||
|
||||
if (img->post) {
|
||||
|
@ -435,9 +435,8 @@ gst_camerabin_image_create_elements (GstCameraBinImage * img)
|
|||
img_sinkpad = gst_element_get_static_pad (csp, "sink");
|
||||
}
|
||||
|
||||
/* Create image encoder */
|
||||
if (img->user_enc) {
|
||||
img->enc = img->user_enc;
|
||||
if (img->app_enc) {
|
||||
img->enc = img->app_enc;
|
||||
if (!gst_camerabin_add_element (imgbin, img->enc)) {
|
||||
goto done;
|
||||
}
|
||||
|
@ -518,12 +517,12 @@ void
|
|||
gst_camerabin_image_set_encoder (GstCameraBinImage * img, GstElement * encoder)
|
||||
{
|
||||
GST_DEBUG ("setting image encoder %" GST_PTR_FORMAT, encoder);
|
||||
if (img->user_enc)
|
||||
gst_object_unref (img->user_enc);
|
||||
if (img->app_enc)
|
||||
gst_object_unref (img->app_enc);
|
||||
if (encoder)
|
||||
gst_object_ref (encoder);
|
||||
|
||||
img->user_enc = encoder;
|
||||
img->app_enc = encoder;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -551,8 +550,8 @@ gst_camerabin_image_get_encoder (GstCameraBinImage * img)
|
|||
{
|
||||
GstElement *enc;
|
||||
|
||||
if (img->user_enc) {
|
||||
enc = img->user_enc;
|
||||
if (img->app_enc) {
|
||||
enc = img->app_enc;
|
||||
} else {
|
||||
enc = img->enc;
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ struct _GstCameraBinImage
|
|||
|
||||
GstElement *post;
|
||||
GstElement *enc;
|
||||
GstElement *user_enc;
|
||||
GstElement *app_enc;
|
||||
GstElement *meta_mux;
|
||||
GstElement *sink;
|
||||
|
||||
|
@ -81,4 +81,4 @@ GstElement *gst_camerabin_image_get_encoder (GstCameraBinImage * img);
|
|||
GstElement *gst_camerabin_image_get_postproc (GstCameraBinImage * img);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* #ifndef __CAMERABIN_IMAGE_H__ */
|
||||
#endif /* #ifndef __CAMERABIN_IMAGE_H__ */
|
||||
|
|
|
@ -166,11 +166,11 @@ gst_camerabin_video_init (GstCameraBinVideo * vid,
|
|||
{
|
||||
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;
|
||||
|
@ -216,29 +216,29 @@ gst_camerabin_video_dispose (GstCameraBinVideo * vid)
|
|||
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);
|
||||
|
@ -548,11 +548,11 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * 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 */
|
||||
|
@ -580,8 +580,8 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
|
|||
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;
|
||||
}
|
||||
|
@ -590,9 +590,9 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
|
|||
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;
|
||||
}
|
||||
|
@ -610,9 +610,9 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
|
|||
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 {
|
||||
|
@ -644,9 +644,9 @@ gst_camerabin_video_create_elements (GstCameraBinVideo * vid)
|
|||
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;
|
||||
}
|
||||
|
@ -787,12 +787,12 @@ gst_camerabin_video_set_mute (GstCameraBinVideo * vid, gboolean mute)
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -800,11 +800,11 @@ void
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -812,22 +812,22 @@ void
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -835,11 +835,11 @@ void
|
|||
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);
|
||||
}
|
||||
|
||||
|
@ -868,29 +868,29 @@ gst_camerabin_video_get_mute (GstCameraBinVideo * 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;
|
||||
}
|
||||
|
|
|
@ -64,12 +64,12 @@ struct _GstCameraBinVideo
|
|||
GstPad *tee_video_srcpad;
|
||||
GstPad *tee_vf_srcpad;
|
||||
|
||||
/* User set elements */
|
||||
GstElement *user_post; /* Video post processing */
|
||||
GstElement *user_vid_enc;
|
||||
GstElement *user_aud_enc;
|
||||
GstElement *user_aud_src;
|
||||
GstElement *user_mux;
|
||||
/* Application set elements */
|
||||
GstElement *app_post; /* Video post processing */
|
||||
GstElement *app_vid_enc;
|
||||
GstElement *app_aud_enc;
|
||||
GstElement *app_aud_src;
|
||||
GstElement *app_mux;
|
||||
|
||||
/* Other elements */
|
||||
GstElement *aud_src; /* Audio source */
|
||||
|
|
|
@ -175,11 +175,11 @@
|
|||
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
|
||||
|
@ -339,22 +339,23 @@ gst_camerabin_handle_message_func (GstBin * bin, GstMessage * message);
|
|||
* 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);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -556,9 +557,9 @@ camerabin_create_src_elements (GstCameraBin * camera)
|
|||
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 {
|
||||
|
@ -683,9 +684,9 @@ camerabin_create_view_elements (GstCameraBin * camera)
|
|||
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 {
|
||||
|
@ -878,14 +879,14 @@ camerabin_dispose_elements (GstCameraBin * camera)
|
|||
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) {
|
||||
|
@ -1126,7 +1127,7 @@ gst_camerabin_get_allowed_input_caps (GstCameraBin * camera)
|
|||
|
||||
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");
|
||||
|
@ -2658,11 +2659,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
* 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);
|
||||
|
||||
/**
|
||||
|
@ -2673,11 +2674,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
* 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);
|
||||
|
||||
/**
|
||||
|
@ -2688,11 +2689,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
* 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);
|
||||
|
||||
/**
|
||||
|
@ -2711,11 +2712,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
* 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);
|
||||
|
||||
|
@ -2729,11 +2730,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
* 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);
|
||||
|
||||
|
@ -2757,11 +2758,11 @@ gst_camerabin_class_init (GstCameraBinClass * klass)
|
|||
|
||||
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;
|
||||
|
||||
|
@ -2842,7 +2843,7 @@ gst_camerabin_init (GstCameraBin * camera, GstCameraBinClass * gclass)
|
|||
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;
|
||||
|
@ -2853,7 +2854,6 @@ gst_camerabin_init (GstCameraBin * camera, GstCameraBinClass * gclass)
|
|||
camera->src_out_sel = NULL;
|
||||
|
||||
camera->app_video_filter = NULL;
|
||||
camera->user_vid_src = NULL;
|
||||
|
||||
camera->active_bin = NULL;
|
||||
|
||||
|
@ -3009,10 +3009,10 @@ gst_camerabin_set_property (GObject * object, guint prop_id,
|
|||
("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:
|
||||
|
@ -3021,10 +3021,10 @@ gst_camerabin_set_property (GObject * object, guint prop_id,
|
|||
("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:
|
||||
|
@ -3151,13 +3151,13 @@ gst_camerabin_get_property (GObject * object, guint prop_id,
|
|||
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,
|
||||
|
@ -3349,12 +3349,12 @@ gst_camerabin_handle_message_func (GstBin * bin, GstMessage * msg)
|
|||
*/
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -3399,7 +3399,7 @@ gst_camerabin_user_start (GstCameraBin * camera)
|
|||
}
|
||||
|
||||
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");
|
||||
|
@ -3411,7 +3411,7 @@ gst_camerabin_user_stop (GstCameraBin * camera)
|
|||
}
|
||||
|
||||
static void
|
||||
gst_camerabin_user_pause (GstCameraBin * camera)
|
||||
gst_camerabin_capture_pause (GstCameraBin * camera)
|
||||
{
|
||||
if (camera->active_bin == camera->vidbin) {
|
||||
if (!camera->paused) {
|
||||
|
@ -3454,8 +3454,8 @@ gst_camerabin_user_pause (GstCameraBin * camera)
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -3523,7 +3523,8 @@ gst_camerabin_set_image_capture_caps (GstCameraBin * camera, gint width,
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -134,9 +134,9 @@ struct _GstCameraBin
|
|||
GstElement *view_scale;
|
||||
GstElement *view_sink;
|
||||
|
||||
/* User configurable elements */
|
||||
GstElement *user_vid_src;
|
||||
GstElement *user_vf_sink;
|
||||
/* Application configurable elements */
|
||||
GstElement *app_vid_src;
|
||||
GstElement *app_vf_sink;
|
||||
GstElement *app_video_filter;
|
||||
|
||||
/* Night mode handling */
|
||||
|
@ -169,12 +169,12 @@ struct _GstCameraBinClass
|
|||
|
||||
/* action signals */
|
||||
|
||||
void (*user_start) (GstCameraBin * camera);
|
||||
void (*user_stop) (GstCameraBin * camera);
|
||||
void (*user_pause) (GstCameraBin * camera);
|
||||
void (*user_res_fps) (GstCameraBin * camera, gint width, gint height,
|
||||
gint fps_n, gint fps_d);
|
||||
void (*user_image_res) (GstCameraBin * camera, gint width, gint height);
|
||||
void (*capture_start) (GstCameraBin * camera);
|
||||
void (*capture_stop) (GstCameraBin * camera);
|
||||
void (*capture_pause) (GstCameraBin * camera);
|
||||
void (*set_video_resolution_fps) (GstCameraBin * camera, gint width,
|
||||
gint height, gint fps_n, gint fps_d);
|
||||
void (*set_image_resolution) (GstCameraBin * camera, gint width, gint height);
|
||||
|
||||
/* signals (callback) */
|
||||
|
||||
|
|
Loading…
Reference in a new issue