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 741501 - videopool: should update video alignment after change it
videopool: should update video alignment after change it
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.4.1
Other Linux
: Normal normal
: 1.5.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-12-14 10:14 UTC by kevin
Modified: 2014-12-22 14:44 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch to fix the issue. (1.07 KB, patch)
2014-12-15 01:42 UTC, kevin
accepted-commit_now Details | Review
updated patch for all place need update video alignment. (2.00 KB, patch)
2014-12-17 05:25 UTC, kevin
needs-work Details | Review
updata the patch to apply to latest master branch. (2.01 KB, patch)
2014-12-21 04:50 UTC, kevin
committed Details | Review

Description kevin 2014-12-14 10:14:37 UTC
Video buffer pool will update video alignment to respect stride alignment requirement. But haven't update it to video alignment in configure. Which will cause user get wrong video alignment.
Our use case need get the actual video alignment.
Will upload the patch later.
Comment 1 kevin 2014-12-15 01:42:47 UTC
Created attachment 292726 [details] [review]
patch to fix the issue.
Comment 2 Nicolas Dufresne (ndufresne) 2014-12-15 02:13:35 UTC
Review of attachment 292726 [details] [review]:

It seem rather harmless, but it is slightly against gst_buffer_pool_set_config() documentation that says that if your pool changes a parameter in the config it should return false. It's not really changing the alignment, this patch in fact replace the user selected alignment with the applied alignment. Would it be possible to explain in what situation it is required to read back the alignment from the buffer pool configuration ? This is important that we understand and document this behaviour. If we decide that the config shall be update with applied alignment, this patch should come with a V4l2 buffer pool update to be consitent (along with any pool I may have forgotten).
Comment 3 kevin 2014-12-15 04:30:09 UTC
Our hardware use physical address and has alignment requirement. The video buffer is allocator by one hardware and will used by another hardware. We can get physical address as we implement our allocator. But our hardware also need know the video padding to interpret the input video buffer. So we need know the actual video padding.
Comment 4 Nicolas Dufresne (ndufresne) 2014-12-16 14:23:01 UTC
Comment on attachment 292726 [details] [review]
patch to fix the issue.

If we can update the size, we can definitely update the alignment.
Comment 5 kevin 2014-12-17 05:25:49 UTC
Created attachment 292866 [details] [review]
updated patch for all place need update video alignment.
Comment 6 Nicolas Dufresne (ndufresne) 2014-12-19 19:08:51 UTC
Comment on attachment 292866 [details] [review]
updated patch for all place need update video alignment.

The patch does not apply with current master, would it be possible to resubmit ?
Comment 7 kevin 2014-12-21 04:50:39 UTC
Created attachment 293144 [details] [review]
updata the patch to apply to latest master branch.
Comment 8 Nicolas Dufresne (ndufresne) 2014-12-22 14:41:28 UTC
Comment on attachment 293144 [details] [review]
updata the patch to apply to latest master branch.

commit e9c6c833c958c8fa28bd9e6a779f16556d92dabe
Author: Song Bing <b06498@freescale.com>
Date:   Mon Dec 22 09:25:04 2014 -0500

    videopool: update video alignment after applying
    
    Video buffer pool will update video alignment to respect stride alignment
    requirement. But haven't updated it to video alignment in configure.
    Which will cause user get wrong video alignment.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=741501
Comment 9 Nicolas Dufresne (ndufresne) 2014-12-22 14:44:35 UTC
Thanks for your patch. Still, be careful when using this in your code. The only trustful alignment check is the one you do an allocated buffer stride and size. Any other check using this information should only be used as a hint to make smarter decisions. Ignoring this comment will make your code unsafe.