mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-08 04:41:31 +00:00
camerabin: reset active-pad in output-selector after READY state
Camerabin sets itself to READY state during resolution change. This operation makes output-selector to forget its currently active pad, so it must be set again after state change.
This commit is contained in:
parent
7b62e11412
commit
b2fc088c84
1 changed files with 13 additions and 0 deletions
|
@ -3219,6 +3219,7 @@ gst_camerabin_user_res_fps (GstCameraBin * camera, gint width, gint height,
|
||||||
gint fps_n, gint fps_d)
|
gint fps_n, gint fps_d)
|
||||||
{
|
{
|
||||||
GstState state, pending;
|
GstState state, pending;
|
||||||
|
GstPad *activepad;
|
||||||
|
|
||||||
GST_INFO_OBJECT (camera, "switching resolution to %dx%d and fps to %d/%d",
|
GST_INFO_OBJECT (camera, "switching resolution to %dx%d and fps to %d/%d",
|
||||||
width, height, fps_n, fps_d);
|
width, height, fps_n, fps_d);
|
||||||
|
@ -3226,6 +3227,8 @@ gst_camerabin_user_res_fps (GstCameraBin * camera, gint width, gint height,
|
||||||
/* Interrupt ongoing capture */
|
/* Interrupt ongoing capture */
|
||||||
gst_camerabin_do_stop (camera);
|
gst_camerabin_do_stop (camera);
|
||||||
|
|
||||||
|
g_object_get (G_OBJECT (camera->src_out_sel), "active-pad", &activepad, NULL);
|
||||||
|
|
||||||
gst_element_get_state (GST_ELEMENT (camera), &state, &pending, 0);
|
gst_element_get_state (GST_ELEMENT (camera), &state, &pending, 0);
|
||||||
if (state == GST_STATE_PAUSED || state == GST_STATE_PLAYING) {
|
if (state == GST_STATE_PAUSED || state == GST_STATE_PLAYING) {
|
||||||
GST_INFO_OBJECT (camera,
|
GST_INFO_OBJECT (camera,
|
||||||
|
@ -3241,6 +3244,16 @@ gst_camerabin_user_res_fps (GstCameraBin * camera, gint width, gint height,
|
||||||
gst_element_state_get_name (pending));
|
gst_element_state_get_name (pending));
|
||||||
state = pending;
|
state = pending;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Re-set the active pad since switching camerabin to READY state clears this
|
||||||
|
* setting in output-selector */
|
||||||
|
if (activepad) {
|
||||||
|
GST_INFO_OBJECT (camera, "re-setting active pad in output-selector");
|
||||||
|
|
||||||
|
g_object_set (G_OBJECT (camera->src_out_sel), "active-pad", activepad,
|
||||||
|
NULL);
|
||||||
|
}
|
||||||
|
|
||||||
gst_element_set_state (GST_ELEMENT (camera), state);
|
gst_element_set_state (GST_ELEMENT (camera), state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue