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 710855 - ivfparse: Port to 1.0
ivfparse: Port to 1.0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-10-25 06:40 UTC by Zhao, Halley
Modified: 2014-04-25 12:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-ivfparse-port-to-1.x-api.patch (6.47 KB, patch)
2013-10-25 06:41 UTC, Zhao, Halley
needs-work Details | Review
0002-configure-build-ivfparse-after-1.x-proting.patch (733 bytes, patch)
2013-10-25 06:44 UTC, Zhao, Halley
reviewed Details | Review
0001-ivfparse-port-to-1.x-api (7.42 KB, patch)
2013-11-11 06:29 UTC, Zhao, Halley
needs-work Details | Review
0002-configure-build-ivfparse-after-1.x-porting (733 bytes, patch)
2013-11-11 06:30 UTC, Zhao, Halley
committed Details | Review
ivfparse: port to baseparse (15.53 KB, patch)
2014-03-18 19:13 UTC, Gwenole Beauchesne
committed Details | Review

Description Zhao, Halley 2013-10-25 06:40:57 UTC
ivfparse can't build for gst 1.x api, port it.
Comment 1 Zhao, Halley 2013-10-25 06:41:51 UTC
Created attachment 258081 [details] [review]
0001-ivfparse-port-to-1.x-api.patch
Comment 2 Zhao, Halley 2013-10-25 06:44:31 UTC
Created attachment 258082 [details] [review]
0002-configure-build-ivfparse-after-1.x-proting.patch
Comment 3 Sebastian Dröge (slomo) 2013-10-30 17:57:02 UTC
Review of attachment 258081 [details] [review]:

::: gst/ivfparse/gstivfparse.c
@@ +219,3 @@
+        segment.start = 0;
+        segment.stop = -1;
+        segment.position = 0;

These are the default values of the segment after gst_segment_init()

@@ +220,3 @@
+        segment.stop = -1;
+        segment.position = 0;
+        gst_pad_push_event (ivf->srcpad, gst_event_new_segment (&segment));

Additionally you will need to implement a event function on the sinkpad and drop the segment event received there
Comment 4 Sebastian Dröge (slomo) 2013-10-30 17:59:10 UTC
Comment on attachment 258082 [details] [review]
0002-configure-build-ivfparse-after-1.x-proting.patch

typo: proting should be porting
Comment 5 Zhao, Halley 2013-11-11 06:29:41 UTC
Created attachment 259522 [details] [review]
0001-ivfparse-port-to-1.x-api
Comment 6 Zhao, Halley 2013-11-11 06:30:07 UTC
Created attachment 259523 [details] [review]
0002-configure-build-ivfparse-after-1.x-porting
Comment 7 Zhao, Halley 2013-11-11 06:31:17 UTC
thanks slomo, updated patches attached.
Comment 8 Sebastian Dröge (slomo) 2013-11-11 17:16:27 UTC
Review of attachment 259522 [details] [review]:

::: gst/ivfparse/gstivfparse.c
@@ +219,3 @@
 
+        gst_segment_init (&segment, GST_FORMAT_TIME);
+        gst_pad_push_event (ivf->srcpad, gst_event_new_segment (&segment));

You first need to send a stream-start event, then the caps event, then the segment event. You don't send a stream-start even currently.

@@ +234,3 @@
+        guint8 data[12];
+
+        gst_adapter_copy (ivf->adapter, data, 0, 12);

Why do you here use copy/flush, and above use take_bytes?
Comment 9 Zhao, Halley 2013-11-12 09:48:16 UTC
could you point me a link on how to deal with these gst event? I know few about it. thanks

i use gst_adapter_copy/flush, because the 12 bytes is flushed only after the adapter has the complete frame. otherwise it does nothing.
Comment 10 Olivier Crête 2013-12-06 00:31:47 UTC
This should be ported to GstBaseParse
Comment 11 Gwenole Beauchesne 2014-03-18 19:13:06 UTC
Created attachment 272319 [details] [review]
ivfparse: port to baseparse

This patch adds support for the new GstBaseParse APIs to the IVF video parser. Tested ivfparse ! { vp8dec, vaapidecode }, no difference in conformance testing and additional streams.

Except that, in both cases, 03-segmentation-1436 and 03-segmentation-1425 fail because resolutions changes are not supported yet. Though, this is not a parser problem since the format is pretty simple and doesn't allow for that anyway. i.e. this is a decoder side bug.
Comment 12 Gwenole Beauchesne 2014-03-18 19:20:45 UTC
Sorry, I had tried to keep most of the original code and structure, but the resulting patch doesn't look so nice. You could locally apply and git show -w instead to ease reading. :)
Comment 13 Gwenole Beauchesne 2014-04-10 23:33:11 UTC
Ping. If nobody objects, I will push this one with the codecparsers change. I have been using that with no issue so far. wrt. resolution change, this is no longer an issue from vaapidecode point of view since it now handles that case. However, from a video parser POV, is it usual to track resolution changes and propagate this to src pad GstCaps? If so, I will write a subsequent patch that uses the new VP8 codecparsers. Thanks.
Comment 14 Tim-Philipp Müller 2014-04-10 23:50:38 UTC
> wrt. resolution change, this is no longer an issue from vaapidecode point of
> view since it now handles that case. However, from a video parser POV, is
> it usual to track resolution changes and propagate this to src pad GstCaps?

Yes it is, but it's not really a blocker for pushing the initial patch IMHO.
Comment 15 Gwenole Beauchesne 2014-04-18 16:37:40 UTC
commit abadffd4d848860ff19d4545502fc85f473a5a46
Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Date:   Fri Apr 18 18:12:36 2014 +0200

    ivfparse: detect and propagate resolution changes.
    
    Detect resolution changes on key frames, and propagate the resulting
    caps to the src pad. Only the uncompressed data chunk is decoded, so
    avoid using the new VP8 bitstream parsing library for now.
    
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>

commit 3b308cba3c6e5bfe2dbfc1a1f83640b44a27e5f9
Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Date:   Fri Apr 18 17:34:08 2014 +0200

    ivfparse: avoid possible division-by-zero when calculating PTS.
    
    Avoid possible division-by-zero while deriving the presentation timestamp
    of the buffer. The base class will take care of any interpolation needs.
    
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>

commit 4cf290074fd000ed882f1c263ab834df8472651e
Author: Halley Zhao <halley.zhao@intel.com>
Date:   Fri Oct 25 07:38:53 2013 +0800

    ivfparse: enable build.
    
    Drop `ivfparse' element from the non-ported set of plugins in configure.

commit 3d0ce67fcd886cf6e03f4f123d7da64491b96a8d
Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Date:   Tue Mar 4 15:46:58 2014 +0100

    ivfparse: port to baseparse.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=710855
    
    Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
Comment 16 Gwenole Beauchesne 2014-04-18 16:39:31 UTC
I have pushed the patch to git master branch. I would like to backport to 1.2 series. OK?

It should be enough to cherry-pick everything as I finally did not use the VP8 bitstream parser. i.e. only the uncompressed data chunk was needed, so I manually parsed the necessary bits from there. When VP8 parser meta are available, we could use the codecparser in ivfparse then.
Comment 17 Tim-Philipp Müller 2014-04-25 12:56:52 UTC
Yes, feel free to cherry pick the port into 1.2, either as one single merged commit or multiple commits.