gstreamer/sys
Hyunjun Ko b08b8ddae3 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.

https://bugzilla.gnome.org/show_bug.cgi?id=793413
https://bugzilla.gnome.org/show_bug.cgi?id=793525
2018-03-08 11:37:12 -09:00
..
acmenc Fix up package name and origin in some plugins 2017-05-18 10:58:20 +01:00
acmmp3dec Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
androidmedia ahc: enable autofocus callback 2018-01-26 10:13:00 +00:00
applemedia applemedia: don't include private cocoa gl header 2017-12-19 21:35:31 +00:00
bluez Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
d3dvideosink Request minimum buffer even if need_pool is FALSE 2017-09-06 14:19:37 -04:00
decklink decklink: Fix array of devices usage 2018-02-14 16:00:34 +01:00
directsound wasapi: Increase rank to prefer over directsoundsrc 2018-03-01 15:33:18 +05:30
dshowdecwrapper Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
dshowsrcwrapper dshowsrcwrapper: fix DirectShow caps negotiation and set capture pin caps 2016-04-23 15:21:44 +01:00
dshowvideosink bad: use new gst_element_class_add_static_pad_template() 2016-03-24 14:56:51 +02:00
dvb dvb: Fix previous commit 2017-11-23 08:14:06 +01:00
fbdev Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
ipcpipeline ipcpipeline: Don't leak structure 2017-11-23 08:09:36 +01:00
kms kmssink: Make render rectangle property controllable 2018-01-30 10:02:14 +00:00
msdk msdk: manage MSDK surfaces seperately 2018-03-08 11:37:12 -09:00
nvdec gl: update plugins to use GstGL from -base 2017-12-19 12:02:31 +00:00
nvenc nvenc: add "gop-size" property 2018-01-24 10:39:40 +00:00
opensles Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
shm shmsink: Block in preroll_wait on unlock 2017-12-19 17:41:43 -05:00
tinyalsa Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
uvch264 uvch264src: Check return values of all xu_query calls 2017-11-24 08:06:52 +01:00
vcd Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
vdpau Fix up package name and origin in some plugins 2017-05-18 10:58:20 +01:00
wasapi wasapi: Increase rank to prefer over directsoundsrc 2018-03-01 15:33:18 +05:30
winks sys: Convert source files to UTF-8 2017-08-16 13:05:05 +01:00
winscreencap Remove plugin specific static build option 2017-05-16 14:05:52 -04:00
Makefile.am ipcpipeline: move to sys/ and make it dependent on platform support for unix sockets 2017-08-02 10:40:24 +03:00
meson.build ipcpipeline: move to sys/ and make it dependent on platform support for unix sockets 2017-08-02 10:40:24 +03:00