GNOME Bugzilla – Bug 313086
0.9 patch, part #2
Last modified: 2005-11-03 21:36:27 UTC
Attached patch makes HEAD/CVS compileable against 0.8 or 0.9, depending on a ./configure switch. I use this to test GStreamer-0.9. For me, this is easier to maintain than the separate BRANCH-GSTREAMER-0_9, since CVS merge features suck.
Created attachment 50506 [details] [review] patch, current version Against GStreamer HEAD/CVS of right now.
Created attachment 51764 [details] [review] updated patch for current GStreamer CVS HEAD (fixes state enums etc.) Updated patch that fixes the old GstElementState enums and state change function semantics to the new stuff as in GStreamer CVS HEAD. Cheers -Tim
Created attachment 51765 [details] [review] same patch as above, but compiles with 0.8 as well Same updated patch as before, just that it compiles and works with 0.8 as well. Cheers -Tim
Created attachment 52686 [details] [review] updated patch with registry and bus API changes
Created attachment 52809 [details] [review] Updated for caps-filter, bus api changes
Created attachment 53104 [details] [review] same as above, only that gstscreenshot.c is updated for capsfilter changes as well
Created attachment 53299 [details] [review] Updated patch As above, updated for changed API in state changes.
Created attachment 53331 [details] [review] updated patch (for recent state change stuff)
Created attachment 53429 [details] [review] update for GST_TAG_DATE => GST_TYPE_DATE change (and fix minor memleak)
Created attachment 53484 [details] [review] updated patch (this time hopefully without g_date_free-ing random values on the stack)
Created attachment 53647 [details] [review] updated patch
Created attachment 53669 [details] [review] Updated patch (recent query API changes)
Created attachment 53905 [details] [review] updated patch, separates 0.8 and 0.10 code into different backends
That's not a good idea, I considered that several times and in the end, most of it is just duplicated code and bugfixes in one will be lost in the other. We'll have to maintain the 0.8 port for at least cycle, so just keep them together.
My understanding is that this is the best way to get the 0.10 code into totem CVS HEAD any time soon. Besides, it's really painful to work with code that has a trizillion #ifdef #ifndef #else #endif brackets, and code that can't be changed easily because you always have to take 0.8 backwards compatibility into account when you change something. Having separate backends is also the safer option in the end, because this way the 0.8 code doesn't get broken by accident. And let's face it, 0.8 maintainance is not really something gstreamer devs do a lot of at the moment, and that will be even less in a month's time when 0.10.0 comes out. Having a separate 0.10 backend simply means that we can make use of all the new 0.9 features much more easily, while keeping the 0.8 as stable and rocking as it currently is. Fixing things in one backend but not the other is not a much different problem than fixing things in HEAD and the 0.8 branch of gst-plugins at the same time. It's managable, and if things are forgotten it's pretty easy to backport/forwardport the changes. Cheers -Tim
I will need to look closer at the patch to know for sure, but when I created my original patch, I tried to put as little code as possible in the #ifdef macros, and keep pretty much all code shared, exactly for maintainance reasons.
Created attachment 53915 [details] [review] same patch as above, but keeps changes to 0.8 backend to a minimum This patch keeps the changes to the 0.8 backend to a minimum. The remaining changes to the 0.8 are: - add bacon_video_widget_can_seek_direct() - extract xoverlay element if videosink is a bin - remove unused bits and pieces, add newlines here and there - add some casts for gcc4 to fix compiler warnings - move some code from cb_audio_fixate() into helper functions for clarity - fix minor memory leak - better error messages when audio/video sink couldn't be created (same as in 0.10 backend) Cheers -Tim
Ronald, one of the issues is that there are changes that should be made to the 0.9-based backend that have no equivalent in the 0.8 backend. For example, everything is ready now to not *freeze the UI* when opening stuff. There is simply no equivalent for this in 0.8. So basically, how it currently is is not really an argument in favor of keeping things in one backend - if anything, it stifles progress.
As for the patch, I discussed it with Tim, and we (contributors) will figure it out with Bastien (the maintainer), and we'll do just fine at that. In the end, if Bastien says one or the other, I will comply, since he's maintainer. If he wants us to figure it out, then I still think it should be the same backend. Bastie, your call. Poke me on IRC if you need me.
I don't care one way or the other, whatever makes it easier for you guys to maintain the 2 versions, and for people to contribute.
2005-11-03 Tim-Philipp Müller <tim at centricular dot net> * configure.in: * src/backend/Makefile.am: Add configure magic GStreamer 0.9/0.10 backend: --enable-gstreamer now optionally accepts a GStreamer major/minor version as well (if none is specified it defaults to GStreamer 0.8). * src/backend/bacon-video-widget-gst-0.10.c: Add GStreamer 0.9/0.10 backend (based on Ronald's original patch, #313086). * src/backend/bacon-video-widget-gst.c: (bacon_video_widget_signal_idler), (got_found_tag), (parse_stream_info), (cb_audio_fixate), (get_num_audio_channels), (fixate_to_num), (bacon_video_widget_set_audio_out_type), (bacon_video_widget_open_with_subtitle), (bacon_video_widget_play), (bacon_video_widget_can_direct_seek), (bacon_video_widget_get_metadata_string), (bacon_video_widget_get_metadata_int), (bacon_video_widget_new): Some fixes for the 0.8 backend: gcc4 signedness fixes; move some code from cb_audio_fixate() into helper functions; fix minor memory leak; improve error messages when sink could not be created. * src/backend/bacon-video-widget-xine.c: (bacon_video_widget_can_direct_seek): * src/backend/bacon-video-widget.h: Add new _can_direct_seek() method. * src/backend/gstscreenshot.c: (have_data), (get_any), (bvw_frame_conv_convert): Add code paths for GStreamer 0.9/0.10. * src/totem.c: (seek_slider_changed_cb), (seek_slider_released_cb): Slider magic for direct seeking.