diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-06-10 17:00:42 +0200 |
---|---|---|
committer | Sebastian Dröge <slomo@circular-chaos.org> | 2013-06-11 12:47:53 +0200 |
commit | 28e64d10312d9df97ba609ee9ca871595fff8db2 (patch) | |
tree | c9013ce82aa8bc72944b1069aba439c120460520 /gst/camerabin2 | |
parent | 5732c53c810562dba6c4dd731f17f78be2821034 (diff) | |
download | gstreamer-plugins-bad-28e64d10312d9df97ba609ee9ca871595fff8db2.tar.gz |
wrappercamerabinsrc: Add video-source-filter during construction
By adding the video-source-filter during construction time, rather then
patching it in later (*), we can greatly reduce the amount of caps involved
in negotation, speeding up pipeline creation.
I wrote this while working on speeding up the startup of cheese. My cheese
has been modified to add a capsfilter, filtering for only the configured
resolution, with that cheese patch + this patch, the pipeline creation time
goes from aprox 1.1 seconds to aprox 350ms. This is with a Logitech 9000
pro camera, which supports lots of different resolutions at many different
framerates per resolution, causing a caps "explosion" if not filtered.
*) Note the code for this is left in, as it is still necessary if the
video-source-filter is changed between a stop + re-start.
https://bugzilla.gnome.org/show_bug.cgi?id=701953
Diffstat (limited to 'gst/camerabin2')
-rw-r--r-- | gst/camerabin2/gstwrappercamerabinsrc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gst/camerabin2/gstwrappercamerabinsrc.c b/gst/camerabin2/gstwrappercamerabinsrc.c index 3f94428e2..2e3dda64f 100644 --- a/gst/camerabin2/gstwrappercamerabinsrc.c +++ b/gst/camerabin2/gstwrappercamerabinsrc.c @@ -552,6 +552,16 @@ gst_wrapper_camera_bin_src_construct_pipeline (GstBaseCameraSrc * bcamsrc) "src-videoconvert")) goto done; + if (self->app_vid_filter) { + self->video_filter = gst_object_ref (self->app_vid_filter); + + if (!gst_camerabin_add_element (cbin, self->video_filter)) + goto done; + if (!gst_camerabin_create_and_add_element (cbin, "videoconvert", + "filter-videoconvert")) + goto done; + } + if (!(self->src_filter = gst_camerabin_create_and_add_element (cbin, "capsfilter", "src-capsfilter"))) |