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 577784 - Implement full H.263/+/++ caps negotiation according to RFC4629
Implement full H.263/+/++ caps negotiation according to RFC4629
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal normal
: 0.10.31
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-04-02 22:54 UTC by Olivier Crête
Modified: 2012-07-06 07:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
good-0001: Set H263-2000 if thats what the other side wants (1.70 KB, patch)
2009-04-02 22:55 UTC, Olivier Crête
committed Details | Review
good-002: rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes (9.57 KB, patch)
2009-04-02 22:56 UTC, Olivier Crête
none Details | Review
good-0003: rtph263ppay: Also implement size/framerate restrictions in getcaps (7.50 KB, patch)
2009-04-02 22:57 UTC, Olivier Crête
none Details | Review
ffmpeg-0001: gstffmpegcfg: Expose loop-filter flag (954 bytes, patch)
2009-04-02 22:57 UTC, Olivier Crête
committed Details | Review
ffmpeg-0002: codecmap: Respect the various h263 options (2.10 KB, patch)
2009-04-02 22:58 UTC, Olivier Crête
committed Details | Review
ffmpeg-0003: gstffmpegenc: Make getcaps proxy the downstream height/width/framerate requirements (3.81 KB, patch)
2009-04-02 22:58 UTC, Olivier Crête
committed Details | Review
openmax-0001: Allow videoenc subclass to act on setcaps (1.29 KB, patch)
2009-04-02 23:01 UTC, Olivier Crête
none Details | Review
openmax-0002: omx_h263enc: Implement sink getcaps (11.80 KB, patch)
2009-04-02 23:01 UTC, Olivier Crête
none Details | Review
openmax-0003: omx_h263enc: Implement setcaps (5.34 KB, patch)
2009-04-02 23:01 UTC, Olivier Crête
none Details | Review
openmax-0003: omx_h263enc: Implement setcaps (updated) (5.34 KB, patch)
2009-05-28 23:05 UTC, Olivier Crête
none Details | Review
rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes (9.83 KB, patch)
2010-04-19 17:17 UTC, Olivier Crête
none Details | Review
good-0002: rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes (9.95 KB, patch)
2011-03-03 23:22 UTC, Olivier Crête
committed Details | Review
good-0003: rtph263ppay: Also implement size/framerate restrictions in getcaps (7.62 KB, patch)
2011-03-03 23:23 UTC, Olivier Crête
committed Details | Review
rtph263ppay: Return the sink pad template as sink caps, not the src's (983 bytes, patch)
2011-11-02 16:59 UTC, Olivier Crête
committed Details | Review

Description Olivier Crête 2009-04-02 22:54:54 UTC
RFC 4629 specifies that the various annexes should be used when encoding only when recommended. It also specifies ways to set the maximum frame size and frame rates.

The patches are in three series, against the rtp payloader, gst-ffmpeg and gst-openmax.

The ffmpeg patches must be applied before the size/framerate restriction patch is added to the rtp payloader, otherwise there may be a caps negotiation failure. So what suggest is apply all the patches now except for the size/restriction patch on the payloader and only apply it after the next gst-ffmpeg release.
Comment 1 Olivier Crête 2009-04-02 22:55:53 UTC
Created attachment 131946 [details] [review]
good-0001: Set H263-2000 if thats what the other side wants

The static caps states this element supports H263-2000, but setcaps never
sets it, so it was lie.
Comment 2 Olivier Crête 2009-04-02 22:56:25 UTC
Created attachment 131947 [details] [review]
good-002: rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes
Comment 3 Olivier Crête 2009-04-02 22:57:09 UTC
Created attachment 131948 [details] [review]
good-0003: rtph263ppay: Also implement size/framerate restrictions in getcaps

This one should come after the ffmpeg/openmax patches have been merged and released.
Comment 4 Olivier Crête 2009-04-02 22:57:41 UTC
Created attachment 131949 [details] [review]
ffmpeg-0001: gstffmpegcfg: Expose loop-filter flag
Comment 5 Olivier Crête 2009-04-02 22:58:04 UTC
Created attachment 131950 [details] [review]
ffmpeg-0002: codecmap: Respect the various h263 options
Comment 6 Olivier Crête 2009-04-02 22:58:44 UTC
Created attachment 131951 [details] [review]
ffmpeg-0003: gstffmpegenc: Make getcaps proxy the downstream height/width/framerate requirements
Comment 7 Olivier Crête 2009-04-02 23:01:13 UTC
Created attachment 131952 [details] [review]
openmax-0001: Allow videoenc subclass to act on setcaps
Comment 8 Olivier Crête 2009-04-02 23:01:30 UTC
Created attachment 131953 [details] [review]
openmax-0002: omx_h263enc: Implement sink getcaps
Comment 9 Olivier Crête 2009-04-02 23:01:53 UTC
Created attachment 131954 [details] [review]
openmax-0003: omx_h263enc: Implement setcaps
Comment 10 Jan Schmidt 2009-04-03 11:06:36 UTC
Normally it's better if it continues to work with older versions of course, but I can't immediately see a way to avoid the problem here - you want the payloader to only accept restricted formats for the appropriate levels, so the encoders need to first be taught how to accept those.

I don't think it'll be a problem for anyone in practice - presumably if they were configuring those levels in the past, they were already arranging for the encode to produce a compatible sized video.
Comment 11 Felipe Contreras (banned) 2009-04-15 12:34:15 UTC
Nice!

For the omx part however, you are not checking the return value of the GetParameter for OMX_IndexParamVideoProfileLevelQuerySupported. If the omxil implementation doesn't support that query you'll get strange results.
Comment 12 Olivier Crête 2009-05-21 19:50:52 UTC
Any chance to merge the ffmpeg part before the next freeze ?
Comment 13 Olivier Crête 2009-05-28 23:05:25 UTC
Created attachment 135531 [details] [review]
openmax-0003: omx_h263enc: Implement setcaps (updated)

I updated the openmax patch to fix the problem pointed out by Felipe.
Comment 14 Mark Nauwelaerts 2010-04-19 12:08:43 UTC
(In reply to comment #2)
> Created an attachment (id=131947) [details] [review]
> good-002: rtph263ppay: Implement getcaps following RFC 4629, picks the right
> annexes

>+static GstCaps *
>+gst_rtp_h263p_pay_sink_getcaps (GstBaseRTPPayload * payload, GstPad * pad)
>+{
>+  GstRtpH263PPay *rtph263ppay;
>+  GstCaps *caps = gst_caps_new_empty ();
>+  GstCaps *peercaps = NULL;
>+  GstCaps *intersect = NULL;
>+  guint i;
>+
>+  rtph263ppay = GST_RTP_H263P_PAY (payload);
>+
>+  peercaps = gst_pad_peer_get_caps (GST_BASE_RTP_PAYLOAD_SRCPAD (payload));
>+  if (!peercaps)
>+    return NULL;

If I read core right, it would go g_critical when getting NULL from a getcaps function, so this might have to be template caps instead (or whatever is tried to express here).
Comment 15 Olivier Crête 2010-04-19 17:17:34 UTC
Created attachment 159091 [details] [review]
rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes
Comment 16 Olivier Crête 2010-04-19 17:18:45 UTC
Comment on attachment 131947 [details] [review]
good-002: rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes

Oops, not sure what I was thinking, updated patch attached
Comment 17 Mark Nauwelaerts 2010-04-20 09:32:30 UTC
Btw, this seems like a good time to apply the gst-ffmpeg patches, and then the rtp -good patches following impending release ... ?
Comment 18 Mark Nauwelaerts 2010-05-10 13:58:15 UTC
commit 21e855d167489a61aa2e8751d7b169ceccc6943e
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Thu Mar 5 19:12:18 2009 -0500

    gstffmpegcfg: Expose loop-filter flag

    See #577784.

commit 2b891aff61f30b4f12b597bb1ae325368903a22b
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Thu Mar 5 21:35:46 2009 -0500

    codecmap: Respect the various h263 options

    See #577784.

commit 83820511a8be7af645df8d2ed0289df6d44e0bdd
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Fri Mar 6 13:47:05 2009 -0500

    gstffmpegenc: Make getcaps proxy the downstream height/width/framerate requirements

    See #577784.
Comment 19 Mark Nauwelaerts 2010-12-06 10:26:29 UTC
Assuming these patches are still relevant and up-to-date (?), now seems like a good to apply those for the rtppayloader in -good ...
Comment 20 Olivier Crête 2011-03-03 23:22:53 UTC
Created attachment 182419 [details] [review]
good-0002: rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes
Comment 21 Olivier Crête 2011-03-03 23:23:37 UTC
Created attachment 182420 [details] [review]
good-0003: rtph263ppay: Also implement size/framerate restrictions in getcaps

Updated patches to build with newest git
Comment 22 Sebastian Dröge (slomo) 2011-05-20 06:04:38 UTC
So what's missing here now? Can the patches get committed?
Comment 23 Olivier Crête 2011-07-13 23:58:13 UTC
I guess they should be
Comment 24 Mark Nauwelaerts 2011-09-05 11:03:11 UTC
As good a time as any to (finally) push these, so:

commit d4778dbe4341ddc13c1ce9214ae21a2e15cba25d
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Wed Mar 4 14:51:09 2009 -0500

    rtph263ppay: Set H263-2000 if thats what the other side wants
    
    The static caps states this element supports H263-2000, but setcaps never
    sets it, so it was lie.
    
    See https://bugzilla.gnome.org/show_bug.cgi?id=577784


However, noticed something in the good-0002 patch:

+  peercaps = gst_pad_peer_get_caps (GST_BASE_RTP_PAYLOAD_SRCPAD (payload));
+  if (!peercaps)
+    return
+        gst_caps_copy (gst_pad_get_pad_template_caps
+        (GST_BASE_RTP_PAYLOAD_SRCPAD (payload)));

Should that not use the template caps of _SINKPAD (in a sink getcaps function) rather than of the SRCPAD ?
Comment 25 Vincent Penquerc'h 2011-11-01 11:56:07 UTC
Setting to NEEDINFO for Mark's question in comment 24.
Comment 26 Olivier Crête 2011-11-02 16:59:47 UTC
Created attachment 200526 [details] [review]
rtph263ppay: Return the sink pad template as sink caps, not the src's
Comment 27 Olivier Crête 2011-11-02 17:00:16 UTC
Mark: you're entirely right.. attached a fixed patch.
Comment 28 Mark Nauwelaerts 2011-11-08 14:56:36 UTC
OK, so finally these ...

commit e15c293f13429f3d4894f332db5026cbf1fd77e7
Author: Olivier Crête <olivier.crete@collabora.com>
Date:   Wed Nov 2 12:58:12 2011 -0400

    rtph263ppay: Return the sink pad template as sink caps, not the src's
    
    https://bugzilla.gnome.org/show_bug.cgi?id=577784

commit 4b28d9d44e1b332aa7dc9ceddb484ca11f4ab221
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Sun Mar 15 19:26:48 2009 -0400

    rtph263ppay: Also implement size/framerate restrictions in getcaps
    
    https://bugzilla.gnome.org/show_bug.cgi?id=577784

commit ff31090671a18900e5266d3d4a8a6995f0b4e208
Author: Olivier Crête <olivier.crete@collabora.co.uk>
Date:   Wed Mar 4 20:50:19 2009 -0500

    rtph263ppay: Implement getcaps following RFC 4629, picks the right annexes
    
    https://bugzilla.gnome.org/show_bug.cgi?id=577784
Comment 29 Olivier Crête 2012-07-05 17:00:05 UTC
I guess gst-openmax is not being maintained, closing this.
Comment 30 Tim-Philipp Müller 2012-07-06 07:49:31 UTC
> I guess gst-openmax is not being maintained, closing this.

You should probably file an issue against gst-openmax then, if you want Felipe to see the patches. Or just push them.

Or better: port them to gst-omx ;)