2010-05-12 07:57:55 +00:00
|
|
|
/*
|
2011-11-04 20:50:15 +00:00
|
|
|
* gstvaapipluginutil.h - VA-API plugins private helper
|
2010-05-12 07:57:55 +00:00
|
|
|
*
|
2013-11-22 05:37:12 +00:00
|
|
|
* Copyright (C) 2011-2013 Intel Corporation
|
2013-11-22 04:57:18 +00:00
|
|
|
* Author: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
|
2011-11-04 20:50:15 +00:00
|
|
|
* Copyright (C) 2011 Collabora
|
|
|
|
* Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk>
|
2010-05-12 07:57:55 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2.1
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
* Boston, MA 02110-1301 USA
|
|
|
|
*/
|
|
|
|
|
2012-07-23 15:49:08 +00:00
|
|
|
#ifndef GST_VAAPI_PLUGIN_UTIL_H
|
|
|
|
#define GST_VAAPI_PLUGIN_UTIL_H
|
|
|
|
|
2010-05-12 07:57:55 +00:00
|
|
|
#include <gst/vaapi/gstvaapidisplay.h>
|
2013-03-21 15:32:43 +00:00
|
|
|
#include <gst/vaapi/gstvaapisurface.h>
|
2014-01-14 18:08:36 +00:00
|
|
|
#if GST_CHECK_VERSION(1,0,0)
|
|
|
|
#include "gstvaapivideomemory.h"
|
|
|
|
#endif
|
2010-05-12 07:57:55 +00:00
|
|
|
|
2012-07-24 14:14:51 +00:00
|
|
|
G_GNUC_INTERNAL
|
2012-07-23 16:01:26 +00:00
|
|
|
gboolean
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_vaapi_ensure_display (gpointer element, GstVaapiDisplayType type);
|
2012-07-23 16:01:26 +00:00
|
|
|
|
2012-07-24 14:14:51 +00:00
|
|
|
G_GNUC_INTERNAL
|
2012-07-23 16:01:26 +00:00
|
|
|
void
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_vaapi_set_display (const gchar * type,
|
|
|
|
const GValue * value, GstVaapiDisplay ** display_ptr);
|
2012-07-23 16:01:26 +00:00
|
|
|
|
2012-07-24 14:14:51 +00:00
|
|
|
G_GNUC_INTERNAL
|
2012-07-23 16:01:26 +00:00
|
|
|
gboolean
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_vaapi_reply_to_query (GstQuery * query, GstVaapiDisplay * display);
|
2012-01-05 10:00:39 +00:00
|
|
|
|
2012-07-24 14:14:51 +00:00
|
|
|
G_GNUC_INTERNAL
|
2012-01-05 10:00:39 +00:00
|
|
|
gboolean
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_vaapi_append_surface_caps (GstCaps * out_caps, GstCaps * in_caps);
|
2012-07-23 15:49:08 +00:00
|
|
|
|
2013-03-21 15:32:43 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_vaapi_apply_composition (GstVaapiSurface * surface, GstBuffer * buffer);
|
2013-03-21 15:32:43 +00:00
|
|
|
|
2012-09-06 09:47:40 +00:00
|
|
|
#ifndef G_PRIMITIVE_SWAP
|
|
|
|
#define G_PRIMITIVE_SWAP(type, a, b) do { \
|
|
|
|
const type t = a; a = b; b = t; \
|
|
|
|
} while (0)
|
|
|
|
#endif
|
|
|
|
|
2013-12-21 05:41:34 +00:00
|
|
|
/* Helpers for GValue construction for video formats */
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
|
|
|
gst_vaapi_value_set_format (GValue * value, GstVideoFormat format);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
|
|
|
gst_vaapi_value_set_format_list (GValue * value, GArray * formats);
|
|
|
|
|
2013-12-21 09:41:22 +00:00
|
|
|
/* Helpers to build video caps */
|
2014-01-14 18:08:36 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GST_VAAPI_CAPS_FEATURE_SYSTEM_MEMORY = 1,
|
|
|
|
GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META,
|
|
|
|
GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE,
|
|
|
|
} GstVaapiCapsFeature;
|
|
|
|
|
2013-12-21 09:41:22 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
GstCaps *
|
|
|
|
gst_vaapi_video_format_new_template_caps (GstVideoFormat format);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
GstCaps *
|
|
|
|
gst_vaapi_video_format_new_template_caps_from_list (GArray * formats);
|
|
|
|
|
2014-01-14 18:08:36 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
GstCaps *
|
|
|
|
gst_vaapi_video_format_new_template_caps_with_features (GstVideoFormat format,
|
|
|
|
const gchar * features_string);
|
|
|
|
|
|
|
|
G_GNUC_INTERNAL
|
|
|
|
GstVaapiCapsFeature
|
|
|
|
gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat format);
|
|
|
|
|
2013-04-17 08:18:45 +00:00
|
|
|
/* Helpers to handle interlaced contents */
|
|
|
|
#if GST_CHECK_VERSION(1,0,0)
|
|
|
|
# define GST_CAPS_INTERLACED_MODES \
|
2013-10-04 14:00:56 +00:00
|
|
|
"interlace-mode = (string){ progressive, interleaved, mixed }"
|
2013-04-17 08:18:45 +00:00
|
|
|
# define GST_CAPS_INTERLACED_FALSE \
|
|
|
|
"interlace-mode = (string)progressive"
|
|
|
|
#else
|
|
|
|
# define GST_CAPS_INTERLACED_MODES \
|
|
|
|
"interlaced = (boolean){ true, false }"
|
|
|
|
# define GST_CAPS_INTERLACED_FALSE \
|
|
|
|
"interlaced = (boolean)false"
|
|
|
|
#endif
|
|
|
|
|
2013-10-04 17:30:36 +00:00
|
|
|
G_GNUC_INTERNAL
|
|
|
|
gboolean
|
2013-12-21 05:22:30 +00:00
|
|
|
gst_caps_set_interlaced (GstCaps * caps, GstVideoInfo * vip);
|
2013-10-04 17:30:36 +00:00
|
|
|
|
2012-07-23 15:49:08 +00:00
|
|
|
#endif /* GST_VAAPI_PLUGIN_UTIL_H */
|