camera source pads. The camera source can simply get_caps on the peer of
each of its pads to know what are the allowed caps for that pad.
-
--- Renegotiation --
-Easy renegotiation isn't supported on gstreamer yet (there is some ongoing work
-currently). Camerabin2 will use a custom 'renegotiate' event, no fields to
-indicate that a certain pad should renegotiate its caps.
-
-Upon receiving this event, a pad should get_caps on its peer and do the caps
-negotiation again. It is likely that a new format was requested.
/* Camerabin functions */
-static GstEvent *
-gst_camera_bin_new_event_renegotiate (void)
-{
- return gst_event_new_custom (GST_EVENT_CUSTOM_BOTH,
- gst_structure_new_empty ("renegotiate"));
-}
-
static GstEvent *
gst_camera_bin_new_event_file_location (const gchar * location)
{
GST_WARNING_OBJECT (camera, "Image capsfilter missing");
}
- /* set the capsfilter caps and notify the src to renegotiate */
- if (pad) {
- GST_DEBUG_OBJECT (camera, "Pushing renegotiate on %s",
- GST_PAD_NAME (pad));
- gst_pad_send_event (pad, gst_camera_bin_new_event_renegotiate ());
+ if (pad)
gst_object_unref (pad);
- }
}
break;
case PROP_VIDEO_CAPTURE_CAPS:{
"Setting video capture caps to %" GST_PTR_FORMAT,
gst_value_get_caps (value));
- /* set the capsfilter caps and notify the src to renegotiate */
if (G_LIKELY (camera->videobin_capsfilter)) {
g_object_set (camera->videobin_capsfilter, "caps",
gst_value_get_caps (value), NULL);
}
if (pad) {
- GST_DEBUG_OBJECT (camera, "Pushing renegotiate on %s",
- GST_PAD_NAME (pad));
- gst_pad_send_event (pad, gst_camera_bin_new_event_renegotiate ());
gst_object_unref (pad);
}
}
"Setting viewfinder capture caps to %" GST_PTR_FORMAT,
gst_value_get_caps (value));
- /* set the capsfilter caps and notify the src to renegotiate */
if (G_LIKELY (camera->viewfinderbin_capsfilter)) {
g_object_set (camera->viewfinderbin_capsfilter, "caps",
gst_value_get_caps (value), NULL);
}
if (pad) {
- GST_DEBUG_OBJECT (camera, "Pushing renegotiate on %s",
- GST_PAD_NAME (pad));
- gst_pad_send_event (pad, gst_camera_bin_new_event_renegotiate ());
gst_object_unref (pad);
}
}