GNOME Bugzilla – Bug 303167
Add bzip2 support
Last modified: 2006-02-06 09:43:54 UTC
GStreamer currently does not handle zipped files.
Created attachment 46069 [details]
GStreamer can now replace bunzip2:
gst-launch filesrc location=... ! bz2dec ! filesink location=...
Encoder to follow soon.
Now totem can play bzipped files, too.
Created attachment 46070 [details] [review]
Necessary modifications to configure.ac
Created attachment 46109 [details]
bz2 encoder and decoder
"bzip2 file": filesrc location=file ! bz2enc ! filesink location=file.bz2
"bunzip2 file.bz2": filesrc location=file.bz2 ! bz2dec ! filesink location=file
It's not quite b[un]zip2, because the filesrc does not remove the file after
reading it, but I hope this is not a showstopper :-)
A very strange enhancement you have here ;-)
I don't expect this to be used very much. Media formats typically have their own
compression. I've never seen foo.avi.bz2 for example.
So I would think the benefit of having this element would be small (not zero,
but small). OTOH the costs of maintaining elements is non zero either. So this
plugin needs to go in a module that is not maintained as well as other ones, so
we don't spend effort on it. Wait for gst-plugins-unmaintained, a new 0.9 module
thomas is going to create, and propose it for addition there. Of course you will
have to do some 0.9 porting first.
Also, codewise, please use gstreamer style (indentation mainly). And add
yourself as the copyright holder. Patch ext/Makefile.am as well.
Lutz, ping? We're stable now, so whatever you do against 0.10 will be around for a while. gst-plugins-bad is where new plugins get added these days.
Created attachment 58705 [details] [review]
Patch to hook up bz2 plugin
Created attachment 58706 [details]
Updated to compile in CVS head (gst-plugins-bad).
regarding attachment #58705 [details] -- please add a changelog entry as well, that makes sure you get in the release notes.
regarding attachment #58706 [details] -- Always pay attention to the return value of gst_pad_push. Use gst_pad_alloc_buffer instead of gst_buffer_new_and_alloc, and pay attention to its return value. Use GST_BOILERPLATE instead of manually defining a get_type function.
Constructs like these:
GstBz2dec *b = GST_BZ2DEC (gst_pad_get_parent (pad));
GstPad *src = gst_element_get_pad (GST_ELEMENT (b), "src");
return new references; you will need to unref b and src before the end of the function. This applies to both the decoder, and two places in the encoder.
Otherwise these are looking good.
Created attachment 58739 [details] [review]
Patch to hook up bz2 plugin (updated)
Created attachment 58740 [details]
(Note our changelog style as well, for future patches :)
2006-02-05 Lutz Mueller <firstname.lastname@example.org>
reviewed by: Andy Wingo <email@example.com>
* ext/Makefile.am: Hook it up.
* ext/bz2/gstbz2enc.c: New plugin, implements bz2 encoding and