Commit graph

58 commits

Author SHA1 Message Date
Gwenole Beauchesne
6136ebe5e2 vaapisink: improve check for raw YUV format mode.
Improve check for raw YUV format modes by avoiding checks against strings
("video/x-raw-yuv") for each new GstBuffer allocation. In the usual case,
GstBaseSink::set_caps() is called first and if VA surface format mode is
used, then GstBaseSink::buffer_alloc() is not called. If the latter is
called before set_caps(), then we just make a full check. This one is
pretty rare though, e.g. it usually happens once for custom pipelines.
2013-04-03 15:58:57 +02:00
Gwenole Beauchesne
578f788650 plugins: fix usage of gst_vaapi_reply_to_query().
Make gst_vaapi_reply_to_query() first check whether the query argument
is actually a video-context query, i.e. with type GST_QUERY_TYPE_CUSTOM.
Then, make sure vaapisink propagates the query to the parent class if
it is not a video-context query.
2013-03-26 18:57:00 +01:00
Gwenole Beauchesne
140fa66be3 plugins: integrate GstVaapiVideoMeta from libgstvaapi.
Move GstVaapiVideoMeta from core libgstvaapi decoding library to the
actual plugin elements. That's only useful there. Also inline reference
counting code from GstVaapiMiniObject.
2013-03-26 10:33:27 +01:00
Gwenole Beauchesne
95b865968c plugins: use common helper function to apply compositions.
Use common gst_vaapi_apply_composition() helper function to apply compositions
attached to a buffer in vaapisink or GstVaapiVideoConverterGLX.
2013-03-21 18:16:14 +01:00
Gwenole Beauchesne
9e1da76971 vaapisink: add helper function to apply a composition buffer.
Simplify application of a composition buffer to a GstVaapiSurface, and
all its peers, until that function is eventually promoted to libgstvaapi.
2013-03-20 19:22:24 +01:00
Gwenole Beauchesne
6ce6712ed5 vaapisink: fix support for raw YUV buffers.
If the raw YUV buffer was created from vaapisink, through the buffer_alloc()
hook, then it will have a valid GstVaapiVideoMeta object attached to it.
However, we previously assumed in that case that it was a "native" VA buffer,
thus not calling into GstVaapiUploader::process().
2013-03-20 19:21:02 +01:00
Gwenole Beauchesne
2dcc9f19da plugins: use modern GstElement metadata information.
Use gst_element_class_set_static_metadata() from GStreamer 1.0, which
basically is the same as gst_element_class_set_details_simple() in
GStreamer 0.10 context.
2013-03-20 18:43:35 +01:00
Gwenole Beauchesne
7fd648b8b0 plugins: move up interfaces (cosmetics).
Move GstImplementsInterface and GstVideoContext support functions up
so that to keep a clear separation between the plugin element and its
interface hooks.
2013-03-20 18:35:01 +01:00
Gwenole Beauchesne
13c5d3244b plugins: upgrade to newer APIs (GstVideoInfo based helpers).
Use GstVideoInfo and gst_video_info_from_caps() helper wherever possible.
Also use the newly added gst_vaapi_image_format_from_structure() helper
in GstVaapiUploader::ensure_allowed_caps().
2013-03-20 18:35:01 +01:00
Gwenole Beauchesne
0c99f351fc legal: fix year for some copyright notices (2013). 2013-01-29 14:37:02 +01:00
Gwenole Beauchesne
a00ae0918a plugins: cope with new GstVaapiVideoMeta API.
Update plugin elements with the new GstVaapiVideoMeta API.

This also fixes support for subpictures/overlay because GstVideoDecoder
generates a sub-buffer from the GstVaapiVideoBuffer. So, that sub-buffer
is marked as read-only. However, when comes in the textoverlay element
for example, it checks whether the input buffer is writable. Since that
buffer read-only, then a new GstBuffer is created. Since gst_buffer_copy()
does not preserve the parent field, the generated buffer in textoverlay
is not exploitable because we lost all VA specific information.

Now, with GstVaapiVideoMeta information attached to a standard GstBuffer,
all information are preserved through gst_buffer_copy() since the latter
does copy metadata (qdata in this case).
2013-01-05 18:02:31 +01:00
Gwenole Beauchesne
d19c59ba31 vaapisink: handle sub video-buffers.
Intermediate elements may produce a sub-buffer from a valid GstVaapiVideoBuffer
for non raw YUV cases. Make sure vaapisink now understands those buffers.
2012-12-18 15:31:51 +01:00
Gwenole Beauchesne
d4a4a49168 vaapisink: compute and expose the supported set of YUV caps.
Make vaapisink expose only the set of supported caps for raw YUV buffers.

Add gst_vaapi_uploader_get_caps() helper function to determine the set
of supported YUV caps as source (for images). This function actually
tries to zero and upload each image to a 64x64 test surface. Of course,
this relies on VA drivers to not claim success if vaPutImage() is not
correctly supported.
2012-11-20 16:04:51 +01:00
Gwenole Beauchesne
499e0dd981 vaapisink: add support for raw YUV buffers.
Add new GstVaapiUploader helper to upload raw YUV buffers to VA surfaces.
It is up to the caller to negotiate source caps (for images) and output
caps (for surfaces). gst_vaapi_uploader_has_direct_rendering() is available
to help decide between the creation of a GstVaapiVideoBuffer or a regular
GstBuffer on sink pads.

Signed-off-by: Zhao Halley <halley.zhao@intel.com>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-11-20 16:04:51 +01:00
Gwenole Beauchesne
e6047734b3 plugins: include "sysdeps.h" instead of "config.h". 2012-09-12 13:41:47 +02:00
Gwenole Beauchesne
a8624d6a79 plugins: fix build in strict ISO C mode. 2012-09-07 16:11:12 +02:00
Gwenole Beauchesne
de2a18012d vaapisink: fix calculation of window size.
If either dimension is out-of-bounds, then scale window to fit the
display size, even if the output is to be rotated. Use the standard
gst_video_sink_center_rect() function to center and scale the window
wrt. the outer (display) bounds.
2012-09-06 13:44:42 +02:00
Wind Yuan
c8f2358479 vaapisink: add video rotation support.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-09-06 13:44:42 +02:00
Gwenole Beauchesne
4a1127dd7c vaapisink: drop obsolete GstVaapiVideoSink interface.
This interface was deprecated since 0.3.x series when the GstVideoContext
interface was added to the main GStreamer APIs.
2012-08-29 13:20:17 +02:00
Gwenole Beauchesne
0ef393c6af vaapisink: automatically detect overlay rendering mode.
Retain the VA surface until another surface is to be displayed only
if VA display rendering mode is determined to be "overlay" mode.
2012-08-29 12:05:03 +02:00
Gwenole Beauchesne
e36fb69ef9 vaapisink: retain VA surface until another one is displayed.
Keep VA surface proxy associated with the surface that is currently
being displayed. This makes sure that surface is not released back
to the pool of surfaces free to use for decoding. This is necessary
with VA driver implementations that support rendering to an overlay
pipe. Otherwise, there could be cases where we are decoding into a
surface that is being displayed, hence some flickering.
2012-08-29 12:05:00 +02:00
Gwenole Beauchesne
dfff02689c vaapisink: handle VA/DRM API.
This is not useful in practice but for raw performance evaluation when
the sink is invoked with display=drm sync=false. fakesink could also be
used though.
2012-08-01 16:40:17 +02:00
Gwenole Beauchesne
4401ada22a wayland: implement display ::get_size*() hooks. 2012-07-27 14:35:48 +02:00
Gwenole Beauchesne
0bf1e761f9 Fix build without X11. 2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
9e00c87367 plugins: add support for Wayland. 2012-07-25 15:31:42 +02:00
Gwenole Beauchesne
cff117b54d plugins: fix display type selection and propagation.
If vaapisink is in the GStreamer pipeline, then we shall allocate a
unique GstVaapiDisplay and propagate it upstream. i.e. subsequent
queries from vaapidecode shall get a valid answer from vaapisink.
2012-07-25 14:52:05 +02:00
Gwenole Beauchesne
437bc925f6 display: add display types.
Move display types from gstvaapipluginutil.* to gstvaapidisplay.* so that
we could simplify characterization of a GstVaapiDisplay. Also rename "auto"
type to "any", and add a "display-type" attribute.
2012-07-25 14:37:11 +02:00
Gwenole Beauchesne
753a56e9a1 pluginutils: improve automatic display type selection. 2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
8f132b7936 configure: drop check for --enable-vaapisink-glx.
vaapisink is now built with support for multiple display types, whenever
they are enabled. The new "display" attribute is used to select a particular
renderer.
2012-07-24 15:57:57 +02:00
Gwenole Beauchesne
bcae632c32 vaapisink: drop checks for new APIs used by default.
GStreamer -base plugins >= 0.10.31 are now required, so the checks for
new APIs like GstXOverlay::set_window_handle() and ::set_render_rectangle()
are no longer necessary.
2012-07-20 14:11:42 +02:00
Javier Jardón
5ff0837b32 plugins: use g_clear_object() wherever applicable.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 15:19:17 +02:00
Javier Jardón
2594aadb0e plugins: use G_DEFINE_TYPE_* instead of deprecated GST_BOILERPLATE_*.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 11:25:15 +02:00
Javier Jardón
187c503870 plugins: do not use deprecated GStreamer -base symbols.
Bump GStreamer plugins -base required version to 0.10.31, needed for
gst_x_overlay_got_window_handle().

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 11:25:15 +02:00
Javier Jardón
90d82ab7e1 plugins: do not use deprecated core GStreamer symbols.
Bump GStreamer required version to 0.10.14, needed for
gst_element_class_set_details_simple().

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-07-19 10:56:56 +02:00
Holger Kaelberer
bd08610e07 vaapisink: don't resize a 'foreign' X-window.
Don't forcibly resize foreign X windows. The user is responsible for
their size and vaapisink shall not change this.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-02 13:33:55 +02:00
Holger Kaelberer
c37c9ca6cf vaapisink: recalculate render rect only if caps are negotiated.
Fix gst_vaapisink_xoverlay_set_window_handle() when it is called before
caps got negotiated. Besides, when a foreign window is provided by the
user, so should the render rect.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-04-02 13:33:13 +02:00
Gwenole Beauchesne
a5144358d1 videobuffer: add surface render flags.
Allow rendering flags, as a combination of GstVaapiSurfaceRenderFlags,
to be set to the video buffer. In particular, this is mostly useful for
basic deinterlacing.
2012-03-26 12:01:36 +02:00
Gwenole Beauchesne
f64bafea59 plugins: fix pad template ref leaks. 2012-02-05 18:24:08 +01:00
Gwenole Beauchesne
990fe81fe2 vaapisink: cap window size to the maximum display size. 2012-01-24 10:15:47 +01:00
Gwenole Beauchesne
92f11799d1 legal: fix year for some copyright notices. 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
0385750fa7 vaapisink: ensure VA display in GstBaseSink::start() hook.
This ensures a VA display is ready by the time upstream elements request
for it.
2012-01-12 16:09:08 +01:00
Nicolas Dufresne
c432e82e44 vaapisink: don't leak GL texture.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2012-01-12 16:09:08 +01:00
Gwenole Beauchesne
8866a7c223 vaapisink: fix calculation of render region. 2012-01-11 09:38:57 +01:00
Gwenole Beauchesne
b1aee91aa0 vaapisink: automatically fit video to window. 2012-01-11 09:38:56 +01:00
Gwenole Beauchesne
3ca1d0820c vaapisink: implement GstXOverlay::set_render_rectangle(). 2012-01-11 09:38:56 +01:00
Gwenole Beauchesne
ac7c4cfe78 surface: apply composition to the parent context, if requested. 2011-12-14 14:40:37 +01:00
Gwenole Beauchesne
9c8c33857f Fix warnings. 2011-12-13 15:59:02 +01:00
Gwenole Beauchesne
a4244820af Rename gst_vaapi_surface_update_composition() to
gst_vaapi_surface_set_subpictures_from_composition().
2011-12-13 15:51:58 +01:00
Thibault Saunier
e4d7e90568 vaapisink: handle GstVideoOverlayComposition planes.
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
2011-12-12 18:38:51 +01:00