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 525743 - support for kate subtitle streams
support for kate subtitle streams
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other All
: Normal enhancement
: 0.10.13
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-02 12:05 UTC by ogg.k.ogg.k
Modified: 2009-08-08 11:58 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
adds a decoder and parser for kate streams (48.54 KB, patch)
2008-04-03 10:55 UTC, ogg.k.ogg.k
none Details | Review
kate stream encoder/decoder/parser (112.30 KB, patch)
2008-06-20 09:51 UTC, ogg.k.ogg.k
none Details | Review
allows oggmux to mux kate streams (800 bytes, patch)
2008-06-20 09:53 UTC, ogg.k.ogg.k
none Details | Review
kate stream encoder/decoder/parser (117.70 KB, patch)
2008-06-23 08:52 UTC, ogg.k.ogg.k
none Details | Review
add a tagger, a couple encoding fixes, cleanup, more tests (144.63 KB, patch)
2008-07-08 10:57 UTC, ogg.k.ogg.k
none Details | Review
update, adds canvas size property (150.26 KB, patch)
2008-08-15 15:24 UTC, ogg.k.ogg.k
none Details | Review
update to HEAD (776 bytes, patch)
2008-08-15 15:27 UTC, ogg.k.ogg.k
none Details | Review
update: better parser, rendering element (192.12 KB, patch)
2008-10-02 16:33 UTC, ogg.k.ogg.k
none Details | Review
add demuxing from and muxing to matroska (8.49 KB, patch)
2008-10-02 16:34 UTC, ogg.k.ogg.k
none Details | Review
the one liner that allows oggmux to accept kate streams (2.24 KB, patch)
2008-10-02 16:36 UTC, ogg.k.ogg.k
none Details | Review
update to latest CVS, and some improvements to the renderer (200.41 KB, patch)
2008-12-14 20:01 UTC, ogg.k.ogg.k
none Details | Review
update to latest CVS (780 bytes, patch)
2008-12-14 20:02 UTC, ogg.k.ogg.k
none Details | Review
update to latest CVS (8.50 KB, patch)
2008-12-14 20:03 UTC, ogg.k.ogg.k
none Details | Review
Fix use of C99 (decl after stmt) that made this stop building - no functional change otherwise (200.82 KB, patch)
2009-01-03 23:05 UTC, ogg.k.ogg.k
none Details | Review
use (new ?) GST_ELEMENT_DETAILS, s/%d/%f/ in debug log, and now applies to latest HEAD (200.76 KB, patch)
2009-01-17 16:10 UTC, ogg.k.ogg.k
none Details | Review
as git patch, updated to latest head (977 bytes, patch)
2009-02-15 19:30 UTC, ogg.k.ogg.k
none Details | Review
as git patch, update to latest head (8.94 KB, patch)
2009-02-15 19:31 UTC, ogg.k.ogg.k
none Details | Review
as git patch, updated to latest head (203.63 KB, patch)
2009-02-15 19:32 UTC, ogg.k.ogg.k
none Details | Review
Update to latest to keep it applying (203.67 KB, patch)
2009-03-07 12:55 UTC, ogg.k.ogg.k
none Details | Review
against latest (985 bytes, patch)
2009-06-30 12:11 UTC, ogg.k.ogg.k
committed Details | Review
against latest (9.02 KB, patch)
2009-06-30 12:12 UTC, ogg.k.ogg.k
committed Details | Review
against latest (203.73 KB, patch)
2009-06-30 12:13 UTC, ogg.k.ogg.k
committed Details | Review
this avoids using trashed memory when a DVD uses an invalid end time (5.40 KB, patch)
2009-07-20 10:47 UTC, ogg.k.ogg.k
committed Details | Review
SUB is now the preferred subtitles category, use this too. (1.43 KB, patch)
2009-07-20 11:27 UTC, ogg.k.ogg.k
committed Details | Review
make elements/kate.valgrind log (3.30 KB, text/plain)
2009-07-20 12:39 UTC, Tim-Philipp Müller
  Details
Fixes leaks found by Valgrind on elements/kate.c (3.29 KB, patch)
2009-07-20 15:27 UTC, ogg.k.ogg.k
committed Details | Review
Moving/factoring stuff around with the recent SPU creation code caused me to introduce a bug in the time conversion macro (893 bytes, patch)
2009-07-21 11:45 UTC, ogg.k.ogg.k
committed Details | Review
Use GST_ELEMENT_ERROR as requested (12.19 KB, patch)
2009-07-24 20:58 UTC, ogg.k.ogg.k
committed Details | Review

Description ogg.k.ogg.k 2008-04-02 12:05:52 UTC
Hi,

I am working on a patch to add a kate decoder to -bad, now working in
Totem. Would you be interested in such a patch ? Still needs some work
before I can submit it.
More information about the format is at:
http://wiki.xiph.org/index.php/OggKate

Thanks
Comment 1 Thijs Vermeir 2008-04-02 15:38:38 UTC
Of course, feel free to put here a patch when you are ready...
Comment 2 ogg.k.ogg.k 2008-04-03 10:55:15 UTC
Created attachment 108534 [details] [review]
adds a decoder and parser for kate streams

Adds preliminary decoder and parser support for kate streams.
Comment 3 ogg.k.ogg.k 2008-04-03 11:13:53 UTC
There is second patch, but I'm hitting a bugzilla internal error each time
I try to submit it (reported to bugmaster). It's very small though, so here
it is.

Muxed streams (using oggmux from -base) need the second hunk to be correct.
Reading the code, I think the increase of the pageno is wrong as it is ++'d
afterwards at the ogg_stream_flush, but I'm not confident this is right.

I've tried muxing a theora stream and a vorbis stream as well with this patch
in, and oggz-validate (checks ogg streams for errors) is happy with them.
Would be nice to have someone who groks oggmux well to have a look at it to
see if I'm not missing anything there.

The first hunk just allows oggmux to accept application/x-kate on its sink
and is needed for the kate parser to be able to be piped to oggmux,

diff -ru /tmp/gst-ogg/gstoggmux.c gst-plugins-base-0.10.17/ext/ogg/gstoggmux.c
--- /tmp/gst-ogg/gstoggmux.c    2008-04-02 19:53:47.000000000 +0100
+++ gst-plugins-base-0.10.17/ext/ogg/gstoggmux.c    2008-04-02 21:47:18.000000000 +0100
@@ -89,7 +183,8 @@
     GST_STATIC_CAPS ("video/x-theora; "
         "audio/x-vorbis; audio/x-flac; audio/x-speex; "
         "application/x-ogm-video; application/x-ogm-audio; video/x-dirac; "
-        "video/x-smoke; text/x-cmml, encoded = (boolean) TRUE")
+        "video/x-smoke; text/x-cmml, encoded = (boolean) TRUE; "
+        "application/x-kate")
     );

 static void gst_ogg_mux_base_init (gpointer g_class);
@@ -1253,7 +1346,7 @@
     if (GST_BUFFER_IS_DISCONT (buf)) {
       packet.packetno++;
       /* No public API for this; hack things in */
-      pad->stream.pageno++;
+      //pad->stream.pageno++;
       force_flush = TRUE;
     }

Comment 4 Tim-Philipp Müller 2008-04-06 12:55:25 UTC
I think Kate's bitstream format / spec should be stabilised/finalised before this is added.

Also:

What programs create content in this format?

Where can content in this format be found?

Is there a community around this or are you the only person using this at the moment?
Comment 5 ogg.k.ogg.k 2008-04-07 09:14:06 UTC
Though the wiki does not mention this, the bitstream is now versioned,
so while not frozen, it is not a moving target. The format includes
hooks to allow adding data without breaking old decoders (in fact, I
already use one of those).

Only one program (apart from the kate encoder supplied with the library)
creates kate streams at the moment: the latest ffmpeg2theora (and this
uses only unformatted text now).

Content in this format may not be found yet as the format is quite new,
and there being only one "real" program writing it, and no players yet
having decoding capability.

I am so far the only person using it, again due to the format being new.
Comment 6 ogg.k.ogg.k 2008-06-20 09:51:14 UTC
Created attachment 113104 [details] [review]
kate stream encoder/decoder/parser

This is further work, adding an encoder, and tests, as well as cleanup and a few fixes.
Comment 7 ogg.k.ogg.k 2008-06-20 09:53:00 UTC
Created attachment 113105 [details] [review]
allows oggmux to mux kate streams

This trivial patch allows oggmux to accept and mux kate streams.
The previous flush hack is removed, it all works fine now.
Comment 8 ogg.k.ogg.k 2008-06-23 08:52:13 UTC
Created attachment 113244 [details] [review]
kate stream encoder/decoder/parser

another update, adding encoding tags, color/contrast parsing fix, and more tests
Comment 9 ogg.k.ogg.k 2008-07-08 10:57:39 UTC
Created attachment 114174 [details] [review]
add a tagger, a couple encoding fixes, cleanup, more tests
Comment 10 ogg.k.ogg.k 2008-08-15 15:24:06 UTC
Created attachment 116673 [details] [review]
update, adds canvas size property
Comment 11 ogg.k.ogg.k 2008-08-15 15:27:00 UTC
Created attachment 116674 [details] [review]
update to HEAD

These patches are ported to a recent HEAD.

It would be nice if the trivial patch to -base was applied, as it should
not cause any adverse effects, and would allow using an out of tree kate
plugin without having to patch GStreamer's ogg plugin.

It's a one liner adding the application/kate MIME type to the list of
allowed inputs to the ogg muxer.

Thanks
Comment 12 ogg.k.ogg.k 2008-10-02 16:33:43 UTC
Created attachment 119797 [details] [review]
update: better parser, rendering element

parser now more resistant, add a rendering element based on libtiger (using cairo and pango)
Comment 13 ogg.k.ogg.k 2008-10-02 16:34:49 UTC
Created attachment 119799 [details] [review]
add demuxing from and muxing to matroska
Comment 14 ogg.k.ogg.k 2008-10-02 16:36:21 UTC
Created attachment 119800 [details] [review]
the one liner that allows oggmux to accept kate streams

the one liner that allows oggmux to accept kate streams, would be nice to get this in if possible as it's non intrusive
Comment 15 ogg.k.ogg.k 2008-12-14 20:01:08 UTC
Created attachment 124671 [details] [review]
update to latest CVS, and some improvements to the renderer
Comment 16 ogg.k.ogg.k 2008-12-14 20:02:19 UTC
Created attachment 124672 [details] [review]
update to latest CVS
Comment 17 ogg.k.ogg.k 2008-12-14 20:03:03 UTC
Created attachment 124673 [details] [review]
update to latest CVS
Comment 18 ogg.k.ogg.k 2009-01-03 23:05:09 UTC
Created attachment 125715 [details] [review]
Fix use of C99 (decl after stmt) that made this stop building - no functional change otherwise

just in case someone might have wanted to try applying it ^_^
Comment 19 ogg.k.ogg.k 2009-01-17 16:10:29 UTC
Created attachment 126650 [details] [review]
use (new ?) GST_ELEMENT_DETAILS, s/%d/%f/ in debug log, and now applies to latest HEAD
Comment 20 ogg.k.ogg.k 2009-02-15 19:30:04 UTC
Created attachment 128786 [details] [review]
as git patch, updated to latest head
Comment 21 ogg.k.ogg.k 2009-02-15 19:31:19 UTC
Created attachment 128787 [details] [review]
as git patch, update to latest head
Comment 22 ogg.k.ogg.k 2009-02-15 19:32:40 UTC
Created attachment 128788 [details] [review]
as git patch, updated to latest head
Comment 23 Tim-Philipp Müller 2009-03-01 15:45:56 UTC
Could you please let us know your real name? We'd like to know our copyright holders and be able to attribute non-trivial patches correctly.
Comment 24 ogg.k.ogg.k 2009-03-01 19:01:13 UTC
My name is Vincent Penquerc'h.
I'd rather be attributed as my pseudonym (general passive defense against
automated cross referencing of information), but if you have a preference
for real names, that's fine by me.
Comment 25 ogg.k.ogg.k 2009-03-07 12:55:06 UTC
Created attachment 130234 [details] [review]
Update to latest to keep it applying
Comment 26 ogg.k.ogg.k 2009-04-04 00:15:40 UTC
Hi,

has anyone had a chance to look at this recently ?
The GStreamer patch is essentially done, the last few iterations were
just tweaks and updates to keep the patch applying.

If there's anything that needs changing, answering, etc, please feel
free to ask.

Thanks
Comment 27 Tim-Philipp Müller 2009-05-12 11:58:04 UTC
Sorry this is taking so long. I was meaning to get this in before the freeze and have committed it locally, but didn't have a chance to look over it or ensure basic functionality before the freeze. Will get it in as soon as things get unfrozen though.
Comment 28 ogg.k.ogg.k 2009-05-17 10:52:55 UTC
Great, thanks. Any problem, let me know.
Also if you need varied test streams.
Comment 29 ogg.k.ogg.k 2009-06-30 11:32:06 UTC
Just for the avoidance of doubt: the patch hasn't been applying cleanly for
a while now, but I haven't posted an update since you said it was committed
locally - give me a shout if you'd rather get a patch that applies to the
current master.
Comment 30 Tim-Philipp Müller 2009-06-30 11:42:19 UTC
> Just for the avoidance of doubt: the patch hasn't been applying cleanly for
> a while now, but I haven't posted an update since you said it was committed
> locally - give me a shout if you'd rather get a patch that applies to the
> current master.

Sorry, I had it applied locally, but I lost that when my VM setup got wiped out a while back, so an updated patch set or a repo to pull from would be much appreciated. I'm hoping to find some time in the next two weeks to finally integrate this.
Comment 31 ogg.k.ogg.k 2009-06-30 12:11:21 UTC
Created attachment 137614 [details] [review]
against latest
Comment 32 ogg.k.ogg.k 2009-06-30 12:12:14 UTC
Created attachment 137615 [details] [review]
against latest
Comment 33 ogg.k.ogg.k 2009-06-30 12:13:33 UTC
Created attachment 137616 [details] [review]
against latest
Comment 34 ogg.k.ogg.k 2009-06-30 12:15:28 UTC
All patches now updated against latest master, tests still pass. Phew :)

Thanks
Comment 35 Tim-Philipp Müller 2009-07-10 11:53:42 UTC
Any reason you chose 'application/x-kate' as GStreamer media type, rather than e.g. subtitle/x-kate or somesuch? I think I'd prefer the latter.
Comment 36 ogg.k.ogg.k 2009-07-10 12:18:28 UTC
I thought these were MIME types, rather than GStreamer specific ?
application was chosen because it's semantically (mostly) text, but not
actual text, so text/x-kate was out.

As for subtitle/x-kate, generic handling by some element that would try
to use 'subtitle/*' wouldn't work due to the binary encoding, so there's
not much gain to this. Moreover, subtitles are just one possible use.
If this media type is GStreamer specific, then you could change it, but
I think it would create confusion with the MIME type as saved in, eg,
the Skeleton track by ffmpeg2theora.

Comment 37 Tim-Philipp Müller 2009-07-10 17:30:45 UTC
Another question: so the encoder accepts both text/markup and dvd-subpictures; any reason why the decoder only outputs text/markup and not also dvd subpictures? Can the dvdspu element not also be used to overlay dvd-subpicture streams stored in kate on top of video?
Comment 38 ogg.k.ogg.k 2009-07-10 17:45:44 UTC
It would be possible to do this, if code was added to convert images from
a Kate stream to the DVD subpicture format (the SPUs are not just dumped
as in in the stream, though the encoding used for SPU type images is also
RLE based). Since the renderer in this element handles all types of images
that may be found in a stream, I thought it unnecessary to have a decoder
convert back paletted images to SPUs. Would it gain much to also do it
this way ? (compatibility, speed ?)
Comment 39 Tim-Philipp Müller 2009-07-10 18:40:14 UTC
> It would be possible to do this, if code was added to convert images from
> a Kate stream to the DVD subpicture format (the SPUs are not just dumped
> as in in the stream, though the encoding used for SPU type images is also
> RLE based). Since the renderer in this element handles all types of images
> that may be found in a stream, I thought it unnecessary to have a decoder
> convert back paletted images to SPUs. Would it gain much to also do it
> this way ? (compatibility, speed ?)

Well, it seems a bit asymetrical as it is now. And I feel that one should be able to get to the subpicture data in some way (either as a fake kate bitmap format, for which one could have yet another decoder/transcoder that changes it into dvd format, or included in katedec) without overlaying it, e.g. for transcoding purposes.

Also, for playbin integration it would be much much easier if katedec outputted dvd-subpicture format for bitmaps. I think we want to avoid plugging all kinds of overlay elements, or rows of overlay elements, in playbin. Besides, it seems your overlay element only handles RGB at the moment, which isn't really ideal for the still most common case where the decoder outputs YUV which gets piped to xvimagesink, as far as I can tell.

(In the long run / for 0.11/1.0 we would probably want some sort of generic overlay format in gstreamer with one overlay element to rule them all; I think Jan might have started looking into that.)
Comment 40 ogg.k.ogg.k 2009-07-10 18:53:59 UTC
I will have a look at this then. It'll just ignore everything in the stream
apart from paletted images, but I suppose a fair number of streams would be
just these anyway.

Fake Kate bitmaps don't really sound like a good idea, PNG would be a better
match instead.

RGB is because Cairo doesn't do YUV, and rendering on top of subsampled YUV
often doesn't look very nice anyway.
Comment 41 Tim-Philipp Müller 2009-07-10 19:03:38 UTC
Ok, great. Do you expect that people will (or should?) create 'mixed type' streams, that is plain text or markup interleaved with bitmaps in the same kate stream?
Comment 42 ogg.k.ogg.k 2009-07-10 19:10:31 UTC
It is definitely possible, and encouraged.
Something which I was looking at is extraction from a PDF file, so slides from
a conference can be embedded at the correct times within a stream with the A/V
from the speaker. At the moment, it's all embedded as a large PNG image, but I
was hoping to do text/image extraction at some point, so that'd be a Kate stream
with text, images, and formatting (typically background+logo as images, and the
talking points as text).

Comment 43 Tim-Philipp Müller 2009-07-10 19:26:23 UTC
Right, in that case it'd be nice if there was some sort of 'purpose/use type' enum in the headers so we can skip these sort of streams and only present true subtitles/lyrics to the user (since I don't see us supporting stuff like this any time soon tbh; besides, I feel that things like slides should be presented as additional out-of-band info to the stream which players could show in addition in a separate window for example rather than have them overlayed, but that might just be me).
Comment 44 ogg.k.ogg.k 2009-07-10 19:37:44 UTC
The 'category' property from katedec is that 'purpose/use type' you need.
A list of well known category types is available at
wiki.xiph.org/index.php/OggText
In VLC, I fill the subtitles list menu with, for all streams:
<language> <category>
Category is a textual code, so may be translated in the user's language,
so for category 'LRC' and language 'de', you'd get:
German lyrics
for an English user.

As for the slides thing (category K-SLD-I, not in the well defined
list for now), I have them displaying on a second window in VLC (in
a local patch, it's unwieldy, and unfinished). Actual presentation
would be up to the client, but I'd imagine that if the stream is
enabled, new slides would go fullscreen for a few seconds when the
presenter switches to them, then zooming out back to a corner to
have them as a clickable zoom in/out icon would be a nice way to
do it, for a video player wanting to do presentations.

As a side note, if subtitles were also present, they'd typically be
in a separate stream, as text.

Comment 45 ogg.k.ogg.k 2009-07-11 07:53:41 UTC
Should I create a new bug with the x-dvd-subpicture when I get round to
doing it, or just post it here (several things queued up just now and
it's not a quick fix) ?
Comment 46 Tim-Philipp Müller 2009-07-11 19:27:48 UTC
> Should I create a new bug with the x-dvd-subpicture when I get round to
> doing it, or just post it here (several things queued up just now and
> it's not a quick fix) ?

Just file a new bug when it's ready (I'm trying to get the other stuff in before the freeze on Monday, but not making any promises, since I'm travelling at the moment).
Comment 47 ogg.k.ogg.k 2009-07-15 11:04:54 UTC
Decoding/reencoding to DVD SPU now in:
http://bugzilla.gnome.org/show_bug.cgi?id=588638
Comment 48 Tim-Philipp Müller 2009-07-19 23:02:40 UTC
Ok, here it goes:

commit 2f7ec508993fd8f8a5f3b343b5873ef09069154a
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 23:45:02 2009 +0100

    docs: add inspect info for kate plugin
    
    Should fix the docs build.

commit 4728d7f18eff48760ff2e753142b7313eaf552d1
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 23:35:05 2009 +0100

    kate: add some FIXMEs

commit faf2d0469691a0f357cf6a4c048cf774ddf5b990
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 23:32:07 2009 +0100

    katedec: demote to GST_RANK_NONE for now
    
    There are still some autoplugging issues to sort out, and it needs
    some testing.

commit 0d16612717860fff76a9c1889d47f7f5fe0fbf7c
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 23:29:19 2009 +0100

    checks: add kate unit tests to valgrind blacklist for now
    
    And add check binary to ignore list.

commit 3f347c7edd0796fb033bb58f15017f1f6c6c5ebe
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 23:16:07 2009 +0100

    kate: make sure to free some more stuff

commit 71efbb1e73a557d50093ccaf2ecc47009b7edd95
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Sun Jul 19 22:29:19 2009 +0100

    kate: fix up for additional subtitle/x-kate media type

commit 71e6bbd19fa1845dc07abc561b1ca5a71ae59d60
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Mon Jul 13 22:38:43 2009 +0100

    kate: remove local kate typefinder, use the one in -base

commit ce0d40b634a08aec047f8fd3fb059c1eb4480e1c
Author: Tim-Philipp Müller <tim.muller@collabora.co.uk>
Date:   Fri Jul 10 18:45:28 2009 +0100

    kate: change media type to subtitle/x-kate and update define accordingly

commit e88984ccbd4b2b7b5527cbc3ff488c5c85bb1e97
Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
Date:   Sun Feb 15 18:35:04 2009 +0000

    add new Kate plugin, for Kate overlay streams
    
    katedec: Kate decoder (text only)
    kateenc: Kate encoder (text and DVD SPU only)
    katetag: Kate tagger
    kateparse: Kate parser
    tiger: Kate renderer using the Tiger rendering library
    
    Fixes #525743.


I'm sure I've introduced an issue or two with the media type change (apologies in advance), but I don't think I'll find those any sooner by keeping the code on my harddrive. Also demoted the decoder to RANK_NONE for now until the subtitle/subpicture overlay stuff in playbin(2) is sorted out.

It'd be great if you could make the unit tests valgrind clean at some point (there seem to be a few minor mem leaks, and also a jump-depends-onuninitialised-memory issue in the test_kate_encode_spu test). I've also had the encode_spu test segfault once, but never managed to reproduce that again.

Btw, whenever you return GST_FLOW_ERROR, you should post some sort of error message on the bus, otherwise the user will just get to see a generic 'internal flow error' message from the source element or demuxer, and won't have the slightest idea where that comes from. Something like this should do the job:
  GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, (NULL), ("debug message"));


Thanks for the patches and your patience!
Comment 49 ogg.k.ogg.k 2009-07-20 09:30:14 UTC
Sorry, hadn't run on Valgrind for ages, I'll fix it asap. If you have a
sample that makes it crash (or not behave as it should), feel free to
send it (or a minimal subset) to me.
By the stuff in playbin, do you mean the dvdspu crash, or something else ?
Thanks for your time!
Comment 50 ogg.k.ogg.k 2009-07-20 10:47:15 UTC
Created attachment 138793 [details] [review]
this avoids using trashed memory when a DVD uses an invalid end time

This fixes the valgrind unitialized value report.
About leaks, however, I don't see any that seem to be mine, though in the
sea of spam it's hard to see. I'm using the supp file I found, and I'm
still getting imperial craploads of stuff from other places, so it makes
it hard to see anything. If you have a log which shows leaks, feel free
to send it to me.
Comment 51 ogg.k.ogg.k 2009-07-20 11:27:47 UTC
Created attachment 138805 [details] [review]
SUB is now the preferred subtitles category, use this too.
Comment 52 Tim-Philipp Müller 2009-07-20 12:38:42 UTC
Committed, thanks:

commit a7c64556ff25eae0ca3325dbbe166352b9b03006
Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
Date:   Mon Jul 20 12:25:15 2009 +0100

    kateenc: also recognise the new recommended 'SUB' category
    
    Move the check for 'simple' subtitles category to a separate routine
    and add in the new recommended SUB category (#525743).

commit 9db1323d310d0fdb0a1e41b5278fc0c3fc84641e
Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
Date:   Mon Jul 20 11:41:40 2009 +0100

    kateenc: keep bitmap/palette/region around when on the spot encoding is not possible due to an unknown end time
    
    Fixes valgrind unitialized value report. See #525743.
Comment 53 Tim-Philipp Müller 2009-07-20 12:39:44 UTC
Created attachment 138816 [details]
make elements/kate.valgrind log
Comment 54 ogg.k.ogg.k 2009-07-20 12:57:41 UTC
Spooky, I double check my log (done this morning), and I don't see these leaks.
Thanks, I'll check those.
Comment 55 ogg.k.ogg.k 2009-07-20 15:27:48 UTC
Created attachment 138826 [details] [review]
Fixes leaks found by Valgrind on elements/kate.c

Found the way to use Valgrind from within the build sytem, I was running
valgrind --leak-check=full --show-reachable=yes elements/kate,
which was giving me lots of extra spam (even with the supplied supp file)
and not the ones in the log above (lack of --trace-children=yes I suppose).
No leaks left in that test.
Comment 56 Tim-Philipp Müller 2009-07-20 22:47:16 UTC
Great, thanks!
 

Comment 57 ogg.k.ogg.k 2009-07-21 11:45:50 UTC
Created attachment 138902 [details] [review]
Moving/factoring stuff around with the recent SPU creation code caused me to introduce a bug in the time conversion macro

Without this, SPU subtitles would be encoded with zero duration.
Comment 58 ogg.k.ogg.k 2009-07-24 19:18:03 UTC
> Btw, whenever you return GST_FLOW_ERROR, you should post some sort of error
> message on the bus, otherwise the user will just get to see a generic 'internal
> flow error' message from the source element or demuxer, and won't have the
> slightest idea where that comes from. Something like this should do the job:
>   GST_ELEMENT_ERROR (encoder, STREAM, ENCODE, (NULL), ("debug message"));

I most often have a GST_OBJECT_WARNING at these places. Should
GST_ELEMENT_ERROR
replace those, or come in addition (eg, would logs be generated from calls to
GST_ELEMENT_ERROR to help in parsing log files ?)
Comment 59 Tim-Philipp Müller 2009-07-24 20:21:28 UTC
> I most often have a GST_OBJECT_WARNING at these places. Should
> GST_ELEMENT_ERROR
> replace those, or come in addition (eg, would logs be generated from calls to
> GST_ELEMENT_ERROR to help in parsing log files ?)

They should replace the GST_{WARNING|ERROR}_OBJECT. GST_ELEMENT_ERROR will log its own GST_WARNING_OBJECT messages (with the right file/line info, since it's a macro).
Comment 60 ogg.k.ogg.k 2009-07-24 20:58:07 UTC
Created attachment 139182 [details] [review]
Use GST_ELEMENT_ERROR as requested
Comment 61 Tim-Philipp Müller 2009-07-25 11:22:13 UTC
> Use GST_ELEMENT_ERROR as requested

Thanks! Committed with some changes (mostly just used (NULL) for the main error message and moved your untranslated strings into the debug message part of the error, since that's not really stuff we should show to the user); also changed one or two GST_FLOW_ERRORs into GST_FLOW_NOT_NEGOTIATED (where caps are missing or could not be set).

commit aaed93e1265959bb06c4759e68537788c9446681
Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
Date:   Fri Jul 24 21:54:59 2009 +0100

    kate: use GST_ELEMENT_ERROR for error reporting
    
    See #525743.
 

Comment 62 Tim-Philipp Müller 2009-08-08 11:58:57 UTC
Also committed this, with some minor changes (for the gstreamer media type change, but also leave the xiph3 header packing function as it is now to minimise risk of breakage two days before code freeze):

commit 19b7001bf99ea37a91af6061ca98e50b08064017
Author: Vincent Penquerc'h <ogg.k.ogg.k@googlemail.com>
Date:   Sun Feb 15 18:49:44 2009 +0000

    matroska: add kate subtitle support to matroska muxer and demuxer
    
    See #525743.