After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 303167 - Add bzip2 support
Add bzip2 support
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 0.10.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 311167
Blocks: 303975
Reported: 2005-05-05 19:19 UTC by Lutz Mueller
Modified: 2006-02-06 09:43 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement

bz2 decoder (10.90 KB, application/x-compressed-tar)
2005-05-05 19:22 UTC, Lutz Mueller
Necessary modifications to (956 bytes, patch)
2005-05-05 19:23 UTC, Lutz Mueller
none Details | Review
bz2 encoder and decoder (9.61 KB, application/x-compressed-tar)
2005-05-06 22:16 UTC, Lutz Mueller
Patch to hook up bz2 plugin (1.62 KB, patch)
2006-02-04 16:02 UTC, Lutz Mueller
needs-work Details | Review
Updated plugin (10.17 KB, application/x-compressed-tar)
2006-02-04 16:03 UTC, Lutz Mueller
Patch to hook up bz2 plugin (updated) (2.24 KB, patch)
2006-02-05 04:31 UTC, Lutz Mueller
committed Details | Review
Updated plugin (10.10 KB, application/x-compressed-tar)
2006-02-05 04:32 UTC, Lutz Mueller

Description Lutz Mueller 2005-05-05 19:19:58 UTC
GStreamer currently does not handle zipped files.
Comment 1 Lutz Mueller 2005-05-05 19:22:11 UTC
Created attachment 46069 [details]
bz2 decoder

GStreamer can now replace bunzip2:

gst-launch filesrc location=... ! bz2dec ! filesink location=...

Encoder to follow soon.

Now totem can play bzipped files, too.
Comment 2 Lutz Mueller 2005-05-05 19:23:52 UTC
Created attachment 46070 [details] [review]
Necessary modifications to
Comment 3 Lutz Mueller 2005-05-06 22:16:47 UTC
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 :-)
Comment 4 Andy Wingo 2005-07-16 13:33:34 UTC
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/ as well.
Comment 5 Andy Wingo 2006-01-27 12:47:54 UTC
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.
Comment 6 Lutz Mueller 2006-02-04 16:02:20 UTC
Created attachment 58705 [details] [review]
Patch to hook up bz2 plugin
Comment 7 Lutz Mueller 2006-02-04 16:03:53 UTC
Created attachment 58706 [details]
Updated plugin

Updated to compile in CVS head (gst-plugins-bad).
Comment 8 Andy Wingo 2006-02-04 18:25:44 UTC
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.
Comment 9 Lutz Mueller 2006-02-05 04:31:54 UTC
Created attachment 58739 [details] [review]
Patch to hook up bz2 plugin (updated)
Comment 10 Lutz Mueller 2006-02-05 04:32:44 UTC
Created attachment 58740 [details]
Updated plugin
Comment 11 Andy Wingo 2006-02-06 09:43:41 UTC
Committed, thanks!

(Note our changelog style as well, for future patches :)

2006-02-05  Lutz Mueller <>

	reviewed by: Andy Wingo <>

	* ext/ Hook it up.
	* ext/bz2/gstbz2.c:
	* ext/bz2/gstbz2dec.h:
	* ext/bz2/gstbz2dec.c:
	* ext/bz2/gstbz2enc.h:
	* ext/bz2/gstbz2enc.c: New plugin, implements bz2 encoding and
	decoding (#303167).