Commit graph

43 commits

Author SHA1 Message Date
Víctor Manuel Jáquez Leal
0e16691b09 libs: videopool: remove unneeded code
The removed code comes frome the bad practice of copy&paste. Better
move it as internal function.

https://bugzilla.gnome.org/show_bug.cgi?id=797139
2018-09-25 17:41:55 +02:00
Sreerenj Balachandran
d5542fa8c0 FEI: libs: Add fei codec objects to surface proxy
Add fei codec objects to surface proxy since handling the
fei buffers(codec objects here) external to gstvaapisurfaceproxy
will make the code complicated. Especially considering the behavior
of encoder where the input frame order from upstream and output
frame order to the downstream are not sequential.

Other contributors:
              Zhong, Xiaoxia <xiaoxia.zhong@intel.com>
              xiaominc <xiaomin.chen@intel.com>
              Leilei <leilei.shang@intel.com>
              Li, Jing B <jing.b.li@intel.com>

https://bugzilla.gnome.org/show_bug.cgi?id=785712
https://bugzilla.gnome.org/show_bug.cgi?id=784667
2017-09-01 11:32:24 +02:00
Víctor Manuel Jáquez Leal
b1f6da98de libs: fix code style for errors 2016-11-03 12:51:44 +01:00
Gwenole Beauchesne
568a62ae1e surfaceproxy: add helper to create a wrapped surface object.
Add new gst_vaapi_surface_proxy_new() helper to wrap a surface into
a proxy. The main use case for that is to convey additional information
at the proxy level that would not be suitable to the plain surface.
2015-01-27 18:11:44 +01:00
Gwenole Beauchesne
1810a41c68 surfaceproxy: re-indent all GstVaapiSurfaceProxy related source code. 2015-01-27 18:11:44 +01:00
Gwenole Beauchesne
97d7f21575 surfaceproxy: fix copy to propagate view_id.
Fix gst_vaapi_surface_proxy_copy() to copy the view-id element, thus
fixing random frames skipped when vaapipostproc element is used in
passthrough mode. In that mode, GstMemory is copied, thus including
the underlying GstVaapiVideoMeta and associated GstVaapiSurfaceProxy.
2014-08-22 15:54:31 +02:00
Gwenole Beauchesne
702de9ad2f decoder: propagate MVC metadata ("view-id", head of multiview set).
Add new GstVaapiSurfaceProxy flag FFB, which means "first frame in
bundle", and really expresses the first view component of a multi
view coded frame. e.g. in H.264 MVC, the surface proxy has flag FFB
set if VOIdx = 0.

Likewise, new API is exposed to retrieve the associated "view-id".
2014-06-30 19:13:25 +02:00
Gwenole Beauchesne
6bf3c1863c legal: update copyright notice dates. 2014-01-22 19:02:35 +01:00
Wind Yuan
0e8afe1c22 decoder: fix crash on invalid pointer for GST_DEBUG().
When decoding failed, or that the frame was dropped, the associated
surface proxy is not guaranteed to be present. Thus, the GST_DEBUG()
message needs to check whether the proxy is actually present or not.

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

[fixed gst_vaapi_surface_proxy_get_surface_id() to return VA_INVALID_ID]
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2014-01-22 18:30:26 +01:00
Gwenole Beauchesne
5e245ae2c2 surfaceproxy: add copy function.
Add gst_vaapi_surface_proxy_copy() function that creates a new surface
proxy with the same information from the parent proxy, except that the
user-defined destroy notify function is not copied over.

The underlying VA surface is pushed back to the video pool only when
the last reference to the parent surface proxy is released.
2013-11-28 17:32:18 +01:00
Gwenole Beauchesne
c516311a1a legal: update copyright notice dates. 2013-11-22 06:39:20 +01:00
Gwenole Beauchesne
15519ebe3d legal: add per-file authorship information.
Credit original authors on a per-file basis as we cannot expect people
to know all country-specific rules, or bother browsing through the git
history.
2013-11-22 06:39:15 +01:00
Gwenole Beauchesne
a1189301c9 libs: fix GstVaapiSurfaceProxy destroy notify call site.
The user-defined destroy notify function is meant to be called only when
the surface proxy was fully released, i.e. once it actually released the
VA surface back to the underlying pool.
2013-11-21 11:08:23 +01:00
XuGuangxin
f9d0d6e272 libs: robustify decoder objects and surface proxy initialization.
Fix GstVaapiPicture, GstVaapiSlice and GstVaapiSurfaceProxy initialization
sequences to have the expected default values set beforehand in case of an
error raising up further during creation. i.e. make it possible to cleanly
destroy those partially initialized objects.

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

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-11-21 11:08:23 +01:00
Gwenole Beauchesne
eb00f6d101 surfaceproxy: allow for NULL cropping rectangle.
Make it possible associate an empty cropping rectangle to the surface
proxy, thus resetting any cropping rectangle that was previously set.
This allows for returning plain NULL when no cropping rectangle was
initially set up to the surface proxy, or if it was reset to defaults.
2013-07-08 18:52:56 +02:00
Gwenole Beauchesne
99dfd44f33 surface: add simple surface info accessors as helper macros.
Add helper macros to retrieve the VA surface information like size
(width, height) or chroma type. This is a micro-optimization to avoid
useless function calls and NULL pointer re-checks in internal routines.
2013-07-08 18:52:56 +02:00
Sreerenj Balachandran
e66e72e7e3 decoder: add support for video cropping.
Add gst_vaapi_picture_set_crop_rect() helper function to copy the video
cropping information from raw bitstreams to each picture being decoded.
Also add helper function to surface proxy to propagate that information
outside of libgstvaapi. e.g. plug-in elements or standalone applications.

Signed-off-by: Sreerenj Balachandran <sreerenj.balachandran@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2013-07-08 18:52:56 +02:00
Gwenole Beauchesne
67eea92044 libs: drop GST_VAAPI_IS_xxx() helper macros.
Drop obsolete GST_VAAPI_IS_xxx() helper macros since we are no longer
deriving from GObject and so those were only checking for whether the
argument was NULL or not. This is now irrelevant, and even confusing
to some extent, because we no longer have type checking.

Note: this incurs more type checking (review) but the libgstvaapi is
rather small, so this is manageable.
2013-05-23 18:15:48 +02:00
Gwenole Beauchesne
c2abeb1290 libs: simplify GstVaapiID definitions.
Make GstVaapiID a gsize instead of guessing an underlying integer large
enough to hold all bits of a pointer. Also drop GST_VAAPI_ID_NONE since
this is plain zero and that it is no longer passed as varargs.
2013-05-07 18:19:03 +02:00
Gwenole Beauchesne
2e6ff64a34 libs: use GstVaapiMiniObject for video object pools.
Port GstVaapiVideoPool, GstVaapiSurfacePool and GstVaapiImagePool to
GstVaapiMiniObject. Drop gst_vaapi_video_pool_get_caps() since it was
no longer used for a long time. Make object allocators static, i.e.
local to the shared library.
2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
6c46179709 libs: use GstVaapiObject for VA objects. 2013-05-07 17:51:27 +02:00
Gwenole Beauchesne
c7dff071c7 surfaceproxy: add more attributes for raw decoding modes.
Add more attributes for raw decoding modes, i.e. directly through the
libgstvaapi helper library. In particular, add presentation timestamp,
duration and a couple of flags (interlaced, TFF, RFF, one-field).
2013-04-16 19:07:24 +02:00
Gwenole Beauchesne
0bd929dfa2 surfaceproxy: drop user-data support from GstVaapiSurfaceProxy.
Drop user-data support from GstVaapiSurfaceProxy. Rather make it explicit
to call some user-provided function when the surface proxy is released.
2013-04-16 18:54:37 +02:00
Gwenole Beauchesne
e65726de8d decoder: drop obsolete functions.
Drop the following functions that are now obsolete:
- gst_vaapi_context_get_surface()
- gst_vaapi_context_put_surface()
- gst_vaapi_context_find_surface_by_id()
- gst_vaapi_surface_proxy_new()
- gst_vaapi_surface_proxy_get_context()
- gst_vaapi_surface_proxy_set_context()
- gst_vaapi_surface_proxy_set_surface()

This is an API change.
2013-04-03 13:34:59 +02:00
Gwenole Beauchesne
e22a863084 decoder: simplify acquisition/release of spare surface.
Introduce gst_vaapi_surface_proxy_new_from_pool() to allocate a new surface
proxy from the context surface pool. This change also makes sure to retain
the parent surface pool in the proxy.

Besides, it was also totally useless to attach/detach parent context to
VA surface each time we acquire/release it. Since the whole context owns
all associated VA surfaces, we can mark this as such only once and for all.
2013-04-03 13:34:59 +02:00
Gwenole Beauchesne
9dcf082002 surfaceproxy: minor clean-ups. 2012-12-18 15:31:52 +01:00
Gwenole Beauchesne
51d028a628 surfaceproxy: drop accessors to obsolete attributes.
Make GstVaapiSurfaceProxy only a thin wrapper around a VA context and a
VA surface. i.e. drop any other attribute like timestamp, duration,
interlaced or top-field-first.
2012-12-18 15:31:52 +01:00
Gwenole Beauchesne
1130a46837 surfaceproxy: port to GstVaapiMiniObject.
GstVaapiSurfaceProxy does not use any particular functionality from
GObject. Actually, it only needs a basic object type with reference
counting.

This is an API and ABI change.
2012-12-18 15:31:50 +01:00
Gwenole Beauchesne
e4d27fba6b surfaceproxy: add "duration" property. 2012-09-11 17:08:47 +02:00
Gwenole Beauchesne
61cc02f54b libs: fix build in strict ISO C mode. 2012-09-07 16:23:42 +02:00
Javier Jardón
30024b3f8e libs: use g_clear_object() wherever applicable.
This is a preferred thread-safe version. Also add an inline version of
g_clear_object() if compiling with glib < 2.28.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Gwenole Beauchesne
b98d334dce vaapipostproc: get "interlaced" attribute from surface proxy.
Add new "interlaced" attribute to GstVaapiSurfaceProxy. Use this in
vaapipostproc so that to handles cases where bitstream is interlaced
but almost only frame pictures are generated. In this case, we should
not be alternating between top/bottom fields.
2012-03-28 17:59:19 +02:00
Holger Kaelberer
8593fb619c surfaceproxy: add TFF property.
Add TFF (top-field-first) property to GstVaapiSurfaceProxy.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-03-19 18:43:06 +01:00
Gwenole Beauchesne
0fb1147d9c Add header for system-dependent definitions. 2012-01-30 19:52:10 +01:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
1594d99d55 legal: add Intel copyright on modified files. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
14cc1cf061 legal: fix copyright notices to include "Copyright" term. 2012-01-16 11:40:51 +01:00
Gwenole Beauchesne
4e72aa587c surfaceproxy: add helper to retrieve the VA surface ID. 2012-01-05 17:35:43 +01:00
Gwenole Beauchesne
40f44ab60e surfaceproxy: simplify destruction.
Also make sure to always make sure to release the surface back to the
pool of surfaces in the associated VA context, if any.
2012-01-05 17:35:37 +01:00
Gwenole Beauchesne
1701ce3107 Update copyright notice. 2011-06-14 13:54:07 +02:00
Gwenole Beauchesne
b614ec9c9b Fix licensing terms. 2011-06-14 13:54:03 +02:00
gb
a14711b935 Add timestamps to GstVaapiSurfaceProxy. 2010-09-20 12:55:41 +02:00
gb
5fb146c298 Add surface proxy that holds a reference to the parent surface
and that returns the surface to that context on destruction.
2010-04-23 16:00:50 +00:00