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 162137 - PostScript plugin
PostScript plugin
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-12-24 01:02 UTC by Lutz Mueller
Modified: 2011-05-20 13:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
PostScript plugin for GStreamer (4.77 KB, application/x-compressed-tar)
2004-12-24 01:06 UTC, Lutz Mueller
Details
PostScript plugin for GStreamer (15.37 KB, application/x-compressed-tar)
2005-01-09 17:17 UTC, Lutz Mueller
Details
Makefile for the postscript plugin (280 bytes, text/plain)
2009-09-20 21:27 UTC, Lutz Mueller
Details
gstpostscript.c (1.22 KB, text/plain)
2009-09-20 21:27 UTC, Lutz Mueller
Details
gstpostscriptdec.c (7.29 KB, text/plain)
2009-09-20 21:28 UTC, Lutz Mueller
Details
gstpostscriptdec.h (1.43 KB, text/plain)
2009-09-20 21:32 UTC, Lutz Mueller
Details
gstpostscriptdec.c (7.79 KB, text/plain)
2009-09-22 06:22 UTC, Lutz Mueller
Details
gstpostscriptdec.h (1.41 KB, text/plain)
2009-09-22 06:22 UTC, Lutz Mueller
Details
gstpostscriptdec.h (1.44 KB, text/plain)
2009-09-25 19:46 UTC, Lutz Mueller
Details
gstpostscriptdec.c (10.14 KB, text/plain)
2009-09-25 19:51 UTC, Lutz Mueller
Details

Description Lutz Mueller 2004-12-24 01:02:01 UTC
GStreamer currently does not support the PostScript format.
Comment 1 Lutz Mueller 2004-12-24 01:06:26 UTC
Created attachment 35178 [details]
PostScript plugin for GStreamer

The plugin is not yet fully functional. I submit it in order to announce my
work on a PostScript plugin. Once it is fully functional, I'll post an update.

Final goal: To be able to do 

gst-launch filesrc location="test.jpeg" ! jpegdec ! postscriptenc ! filesink
location="test.ps"

and vice versa.
Comment 2 Lutz Mueller 2005-01-09 17:17:53 UTC
Created attachment 35737 [details]
PostScript plugin for GStreamer

The PostScript plugin can now

(1) Encode videos/images in PostScript
(2) Decode PostScript files in images

For example, you can convert a PostScript file into a JPEG file by running
gst-launch-0.8 filesrc location=test.ps ! postscriptdec type=4 ! filesink
location=test.jpeg
Comment 3 Maciej Katafiasz 2005-01-09 18:35:40 UTC
Some comments:
1) PS <-> pnm doesn't look like most fortunate format choice, is there any
specific reason not to use video/x-raw-rgb? I don't think we even have any
plugin capable of dealing with pnm, unlike video/x-raw-rgb. So unless there's
some significant loss of functionality, change that to video/x-raw-rgb, and
leave manipulating pnm/png/jpeg their respective plugins.
2) Related to above, DON'T use property to choose output format. We have
filtered caps for that, you should be using those (and I still hold there should
be choice between at most vide/x-raw-rgb and video/x-raw-yuv, not other encoded
image formats)
3) Style fixes:
- mv gstpostscriptplugin.c gstpostscript.c, no need to specifically mark it's a
plugin, it's kinda obvious when it resides in gst-plugins ;)
- break long declaration lines, like 94 and following gstpostscriptdec.c, they
are *way* too long. Use general gstreamer/GNOME formatting rules
- I'd prefer s/Postscriptdec/PostscriptDec/, easier to read this way
- Also, postscriptdec is very typing-unfriendly, but I guess simply "psdec"
would have too high probability of clashes, right? Sigh, will need to live with that

Otherwise, from quick compile and run, it seems to work nice. Didn't have time
to look at source closely, will do sometime, preferably after the above
suggestions are incorporated :)
Comment 4 Andy Wingo 2006-01-27 17:05:29 UTC
Some comments:

If you are going to spawn ghostscript, use pipes. Still there is much error correciton to be done.

The encoder actually looks OK.
Comment 5 Lutz Mueller 2006-02-16 15:08:53 UTC
There is now an encoder using CAIRO in bugzilla: http://bugzilla.gnome.org/show_bug.cgi?id=331420.

Once this encoder is in CVS, I'll start work on the postscript decoder again.
Comment 6 Tim-Philipp Müller 2009-05-27 00:29:49 UTC
> Once this encoder is in CVS, I'll start work on the postscript decoder again.

I guess this isn't really going to happen any longer, is it?

Also, it looks like it's 0.8 code..
Comment 7 Lutz Mueller 2009-06-06 14:46:37 UTC
Why not? But again, let's first do the encoder (#331420).
Comment 8 Sebastian Dröge (slomo) 2009-07-18 06:54:56 UTC
The encoder is in gst-plugins-good now.
Comment 9 Lutz Mueller 2009-09-20 21:27:42 UTC
Created attachment 143547 [details]
Makefile for the postscript plugin
Comment 10 Lutz Mueller 2009-09-20 21:27:59 UTC
Created attachment 143548 [details]
gstpostscript.c
Comment 11 Lutz Mueller 2009-09-20 21:28:21 UTC
Created attachment 143549 [details]
gstpostscriptdec.c
Comment 12 Lutz Mueller 2009-09-20 21:32:38 UTC
Created attachment 143550 [details]
gstpostscriptdec.h

The plugin has been tested with the following pipeline: filesrc ! postscriptdec ! "image/png" ! filesink.
Comment 13 Lutz Mueller 2009-09-22 06:22:20 UTC
Created attachment 143656 [details]
gstpostscriptdec.c

Same thing, but using pipes. Doesn't work yet, because gs needs a bit of time to convert, and I haven't figured out yet how the plugin can know when gs is done.
Comment 14 Lutz Mueller 2009-09-22 06:22:46 UTC
Created attachment 143657 [details]
gstpostscriptdec.h
Comment 15 Ralph Giles 2009-09-22 06:29:48 UTC
If you pass -dBATCH and -dNOPAUSE gs should exit after writing the last of the image data.

Alternatively, you could link the the shared library and use the display device as described in http://ghostscript.com/doc/current/API.htm which will give you a callback on page completion. This means you'll only be able to support image/x-raw-rgb, but pngenc and jpegenc are of course available to pipeline users.
Comment 16 Sebastian Dröge (slomo) 2009-09-22 06:51:20 UTC
Yes, Ralphs suggesting to use the shared library sounds like the way to go.

Calling and controlling other processes should always be the last thing to use if nothing else is possible IMHO
Comment 17 Lutz Mueller 2009-09-25 19:46:58 UTC
Created attachment 144025 [details]
gstpostscriptdec.h
Comment 18 Lutz Mueller 2009-09-25 19:51:04 UTC
Created attachment 144027 [details]
gstpostscriptdec.c

filesrc ! postscriptdec ! "image/[png,jpeg]" ! filesink is now fully working. The plugin still uses pipes because ghostscript's header file gave me the creeps:

 * Current problems:
 * 1. Ghostscript does not support multiple instances.
 * 2. Global variables in gs_main_instance_default() 
 *    and gsapi_instance_counter

I propose to use pipes as long as those issues persist.
Comment 19 Sebastian Dröge (slomo) 2010-04-21 04:23:37 UTC
Maybe using http://libspectre.freedesktop.org/wiki/ would be a solution. This is used by evince and evince supports multiple instances.
Comment 20 Christian Fredrik Kalager Schaller 2011-05-20 13:48:38 UTC
Lutz, I am assuming you are not working on this anymore. So I am closing this as wontfix.