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 652694 - rtpvp8pay fails on error-resilient stream
rtpvp8pay fails on error-resilient stream
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-06-16 07:35 UTC by Oleksij Rempel
Modified: 2011-09-19 09:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtpvp8: fix bitstream parsing using the wrong kind of bitreader (13.87 KB, patch)
2011-09-10 10:41 UTC, Vincent Penquerc'h
needs-work Details | Review
rtpvp8: fix bitstream parsing using the wrong kind of bitreader (15.33 KB, patch)
2011-09-19 09:27 UTC, Vincent Penquerc'h
committed Details | Review

Description Oleksij Rempel 2011-06-16 07:35:32 UTC
Current rtpvp8pay fail on this pipe:
... ! vp8enc error-resilient=true ! rtpvp8pay ! ...

the reason is, this check in function gst_rtp_vp8_pay_parse_frame:
   if (header_size + (partitions - 1) * 3 >= GST_BUFFER_SIZE (buffer))
     goto error;

by stream with error-resilient=false, partitions=1, so result of this check is less then buffer_size. With error-resilient=true, usually partitions=4 (after partitions = 1 << tmp8), and the buffer size is too small.

I assume:
- vp8 should produce bigger buffer by samples with more then one partition.
- libvpx is brocken?
- rtpvp8pay should recalculate the buffer instead of fail.

Any other suggestions?

Regards,
  Alexey.
Comment 1 David Schleef 2011-06-17 09:02:49 UTC
Offhand, it's probably a mistake in rtpvp8pay.
Comment 2 Vincent Penquerc'h 2011-09-10 10:41:32 UTC
Created attachment 196169 [details] [review]
rtpvp8: fix bitstream parsing using the wrong kind of bitreader

VP8 uses a probabilistic bool coder, not a straight bit coder.
This fixes parsing when error-resilient is set.

This commit includes a copy of libvpx's bool coder, BSD licensed.
Comment 3 Vincent Penquerc'h 2011-09-10 10:43:09 UTC
(In reply to comment #1)
> Offhand, it's probably a mistake in rtpvp8pay.

It was. And it took me hours of reading the spec to find out where it was going out of sync before realizing it was on the lower layer :S
Comment 4 Sebastian Dröge (slomo) 2011-09-19 07:26:00 UTC
Review of attachment 196169 [details] [review]:

Looks good from a technical point of view but:

::: gst/rtpvp8/dboolhuff.c
@@ +3,3 @@
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source

You have to include the LICENSE file here somewhere or copy the license into the file headers

@@ +12,3 @@
+#include "dboolhuff.h"
+//#include "vpx_ports/mem.h"
+//#include "vpx_mem/vpx_mem.h"

No // comments, even if it's code copied from somewhere else. Also, add a README file here that says where the code comes from and from where it can be synced again, also including a diff of all changes you did

::: gst/rtpvp8/dboolhuff.h
@@ +17,3 @@
+//#include "vpx_ports/config.h"
+//#include "vpx_ports/mem.h"
+//#include "vpx/vpx_integer.h"

// comments again
Comment 5 Sebastian Dröge (slomo) 2011-09-19 07:26:19 UTC
Review of attachment 196169 [details] [review]:

Looks good from a technical point of view but:

::: gst/rtpvp8/dboolhuff.c
@@ +3,3 @@
+ *
+ *  Use of this source code is governed by a BSD-style license
+ *  that can be found in the LICENSE file in the root of the source

You have to include the LICENSE file here somewhere or copy the license into the file headers

@@ +12,3 @@
+#include "dboolhuff.h"
+//#include "vpx_ports/mem.h"
+//#include "vpx_mem/vpx_mem.h"

No // comments, even if it's code copied from somewhere else. Also, add a README file here that says where the code comes from and from where it can be synced again, also including a diff of all changes you did

::: gst/rtpvp8/dboolhuff.h
@@ +17,3 @@
+//#include "vpx_ports/config.h"
+//#include "vpx_ports/mem.h"
+//#include "vpx/vpx_integer.h"

// comments again
Comment 6 Vincent Penquerc'h 2011-09-19 09:27:30 UTC
Created attachment 196908 [details] [review]
rtpvp8: fix bitstream parsing using the wrong kind of bitreader

VP8 uses a probabilistic bool coder, not a straight bit coder.
This fixes parsing when error-resilient is set.

This commit includes a copy of libvpx's bool coder, BSD licensed.
Comment 7 Sebastian Dröge (slomo) 2011-09-19 09:34:30 UTC
commit 837500af07124c19fbad891a9edf57a38d15c025
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Sat Sep 10 11:31:20 2011 +0100

    rtpvp8: fix bitstream parsing using the wrong kind of bitreader
    
    VP8 uses a probabilistic bool coder, not a straight bit coder.
    This fixes parsing when error-resilient is set.
    
    This commit includes a copy of libvpx's bool coder, BSD licensed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=652694
Comment 8 Oleksij Rempel 2011-09-19 09:48:00 UTC
Thank you!