[Bug 793413] msdk: manage mfxFrameSurfaces seperately with other surfacepool.

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Mar 7 10:39:25 UTC 2018


https://bugzilla.gnome.org/show_bug.cgi?id=793413

Hyunjun Ko <zzoon at igalia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #368614|reviewed                    |none
             status|                            |
 Attachment #368614|0                           |1
        is obsolete|                            |
 Attachment #368615|0                           |1
        is obsolete|                            |
 Attachment #369316|0                           |1
        is obsolete|                            |

--- Comment #22 from Hyunjun Ko <zzoon at igalia.com> ---
Created attachment 369401
  --> https://bugzilla.gnome.org/attachment.cgi?id=369401&action=edit
msdk: manage MSDK surfaces seperately

Currently a gst buffer has one mfxFrameSurface when it's allocated and can't be
changed.
This is based on that the life of gst buffer and mfxFrameSurface would be same.
But it's not true. Sometimes even if a gst buffer of a frame is finished on
downstream,
mfxFramesurface coupled with the gst buffer is still locked, which means it's
still being used in the driver.

So this patch does this.
Every time a gst buffer is acquired from the pool, it confirms if the surface
coupled with the buffer is unlocked.
If not, replace it with new unlocked one.
In this way, user(decoder or encoder) doesn't need to manage gst buffers
including locked surface.

To do that, this patch includes the following:

1. GstMsdkContext
- Manages MSDK surfaces available, used, locked respectively as the following:
  1\ surfaces_avail : surfaces which are free and unused anywhere
  2\ surfaces_used : surfaces coupled with a gst buffer and being used now.
  3\ surfaces_locked : surfaces still locked even after the gst buffer is
released.

- Provide an api to get MSDK surface available.
- Provide an api to release MSDK surface.

2. GstMsdkVideoMemory
- Gets a surface available when it's allocated.
- Provide an api to get an available surface with new unlocked one.
- Provide an api to release surface in the msdk video memory.

3. GstMsdkBufferPool
- In acquire_buffer, every time a gst buffer is acquired, get new available
surface from the list.
- In release_buffer, it confirms if the buffer's surface is unlocked or not.
  - If unlocked, it is put to the available list.
  - If still locked, it is put to the locked list.

This also fixes bug #793525.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list