├── .gitignore ├── .gitlab-ci.yml ├── AUTHORS ├── COPYING.LIB ├── ChangeLog ├── NEWS ├── README ├── RELEASE ├── docs ├── gst_plugins_cache.json ├── index.md ├── meson.build └── sitemap.txt ├── gst-libs ├── gst │ ├── meson.build │ └── vaapi │ │ ├── egl_compat.h │ │ ├── egl_vtable.h │ │ ├── gstvaapiblend.c │ │ ├── gstvaapiblend.h │ │ ├── gstvaapibufferproxy.c │ │ ├── gstvaapibufferproxy.h │ │ ├── gstvaapibufferproxy_priv.h │ │ ├── gstvaapicodec_objects.c │ │ ├── gstvaapicodec_objects.h │ │ ├── gstvaapicodedbuffer.c │ │ ├── gstvaapicodedbuffer.h │ │ ├── gstvaapicodedbuffer_priv.h │ │ ├── gstvaapicodedbufferpool.c │ │ ├── gstvaapicodedbufferpool.h │ │ ├── gstvaapicodedbufferproxy.c │ │ ├── gstvaapicodedbufferproxy.h │ │ ├── gstvaapicodedbufferproxy_priv.h │ │ ├── gstvaapicompat.h │ │ ├── gstvaapicontext.c │ │ ├── gstvaapicontext.h │ │ ├── gstvaapidebug.h │ │ ├── gstvaapidecoder.c │ │ ├── gstvaapidecoder.h │ │ ├── gstvaapidecoder_av1.c │ │ ├── gstvaapidecoder_av1.h │ │ ├── gstvaapidecoder_dpb.c │ │ ├── gstvaapidecoder_dpb.h │ │ ├── gstvaapidecoder_h264.c │ │ ├── gstvaapidecoder_h264.h │ │ ├── gstvaapidecoder_h265.c │ │ ├── gstvaapidecoder_h265.h │ │ ├── gstvaapidecoder_jpeg.c │ │ ├── gstvaapidecoder_jpeg.h │ │ ├── gstvaapidecoder_mpeg2.c │ │ ├── gstvaapidecoder_mpeg2.h │ │ ├── gstvaapidecoder_mpeg4.c │ │ ├── gstvaapidecoder_mpeg4.h │ │ ├── gstvaapidecoder_objects.c │ │ ├── gstvaapidecoder_objects.h │ │ ├── gstvaapidecoder_priv.h │ │ ├── gstvaapidecoder_unit.c │ │ ├── gstvaapidecoder_unit.h │ │ ├── gstvaapidecoder_vc1.c │ │ ├── gstvaapidecoder_vc1.h │ │ ├── gstvaapidecoder_vp8.c │ │ ├── gstvaapidecoder_vp8.h │ │ ├── gstvaapidecoder_vp9.c │ │ ├── gstvaapidecoder_vp9.h │ │ ├── gstvaapidisplay.c │ │ ├── gstvaapidisplay.h │ │ ├── gstvaapidisplay_drm.c │ │ ├── gstvaapidisplay_drm.h │ │ ├── gstvaapidisplay_drm_priv.h │ │ ├── gstvaapidisplay_egl.c │ │ ├── gstvaapidisplay_egl.h │ │ ├── gstvaapidisplay_egl_priv.h │ │ ├── gstvaapidisplay_glx.c │ │ ├── gstvaapidisplay_glx.h │ │ ├── gstvaapidisplay_glx_priv.h │ │ ├── gstvaapidisplay_priv.h │ │ ├── gstvaapidisplay_wayland.c │ │ ├── gstvaapidisplay_wayland.h │ │ ├── gstvaapidisplay_wayland_priv.h │ │ ├── gstvaapidisplay_x11.c │ │ ├── gstvaapidisplay_x11.h │ │ ├── gstvaapidisplay_x11_priv.h │ │ ├── gstvaapiencoder.c │ │ ├── gstvaapiencoder.h │ │ ├── gstvaapiencoder_h264.c │ │ ├── gstvaapiencoder_h264.h │ │ ├── gstvaapiencoder_h265.c │ │ ├── gstvaapiencoder_h265.h │ │ ├── gstvaapiencoder_jpeg.c │ │ ├── gstvaapiencoder_jpeg.h │ │ ├── gstvaapiencoder_mpeg2.c │ │ ├── gstvaapiencoder_mpeg2.h │ │ ├── gstvaapiencoder_mpeg2_priv.h │ │ ├── gstvaapiencoder_objects.c │ │ ├── gstvaapiencoder_objects.h │ │ ├── gstvaapiencoder_priv.h │ │ ├── gstvaapiencoder_vp8.c │ │ ├── gstvaapiencoder_vp8.h │ │ ├── gstvaapiencoder_vp9.c │ │ ├── gstvaapiencoder_vp9.h │ │ ├── gstvaapifilter.c │ │ ├── gstvaapifilter.h │ │ ├── gstvaapiimage.c │ │ ├── gstvaapiimage.h │ │ ├── gstvaapiimage_priv.h │ │ ├── gstvaapiimagepool.c │ │ ├── gstvaapiimagepool.h │ │ ├── gstvaapiminiobject.c │ │ ├── gstvaapiminiobject.h │ │ ├── gstvaapiparser_frame.c │ │ ├── gstvaapiparser_frame.h │ │ ├── gstvaapiprofile.c │ │ ├── gstvaapiprofile.h │ │ ├── gstvaapiprofilecaps.c │ │ ├── gstvaapiprofilecaps.h │ │ ├── gstvaapisubpicture.c │ │ ├── gstvaapisubpicture.h │ │ ├── gstvaapisurface.c │ │ ├── gstvaapisurface.h │ │ ├── gstvaapisurface_drm.c │ │ ├── gstvaapisurface_drm.h │ │ ├── gstvaapisurface_egl.c │ │ ├── gstvaapisurface_egl.h │ │ ├── gstvaapisurface_priv.h │ │ ├── gstvaapisurfacepool.c │ │ ├── gstvaapisurfacepool.h │ │ ├── gstvaapisurfaceproxy.c │ │ ├── gstvaapisurfaceproxy.h │ │ ├── gstvaapisurfaceproxy_priv.h │ │ ├── gstvaapitexture.c │ │ ├── gstvaapitexture.h │ │ ├── gstvaapitexture_egl.c │ │ ├── gstvaapitexture_egl.h │ │ ├── gstvaapitexture_glx.c │ │ ├── gstvaapitexture_glx.h │ │ ├── gstvaapitexture_priv.h │ │ ├── gstvaapitexturemap.c │ │ ├── gstvaapitexturemap.h │ │ ├── gstvaapitypes.h │ │ ├── gstvaapiutils.c │ │ ├── gstvaapiutils.h │ │ ├── gstvaapiutils_core.c │ │ ├── gstvaapiutils_core.h │ │ ├── gstvaapiutils_egl.c │ │ ├── gstvaapiutils_egl.h │ │ ├── gstvaapiutils_glx.c │ │ ├── gstvaapiutils_glx.h │ │ ├── gstvaapiutils_h264.c │ │ ├── gstvaapiutils_h264.h │ │ ├── gstvaapiutils_h264_priv.h │ │ ├── gstvaapiutils_h265.c │ │ ├── gstvaapiutils_h265.h │ │ ├── gstvaapiutils_h265_priv.h │ │ ├── gstvaapiutils_h26x.c │ │ ├── gstvaapiutils_h26x_priv.h │ │ ├── gstvaapiutils_mpeg2.c │ │ ├── gstvaapiutils_mpeg2.h │ │ ├── gstvaapiutils_mpeg2_priv.h │ │ ├── gstvaapiutils_vpx.c │ │ ├── gstvaapiutils_vpx.h │ │ ├── gstvaapiutils_x11.c │ │ ├── gstvaapiutils_x11.h │ │ ├── gstvaapivalue.c │ │ ├── gstvaapivalue.h │ │ ├── gstvaapivideopool.c │ │ ├── gstvaapivideopool.h │ │ ├── gstvaapivideopool_priv.h │ │ ├── gstvaapiwindow.c │ │ ├── gstvaapiwindow.h │ │ ├── gstvaapiwindow_drm.c │ │ ├── gstvaapiwindow_drm.h │ │ ├── gstvaapiwindow_egl.c │ │ ├── gstvaapiwindow_egl.h │ │ ├── gstvaapiwindow_glx.c │ │ ├── gstvaapiwindow_glx.h │ │ ├── gstvaapiwindow_priv.h │ │ ├── gstvaapiwindow_wayland.c │ │ ├── gstvaapiwindow_wayland.h │ │ ├── gstvaapiwindow_x11.c │ │ ├── gstvaapiwindow_x11.h │ │ ├── gstvaapiwindow_x11_priv.h │ │ ├── gstvaapiworkarounds.h │ │ ├── meson.build │ │ ├── ogl_compat.h │ │ ├── sysdeps.h │ │ ├── video-format.c │ │ └── video-format.h └── meson.build ├── gst ├── meson.build └── vaapi │ ├── gstcompat.h │ ├── gstvaapi.c │ ├── gstvaapi.h │ ├── gstvaapidecode.c │ ├── gstvaapidecode.h │ ├── gstvaapidecode_props.c │ ├── gstvaapidecode_props.h │ ├── gstvaapidecodebin.c │ ├── gstvaapidecodebin.h │ ├── gstvaapidecodedoc.c │ ├── gstvaapiencode.c │ ├── gstvaapiencode.h │ ├── gstvaapiencode_h264.c │ ├── gstvaapiencode_h264.h │ ├── gstvaapiencode_h265.c │ ├── gstvaapiencode_h265.h │ ├── gstvaapiencode_jpeg.c │ ├── gstvaapiencode_jpeg.h │ ├── gstvaapiencode_mpeg2.c │ ├── gstvaapiencode_mpeg2.h │ ├── gstvaapiencode_vp8.c │ ├── gstvaapiencode_vp8.h │ ├── gstvaapiencode_vp9.c │ ├── gstvaapiencode_vp9.h │ ├── gstvaapioverlay.c │ ├── gstvaapioverlay.h │ ├── gstvaapipluginbase.c │ ├── gstvaapipluginbase.h │ ├── gstvaapipluginutil.c │ ├── gstvaapipluginutil.h │ ├── gstvaapipostproc.c │ ├── gstvaapipostproc.h │ ├── gstvaapipostprocutil.c │ ├── gstvaapipostprocutil.h │ ├── gstvaapisink.c │ ├── gstvaapisink.h │ ├── gstvaapivideobuffer.c │ ├── gstvaapivideobuffer.h │ ├── gstvaapivideobufferpool.c │ ├── gstvaapivideobufferpool.h │ ├── gstvaapivideocontext.c │ ├── gstvaapivideocontext.h │ ├── gstvaapivideomemory.c │ ├── gstvaapivideomemory.h │ ├── gstvaapivideometa.c │ ├── gstvaapivideometa.h │ ├── gstvaapivideometa_texture.c │ ├── gstvaapivideometa_texture.h │ └── meson.build ├── gstreamer-vaapi.doap ├── hooks └── pre-commit.hook ├── meson.build ├── meson_options.txt ├── scripts └── extract-release-date-from-doap-file.py └── tests ├── check ├── elements │ ├── vaapioverlay.c │ └── vaapipostproc.c └── meson.build ├── examples ├── meson.build ├── test-roi.c ├── test-vaapicontext.c ├── test-vaapipostproc.c └── test-vaapisink.c ├── internal ├── codec.c ├── codec.h ├── decoder.c ├── decoder.h ├── image.c ├── image.h ├── meson.build ├── output.c ├── output.h ├── simple-decoder.c ├── simple-encoder.c ├── test-decode.c ├── test-decode.h ├── test-display.c ├── test-filter.c ├── test-h264.c ├── test-h264.h ├── test-jpeg.c ├── test-jpeg.h ├── test-mpeg2.c ├── test-mpeg2.h ├── test-mpeg4.c ├── test-mpeg4.h ├── test-subpicture-data.c ├── test-subpicture-data.h ├── test-subpicture.c ├── test-surfaces.c ├── test-textures.c ├── test-vc1.c ├── test-vc1.h ├── test-windows.c ├── y4mreader.c └── y4mreader.h └── meson.build /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | include: "https://gitlab.freedesktop.org/gstreamer/gst-ci/raw/master/gitlab/ci_template.yml" 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Maintainers: 2 | 3 | Gwenole Beauchesne - Lead developer 4 | Sreerenj Balachandran - Lead developer 5 | Halley Zhao - MPEG-4:2 decoder 6 | 7 | This project is maintained by Intel Corporation. 8 | 9 | Contributors (sorted by first name): 10 | 11 | Adrian Cox 12 | Alban Browaeys 13 | Changzhi Wei 14 | Cong Zhong 15 | Emilio Lopez 16 | Fabrice Bellet 17 | Feng Yuan 18 | Guangxin Xu 19 | Haihao Xiang 20 | Holger Kaelberer 21 | Jacobo Aragunde Pérez 22 | Jan Schmidt 23 | Javier Jardon 24 | Julien Isorce 25 | Junfeng Xu 26 | Kristian Hogsberg 27 | Lim Siew Hoon 28 | Lionel Landwerlin 29 | Mark Nauwelaerts 30 | Martin Sherburn 31 | Matthew Waters 32 | Matthieu Bouron 33 | Michael Olbrich 34 | Nicolas Dufresne 35 | Olivier Crete 36 | Philip Lorenz 37 | Robert Bradford 38 | Ross Burton 39 | Sebastian Dröge 40 | Simon Farnsworth 41 | Thibault Saunier 42 | Victor Manuel Jaquez Leal 43 | Warly 44 | Xiaowei Li 45 | Yan Yin 46 | -------------------------------------------------------------------------------- /docs/index.md: -------------------------------------------------------------------------------- 1 | --- 2 | short-description: GStreamer plugins from gstreamer-vaapi 3 | ... 4 | 5 | # VAAPI Plugin 6 | 7 | ## Environment variables 8 | 9 | GStreamer-VAAPI inspects a few of environment variables to define it 10 | usage. 11 | 12 | **GST_VAAPI_ALL_DRIVERS.** 13 | 14 | This environment variable can be set, independently of its value, to 15 | disable the drivers white list. By default only intel and mesa va 16 | drivers are loaded if they are available. The rest are ignored. With 17 | this environment variable defined, all the available va drivers are 18 | loaded, even if they are deprecated. 19 | 20 | **LIBVA_DRIVER_NAME.** 21 | 22 | This environment variable can be set with the drivers name to load. For 23 | example, intel's driver is `i915`, meanwhile mesa is `gallium`. 24 | 25 | **LIBVA_DRIVERS_PATH.** 26 | 27 | This environment variable can be set to a colon-separated list of paths 28 | (or a semicolon-separated list on Windows). libva will scan these paths 29 | for va drivers. 30 | 31 | **GST_VAAPI_DRM_DEVICE.** 32 | This environment variable can be set to a specified DRM device when DRM 33 | display is used, it is ignored when other types of displays are used. 34 | By default /dev/dri/renderD128 is used for DRM display. 35 | -------------------------------------------------------------------------------- /docs/meson.build: -------------------------------------------------------------------------------- 1 | build_hotdoc = false 2 | 3 | if meson.is_cross_build() 4 | if get_option('doc').enabled() 5 | error('Documentation enabled but building the doc while cross building is not supported yet.') 6 | endif 7 | 8 | message('Documentation not built as building it while cross building is not supported yet.') 9 | subdir_done() 10 | endif 11 | 12 | required_hotdoc_extensions = ['gi-extension', 'gst-extension'] 13 | if gst_dep.type_name() == 'internal' 14 | gst_proj = subproject('gstreamer') 15 | plugins_cache_generator = gst_proj.get_variable('plugins_cache_generator') 16 | else 17 | plugins_cache_generator = find_program(join_paths(gst_dep.get_pkgconfig_variable('libexecdir'), 'gstreamer-' + api_version, 'gst-plugins-doc-cache-generator'), 18 | required: false) 19 | endif 20 | 21 | plugins_cache = join_paths(meson.current_source_dir(), 'gst_plugins_cache.json') 22 | if plugins_cache_generator.found() 23 | plugins_doc_dep = custom_target('vaapi-plugins-doc-cache', 24 | command: [plugins_cache_generator, plugins_cache, '@OUTPUT@', '@INPUT@'], 25 | input: plugins, 26 | output: 'gst_plugins_cache.json', 27 | build_always_stale: true, 28 | ) 29 | else 30 | warning('GStreamer plugin inspector for documentation not found, can\'t update the cache') 31 | endif 32 | 33 | hotdoc_p = find_program('hotdoc', required: get_option('doc')) 34 | if not hotdoc_p.found() 35 | message('Hotdoc not found, not building the documentation') 36 | subdir_done() 37 | endif 38 | 39 | hotdoc_req = '>= 0.11.0' 40 | hotdoc_version = run_command(hotdoc_p, '--version').stdout() 41 | if not hotdoc_version.version_compare(hotdoc_req) 42 | if get_option('doc').enabled() 43 | error('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version)) 44 | else 45 | message('Hotdoc version @0@ not found, got @1@'.format(hotdoc_req, hotdoc_version)) 46 | subdir_done() 47 | endif 48 | endif 49 | 50 | build_hotdoc = true 51 | hotdoc = import('hotdoc') 52 | if not hotdoc.has_extensions(required_hotdoc_extensions) 53 | if get_option('doc').enabled() 54 | error('Documentation enabled but gi-extension missing') 55 | endif 56 | 57 | message('@0@ extensions not found, not building documentation'.format(required_hotdoc_extensions)) 58 | subdir_done() 59 | endif 60 | 61 | message('Plugins: @0@'.format(plugins)) 62 | libs_doc = [] 63 | plugins_doc = [hotdoc.generate_doc('vaapi', 64 | project_version: api_version, 65 | sitemap: 'sitemap.txt', 66 | index: 'index.md', 67 | gst_index: 'index.md', 68 | gst_smart_index: true, 69 | gst_c_sources: ['../gst/*/*.[ch]',], 70 | gst_cache_file: plugins_cache, 71 | gst_plugin_name: 'vaapi', 72 | dependencies: [gstbase_dep, gstvideo_dep, gstallocators_dep, gstpbutils_dep, 73 | libva_dep, gstlibvaapi_dep, gstgl_dep, libm] + plugins, 74 | )] 75 | -------------------------------------------------------------------------------- /docs/sitemap.txt: -------------------------------------------------------------------------------- 1 | gst-index 2 | -------------------------------------------------------------------------------- /gst-libs/gst/meson.build: -------------------------------------------------------------------------------- 1 | subdir('vaapi') 2 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/egl_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * egl_compat.h - EGL compatiliby layer 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 21 | */ 22 | 23 | #ifndef EGL_COMPAT_H 24 | #define EGL_COMPAT_H 25 | 26 | #include 27 | #include 28 | #include "ogl_compat.h" 29 | 30 | #ifndef GL_OES_EGL_image 31 | #define GL_OES_EGL_image 1 32 | typedef void *GLeglImageOES; 33 | typedef void (*PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target, 34 | GLeglImageOES image); 35 | typedef void (*PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC)(GLenum target, 36 | GLeglImageOES image); 37 | #endif /* GL_OES_EGL_image */ 38 | 39 | #endif /* EGL_COMPAT_H */ 40 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiblend.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiblend.h - Video processing blend 3 | * 4 | * Copyright (C) 2019 Intel Corporation 5 | * Author: U. Artie Eoff 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_BLEND_H 24 | #define GST_VAAPI_BLEND_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_BLEND \ 31 | (gst_vaapi_blend_get_type ()) 32 | #define GST_VAAPI_BLEND(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_BLEND, GstVaapiBlend)) 34 | #define GST_IS_VAAPI_BLEND(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_BLEND)) 36 | 37 | typedef struct _GstVaapiBlend GstVaapiBlend; 38 | typedef struct _GstVaapiBlendSurface GstVaapiBlendSurface; 39 | 40 | struct _GstVaapiBlendSurface 41 | { 42 | GstVaapiSurface const *surface; 43 | const GstVaapiRectangle *crop; 44 | GstVaapiRectangle target; 45 | gdouble alpha; 46 | }; 47 | 48 | typedef GstVaapiBlendSurface* (*GstVaapiBlendSurfaceNextFunc)(gpointer data); 49 | 50 | GstVaapiBlend * 51 | gst_vaapi_blend_new (GstVaapiDisplay * display); 52 | 53 | void 54 | gst_vaapi_blend_replace (GstVaapiBlend ** old_blend_ptr, 55 | GstVaapiBlend * new_blend); 56 | 57 | gboolean 58 | gst_vaapi_blend_process (GstVaapiBlend * blend, GstVaapiSurface * output, 59 | GstVaapiBlendSurfaceNextFunc next, gpointer user_data); 60 | 61 | GType 62 | gst_vaapi_blend_get_type (void) G_GNUC_CONST; 63 | 64 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiBlend, gst_object_unref) 65 | 66 | G_END_DECLS 67 | 68 | #endif /* GST_VAAPI_FILTER_H */ 69 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapibufferproxy_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapibufferproxy_priv.h - Buffer proxy abstraction (private definitions) 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_BUFFER_PROXY_PRIV_H 24 | #define GST_VAAPI_BUFFER_PROXY_PRIV_H 25 | 26 | #include "gstvaapibufferproxy.h" 27 | #include "gstvaapiminiobject.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | /** 32 | * GST_VAAPI_BUFFER_PROXY_TYPE: 33 | * @buf: a #GstVaapiBufferProxy 34 | * 35 | * Macro that evaluates to the type of the underlying VA buffer @buf 36 | */ 37 | #undef GST_VAAPI_BUFFER_PROXY_TYPE 38 | #define GST_VAAPI_BUFFER_PROXY_TYPE(buf) \ 39 | (GST_VAAPI_BUFFER_PROXY (buf)->type) 40 | 41 | /** 42 | * GST_VAAPI_BUFFER_PROXY_HANDLE: 43 | * @buf: a #GstVaapiBufferProxy 44 | * 45 | * Macro that evaluates to the handle of the underlying VA buffer @buf 46 | */ 47 | #undef GST_VAAPI_BUFFER_PROXY_HANDLE 48 | #define GST_VAAPI_BUFFER_PROXY_HANDLE(buf) \ 49 | (GST_VAAPI_BUFFER_PROXY (buf)->va_info.handle) 50 | 51 | /** 52 | * GST_VAAPI_BUFFER_PROXY_SIZE: 53 | * @buf: a #GstVaapiBufferProxy 54 | * 55 | * Macro that evaluates to the size of the underlying VA buffer @buf 56 | */ 57 | #undef GST_VAAPI_BUFFER_PROXY_SIZE 58 | #define GST_VAAPI_BUFFER_PROXY_SIZE(buf) \ 59 | (GST_VAAPI_BUFFER_PROXY (buf)->va_info.mem_size) 60 | 61 | struct _GstVaapiBufferProxy { 62 | /*< private >*/ 63 | GstVaapiMiniObject parent_instance; 64 | GstMiniObject *surface; 65 | 66 | GDestroyNotify destroy_func; 67 | gpointer destroy_data; 68 | guint type; 69 | VABufferID va_buf; 70 | VABufferInfo va_info; 71 | }; 72 | 73 | G_GNUC_INTERNAL 74 | GstVaapiBufferProxy * 75 | gst_vaapi_buffer_proxy_new_from_surface (GstMiniObject * surface, 76 | VABufferID buf_id, guint type, GDestroyNotify destroy_func, gpointer data); 77 | 78 | G_GNUC_INTERNAL 79 | guint 80 | from_GstVaapiBufferMemoryType (guint type); 81 | 82 | G_GNUC_INTERNAL 83 | guint 84 | to_GstVaapiBufferMemoryType (guint va_type); 85 | 86 | G_END_DECLS 87 | 88 | #endif /* GST_VAAPI_BUFFER_PROXY_PRIV_H */ 89 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicodedbuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapicodedbuffer.h - VA coded buffer abstraction 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Wind Yuan 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_CODED_BUFFER_H 25 | #define GST_VAAPI_CODED_BUFFER_H 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_VAAPI_CODED_BUFFER(obj) \ 30 | ((GstVaapiCodedBuffer *)(obj)) 31 | 32 | /** 33 | * GST_VAAPI_CODED_BUFFER_SIZE: 34 | * @buf: a #GstVaapiCodedBuffer 35 | * 36 | * Macro that evaluates to the size of the underlying VA coded buffer @buf 37 | */ 38 | #define GST_VAAPI_CODED_BUFFER_SIZE(buf) \ 39 | gst_vaapi_coded_buffer_get_size (GST_VAAPI_CODED_BUFFER(buf)) 40 | 41 | typedef struct _GstVaapiCodedBuffer GstVaapiCodedBuffer; 42 | typedef struct _GstVaapiCodedBufferProxy GstVaapiCodedBufferProxy; 43 | typedef struct _GstVaapiCodedBufferPool GstVaapiCodedBufferPool; 44 | 45 | #define GST_TYPE_VAAPI_CODED_BUFFER (gst_vaapi_coded_buffer_get_type ()) 46 | 47 | GType 48 | gst_vaapi_coded_buffer_get_type (void) G_GNUC_CONST; 49 | 50 | /** 51 | * gst_vaapi_coded_buffer_unref: (skip) 52 | * @buf: (transfer full): a #GstVaapiCodedBuffer. 53 | * 54 | * Decreases the refcount of @buf. If the refcount reaches 0, the 55 | * @buf will be freed. 56 | */ 57 | static inline void 58 | gst_vaapi_coded_buffer_unref (GstVaapiCodedBuffer * buf) 59 | { 60 | gst_mini_object_unref (GST_MINI_OBJECT_CAST (buf)); 61 | } 62 | 63 | gssize 64 | gst_vaapi_coded_buffer_get_size (GstVaapiCodedBuffer * buf); 65 | 66 | gboolean 67 | gst_vaapi_coded_buffer_copy_into (GstBuffer * dest, GstVaapiCodedBuffer * src); 68 | 69 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiCodedBuffer, gst_vaapi_coded_buffer_unref) 70 | 71 | G_END_DECLS 72 | 73 | #endif /* GST_VAAPI_CODED_BUFFER_H */ 74 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicodedbuffer_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapicodedbuffer_priv.h - VA coded buffer abstraction (private defs) 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Wind Yuan 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_CODED_BUFFER_PRIV_H 25 | #define GST_VAAPI_CODED_BUFFER_PRIV_H 26 | 27 | #include 28 | #include "gstvaapicodedbuffer.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_VAAPI_CODED_BUFFER_CAST(obj) \ 33 | ((GstVaapiCodedBuffer *)(obj)) 34 | 35 | /** 36 | * GstVaapiCodedBuffer: 37 | * 38 | * A VA coded buffer object wrapper. 39 | */ 40 | struct _GstVaapiCodedBuffer 41 | { 42 | /*< private >*/ 43 | GstMiniObject mini_object; 44 | GstVaapiDisplay *display; 45 | GstVaapiID object_id; 46 | 47 | /*< public >*/ 48 | VACodedBufferSegment *segment_list; 49 | }; 50 | 51 | /** 52 | * GST_VAAPI_CODED_BUFFER_DISPLAY: 53 | * @buf: a #GstVaapiCodedBuffer 54 | * 55 | * Macro that evaluates to the #GstVaapiDisplay of @buf 56 | */ 57 | #undef GST_VAAPI_CODED_BUFFER_DISPLAY 58 | #define GST_VAAPI_CODED_BUFFER_DISPLAY(buf) (GST_VAAPI_CODED_BUFFER (buf)->display) 59 | 60 | /** 61 | * GST_VAAPI_CODED_BUFFER_ID: 62 | * @buf: a #GstVaapiCodedBuffer 63 | * 64 | * Macro that evaluates to the object ID of @buf 65 | */ 66 | #undef GST_VAAPI_CODED_BUFFER_ID 67 | #define GST_VAAPI_CODED_BUFFER_ID(buf) (GST_VAAPI_CODED_BUFFER (buf)->object_id) 68 | 69 | G_GNUC_INTERNAL 70 | GstVaapiCodedBuffer * 71 | gst_vaapi_coded_buffer_new (GstVaapiContext * context, guint buf_size); 72 | 73 | G_GNUC_INTERNAL 74 | gboolean 75 | gst_vaapi_coded_buffer_map (GstVaapiCodedBuffer * buf, 76 | VACodedBufferSegment ** out_segment_list_ptr); 77 | 78 | G_GNUC_INTERNAL 79 | void 80 | gst_vaapi_coded_buffer_unmap (GstVaapiCodedBuffer * buf); 81 | 82 | G_END_DECLS 83 | 84 | #endif /* GST_VAAPI_CODED_BUFFER_PRIV_H */ 85 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicodedbufferpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapicodedbufferpool.h - VA coded buffer pool 3 | * 4 | * Copyright (C) 2013-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_CODED_BUFFER_POOL_H 24 | #define GST_VAAPI_CODED_BUFFER_POOL_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_VAAPI_CODED_BUFFER_POOL(obj) \ 32 | ((GstVaapiCodedBufferPool *)(obj)) 33 | 34 | struct _GstVaapiEncoder; 35 | 36 | GstVaapiVideoPool * 37 | gst_vaapi_coded_buffer_pool_new (struct _GstVaapiEncoder * encoder, 38 | gsize buf_size); 39 | 40 | gsize 41 | gst_vaapi_coded_buffer_pool_get_buffer_size (GstVaapiCodedBufferPool * pool); 42 | 43 | G_END_DECLS 44 | 45 | #endif /* GST_VAAPI_CODED_BUFFER_POOL_H */ 46 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicodedbufferproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapicodedbufferproxy_priv.h - VA coded buffer proxy 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_CODED_BUFFER_PROXY_H 24 | #define GST_VAAPI_CODED_BUFFER_PROXY_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | /** 32 | * GST_VAAPI_CODED_BUFFER_PROXY_BUFFER: 33 | * @proxy: a #GstVaapiCodedBufferProxy 34 | * 35 | * Macro that evaluated to the underlying #GstVaapiCodedBuffer of @proxy. 36 | */ 37 | #define GST_VAAPI_CODED_BUFFER_PROXY_BUFFER(proxy) \ 38 | gst_vaapi_coded_buffer_proxy_get_buffer(proxy) 39 | 40 | /** 41 | * GST_VAAPI_CODED_BUFFER_PROXY_BUFFER_SIZE: 42 | * @proxy: a #GstVaapiCodedBufferProxy 43 | * 44 | * Macro that evaluated to the underlying #GstVaapiCodedBuffer size of 45 | * @proxy. 46 | */ 47 | #define GST_VAAPI_CODED_BUFFER_PROXY_BUFFER_SIZE(proxy) \ 48 | gst_vaapi_coded_buffer_proxy_get_buffer_size(proxy) 49 | 50 | GstVaapiCodedBufferProxy * 51 | gst_vaapi_coded_buffer_proxy_new_from_pool (GstVaapiCodedBufferPool * pool); 52 | 53 | GstVaapiCodedBufferProxy * 54 | gst_vaapi_coded_buffer_proxy_ref (GstVaapiCodedBufferProxy * proxy); 55 | 56 | void 57 | gst_vaapi_coded_buffer_proxy_unref (GstVaapiCodedBufferProxy * proxy); 58 | 59 | void 60 | gst_vaapi_coded_buffer_proxy_replace (GstVaapiCodedBufferProxy ** old_proxy_ptr, 61 | GstVaapiCodedBufferProxy * new_proxy); 62 | 63 | GstVaapiCodedBuffer * 64 | gst_vaapi_coded_buffer_proxy_get_buffer (GstVaapiCodedBufferProxy * proxy); 65 | 66 | gssize 67 | gst_vaapi_coded_buffer_proxy_get_buffer_size (GstVaapiCodedBufferProxy * proxy); 68 | 69 | void 70 | gst_vaapi_coded_buffer_proxy_set_destroy_notify (GstVaapiCodedBufferProxy * 71 | proxy, GDestroyNotify destroy_func, gpointer user_data); 72 | 73 | gpointer 74 | gst_vaapi_coded_buffer_proxy_get_user_data (GstVaapiCodedBufferProxy * proxy); 75 | 76 | void 77 | gst_vaapi_coded_buffer_proxy_set_user_data (GstVaapiCodedBufferProxy * proxy, 78 | gpointer user_data, GDestroyNotify destroy_func); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* GST_VAAPI_CODED_BUFFER_PROXY_H */ 83 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicodedbufferproxy_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapicodedbufferproxy_priv.h - VA coded buffer proxy (private defs) 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_CODED_BUFFER_PROXY_PRIV_H 24 | #define GST_VAAPI_CODED_BUFFER_PROXY_PRIV_H 25 | 26 | #include "gstvaapicodedbuffer_priv.h" 27 | #include "gstvaapiminiobject.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_VAAPI_CODED_BUFFER_PROXY(proxy) \ 32 | ((GstVaapiCodedBufferProxy *)(proxy)) 33 | 34 | struct _GstVaapiCodedBufferProxy 35 | { 36 | /*< private >*/ 37 | GstVaapiMiniObject parent_instance; 38 | 39 | GstVaapiVideoPool *pool; 40 | GstVaapiCodedBuffer *buffer; 41 | GDestroyNotify destroy_func; 42 | gpointer destroy_data; 43 | GDestroyNotify user_data_destroy; 44 | gpointer user_data; 45 | }; 46 | 47 | /** 48 | * GST_VAAPI_CODED_BUFFER_PROXY_BUFFER: 49 | * @proxy: a #GstVaapiCodedBufferProxy 50 | * 51 | * Macro that evaluated to the underlying #GstVaapiCodedBuffer of @proxy. 52 | */ 53 | #undef GST_VAAPI_CODED_BUFFER_PROXY_BUFFER 54 | #define GST_VAAPI_CODED_BUFFER_PROXY_BUFFER(proxy) \ 55 | GST_VAAPI_CODED_BUFFER_PROXY(proxy)->buffer 56 | 57 | /** 58 | * GST_VAAPI_CODED_BUFFER_PROXY_BUFFER_SIZE: 59 | * @proxy: a #GstVaapiCodedBufferProxy 60 | * 61 | * Macro that evaluated to the underlying #GstVaapiCodedBuffer size of 62 | * @proxy. 63 | */ 64 | #undef GST_VAAPI_CODED_BUFFER_PROXY_BUFFER_SIZE 65 | #define GST_VAAPI_CODED_BUFFER_PROXY_BUFFER_SIZE(proxy) \ 66 | GST_VAAPI_CODED_BUFFER_SIZE(GST_VAAPI_CODED_BUFFER_PROXY_BUFFER(proxy)) 67 | 68 | G_END_DECLS 69 | 70 | #endif /* GST_VAAPI_CODED_BUFFER_PROXY_PRIV_H */ 71 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapicompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvapicompat.h - VA-API compatibility glue 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_COMPAT_H 26 | #define GST_VAAPI_COMPAT_H 27 | 28 | #include 29 | 30 | #if VA_CHECK_VERSION(1,0,0) 31 | #define VA_ROI_RC_QP_DELTA_SUPPORT(x) x->bits.roi_rc_qp_delta_support 32 | #define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderRawData 33 | #else 34 | #define VA_ROI_RC_QP_DELTA_SUPPORT(x) x->bits.roi_rc_qp_delat_support 35 | #define VA_ENC_PACKED_HEADER_H264_SEI VAEncPackedHeaderH264_SEI 36 | #endif 37 | 38 | #include 39 | #include 40 | 41 | #endif /* GST_VAAPI_COMPAT_H */ 42 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidebug.h - VA-API debugging utilities 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DEBUG_H 24 | #define GST_VAAPI_DEBUG_H 25 | 26 | #include 27 | 28 | #if DEBUG 29 | GST_DEBUG_CATEGORY_EXTERN(gst_debug_vaapi); 30 | #define GST_CAT_DEFAULT gst_debug_vaapi 31 | #endif 32 | 33 | #if DEBUG_VAAPI_DISPLAY 34 | GST_DEBUG_CATEGORY_EXTERN(gst_debug_vaapi_display); 35 | #define GST_CAT_DEFAULT gst_debug_vaapi_display 36 | #endif 37 | 38 | #endif /* GST_VAAPI_DEBUG_H */ 39 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_av1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_av1.h - AV1 decoder 3 | * 4 | * Copyright (C) 2019-2020 Intel Corporation 5 | * Author: Junyan He 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_AV1_H 24 | #define GST_VAAPI_DECODER_AV1_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODER_AV1 \ 31 | (gst_vaapi_decoder_av1_get_type ()) 32 | #define GST_VAAPI_DECODER_AV1(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_AV1, GstVaapiDecoderAV1)) 34 | #define GST_VAAPI_IS_DECODER_AV1(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_AV1)) 36 | 37 | typedef struct _GstVaapiDecoderAV1 GstVaapiDecoderAV1; 38 | 39 | GType 40 | gst_vaapi_decoder_av1_get_type (void) G_GNUC_CONST; 41 | 42 | GstVaapiDecoder * 43 | gst_vaapi_decoder_av1_new (GstVaapiDisplay * display, GstCaps * caps); 44 | 45 | G_END_DECLS 46 | 47 | #endif /* GST_VAAPI_DECODER_AV1_H */ 48 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_dpb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_dpb.h - Decoded Picture Buffer 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_DPB_H 24 | #define GST_VAAPI_DECODER_DPB_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _GstVaapiDpb GstVaapiDpb; 31 | typedef struct _GstVaapiDpbClass GstVaapiDpbClass; 32 | 33 | /* ------------------------------------------------------------------------- */ 34 | /* --- Decoded Picture Buffer --- */ 35 | /* ------------------------------------------------------------------------- */ 36 | 37 | #define GST_VAAPI_DPB(obj) \ 38 | ((GstVaapiDpb *)(obj)) 39 | 40 | #define GST_VAAPI_IS_DPB(obj) \ 41 | (GST_VAAPI_DPB(obj) != NULL) 42 | 43 | G_GNUC_INTERNAL 44 | GstVaapiDpb * 45 | gst_vaapi_dpb_new(guint max_pictures); 46 | 47 | G_GNUC_INTERNAL 48 | void 49 | gst_vaapi_dpb_flush(GstVaapiDpb *dpb); 50 | 51 | G_GNUC_INTERNAL 52 | gboolean 53 | gst_vaapi_dpb_add(GstVaapiDpb *dpb, GstVaapiPicture *picture); 54 | 55 | G_GNUC_INTERNAL 56 | guint 57 | gst_vaapi_dpb_size(GstVaapiDpb *dpb); 58 | 59 | G_GNUC_INTERNAL 60 | void 61 | gst_vaapi_dpb_get_neighbours( 62 | GstVaapiDpb *dpb, 63 | GstVaapiPicture *picture, 64 | GstVaapiPicture **prev_picture_ptr, 65 | GstVaapiPicture **next_picture_ptr 66 | ); 67 | 68 | #define gst_vaapi_dpb_ref(dpb) \ 69 | gst_vaapi_mini_object_ref(GST_VAAPI_MINI_OBJECT(dpb)) 70 | 71 | #define gst_vaapi_dpb_unref(dpb) \ 72 | gst_vaapi_mini_object_unref(GST_VAAPI_MINI_OBJECT(dpb)) 73 | 74 | #define gst_vaapi_dpb_replace(old_dpb_ptr, new_dpb) \ 75 | gst_vaapi_mini_object_replace((GstVaapiMiniObject **)(old_dpb_ptr), \ 76 | (GstVaapiMiniObject *)(new_dpb)) 77 | 78 | G_END_DECLS 79 | 80 | #endif /* GST_VAAPI_DECODER_DPB */ 81 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_h264.h - H.264 decoder 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_H264_H 24 | #define GST_VAAPI_DECODER_H264_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODER_H264 \ 31 | (gst_vaapi_decoder_h264_get_type ()) 32 | #define GST_VAAPI_DECODER_H264(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_H264, GstVaapiDecoderH264)) 34 | #define GST_VAAPI_IS_DECODER_H264(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_H264)) 36 | 37 | typedef struct _GstVaapiDecoderH264 GstVaapiDecoderH264; 38 | 39 | /** 40 | * GstVaapiStreamAlignH264: 41 | * @GST_VAAPI_STREAM_ALIGN_H264_NONE: Generic H.264 stream buffers 42 | * @GST_VAAPI_STREAM_ALIGN_H264_NALU: H.264 stream buffers aligned NAL 43 | * unit boundaries 44 | * @GST_VAAPI_STREAM_ALIGN_H264_AU: H.264 stream buffers aligned on 45 | * access unit boundaries 46 | * 47 | * Set of possible buffer alignments for H.264 streams. 48 | */ 49 | typedef enum { 50 | GST_VAAPI_STREAM_ALIGN_H264_NONE, 51 | GST_VAAPI_STREAM_ALIGN_H264_NALU, 52 | GST_VAAPI_STREAM_ALIGN_H264_AU 53 | } GstVaapiStreamAlignH264; 54 | 55 | GType 56 | gst_vaapi_decoder_h264_get_type (void) G_GNUC_CONST; 57 | 58 | GstVaapiDecoder * 59 | gst_vaapi_decoder_h264_new (GstVaapiDisplay *display, GstCaps *caps); 60 | 61 | void 62 | gst_vaapi_decoder_h264_set_alignment(GstVaapiDecoderH264 *decoder, 63 | GstVaapiStreamAlignH264 alignment); 64 | 65 | gboolean 66 | gst_vaapi_decoder_h264_get_low_latency(GstVaapiDecoderH264 * decoder); 67 | 68 | void 69 | gst_vaapi_decoder_h264_set_low_latency(GstVaapiDecoderH264 * decoder, 70 | gboolean force_low_latency); 71 | 72 | void 73 | gst_vaapi_decoder_h264_set_base_only(GstVaapiDecoderH264 * decoder, 74 | gboolean base_only); 75 | 76 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderH264, gst_object_unref) 77 | 78 | G_END_DECLS 79 | 80 | #endif /* GST_VAAPI_DECODER_H264_H */ 81 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_h265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_h265.h - H.265 decoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_DECODER_H265_H 25 | #define GST_VAAPI_DECODER_H265_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_DECODER_H265 \ 32 | (gst_vaapi_decoder_h265_get_type ()) 33 | #define GST_VAAPI_DECODER_H265(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_H265, GstVaapiDecoderH265)) 35 | #define GST_VAAPI_IS_DECODER_H265(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_H265)) 37 | 38 | typedef struct _GstVaapiDecoderH265 GstVaapiDecoderH265; 39 | 40 | /** 41 | * GstVaapiStreamAlignH265: 42 | * @GST_VAAPI_STREAM_ALIGN_H265_NONE: Generic H.265 stream buffers 43 | * @GST_VAAPI_STREAM_ALIGN_H265_NALU: H.265 stream buffers aligned NAL 44 | * unit boundaries 45 | * @GST_VAAPI_STREAM_ALIGN_H265_AU: H.265 stream buffers aligned on 46 | * access unit boundaries 47 | * 48 | * Set of possible buffer alignments for H.265 streams. 49 | */ 50 | typedef enum { 51 | GST_VAAPI_STREAM_ALIGN_H265_NONE, 52 | GST_VAAPI_STREAM_ALIGN_H265_NALU, 53 | GST_VAAPI_STREAM_ALIGN_H265_AU 54 | } GstVaapiStreamAlignH265; 55 | 56 | GType 57 | gst_vaapi_decoder_h265_get_type (void) G_GNUC_CONST; 58 | 59 | GstVaapiDecoder * 60 | gst_vaapi_decoder_h265_new (GstVaapiDisplay *display, GstCaps *caps); 61 | 62 | void 63 | gst_vaapi_decoder_h265_set_alignment (GstVaapiDecoderH265 *decoder, 64 | GstVaapiStreamAlignH265 alignment); 65 | 66 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderH265, gst_object_unref) 67 | 68 | G_END_DECLS 69 | 70 | #endif /* GST_VAAPI_DECODER_H265_H */ 71 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_jpeg.h - JPEG decoder 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Wind Yuan 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_DECODER_JPEG_H 25 | #define GST_VAAPI_DECODER_JPEG_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_DECODER_JPEG \ 32 | (gst_vaapi_decoder_jpeg_get_type ()) 33 | #define GST_VAAPI_DECODER_JPEG(decoder) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_JPEG, GstVaapiDecoderJpeg)) 35 | #define GST_VAAPI_IS_DECODER_JPEG(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_JPEG)) 37 | 38 | typedef struct _GstVaapiDecoderJpeg GstVaapiDecoderJpeg; 39 | 40 | GType 41 | gst_vaapi_decoder_jpeg_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiDecoder * 44 | gst_vaapi_decoder_jpeg_new (GstVaapiDisplay *display, GstCaps *caps); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderJpeg, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GST_VAAPI_DECODER_JPEG_H */ 51 | 52 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_mpeg2.h - MPEG-2 decoder 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_MPEG2_H 24 | #define GST_VAAPI_DECODER_MPEG2_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_DECODER_MPEG2 \ 32 | (gst_vaapi_decoder_mpeg2_get_type ()) 33 | #define GST_VAAPI_DECODER_MPEG2(decoder) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_MPEG2, GstVaapiDecoderMpeg2)) 35 | #define GST_VAAPI_IS_DECODER_MPEG2(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_MPEG2)) 37 | 38 | typedef struct _GstVaapiDecoderMpeg2 GstVaapiDecoderMpeg2; 39 | 40 | GType 41 | gst_vaapi_decoder_mpeg2_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiDecoder * 44 | gst_vaapi_decoder_mpeg2_new (GstVaapiDisplay *display, GstCaps *caps); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderMpeg2, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GST_VAAPI_DECODER_MPEG2_H */ 51 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_mpeg4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_mpeg4.h - MPEG-4 decoder 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Halley Zhao 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_MPEG4_H 24 | #define GST_VAAPI_DECODER_MPEG4_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODER_MPEG4 \ 31 | (gst_vaapi_decoder_mpeg4_get_type ()) 32 | #define GST_VAAPI_DECODER_MPEG4(decoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_MPEG4, GstVaapiDecoderMpeg4)) 34 | #define GST_VAAPI_IS_DECODER_MPEG4(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_MPEG4)) 36 | 37 | typedef struct _GstVaapiDecoderMpeg4 GstVaapiDecoderMpeg4; 38 | 39 | GType 40 | gst_vaapi_decoder_mpeg4_get_type (void) G_GNUC_CONST; 41 | 42 | GstVaapiDecoder * 43 | gst_vaapi_decoder_mpeg4_new (GstVaapiDisplay *display, GstCaps *caps); 44 | 45 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderMpeg4, gst_object_unref) 46 | 47 | G_END_DECLS 48 | 49 | #endif /* GST_VAAPI_DECODER_MPEG4_H */ 50 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_unit.c: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_unit.c - VA decoder units 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | /** 24 | * SECTION:gstvaapidecoder_unit 25 | * @short_description: Decoder unit 26 | */ 27 | 28 | #include "sysdeps.h" 29 | #include "gstvaapidecoder_unit.h" 30 | 31 | /** 32 | * gst_vaapi_decoder_unit_init: 33 | * @unit: a #GstVaapiDecoderUnit 34 | * 35 | * Initializes internal resources bound to the supplied decoder @unit. 36 | * 37 | * @note This is an internal function used to implement lightweight 38 | * sub-classes. 39 | */ 40 | void 41 | gst_vaapi_decoder_unit_init (GstVaapiDecoderUnit * unit) 42 | { 43 | unit->flags = 0; 44 | unit->size = 0; 45 | unit->offset = 0; 46 | 47 | unit->parsed_info = NULL; 48 | unit->parsed_info_destroy_notify = NULL; 49 | } 50 | 51 | /** 52 | * gst_vaapi_decoder_unit_clear: 53 | * @unit: a #GstVaapiDecoderUnit 54 | * 55 | * Deallocates any internal resources bound to the supplied decoder 56 | * @unit. 57 | * 58 | * @note This is an internal function used to implement lightweight 59 | * sub-classes. 60 | */ 61 | void 62 | gst_vaapi_decoder_unit_clear (GstVaapiDecoderUnit * unit) 63 | { 64 | gst_vaapi_decoder_unit_set_parsed_info (unit, NULL, NULL); 65 | } 66 | 67 | /** 68 | * gst_vaapi_decoder_unit_set_parsed_info: 69 | * @unit: a #GstVaapiDecoderUnit 70 | * @parsed_info: parser info 71 | * @destroy_notify: (closure parsed_info): a #GDestroyNotify 72 | * 73 | * Sets @parsed_info on the object and the #GDestroyNotify that will be 74 | * called when the data is freed. 75 | * 76 | * If some @parsed_info was previously set, then the former @destroy_notify 77 | * function will be called before the @parsed_info is replaced. 78 | */ 79 | void 80 | gst_vaapi_decoder_unit_set_parsed_info (GstVaapiDecoderUnit * unit, 81 | gpointer parsed_info, GDestroyNotify destroy_notify) 82 | { 83 | g_return_if_fail (GST_VAAPI_IS_DECODER_UNIT (unit)); 84 | 85 | if (unit->parsed_info && unit->parsed_info_destroy_notify) 86 | unit->parsed_info_destroy_notify (unit->parsed_info); 87 | unit->parsed_info = parsed_info; 88 | unit->parsed_info_destroy_notify = destroy_notify; 89 | } 90 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_vc1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_vc1.h - VC-1 decoder 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_VC1_H 24 | #define GST_VAAPI_DECODER_VC1_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODER_VC1 \ 31 | (gst_vaapi_decoder_vc1_get_type ()) 32 | #define GST_VAAPI_DECODER_VC1(decoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_VC1, GstVaapiDecoderVC1)) 34 | #define GST_VAAPI_IS_DECODER_VC1(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_VC1)) 36 | 37 | typedef struct _GstVaapiDecoderVC1 GstVaapiDecoderVC1; 38 | 39 | GType 40 | gst_vaapi_decoder_vc1_get_type (void) G_GNUC_CONST; 41 | 42 | GstVaapiDecoder * 43 | gst_vaapi_decoder_vc1_new (GstVaapiDisplay *display, GstCaps *caps); 44 | 45 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderVC1, gst_object_unref) 46 | 47 | G_END_DECLS 48 | 49 | #endif /* GST_VAAPI_DECODER_VC1_H */ 50 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_vp8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_vp8.h - VP8 decoder 3 | * 4 | * Copyright (C) 2013-2014 Intel Corporation 5 | * Author: Halley Zhao 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_DECODER_VP8_H 25 | #define GST_VAAPI_DECODER_VP8_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_DECODER_VP8 \ 32 | (gst_vaapi_decoder_vp8_get_type ()) 33 | #define GST_VAAPI_DECODER_VP8(decoder) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_VP8, GstVaapiDecoderVp8)) 35 | #define GST_VAAPI_IS_DECODER_VP8(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_VP8)) 37 | 38 | typedef struct _GstVaapiDecoderVp8 GstVaapiDecoderVp8; 39 | 40 | GType 41 | gst_vaapi_decoder_vp8_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiDecoder * 44 | gst_vaapi_decoder_vp8_new (GstVaapiDisplay * display, GstCaps * caps); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderVp8, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GST_VAAPI_DECODER_VP8_H */ 51 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidecoder_vp9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecoder_vp9.h - VP9 decoder 3 | * 4 | * Copyright (C) 2015-2016 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODER_VP9_H 24 | #define GST_VAAPI_DECODER_VP9_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODER_VP9 \ 31 | (gst_vaapi_decoder_vp9_get_type ()) 32 | #define GST_VAAPI_DECODER_VP9(decoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODER_VP9, GstVaapiDecoderVp9)) 34 | #define GST_VAAPI_IS_DECODER_VP9(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODER_VP9)) 36 | 37 | typedef struct _GstVaapiDecoderVp9 GstVaapiDecoderVp9; 38 | 39 | GType 40 | gst_vaapi_decoder_vp9_get_type (void) G_GNUC_CONST; 41 | 42 | GstVaapiDecoder * 43 | gst_vaapi_decoder_vp9_new (GstVaapiDisplay * display, GstCaps * caps); 44 | 45 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDecoderVp9, gst_object_unref) 46 | 47 | G_END_DECLS 48 | 49 | #endif /* GST_VAAPI_DECODER_VP9_H */ 50 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_drm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_drm.h - VA/DRM display abstraction 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DISPLAY_DRM_H 24 | #define GST_VAAPI_DISPLAY_DRM_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DISPLAY_DRM (gst_vaapi_display_drm_get_type ()) 31 | #define GST_VAAPI_DISPLAY_DRM(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DISPLAY_DRM, GstVaapiDisplayDRM)) 33 | 34 | typedef struct _GstVaapiDisplayDRM GstVaapiDisplayDRM; 35 | 36 | GstVaapiDisplay * 37 | gst_vaapi_display_drm_new (const gchar * device_path); 38 | 39 | GstVaapiDisplay * 40 | gst_vaapi_display_drm_new_with_device (gint device); 41 | 42 | GstVaapiDisplay * 43 | gst_vaapi_display_drm_new_with_va_display (VADisplay va_display, gint fd); 44 | 45 | gint 46 | gst_vaapi_display_drm_get_device (GstVaapiDisplayDRM * display); 47 | 48 | const gchar * 49 | gst_vaapi_display_drm_get_device_path (GstVaapiDisplayDRM * 50 | display); 51 | 52 | GType 53 | gst_vaapi_display_drm_get_type (void) G_GNUC_CONST; 54 | 55 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplayDRM, gst_object_unref) 56 | 57 | G_END_DECLS 58 | 59 | #endif /* GST_VAAPI_DISPLAY_DRM_H */ 60 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_drm_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_drm_priv.h - Internal VA/DRM interface 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DISPLAY_DRM_PRIV_H 24 | #define GST_VAAPI_DISPLAY_DRM_PRIV_H 25 | 26 | #include 27 | #include "gstvaapidisplay_priv.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_VAAPI_IS_DISPLAY_DRM(display) \ 32 | (G_TYPE_CHECK_INSTANCE_TYPE ((display), GST_TYPE_VAAPI_DISPLAY_DRM)) 33 | 34 | #define GST_VAAPI_DISPLAY_DRM_CAST(display) \ 35 | ((GstVaapiDisplayDRM *)(display)) 36 | 37 | #define GST_VAAPI_DISPLAY_DRM_GET_CLASS(obj) \ 38 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DISPLAY_DRM, GstVaapiDisplayDRMClass)) 39 | 40 | #define GST_VAAPI_DISPLAY_DRM_PRIVATE(display) \ 41 | (GST_VAAPI_DISPLAY_DRM_CAST(display)->priv) 42 | 43 | typedef struct _GstVaapiDisplayDRMPrivate GstVaapiDisplayDRMPrivate; 44 | typedef struct _GstVaapiDisplayDRMClass GstVaapiDisplayDRMClass; 45 | 46 | /** 47 | * GST_VAAPI_DISPLAY_DRM_DEVICE: 48 | * @display: a #GstVaapiDisplay 49 | * 50 | * Macro that evaluates to the underlying DRM file descriptor of @display 51 | */ 52 | #undef GST_VAAPI_DISPLAY_DRM_DEVICE 53 | #define GST_VAAPI_DISPLAY_DRM_DEVICE(display) \ 54 | GST_VAAPI_DISPLAY_DRM_PRIVATE(display)->drm_device 55 | 56 | struct _GstVaapiDisplayDRMPrivate 57 | { 58 | gchar *device_path_default; 59 | gchar *device_path; 60 | gint drm_device; 61 | guint use_foreign_display:1; // Foreign native_display? 62 | }; 63 | 64 | /** 65 | * GstVaapiDisplayDRM: 66 | * 67 | * VA/DRM display wrapper. 68 | */ 69 | struct _GstVaapiDisplayDRM 70 | { 71 | /*< private >*/ 72 | GstVaapiDisplay parent_instance; 73 | 74 | GstVaapiDisplayDRMPrivate *priv; 75 | }; 76 | 77 | /** 78 | * GstVaapiDisplayDRMClass: 79 | * 80 | * VA/DRM display wrapper clas. 81 | */ 82 | struct _GstVaapiDisplayDRMClass 83 | { 84 | /*< private >*/ 85 | GstVaapiDisplayClass parent_class; 86 | }; 87 | 88 | G_END_DECLS 89 | 90 | #endif /* GST_VAAPI_DISPLAY_DRM_PRIV_H */ 91 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_egl.h - VA/EGL display abstraction 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) egl later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT EGL WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DISPLAY_EGL_H 24 | #define GST_VAAPI_DISPLAY_EGL_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef struct _GstVaapiDisplayEGL GstVaapiDisplayEGL; 32 | 33 | #define GST_TYPE_VAAPI_DISPLAY_EGL (gst_vaapi_display_egl_get_type ()) 34 | #define GST_VAAPI_DISPLAY_EGL(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DISPLAY_EGL, GstVaapiDisplayEGL)) 36 | 37 | GstVaapiDisplay * 38 | gst_vaapi_display_egl_new (GstVaapiDisplay * display, guint gles_version); 39 | 40 | GstVaapiDisplay * 41 | gst_vaapi_display_egl_new_with_native_display (gpointer native_display, 42 | GstVaapiDisplayType display_type, guint gles_version); 43 | 44 | EGLDisplay 45 | gst_vaapi_display_egl_get_gl_display (GstVaapiDisplayEGL * display); 46 | 47 | EGLContext 48 | gst_vaapi_display_egl_get_gl_context (GstVaapiDisplayEGL * display); 49 | 50 | gboolean 51 | gst_vaapi_display_egl_set_gl_context (GstVaapiDisplayEGL * display, 52 | EGLContext gl_context); 53 | 54 | gboolean 55 | gst_vaapi_display_egl_set_current_display (GstVaapiDisplayEGL * display); 56 | 57 | GType 58 | gst_vaapi_display_egl_get_type (void) G_GNUC_CONST; 59 | 60 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplayEGL, gst_object_unref) 61 | 62 | G_END_DECLS 63 | 64 | #endif /* GST_VAAPI_DISPLAY_EGL_H */ 65 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_egl_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_egl_priv.h - Internal VA/EGL interface 3 | * 4 | * Copyright (C) 2014 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DISPLAY_EGL_PRIV_H 24 | #define GST_VAAPI_DISPLAY_EGL_PRIV_H 25 | 26 | #include 27 | #include 28 | #include "gstvaapidisplay_egl.h" 29 | #include "gstvaapidisplay_priv.h" 30 | #include "gstvaapiutils_egl.h" 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_VAAPI_IS_DISPLAY_EGL(display) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((display), GST_TYPE_VAAPI_DISPLAY_EGL)) 36 | 37 | #define GST_VAAPI_DISPLAY_EGL_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_DISPLAY_EGL, GstVaapiDisplayEGLClass)) 39 | 40 | #define GST_VAAPI_DISPLAY_EGL_GET_CLASS(obj) \ 41 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DISPLAY_EGL, GstVaapiDisplayEGLClass)) 42 | 43 | #define GST_VAAPI_DISPLAY_EGL_CAST(obj) \ 44 | ((GstVaapiDisplayEGL *)(obj)) 45 | 46 | /** 47 | * GST_VAAPI_DISPLAY_EGL_DISPLAY: 48 | * @display: a #GstVaapiDisplay 49 | * 50 | * Macro that evaluates to #EglDisplay wrapper for @display. 51 | * This is an internal macro that does not do any run-time type check. 52 | */ 53 | #undef GST_VAAPI_DISPLAY_EGL_DISPLAY 54 | #define GST_VAAPI_DISPLAY_EGL_DISPLAY(display) \ 55 | (GST_VAAPI_DISPLAY_EGL_CAST (display)->egl_display) 56 | 57 | /** 58 | * GST_VAAPI_DISPLAY_EGL_CONTEXT: 59 | * @display: a #GstVaapiDisplay 60 | * 61 | * Macro that evaluates to #EglContext wrapper for @display. 62 | * This is an internal macro that does not do any run-time type check. 63 | */ 64 | #undef GST_VAAPI_DISPLAY_EGL_CONTEXT 65 | #define GST_VAAPI_DISPLAY_EGL_CONTEXT(display) \ 66 | gst_vaapi_display_egl_get_context (GST_VAAPI_DISPLAY_EGL (display)) 67 | 68 | typedef struct _GstVaapiDisplayEGLClass GstVaapiDisplayEGLClass; 69 | 70 | /** 71 | * GstVaapiDisplayEGL: 72 | * 73 | * VA/EGL display wrapper. 74 | */ 75 | struct _GstVaapiDisplayEGL 76 | { 77 | /*< private >*/ 78 | GstVaapiDisplay parent_instance; 79 | 80 | gpointer loader; 81 | GstVaapiDisplay *display; 82 | EglDisplay *egl_display; 83 | EglContext *egl_context; 84 | guint gles_version; 85 | GstVaapiTextureMap *texture_map; 86 | }; 87 | 88 | /** 89 | * GstVaapiDisplayEGLClass: 90 | * 91 | * VA/EGL display wrapper clas. 92 | */ 93 | struct _GstVaapiDisplayEGLClass 94 | { 95 | /*< private >*/ 96 | GstVaapiDisplayClass parent_class; 97 | }; 98 | 99 | G_GNUC_INTERNAL 100 | EglContext * 101 | gst_vaapi_display_egl_get_context (GstVaapiDisplayEGL * display); 102 | 103 | G_END_DECLS 104 | 105 | #endif /* GST_VAAPI_DISPLAY_EGL_PRIV_H */ 106 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_glx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_glx.h - VA/GLX display abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_DISPLAY_GLX_H 26 | #define GST_VAAPI_DISPLAY_GLX_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_DISPLAY_GLX (gst_vaapi_display_glx_get_type ()) 33 | #define GST_VAAPI_DISPLAY_GLX(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DISPLAY_GLX, GstVaapiDisplayGLX)) 35 | 36 | typedef struct _GstVaapiDisplayGLX GstVaapiDisplayGLX; 37 | 38 | GstVaapiDisplay * 39 | gst_vaapi_display_glx_new (const gchar * display_name); 40 | 41 | GstVaapiDisplay * 42 | gst_vaapi_display_glx_new_with_display (Display * x11_display); 43 | 44 | GType 45 | gst_vaapi_display_glx_get_type (void) G_GNUC_CONST; 46 | 47 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplayGLX, gst_object_unref) 48 | 49 | G_END_DECLS 50 | 51 | #endif /* GST_VAAPI_DISPLAY_GLX_H */ 52 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_glx_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_glx_priv.h - Internal VA/GLX interface 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DISPLAY_GLX_PRIV_H 24 | #define GST_VAAPI_DISPLAY_GLX_PRIV_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include "gstvaapidisplay_x11_priv.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_VAAPI_IS_DISPLAY_GLX(display) \ 34 | (G_TYPE_CHECK_INSTANCE_TYPE ((display), GST_TYPE_VAAPI_DISPLAY_GLX)) 35 | 36 | #define GST_VAAPI_DISPLAY_GLX_CAST(display) \ 37 | ((GstVaapiDisplayGLX *)(display)) 38 | 39 | #define GST_VAAPI_DISPLAY_GLX_CLASS(klass) \ 40 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_DISPLAY_GLX, GstVaapiDisplayGLXClass)) 41 | 42 | #define GST_VAAPI_DISPLAY_GLX_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DISPLAY_GLX, GstVaapiDisplayGLXClass)) 44 | 45 | typedef struct _GstVaapiDisplayGLXClass GstVaapiDisplayGLXClass; 46 | 47 | /** 48 | * GstVaapiDisplayGLX: 49 | * 50 | * VA/GLX display wrapper. 51 | */ 52 | struct _GstVaapiDisplayGLX 53 | { 54 | /*< private >*/ 55 | GstVaapiDisplayX11 parent_instance; 56 | GstVaapiTextureMap *texture_map; 57 | }; 58 | 59 | /** 60 | * GstVaapiDisplayGLXClass: 61 | * 62 | * VA/GLX display wrapper clas. 63 | */ 64 | struct _GstVaapiDisplayGLXClass 65 | { 66 | /*< private >*/ 67 | GstVaapiDisplayX11Class parent_class; 68 | }; 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_VAAPI_DISPLAY_GLX_PRIV_H */ 73 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_wayland.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_wayland.h - VA/Wayland display abstraction 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_DISPLAY_WAYLAND_H 25 | #define GST_VAAPI_DISPLAY_WAYLAND_H 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_DISPLAY_WAYLAND (gst_vaapi_display_wayland_get_type ()) 33 | #define GST_VAAPI_DISPLAY_WAYLAND(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DISPLAY_WAYLAND, GstVaapiDisplayWayland)) 35 | 36 | typedef struct _GstVaapiDisplayWayland GstVaapiDisplayWayland; 37 | 38 | GstVaapiDisplay * 39 | gst_vaapi_display_wayland_new (const gchar * display_name); 40 | 41 | GstVaapiDisplay * 42 | gst_vaapi_display_wayland_new_with_display (struct wl_display * wl_display); 43 | 44 | GstVaapiDisplay * 45 | gst_vaapi_display_wayland_new_with_va_display (VADisplay va_display, 46 | struct wl_display * wl_display); 47 | 48 | struct wl_display * 49 | gst_vaapi_display_wayland_get_display (GstVaapiDisplayWayland * display); 50 | 51 | GType 52 | gst_vaapi_display_wayland_get_type (void) G_GNUC_CONST; 53 | 54 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplayWayland, gst_object_unref) 55 | 56 | G_END_DECLS 57 | 58 | #endif /* GST_VAAPI_DISPLAY_WAYLAND_H */ 59 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapidisplay_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidisplay_x11.h - VA/X11 display abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_DISPLAY_X11_H 26 | #define GST_VAAPI_DISPLAY_X11_H 27 | 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_TYPE_VAAPI_DISPLAY_X11 (gst_vaapi_display_x11_get_type ()) 34 | #define GST_VAAPI_DISPLAY_X11(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DISPLAY_X11, GstVaapiDisplayX11)) 36 | 37 | typedef struct _GstVaapiDisplayX11 GstVaapiDisplayX11; 38 | 39 | GstVaapiDisplay * 40 | gst_vaapi_display_x11_new (const gchar * display_name); 41 | 42 | GstVaapiDisplay * 43 | gst_vaapi_display_x11_new_with_display (Display * x11_display); 44 | 45 | GstVaapiDisplay * 46 | gst_vaapi_display_x11_new_with_va_display (VADisplay va_display, Display * x11_display); 47 | 48 | Display * 49 | gst_vaapi_display_x11_get_display (GstVaapiDisplayX11 * display); 50 | 51 | int 52 | gst_vaapi_display_x11_get_screen (GstVaapiDisplayX11 * display); 53 | 54 | void 55 | gst_vaapi_display_x11_set_synchronous (GstVaapiDisplayX11 * display, 56 | gboolean synchronous); 57 | 58 | GType 59 | gst_vaapi_display_x11_get_type (void) G_GNUC_CONST; 60 | 61 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiDisplayX11, gst_object_unref) 62 | 63 | G_END_DECLS 64 | 65 | #endif /* GST_VAAPI_DISPLAY_X11_H */ 66 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_h264.h - H.264 encoder 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Wind Yuan 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_ENCODER_H264_H 25 | #define GST_VAAPI_ENCODER_H264_H 26 | 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_ENCODER_H264 \ 33 | (gst_vaapi_encoder_h264_get_type ()) 34 | #define GST_VAAPI_ENCODER_H264(encoder) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_H264, GstVaapiEncoderH264)) 36 | #define GST_IS_VAAPI_ENCODER_H264(encoder) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_H264)) 38 | 39 | typedef struct _GstVaapiEncoderH264 GstVaapiEncoderH264; 40 | typedef struct _GstVaapiEncoderH264Class GstVaapiEncoderH264Class; 41 | 42 | GType 43 | gst_vaapi_encoder_h264_get_type (void) G_GNUC_CONST; 44 | 45 | GstVaapiEncoder * 46 | gst_vaapi_encoder_h264_new (GstVaapiDisplay * display); 47 | 48 | gboolean 49 | gst_vaapi_encoder_h264_set_max_profile (GstVaapiEncoderH264 * encoder, 50 | GstVaapiProfile profile); 51 | 52 | gboolean 53 | gst_vaapi_encoder_h264_get_profile_and_level (GstVaapiEncoderH264 * encoder, 54 | GstVaapiProfile * out_profile_ptr, GstVaapiLevelH264 * out_level_ptr); 55 | 56 | gboolean 57 | gst_vaapi_encoder_h264_supports_avc (GstVaapiEncoderH264 * encoder); 58 | 59 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderH264, gst_object_unref) 60 | 61 | G_END_DECLS 62 | 63 | #endif /*GST_VAAPI_ENCODER_H264_H */ 64 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_h265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_h265.h - H.265 encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_ENCODER_H265_H 24 | #define GST_VAAPI_ENCODER_H265_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_ENCODER_H265 \ 32 | (gst_vaapi_encoder_h265_get_type ()) 33 | #define GST_VAAPI_ENCODER_H265(encoder) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_H265, GstVaapiEncoderH265)) 35 | #define GST_IS_VAAPI_ENCODER_H265(encoder) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_H265)) 37 | 38 | typedef struct _GstVaapiEncoderH265 GstVaapiEncoderH265; 39 | typedef struct _GstVaapiEncoderH265Class GstVaapiEncoderH265Class; 40 | 41 | GType 42 | gst_vaapi_encoder_h265_get_type (void) G_GNUC_CONST; 43 | 44 | GstVaapiEncoder * 45 | gst_vaapi_encoder_h265_new (GstVaapiDisplay * display); 46 | 47 | gboolean 48 | gst_vaapi_encoder_h265_set_allowed_profiles (GstVaapiEncoderH265 * encoder, 49 | GArray * profiles); 50 | 51 | gboolean 52 | gst_vaapi_encoder_h265_get_profile_tier_level (GstVaapiEncoderH265 * encoder, 53 | GstVaapiProfile * out_profile_ptr, GstVaapiTierH265 *out_tier_ptr, GstVaapiLevelH265 * out_level_ptr); 54 | 55 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderH265, gst_object_unref) 56 | 57 | G_END_DECLS 58 | 59 | #endif /*GST_VAAPI_ENCODER_H265_H */ 60 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_jpeg.h JPEGG encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_ENCODER_JPEG_H 24 | #define GST_VAAPI_ENCODER_JPEG_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_ENCODER_JPEG \ 31 | (gst_vaapi_encoder_jpeg_get_type ()) 32 | #define GST_VAAPI_ENCODER_JPEG(encoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_JPEG, GstVaapiEncoderJpeg)) 34 | #define GST_IS_VAAPI_ENCODER_JPEG(encoder) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_JPEG)) 36 | 37 | typedef struct _GstVaapiEncoderJpeg GstVaapiEncoderJpeg; 38 | typedef struct _GstVaapiEncoderJpegClass GstVaapiEncoderJpegClass; 39 | 40 | GType 41 | gst_vaapi_encoder_jpeg_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiEncoder * 44 | gst_vaapi_encoder_jpeg_new (GstVaapiDisplay * display); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderJpeg, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /*GST_VAAPI_ENCODER_JPEG_H */ 51 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_mpeg2.h - MPEG-2 encoder 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Guangxin Xu 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_ENCODER_MPEG2_H 25 | #define GST_VAAPI_ENCODER_MPEG2_H 26 | 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPI_ENCODER_MPEG2 \ 32 | (gst_vaapi_encoder_mpeg2_get_type ()) 33 | #define GST_VAAPI_ENCODER_MPEG2(encoder) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_MPEG2, GstVaapiEncoderMpeg2)) 35 | #define GST_IS_VAAPI_ENCODER_MPEG2(encoder) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_MPEG2)) 37 | 38 | typedef struct _GstVaapiEncoderMpeg2 GstVaapiEncoderMpeg2; 39 | typedef struct _GstVaapiEncoderMpeg2Class GstVaapiEncoderMpeg2Class; 40 | 41 | GType 42 | gst_vaapi_encoder_mpeg2_get_type (void) G_GNUC_CONST; 43 | 44 | GstVaapiEncoder * 45 | gst_vaapi_encoder_mpeg2_new (GstVaapiDisplay * display); 46 | 47 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderMpeg2, gst_object_unref) 48 | 49 | G_END_DECLS 50 | 51 | #endif /* GST_VAAPI_ENCODER_MPEG2_H */ 52 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_mpeg2_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_mpeg2_priv.h - MPEG-2 encoder (private definitions) 3 | * 4 | * Copyright (C) 2013-2014 Intel Corporation 5 | * Author: Guangxin Xu 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_ENCODER_MPEG2_PRIV_H 25 | #define GST_VAAPI_ENCODER_MPEG2_PRIV_H 26 | 27 | #include "gstvaapiencoder_priv.h" 28 | #include "gstvaapiutils_mpeg2.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_VAAPI_ENCODER_MPEG2_CAST(encoder) \ 33 | ((GstVaapiEncoderMpeg2 *) (encoder)) 34 | 35 | #define START_CODE_PICUTRE 0x00000100 36 | #define START_CODE_SLICE 0x00000101 37 | #define START_CODE_USER 0x000001B2 38 | #define START_CODE_SEQ 0x000001B3 39 | #define START_CODE_EXT 0x000001B5 40 | #define START_CODE_GOP 0x000001B8 41 | 42 | struct _GstVaapiEncoderMpeg2 43 | { 44 | GstVaapiEncoder parent_instance; 45 | 46 | GstVaapiProfile profile; 47 | GstVaapiLevelMPEG2 level; 48 | guint8 profile_idc; 49 | guint8 level_idc; 50 | guint32 cqp; /* quantizer value for CQP mode */ 51 | guint32 ip_period; 52 | 53 | /* re-ordering */ 54 | GQueue b_frames; 55 | gboolean dump_frames; 56 | gboolean new_gop; 57 | 58 | /* reference list */ 59 | GstVaapiSurfaceProxy *forward; 60 | GstVaapiSurfaceProxy *backward; 61 | guint32 frame_num; /* same value picture header, but it's not mod by 1024 */ 62 | }; 63 | 64 | G_END_DECLS 65 | 66 | #endif /* GST_VAAPI_ENCODER_MPEG2_PRIV_H */ 67 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_vp8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_vp8.h VP8G encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_ENCODER_VP8_H 24 | #define GST_VAAPI_ENCODER_VP8_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_ENCODER_VP8 \ 31 | (gst_vaapi_encoder_vp8_get_type ()) 32 | #define GST_VAAPI_ENCODER_VP8(encoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_VP8, GstVaapiEncoderVP8)) 34 | #define GST_IS_VAAPI_ENCODER_VP8(encoder) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_VP8)) 36 | 37 | typedef struct _GstVaapiEncoderVP8 GstVaapiEncoderVP8; 38 | typedef struct _GstVaapiEncoderVP8Class GstVaapiEncoderVP8Class; 39 | 40 | GType 41 | gst_vaapi_encoder_vp8_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiEncoder * 44 | gst_vaapi_encoder_vp8_new (GstVaapiDisplay * display); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderVP8, gst_object_unref) 47 | 48 | G_END_DECLS 49 | #endif /*GST_VAAPI_ENCODER_VP8_H */ 50 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiencoder_vp9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencoder_vp9.h VP9 encoder 3 | * 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_ENCODER_VP9_H 24 | #define GST_VAAPI_ENCODER_VP9_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_ENCODER_VP9 \ 31 | (gst_vaapi_encoder_vp9_get_type ()) 32 | #define GST_VAAPI_ENCODER_VP9(encoder) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST ((encoder), GST_TYPE_VAAPI_ENCODER_VP9, GstVaapiEncoderVP9)) 34 | #define GST_IS_VAAPI_ENCODER_VP9(encoder) \ 35 | (G_TYPE_CHECK_INSTANCE_TYPE ((encoder), GST_TYPE_VAAPI_ENCODER_VP9)) 36 | 37 | typedef struct _GstVaapiEncoderVP9 GstVaapiEncoderVP9; 38 | typedef struct _GstVaapiEncoderVP9Class GstVaapiEncoderVP9Class; 39 | 40 | GType 41 | gst_vaapi_encoder_vp9_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiEncoder * 44 | gst_vaapi_encoder_vp9_new (GstVaapiDisplay * display); 45 | 46 | gboolean 47 | gst_vaapi_encoder_vp9_set_allowed_profiles (GstVaapiEncoderVP9 * encoder, 48 | GArray * profiles); 49 | 50 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiEncoderVP9, gst_object_unref) 51 | 52 | G_END_DECLS 53 | #endif /*GST_VAAPI_ENCODER_VP9_H */ 54 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiimagepool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiimagepool.h - Gst VA image pool 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_IMAGE_POOL_H 26 | #define GST_VAAPI_IMAGE_POOL_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_VAAPI_IMAGE_POOL(obj) \ 35 | ((GstVaapiImagePool *)(obj)) 36 | 37 | typedef struct _GstVaapiImagePool GstVaapiImagePool; 38 | 39 | GstVaapiVideoPool * 40 | gst_vaapi_image_pool_new (GstVaapiDisplay * display, const GstVideoInfo * vip); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* GST_VAAPI_IMAGE_POOL_H */ 45 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiparser_frame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiparser_frame.h - VA parser frame 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_PARSER_FRAME_H 24 | #define GST_VAAPI_PARSER_FRAME_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef struct _GstVaapiParserFrame GstVaapiParserFrame; 32 | 33 | #define GST_VAAPI_PARSER_FRAME(frame) \ 34 | ((GstVaapiParserFrame *)(frame)) 35 | 36 | #define GST_VAAPI_IS_PARSER_FRAME(frame) \ 37 | (GST_VAAPI_PARSER_FRAME(frame) != NULL) 38 | 39 | /** 40 | * GstVaapiParserFrame: 41 | * @output_offset: current offset to the reconstructed #GstBuffer for 42 | * this #GstVideoCodecFrame. This is used to initialize the decoder 43 | * unit offset 44 | * @units: list of #GstVaapiDecoderUnit objects (slice data) 45 | * @pre_units: list of units to decode before GstVaapiDecoder:start_frame() 46 | * @post_units: list of units to decode after GstVaapiDecoder:end_frame() 47 | * 48 | * An extension to #GstVideoCodecFrame with #GstVaapiDecoder specific 49 | * information. Decoder frames are usually attached to codec frames as 50 | * the user_data anchor point. 51 | */ 52 | struct _GstVaapiParserFrame { 53 | /*< private >*/ 54 | GstVaapiMiniObject parent_instance; 55 | 56 | guint output_offset; 57 | GArray *units; 58 | GArray *pre_units; 59 | GArray *post_units; 60 | }; 61 | 62 | G_GNUC_INTERNAL 63 | GstVaapiParserFrame * 64 | gst_vaapi_parser_frame_new(guint width, guint height); 65 | 66 | G_GNUC_INTERNAL 67 | void 68 | gst_vaapi_parser_frame_free(GstVaapiParserFrame *frame); 69 | 70 | G_GNUC_INTERNAL 71 | void 72 | gst_vaapi_parser_frame_append_unit(GstVaapiParserFrame *frame, 73 | GstVaapiDecoderUnit *unit); 74 | 75 | static inline GstVaapiParserFrame * 76 | gst_vaapi_parser_frame_ref (GstVaapiParserFrame * frame) 77 | { 78 | return (GstVaapiParserFrame *) 79 | gst_vaapi_mini_object_ref (GST_VAAPI_MINI_OBJECT (frame)); 80 | } 81 | 82 | static inline void 83 | gst_vaapi_parser_frame_unref (GstVaapiParserFrame * frame) 84 | { 85 | gst_vaapi_mini_object_unref (GST_VAAPI_MINI_OBJECT (frame)); 86 | } 87 | 88 | static inline void 89 | gst_vaapi_parser_frame_replace(GstVaapiParserFrame * old_frame_p, 90 | GstVaapiParserFrame * new_frame) 91 | { 92 | gst_vaapi_mini_object_replace ((GstVaapiMiniObject **) old_frame_p, 93 | (GstVaapiMiniObject *) new_frame); 94 | } 95 | 96 | G_END_DECLS 97 | 98 | #endif /* GST_VAAPI_PARSER_FRAME_H */ 99 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiprofilecaps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiprofilecaps.h - VA config attributes as gstreamer capabilities 3 | * 4 | * Copyright (C) 2019 Igalia, S.L. 5 | * Author: Víctor Jáquez 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_PROFILE_CAPS_H 24 | #define GST_VAAPI_PROFILE_CAPS_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | gboolean 33 | gst_vaapi_profile_caps_append_decoder (GstVaapiDisplay * display, 34 | GstVaapiProfile profile, GstStructure * structure); 35 | 36 | gboolean 37 | gst_vaapi_mem_type_supports (guint va_mem_types, guint mem_type); 38 | 39 | G_END_DECLS 40 | 41 | #endif /* GST_VAAPI_PROFILE_CAPS_H */ 42 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapisurface_drm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapisurface_drm.h - VA surface abstraction (DRM interop) 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_SURFACE_DRM_H 24 | #define GST_VAAPI_SURFACE_DRM_H 25 | 26 | #include 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | GstVaapiBufferProxy * 32 | gst_vaapi_surface_peek_dma_buf_handle (GstVaapiSurface * surface); 33 | 34 | GstVaapiBufferProxy * 35 | gst_vaapi_surface_peek_gem_buf_handle (GstVaapiSurface * surface); 36 | 37 | GstVaapiSurface * 38 | gst_vaapi_surface_new_with_dma_buf_handle (GstVaapiDisplay * display, gint fd, 39 | GstVideoInfo * vi); 40 | 41 | GstVaapiSurface * 42 | gst_vaapi_surface_new_with_gem_buf_handle (GstVaapiDisplay * display, 43 | guint32 name, guint size, GstVideoFormat format, guint width, guint height, 44 | gsize offset[GST_VIDEO_MAX_PLANES], gint stride[GST_VIDEO_MAX_PLANES]); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* GST_VAAPI_SURFACE_DRM_H */ 49 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapisurface_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapisurface_egl.h - VA surface abstraction (EGL interop) 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_SURFACE_EGL_H 24 | #define GST_VAAPI_SURFACE_EGL_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | GstVaapiSurface * 33 | gst_vaapi_surface_new_from_egl_image (GstVaapiDisplay * display, 34 | const GstVideoInfo * vip, EGLImageKHR image, GstVideoFormat format, 35 | guint width, guint height, guint flags); 36 | 37 | GstVaapiSurface * 38 | gst_vaapi_surface_new_with_egl_image (GstVaapiDisplay * display, 39 | EGLImageKHR image, GstVideoFormat format, guint width, guint height, 40 | guint mem_types); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* GST_VAAPI_SURFACE_EGL_H */ 45 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapisurfacepool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapisurfacepool.h - Gst VA surface pool 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_SURFACE_POOL_H 26 | #define GST_VAAPI_SURFACE_POOL_H 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_VAAPI_SURFACE_POOL(obj) \ 35 | ((GstVaapiSurfacePool *)(obj)) 36 | 37 | typedef struct _GstVaapiSurfacePool GstVaapiSurfacePool; 38 | 39 | GstVaapiVideoPool * 40 | gst_vaapi_surface_pool_new (GstVaapiDisplay * display, GstVideoFormat format, 41 | guint width, guint height, guint surface_allocation_flags); 42 | 43 | GstVaapiVideoPool * 44 | gst_vaapi_surface_pool_new_full (GstVaapiDisplay * display, 45 | const GstVideoInfo * vip, guint surface_allocation_flags); 46 | 47 | GstVaapiVideoPool * 48 | gst_vaapi_surface_pool_new_with_chroma_type (GstVaapiDisplay * display, 49 | GstVaapiChromaType chroma_type, guint width, guint height, 50 | guint surface_allocation_flags); 51 | 52 | G_END_DECLS 53 | 54 | #endif /* GST_VAAPI_SURFACE_POOL_H */ 55 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapitexture_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapitexture_egl.h - VA/EGL texture abstraction 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_TEXTURE_EGL_H 24 | #define GST_VAAPI_TEXTURE_EGL_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | GstVaapiTexture * 31 | gst_vaapi_texture_egl_new (GstVaapiDisplay * display, guint target, 32 | guint format, guint width, guint height); 33 | 34 | GstVaapiTexture * 35 | gst_vaapi_texture_egl_new_wrapped (GstVaapiDisplay * display, guint id, 36 | guint target, guint format, guint width, guint height); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* GST_VAAPI_TEXTURE_EGL_H */ 41 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapitexture_glx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapitexture_glx.h - VA/GLX texture abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2014 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_TEXTURE_GLX_H 26 | #define GST_VAAPI_TEXTURE_GLX_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | GstVaapiTexture * 33 | gst_vaapi_texture_glx_new (GstVaapiDisplay * display, guint target, 34 | guint format, guint width, guint height); 35 | 36 | GstVaapiTexture * 37 | gst_vaapi_texture_glx_new_wrapped (GstVaapiDisplay * display, guint id, 38 | guint target, guint format); 39 | 40 | G_END_DECLS 41 | 42 | #endif /* GST_VAAPI_TEXTURE_GLX_H */ 43 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapitexturemap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapitexturemap.h - VA texture Hash map 3 | * 4 | * Copyright (C) 2016 Intel Corporation 5 | * Copyright (C) 2016 Igalia S.L. 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_TEXTURE_MAP_H 24 | #define GST_VAAPI_TEXTURE_MAP_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _GstVaapiTextureMap GstVaapiTextureMap; 31 | typedef struct _GstVaapiTextureMapClass GstVaapiTextureMapClass; 32 | 33 | #define GST_TYPE_VAAPI_TEXTURE_MAP \ 34 | (gst_vaapi_texture_map_get_type ()) 35 | #define GST_VAAPI_TEXTURE_MAP(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_TEXTURE_MAP, GstVaapiTextureMap)) 37 | 38 | GstVaapiTextureMap * 39 | gst_vaapi_texture_map_new (void); 40 | 41 | gboolean 42 | gst_vaapi_texture_map_add (GstVaapiTextureMap * map, 43 | GstVaapiTexture * texture, 44 | guint id); 45 | 46 | GstVaapiTexture * 47 | gst_vaapi_texture_map_lookup (GstVaapiTextureMap * map, 48 | guint id); 49 | 50 | void 51 | gst_vaapi_texture_map_reset (GstVaapiTextureMap * map); 52 | 53 | GType 54 | gst_vaapi_texture_map_get_type (void) G_GNUC_CONST; 55 | 56 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiTextureMap, gst_object_unref) 57 | 58 | G_END_DECLS 59 | 60 | #endif /* GST_VAAPI_TEXTURE_MAP_H */ 61 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_core.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_core.h - VA-API utilities (Core, MT-safe) 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_UTILS_CORE_H 26 | #define GST_VAAPI_UTILS_CORE_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | typedef struct _GstVaapiConfigSurfaceAttributes GstVaapiConfigSurfaceAttributes; 33 | 34 | 35 | /** 36 | * GstVaapiConfigSurfaceAttributes: 37 | * @min_width: Minimal width in pixels. 38 | * @min_height: Minimal height in pixels. 39 | * @max_width: Maximal width in pixels. 40 | * @max_height: Maximal height in pixels. 41 | * @mem_types: Surface memory type expressed in bit fields. 42 | * @formats: Array of avialable GstVideoFormats of a surface in a VAConfig. 43 | * 44 | * Represents the possible surface attributes for the supplied config. 45 | **/ 46 | struct _GstVaapiConfigSurfaceAttributes 47 | { 48 | gint min_width; 49 | gint min_height; 50 | gint max_width; 51 | gint max_height; 52 | guint mem_types; 53 | GArray *formats; 54 | }; 55 | 56 | /* Gets attribute value for the supplied profile/entrypoint pair (MT-safe) */ 57 | G_GNUC_INTERNAL 58 | gboolean 59 | gst_vaapi_get_config_attribute (GstVaapiDisplay * display, VAProfile profile, 60 | VAEntrypoint entrypoint, VAConfigAttribType type, guint * out_value_ptr); 61 | 62 | G_GNUC_INTERNAL 63 | GstVaapiConfigSurfaceAttributes * 64 | gst_vaapi_config_surface_attributes_get (GstVaapiDisplay * display, VAConfigID config); 65 | 66 | G_GNUC_INTERNAL 67 | void 68 | gst_vaapi_config_surface_attributes_free (GstVaapiConfigSurfaceAttributes * attribs); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_VAAPI_UTILS_CORE_H */ 73 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_h264_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_h264_priv.h - H.264 related utilities 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_UTILS_H264_PRIV_H 24 | #define GST_VAAPI_UTILS_H264_PRIV_H 25 | 26 | #include "gstvaapiutils_h264.h" 27 | #include "gstvaapisurface.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | /** 32 | * GstVaapiH264LevelLimits: 33 | * @level: the #GstVaapiLevelH264 34 | * @level_idc: the H.264 level_idc value 35 | * @MaxMBPS: the maximum macroblock processing rate (MB/sec) 36 | * @MaxFS: the maximum frame size (MBs) 37 | * @MaxDpbMbs: the maxium decoded picture buffer size (MBs) 38 | * @MaxBR: the maximum video bit rate (kbps) 39 | * @MaxCPB: the maximum CPB size (kbits) 40 | * @MinCR: the minimum Compression Ratio 41 | * 42 | * The data structure that describes the limits of an H.264 level. 43 | */ 44 | typedef struct { 45 | GstVaapiLevelH264 level; 46 | guint8 level_idc; 47 | guint32 MaxMBPS; 48 | guint32 MaxFS; 49 | guint32 MaxDpbMbs; 50 | guint32 MaxBR; 51 | guint32 MaxCPB; 52 | guint32 MinCR; 53 | } GstVaapiH264LevelLimits; 54 | 55 | /* Returns GstVaapiProfile from H.264 profile_idc value */ 56 | G_GNUC_INTERNAL 57 | GstVaapiProfile 58 | gst_vaapi_utils_h264_get_profile (guint8 profile_idc); 59 | 60 | /* Returns H.264 profile_idc value from GstVaapiProfile */ 61 | G_GNUC_INTERNAL 62 | guint8 63 | gst_vaapi_utils_h264_get_profile_idc (GstVaapiProfile profile); 64 | 65 | /* Returns GstVaapiLevelH264 from H.264 level_idc value */ 66 | G_GNUC_INTERNAL 67 | GstVaapiLevelH264 68 | gst_vaapi_utils_h264_get_level (guint8 level_idc); 69 | 70 | /* Returns H.264 level_idc value from GstVaapiLevelH264 */ 71 | G_GNUC_INTERNAL 72 | guint8 73 | gst_vaapi_utils_h264_get_level_idc (GstVaapiLevelH264 level); 74 | 75 | /* Returns level limits as specified in Table A-1 of the H.264 standard */ 76 | G_GNUC_INTERNAL 77 | const GstVaapiH264LevelLimits * 78 | gst_vaapi_utils_h264_get_level_limits (GstVaapiLevelH264 level); 79 | 80 | /* Returns the Table A-1 specification */ 81 | G_GNUC_INTERNAL 82 | const GstVaapiH264LevelLimits * 83 | gst_vaapi_utils_h264_get_level_limits_table (guint * out_length_ptr); 84 | 85 | /* Returns GstVaapiChromaType from H.264 chroma_format_idc value */ 86 | G_GNUC_INTERNAL 87 | GstVaapiChromaType 88 | gst_vaapi_utils_h264_get_chroma_type (guint chroma_format_idc); 89 | 90 | /* Returns H.264 chroma_format_idc value from GstVaapiChromaType */ 91 | G_GNUC_INTERNAL 92 | guint 93 | gst_vaapi_utils_h264_get_chroma_format_idc (GstVaapiChromaType chroma_type); 94 | 95 | G_END_DECLS 96 | 97 | #endif /* GST_VAAPI_UTILS_H264_PRIV_H */ 98 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_h26x_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_h26x_priv.h - H.26x related utilities 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2017 Intel Corporation 7 | * Author: Hyunjun Ko 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_UTILS_H26X_PRIV_H 26 | #define GST_VAAPI_UTILS_H26X_PRIV_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | /* Default CPB length (in milliseconds) */ 33 | #define DEFAULT_CPB_LENGTH 1500 34 | 35 | /* Scale factor for CPB size (HRD cpb_size_scale: min = 4) */ 36 | #define SX_CPB_SIZE 4 37 | 38 | /* Scale factor for bitrate (HRD bit_rate_scale: min = 6) */ 39 | #define SX_BITRATE 6 40 | 41 | /* Define default rate control mode ("constant-qp") */ 42 | #define DEFAULT_RATECONTROL GST_VAAPI_RATECONTROL_CQP 43 | 44 | /* ------------------------------------------------------------------------- */ 45 | /* --- H.264/265 Bitstream Writer --- */ 46 | /* ------------------------------------------------------------------------- */ 47 | 48 | #define WRITE_UINT32(bs, val, nbits) \ 49 | G_STMT_START { \ 50 | if (!gst_bit_writer_put_bits_uint32 (bs, val, nbits)) { \ 51 | GST_WARNING ("failed to write uint32, nbits: %d", nbits); \ 52 | goto bs_error; \ 53 | } \ 54 | } G_STMT_END 55 | 56 | #define WRITE_UE(bs, val) \ 57 | G_STMT_START { \ 58 | if (!bs_write_ue (bs, val)) { \ 59 | GST_WARNING ("failed to write ue(v)"); \ 60 | goto bs_error; \ 61 | } \ 62 | } G_STMT_END 63 | 64 | #define WRITE_SE(bs, val) \ 65 | G_STMT_START { \ 66 | if (!bs_write_se (bs, val)) { \ 67 | GST_WARNING ("failed to write se(v)"); \ 68 | goto bs_error; \ 69 | } \ 70 | } G_STMT_END 71 | 72 | G_GNUC_INTERNAL 73 | gboolean 74 | bs_write_ue (GstBitWriter * bs, guint32 value); 75 | 76 | G_GNUC_INTERNAL 77 | gboolean 78 | bs_write_se (GstBitWriter * bs, gint32 value); 79 | 80 | /* Write nal unit, applying emulation prevention bytes */ 81 | G_GNUC_INTERNAL 82 | gboolean 83 | gst_vaapi_utils_h26x_write_nal_unit (GstBitWriter * bs, guint8 * nal, guint nal_size); 84 | 85 | G_END_DECLS 86 | 87 | #endif /* GST_VAAPI_UTILS_H26X_PRIV_H */ 88 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_mpeg2.h - MPEG-2 related utilities 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_UTILS_MPEG2_H 24 | #define GST_VAAPI_UTILS_MPEG2_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | /** 31 | * GstVaapiLevelMPEG2: 32 | * @GST_VAAPI_LEVEL_MPEG2_LOW: Low level. 33 | * @GST_VAAPI_LEVEL_MPEG2_MAIN: Main level. 34 | * @GST_VAAPI_LEVEL_MPEG2_HIGH_1440: High-1440 level. 35 | * @GST_VAAPI_LEVEL_MPEG2_HIGH: High level. 36 | * @GST_VAAPI_LEVEL_MPEG2_HIGHP: HighP level. 37 | * 38 | * The set of all levels for #GstVaapiLevelMPEG2. 39 | */ 40 | typedef enum { 41 | GST_VAAPI_LEVEL_MPEG2_LOW = 1, 42 | GST_VAAPI_LEVEL_MPEG2_MAIN, 43 | GST_VAAPI_LEVEL_MPEG2_HIGH_1440, 44 | GST_VAAPI_LEVEL_MPEG2_HIGH, 45 | GST_VAAPI_LEVEL_MPEG2_HIGHP, 46 | } GstVaapiLevelMPEG2; 47 | 48 | /* Returns a relative score for the supplied GstVaapiProfile */ 49 | guint 50 | gst_vaapi_utils_mpeg2_get_profile_score (GstVaapiProfile profile); 51 | 52 | /* Returns GstVaapiProfile from a string representation */ 53 | GstVaapiProfile 54 | gst_vaapi_utils_mpeg2_get_profile_from_string (const gchar * str); 55 | 56 | /* Returns a string representation for the supplied MPEG-2 profile */ 57 | const gchar * 58 | gst_vaapi_utils_mpeg2_get_profile_string (GstVaapiProfile profile); 59 | 60 | /* Returns GstVaapiLevelMPEG2 from a string representation */ 61 | GstVaapiLevelMPEG2 62 | gst_vaapi_utils_mpeg2_get_level_from_string (const gchar * str); 63 | 64 | /* Returns a string representation for the supplied MPEG-2 level */ 65 | const gchar * 66 | gst_vaapi_utils_mpeg2_get_level_string (GstVaapiLevelMPEG2 level); 67 | 68 | G_END_DECLS 69 | 70 | #endif /* GST_VAAPI_UTILS_MPEG2_H */ 71 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_mpeg2_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_mpeg2_priv.h - MPEG-2 related utilities 3 | * 4 | * Copyright (C) 2011-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_UTILS_MPEG2_PRIV_H 24 | #define GST_VAAPI_UTILS_MPEG2_PRIV_H 25 | 26 | #include "gstvaapiutils_mpeg2.h" 27 | #include "gstvaapisurface.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | /** 32 | * GstVaapiMPEG2LevelLimits: 33 | * @level: the #GstVaapiLevelMPEG2 34 | * @level_idc: the MPEG-2 level indication value 35 | * @horizontal_size_value: the maximum number of samples per line 36 | * @vertical_size_value: the maximum number of lines per frame 37 | * @frame_rate_value: the maximum number of frames per second 38 | * @sample_rate: the maximum number of samples per second (for luminance) 39 | * @bit_rate: the maximum bit rate (kbps) 40 | * @vbv_buffer_size: the VBV buffer size requirements (bits) 41 | * 42 | * The data structure that describes the limits of an MPEG-2 level. 43 | */ 44 | typedef struct { 45 | GstVaapiLevelMPEG2 level; 46 | guint8 level_idc; 47 | guint16 horizontal_size_value; 48 | guint16 vertical_size_value; 49 | guint32 frame_rate_value; 50 | guint32 sample_rate; 51 | guint32 bit_rate; 52 | guint32 vbv_buffer_size; 53 | } GstVaapiMPEG2LevelLimits; 54 | 55 | /* Returns GstVaapiProfile from MPEG-2 profile_idc value */ 56 | G_GNUC_INTERNAL 57 | GstVaapiProfile 58 | gst_vaapi_utils_mpeg2_get_profile (guint8 profile_idc); 59 | 60 | /* Returns MPEG-2 profile_idc value from GstVaapiProfile */ 61 | G_GNUC_INTERNAL 62 | guint8 63 | gst_vaapi_utils_mpeg2_get_profile_idc (GstVaapiProfile profile); 64 | 65 | /* Returns GstVaapiLevelMPEG2 from MPEG-2 level_idc value */ 66 | G_GNUC_INTERNAL 67 | GstVaapiLevelMPEG2 68 | gst_vaapi_utils_mpeg2_get_level (guint8 level_idc); 69 | 70 | /* Returns MPEG-2 level_idc value from GstVaapiLevelMPEG2 */ 71 | G_GNUC_INTERNAL 72 | guint8 73 | gst_vaapi_utils_mpeg2_get_level_idc (GstVaapiLevelMPEG2 level); 74 | 75 | /* Returns level limits as specified in Table A-1 of the MPEG-2 standard */ 76 | G_GNUC_INTERNAL 77 | const GstVaapiMPEG2LevelLimits * 78 | gst_vaapi_utils_mpeg2_get_level_limits (GstVaapiLevelMPEG2 level); 79 | 80 | /* Returns the Table A-1 specification */ 81 | G_GNUC_INTERNAL 82 | const GstVaapiMPEG2LevelLimits * 83 | gst_vaapi_utils_mpeg2_get_level_limits_table (guint * out_length_ptr); 84 | 85 | /* Returns GstVaapiChromaType from MPEG-2 chroma_format_idc value */ 86 | G_GNUC_INTERNAL 87 | GstVaapiChromaType 88 | gst_vaapi_utils_mpeg2_get_chroma_type (guint chroma_format_idc); 89 | 90 | /* Returns MPEG-2 chroma_format_idc value from GstVaapiChromaType */ 91 | G_GNUC_INTERNAL 92 | guint 93 | gst_vaapi_utils_mpeg2_get_chroma_format_idc (GstVaapiChromaType chroma_type); 94 | 95 | G_END_DECLS 96 | 97 | #endif /* GST_VAAPI_UTILS_MPEG2_PRIV_H */ 98 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_vpx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_vpx.h - vpx related utilities 3 | * 4 | * Copyright (C) 2020 Intel Corporation 5 | * Author: He Junyan 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_UTILS_VPX_H 24 | #define GST_VAAPI_UTILS_VPX_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | /** Returns GstVaapiProfile from a string representation */ 31 | GstVaapiProfile 32 | gst_vaapi_utils_vp9_get_profile_from_string (const gchar * str); 33 | 34 | /** Returns a string representation for the supplied VP9 profile */ 35 | const gchar * 36 | gst_vaapi_utils_vp9_get_profile_string (GstVaapiProfile profile); 37 | 38 | guint 39 | gst_vaapi_utils_vp9_get_chroma_format_idc (guint chroma_type); 40 | 41 | G_END_DECLS 42 | 43 | #endif /* GST_VAAPI_UTILS_VPX_H */ 44 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiutils_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiutils_x11.h - X11 utilties 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_UTILS_X11_H 26 | #define GST_VAAPI_UTILS_X11_H 27 | 28 | #include "config.h" 29 | #include 30 | #include 31 | 32 | G_GNUC_INTERNAL 33 | void 34 | x11_trap_errors (void); 35 | 36 | G_GNUC_INTERNAL 37 | int 38 | x11_untrap_errors (void); 39 | 40 | G_GNUC_INTERNAL 41 | Window 42 | x11_create_window (Display * dpy, guint w, guint h, guint vid, Colormap cmap); 43 | 44 | G_GNUC_INTERNAL 45 | gboolean 46 | x11_get_geometry (Display * dpy, Drawable drawable, gint * px, gint * py, 47 | guint * pwidth, guint * pheight, guint * pdepth); 48 | 49 | #endif /* GST_VAAPI_UTILS_X11_H */ 50 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapivideopool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideopool.h - Video object pool abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_VIDEO_POOL_H 26 | #define GST_VAAPI_VIDEO_POOL_H 27 | 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_VAAPI_VIDEO_POOL(obj) \ 34 | ((GstVaapiVideoPool *)(obj)) 35 | 36 | typedef struct _GstVaapiVideoPool GstVaapiVideoPool; 37 | 38 | /** 39 | * GstVaapiVideoPoolObjectType: 40 | * @GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE: #GstVaapiImage objects. 41 | * @GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE: #GstVaapiSurface objects. 42 | * @GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER: #GstVaapiCodedBuffer objects. 43 | * 44 | * The set of all supported #GstVaapiVideoPool object types. 45 | */ 46 | typedef enum 47 | { 48 | GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_IMAGE = 1, 49 | GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_SURFACE, 50 | GST_VAAPI_VIDEO_POOL_OBJECT_TYPE_CODED_BUFFER 51 | } GstVaapiVideoPoolObjectType; 52 | 53 | GstVaapiVideoPool * 54 | gst_vaapi_video_pool_ref (GstVaapiVideoPool * pool); 55 | 56 | void 57 | gst_vaapi_video_pool_unref (GstVaapiVideoPool * pool); 58 | 59 | void 60 | gst_vaapi_video_pool_replace (GstVaapiVideoPool ** old_pool_ptr, 61 | GstVaapiVideoPool * new_pool); 62 | 63 | GstVaapiDisplay * 64 | gst_vaapi_video_pool_get_display (GstVaapiVideoPool * pool); 65 | 66 | GstVaapiVideoPoolObjectType 67 | gst_vaapi_video_pool_get_object_type (GstVaapiVideoPool * pool); 68 | 69 | gpointer 70 | gst_vaapi_video_pool_get_object (GstVaapiVideoPool * pool); 71 | 72 | void 73 | gst_vaapi_video_pool_put_object (GstVaapiVideoPool * pool, gpointer object); 74 | 75 | gboolean 76 | gst_vaapi_video_pool_add_object (GstVaapiVideoPool * pool, gpointer object); 77 | 78 | gboolean 79 | gst_vaapi_video_pool_add_objects (GstVaapiVideoPool * pool, 80 | GPtrArray * objects); 81 | 82 | guint 83 | gst_vaapi_video_pool_get_size (GstVaapiVideoPool * pool); 84 | 85 | gboolean 86 | gst_vaapi_video_pool_reserve (GstVaapiVideoPool * pool, guint n); 87 | 88 | guint 89 | gst_vaapi_video_pool_get_capacity (GstVaapiVideoPool * pool); 90 | 91 | void 92 | gst_vaapi_video_pool_set_capacity (GstVaapiVideoPool * pool, guint capacity); 93 | 94 | G_END_DECLS 95 | 96 | #endif /* GST_VAAPI_VIDEO_POOL_H */ 97 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapivideopool_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideopool_priv.h - Video object pool abstraction (private defs) 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_VIDEO_POOL_PRIV_H 26 | #define GST_VAAPI_VIDEO_POOL_PRIV_H 27 | 28 | #include "gstvaapiminiobject.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_VAAPI_VIDEO_POOL_CLASS(klass) \ 33 | ((GstVaapiVideoPoolClass *)(klass)) 34 | #define GST_VAAPI_IS_VIDEO_POOL_CLASS(klass) \ 35 | ((klass) != NULL) 36 | 37 | typedef struct _GstVaapiVideoPoolClass GstVaapiVideoPoolClass; 38 | 39 | /** 40 | * GstVaapiVideoPool: 41 | * 42 | * A pool of lazily allocated video objects. e.g. surfaces, images. 43 | */ 44 | struct _GstVaapiVideoPool 45 | { 46 | /*< private >*/ 47 | GstVaapiMiniObject parent_instance; 48 | 49 | guint object_type; 50 | GstVaapiDisplay *display; 51 | GQueue free_objects; 52 | GList *used_objects; 53 | guint used_count; 54 | guint capacity; 55 | GMutex mutex; 56 | }; 57 | 58 | /** 59 | * GstVaapiVideoPoolClass: 60 | * @alloc_object: virtual function for allocating a video pool object 61 | * 62 | * A pool base class used to hold video objects. e.g. surfaces, images. 63 | */ 64 | struct _GstVaapiVideoPoolClass 65 | { 66 | /*< private >*/ 67 | GstVaapiMiniObjectClass parent_class; 68 | 69 | /*< public >*/ 70 | gpointer (*alloc_object) (GstVaapiVideoPool * pool); 71 | }; 72 | 73 | G_GNUC_INTERNAL 74 | void 75 | gst_vaapi_video_pool_init (GstVaapiVideoPool * pool, GstVaapiDisplay * display, 76 | GstVaapiVideoPoolObjectType object_type); 77 | 78 | G_GNUC_INTERNAL 79 | void 80 | gst_vaapi_video_pool_finalize (GstVaapiVideoPool * pool); 81 | 82 | G_END_DECLS 83 | 84 | #endif /* GST_VAAPI_VIDEO_POOL_PRIV_H */ 85 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_drm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_drm.h - VA/DRM window abstraction 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_WINDOW_DRM_H 24 | #define GST_VAAPI_WINDOW_DRM_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_WINDOW_DRM (gst_vaapi_window_drm_get_type ()) 33 | #define GST_VAAPI_WINDOW_DRM(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_WINDOW_DRM, GstVaapiWindowDRM)) 35 | #define GST_VAAPI_IS_WINDOW_DRM(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_WINDOW_DRM)) 37 | 38 | typedef struct _GstVaapiWindowDRM GstVaapiWindowDRM; 39 | 40 | GType 41 | gst_vaapi_window_drm_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiWindow * 44 | gst_vaapi_window_drm_new (GstVaapiDisplay * display, guint width, guint height); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiWindowDRM, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GST_VAAPI_WINDOW_DRM_H */ 51 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_egl.h - VA/EGL window abstraction 3 | * 4 | * Copyright (C) 2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_WINDOW_EGL_H 24 | #define GST_VAAPI_WINDOW_EGL_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_WINDOW_EGL (gst_vaapi_window_egl_get_type ()) 33 | #define GST_VAAPI_WINDOW_EGL(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_WINDOW_EGL, GstVaapiWindowEGL)) 35 | #define GST_VAAPI_IS_WINDOW_EGL(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_WINDOW_EGL)) 37 | 38 | typedef struct _GstVaapiWindowEGL GstVaapiWindowEGL; 39 | 40 | GType 41 | gst_vaapi_window_egl_get_type (void) G_GNUC_CONST; 42 | 43 | GstVaapiWindow * 44 | gst_vaapi_window_egl_new (GstVaapiDisplay * display, guint width, guint height); 45 | 46 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiWindowEGL, gst_object_unref) 47 | 48 | G_END_DECLS 49 | 50 | #endif /* GST_VAAPI_WINDOW_EGL_H */ 51 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_glx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_glx.h - VA/GLX window abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_WINDOW_GLX_H 26 | #define GST_VAAPI_WINDOW_GLX_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | G_BEGIN_DECLS 36 | 37 | #define GST_TYPE_VAAPI_WINDOW_GLX (gst_vaapi_window_glx_get_type ()) 38 | #define GST_VAAPI_WINDOW_GLX(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_WINDOW_GLX, GstVaapiWindowGLX)) 40 | #define GST_VAAPI_IS_WINDOW_GLX(obj) \ 41 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_WINDOW_GLX)) 42 | 43 | typedef struct _GstVaapiWindowGLX GstVaapiWindowGLX; 44 | 45 | GType 46 | gst_vaapi_window_glx_get_type (void) G_GNUC_CONST; 47 | 48 | GstVaapiWindow * 49 | gst_vaapi_window_glx_new (GstVaapiDisplay * display, guint width, guint height); 50 | 51 | GstVaapiWindow * 52 | gst_vaapi_window_glx_new_with_xid (GstVaapiDisplay * display, Window xid); 53 | 54 | GLXContext 55 | gst_vaapi_window_glx_get_context (GstVaapiWindowGLX * window); 56 | 57 | gboolean 58 | gst_vaapi_window_glx_set_context (GstVaapiWindowGLX * window, GLXContext ctx); 59 | 60 | gboolean 61 | gst_vaapi_window_glx_make_current (GstVaapiWindowGLX * window); 62 | 63 | void 64 | gst_vaapi_window_glx_swap_buffers (GstVaapiWindowGLX * window); 65 | 66 | gboolean 67 | gst_vaapi_window_glx_put_texture (GstVaapiWindowGLX * window, 68 | GstVaapiTexture * texture, const GstVaapiRectangle * src_rect, 69 | const GstVaapiRectangle * dst_rect); 70 | 71 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiWindowGLX, gst_object_unref) 72 | 73 | G_END_DECLS 74 | 75 | #endif /* GST_VAAPI_WINDOW_GLX_H */ 76 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_wayland.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_wayland.h - VA/Wayland window abstraction 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_WINDOW_WAYLAND_H 25 | #define GST_VAAPI_WINDOW_WAYLAND_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_TYPE_VAAPI_WINDOW_WAYLAND (gst_vaapi_window_wayland_get_type ()) 34 | #define GST_VAAPI_WINDOW_WAYLAND(obj) \ 35 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_WINDOW_WAYLAND, GstVaapiWindowWayland)) 36 | #define GST_VAAPI_IS_WINDOW_WAYLAND(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_WINDOW_WAYLAND)) 38 | 39 | typedef struct _GstVaapiWindowWayland GstVaapiWindowWayland; 40 | 41 | GType 42 | gst_vaapi_window_wayland_get_type (void) G_GNUC_CONST; 43 | 44 | GstVaapiWindow * 45 | gst_vaapi_window_wayland_new (GstVaapiDisplay * display, guint width, 46 | guint height); 47 | 48 | GstVaapiWindow * 49 | gst_vaapi_window_wayland_new_with_surface (GstVaapiDisplay * display, 50 | guintptr wl_surface); 51 | 52 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiWindowWayland, gst_object_unref) 53 | 54 | G_END_DECLS 55 | 56 | #endif /* GST_VAAPI_WINDOW_WAYLAND_H */ 57 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_x11.h - VA/X11 window abstraction 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_WINDOW_X11_H 26 | #define GST_VAAPI_WINDOW_X11_H 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define GST_TYPE_VAAPI_WINDOW_X11 (gst_vaapi_window_x11_get_type ()) 36 | #define GST_VAAPI_WINDOW_X11(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_WINDOW_X11, GstVaapiWindowX11)) 38 | #define GST_VAAPI_IS_WINDOW_X11(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_WINDOW_X11)) 40 | 41 | /** 42 | * GST_VAAPI_WINDOW_XWINDOW: 43 | * @window: a #GstVaapiWindow 44 | * 45 | * Macro that evaluates to the underlying X11 Window of @window 46 | */ 47 | #define GST_VAAPI_WINDOW_XWINDOW(window) \ 48 | gst_vaapi_window_x11_get_xid (GST_VAAPI_WINDOW_X11 (window)) 49 | 50 | typedef struct _GstVaapiWindowX11 GstVaapiWindowX11; 51 | 52 | GType 53 | gst_vaapi_window_x11_get_type (void) G_GNUC_CONST; 54 | 55 | GstVaapiWindow * 56 | gst_vaapi_window_x11_new (GstVaapiDisplay * display, guint width, guint height); 57 | 58 | GstVaapiWindow * 59 | gst_vaapi_window_x11_new_with_xid (GstVaapiDisplay * display, Window xid); 60 | 61 | Window 62 | gst_vaapi_window_x11_get_xid (GstVaapiWindowX11 * window); 63 | 64 | gboolean 65 | gst_vaapi_window_x11_is_foreign_xid (GstVaapiWindowX11 * window); 66 | 67 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstVaapiWindowX11, gst_object_unref) 68 | 69 | G_END_DECLS 70 | 71 | #endif /* GST_VAAPI_WINDOW_X11_H */ 72 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiwindow_x11_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiwindow_x11_priv.h - VA/X11 window abstraction (private definitions) 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2012-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_WINDOW_X11_PRIV_H 26 | #define GST_VAAPI_WINDOW_X11_PRIV_H 27 | 28 | #include "gstvaapiwindow_priv.h" 29 | 30 | #if HAVE_XRENDER 31 | # include 32 | #endif 33 | 34 | G_BEGIN_DECLS 35 | 36 | #define GST_VAAPI_WINDOW_X11_CAST(obj) ((GstVaapiWindowX11 *)(obj)) 37 | #define GST_VAAPI_WINDOW_X11_GET_PRIVATE(obj) \ 38 | gst_vaapi_window_x11_get_instance_private (GST_VAAPI_WINDOW_X11_CAST (obj)) 39 | 40 | #define GST_VAAPI_WINDOW_X11_GET_CLASS(obj) \ 41 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_WINDOW_X11, GstVaapiWindowX11Class)) 42 | 43 | typedef struct _GstVaapiWindowX11Private GstVaapiWindowX11Private; 44 | typedef struct _GstVaapiWindowX11Class GstVaapiWindowX11Class; 45 | 46 | struct _GstVaapiWindowX11Private 47 | { 48 | Atom atom_NET_WM_STATE; 49 | Atom atom_NET_WM_STATE_FULLSCREEN; 50 | guint is_mapped:1; 51 | guint fullscreen_on_map:1; 52 | gboolean need_vpp; 53 | }; 54 | 55 | /** 56 | * GstVaapiWindowX11: 57 | * 58 | * An X11 Window wrapper. 59 | */ 60 | struct _GstVaapiWindowX11 61 | { 62 | /*< private >*/ 63 | GstVaapiWindow parent_instance; 64 | }; 65 | 66 | /** 67 | * GstVaapiWindowX11Class: 68 | * 69 | * An X11 Window wrapper class. 70 | */ 71 | struct _GstVaapiWindowX11Class 72 | { 73 | /*< private >*/ 74 | GstVaapiWindowClass parent_class; 75 | }; 76 | 77 | G_END_DECLS 78 | 79 | #endif /* GST_VAAPI_WINDOW_X11_PRIV_H */ 80 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/gstvaapiworkarounds.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiworkaround.h - GStreamer/VA workarounds 3 | * 4 | * Copyright (C) 2011-2012 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_WORKAROUNDS_H 24 | #define GST_VAAPI_WORKAROUNDS_H 25 | 26 | G_BEGIN_DECLS 27 | 28 | /* 29 | * Workaround to expose H.263 Baseline decode profile for drivers that 30 | * support MPEG-4:2 Simple profile decoding. 31 | */ 32 | #define WORKAROUND_H263_BASELINE_DECODE_PROFILE (1) 33 | 34 | /* 35 | * Workaround for qtdemux that does not report profiles for 36 | * video/x-h263. Assume H.263 Baseline profile in this case. 37 | */ 38 | #define WORKAROUND_QTDEMUX_NO_H263_PROFILES (1) 39 | 40 | G_END_DECLS 41 | 42 | #endif /* GST_VAAPI_WORKAROUNDS_H */ 43 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/sysdeps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * sysdeps.h - System-dependent definitions 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef SYSDEPS_H 24 | #define SYSDEPS_H 25 | 26 | #ifdef HAVE_CONFIG_H 27 | # include "config.h" 28 | #endif 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include 35 | 36 | #endif /* SYSDEPS_H */ 37 | -------------------------------------------------------------------------------- /gst-libs/gst/vaapi/video-format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * video-format.h - Video format helpers for VA-API 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_VIDEO_FORMAT_H 26 | #define GST_VAAPI_VIDEO_FORMAT_H 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_VAAPI_FORMATS_ALL "{ ENCODED, " \ 33 | "NV12, YV12, I420, YUY2, UYVY, Y444, GRAY8, P010_10LE, P012_LE, VUYA, Y210, Y410, Y212_LE, Y412_LE, " \ 34 | "ARGB, xRGB, RGBA, RGBx, ABGR, xBGR, BGRA, BGRx, RGB16, RGB, BGR10A2_LE " \ 35 | "}" 36 | 37 | const gchar * 38 | gst_vaapi_video_format_to_string (GstVideoFormat format); 39 | 40 | gboolean 41 | gst_vaapi_video_format_is_rgb (GstVideoFormat format); 42 | 43 | gboolean 44 | gst_vaapi_video_format_is_yuv (GstVideoFormat format); 45 | 46 | GstVideoFormat 47 | gst_vaapi_video_format_from_va_fourcc (guint32 fourcc); 48 | 49 | GstVideoFormat 50 | gst_vaapi_video_format_from_va_format (const VAImageFormat * va_format); 51 | 52 | const VAImageFormat * 53 | gst_vaapi_video_format_to_va_format (GstVideoFormat format); 54 | 55 | guint 56 | gst_vaapi_video_format_get_chroma_type (GstVideoFormat format); 57 | 58 | guint 59 | gst_vaapi_video_format_get_score (GstVideoFormat format); 60 | 61 | GstVideoFormat 62 | gst_vaapi_video_format_from_chroma (guint chroma); 63 | 64 | GstVideoFormat 65 | gst_vaapi_video_format_get_best_native (GstVideoFormat format); 66 | 67 | GArray * 68 | gst_vaapi_video_format_get_formats_by_chroma (guint chroma); 69 | 70 | gboolean 71 | gst_vaapi_video_format_create_map (VAImageFormat * formats, guint n); 72 | 73 | guint 74 | gst_vaapi_drm_format_from_va_fourcc (guint32 fourcc); 75 | 76 | GstVideoFormat 77 | gst_vaapi_video_format_from_drm_format (guint drm_format); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* GST_VAAPI_VIDEO_FORMAT_H */ 82 | -------------------------------------------------------------------------------- /gst-libs/meson.build: -------------------------------------------------------------------------------- 1 | subdir('gst') 2 | -------------------------------------------------------------------------------- /gst/meson.build: -------------------------------------------------------------------------------- 1 | subdir('vaapi') 2 | -------------------------------------------------------------------------------- /gst/vaapi/gstcompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstcompat.h - Compatibility glue for GStreamer 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_COMPAT_H 24 | #define GST_COMPAT_H 25 | 26 | #include "gst/vaapi/sysdeps.h" 27 | 28 | #endif /* GST_COMPAT_H */ 29 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapi.h - VA-API element registration 3 | * 4 | * Copyright (C) 2011-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011 Collabora Ltd. 7 | * Author: Nicolas Dufresne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef __GST_VAAPI_H__ 26 | #define __GST_VAAPI_H__ 27 | 28 | G_GNUC_INTERNAL extern gboolean _gst_vaapi_has_video_processing; 29 | 30 | #endif /* __GST_VAAPI_H__ */ 31 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapidecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecode.h - VA-API video decoder 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPIDECODE_H 26 | #define GST_VAAPIDECODE_H 27 | 28 | #include "gstvaapipluginbase.h" 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_VAAPIDECODE(obj) ((GstVaapiDecode *)(obj)) 34 | 35 | typedef struct _GstVaapiDecode GstVaapiDecode; 36 | typedef struct _GstVaapiDecodeClass GstVaapiDecodeClass; 37 | 38 | struct _GstVaapiDecode { 39 | /*< private >*/ 40 | GstVaapiPluginBase parent_instance; 41 | 42 | GstCaps *sinkpad_caps; 43 | GstCaps *srcpad_caps; 44 | GstVideoInfo decoded_info; 45 | GstVaapiDecoder *decoder; 46 | GstCaps *allowed_sinkpad_caps; 47 | GstCaps *allowed_srcpad_caps; 48 | guint current_frame_size; 49 | guint has_texture_upload_meta : 1; 50 | 51 | guint display_width; 52 | guint display_height; 53 | 54 | GstVideoCodecState *input_state; 55 | 56 | gboolean do_renego; 57 | }; 58 | 59 | struct _GstVaapiDecodeClass { 60 | /*< private >*/ 61 | GstVaapiPluginBaseClass parent_class; 62 | }; 63 | 64 | gboolean gst_vaapidecode_register (GstPlugin * plugin, GArray * decoders); 65 | 66 | G_END_DECLS 67 | 68 | #endif /* GST_VAAPIDECODE_H */ 69 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapidecode_props.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecode_props.h - VA-API decoders specific properties 3 | * 4 | * Copyright (C) 2017 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * Author: Victor Jaquez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this program; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPI_DECODE_PROPS_H 25 | #define GST_VAAPI_DECODE_PROPS_H 26 | 27 | #include "gstcompat.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef struct _GstVaapiDecodeH264Private GstVaapiDecodeH264Private; 32 | 33 | struct _GstVaapiDecodeH264Private 34 | { 35 | gboolean is_low_latency; 36 | gboolean base_only; 37 | }; 38 | 39 | void 40 | gst_vaapi_decode_h264_install_properties (GObjectClass * klass); 41 | 42 | GstVaapiDecodeH264Private * 43 | gst_vaapi_decode_h264_get_instance_private (gpointer self); 44 | 45 | G_END_DECLS 46 | 47 | #endif /* GST_VAAPI_DECODE_PROPS_H */ 48 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapidecodebin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapidecodebin.h 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_DECODE_BIN_H 24 | #define GST_VAAPI_DECODE_BIN_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_TYPE_VAAPI_DECODE_BIN (gst_vaapi_decode_bin_get_type ()) 31 | #define GST_VAAPI_DECODE_BIN(obj) \ 32 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_DECODE_BIN, GstVaapiDecodeBin)) 33 | #define GST_VAAPI_DECODE_BIN_CLASS(klass) \ 34 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_DECODE_BIN, GstVaapiDecodeBinClass)) 35 | #define GST_IS_AUTO_DETECT(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_DECODE_BIN)) 37 | #define GST_IS_AUTO_DETECT_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_DECODE_BIN)) 39 | #define GST_VAAPI_DECODE_BIN_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_DECODE_BIN, GstVaapiDecodeBinClass)) 41 | 42 | typedef struct _GstVaapiDecodeBin { 43 | /* < private > */ 44 | GstBin parent; 45 | 46 | GstElement *decoder; 47 | GstElement *queue; 48 | GstElement *postproc; 49 | 50 | /* properties */ 51 | guint max_size_buffers; 52 | guint max_size_bytes; 53 | guint64 max_size_time; 54 | GstVaapiDeinterlaceMethod deinterlace_method; 55 | gboolean disable_vpp; 56 | 57 | gboolean configured; 58 | } GstVaapiDecodeBin; 59 | 60 | typedef struct _GstVaapiDecodeBinClass { 61 | GstBinClass parent_class; 62 | 63 | } GstVaapiDecodeBinClass; 64 | 65 | GType gst_vaapi_decode_bin_get_type (void); 66 | 67 | G_END_DECLS 68 | 69 | #endif /* GST_VAAPI_DECODE_BIN_H */ 70 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_h264.h - VA-API H.264 encoder 3 | * 4 | * Copyright (C) 2012-2014 Intel Corporation 5 | * Author: Wind Yuan 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPIENCODE_H264_H 25 | #define GST_VAAPIENCODE_H264_H 26 | 27 | #include 28 | #include "gstvaapiencode.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPIENCODE_H264 \ 33 | (gst_vaapiencode_h264_get_type ()) 34 | #define GST_VAAPIENCODE_H264_CAST(obj) \ 35 | ((GstVaapiEncodeH264 *)(obj)) 36 | #define GST_VAAPIENCODE_H264(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_H264, \ 38 | GstVaapiEncodeH264)) 39 | #define GST_VAAPIENCODE_H264_CLASS(klass) \ 40 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_H264, \ 41 | GstVaapiEncodeH264Class)) 42 | #define GST_VAAPIENCODE_H264_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_H264, \ 44 | GstVaapiEncodeH264Class)) 45 | #define GST_IS_VAAPIENCODE_H264(obj) \ 46 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_H264)) 47 | #define GST_IS_VAAPIENCODE_H264_CLASS(klass) \ 48 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_H264)) 49 | 50 | typedef struct _GstVaapiEncodeH264 GstVaapiEncodeH264; 51 | typedef struct _GstVaapiEncodeH264Class GstVaapiEncodeH264Class; 52 | 53 | struct _GstVaapiEncodeH264 54 | { 55 | /*< private >*/ 56 | GstVaapiEncode parent_instance; 57 | 58 | guint is_avc:1; /* [FALSE]=byte-stream (default); [TRUE]=avcC */ 59 | GstCaps *available_caps; 60 | }; 61 | 62 | struct _GstVaapiEncodeH264Class 63 | { 64 | /*< private >*/ 65 | GstVaapiEncodeClass parent_class; 66 | }; 67 | 68 | GType 69 | gst_vaapiencode_h264_get_type (void) G_GNUC_CONST; 70 | 71 | GType 72 | gst_vaapiencode_h264_register_type (GstVaapiDisplay * display); 73 | 74 | G_END_DECLS 75 | 76 | #endif /* GST_VAAPIENCODE_H264_H */ 77 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_h265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_h265.h - VA-API H.265 encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPIENCODE_H265_H 24 | #define GST_VAAPIENCODE_H265_H 25 | 26 | #include 27 | #include "gstvaapiencode.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPIENCODE_H265 \ 32 | (gst_vaapiencode_h265_get_type ()) 33 | #define GST_VAAPIENCODE_H265_CAST(obj) \ 34 | ((GstVaapiEncodeH265 *)(obj)) 35 | #define GST_VAAPIENCODE_H265(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_H265, \ 37 | GstVaapiEncodeH265)) 38 | #define GST_VAAPIENCODE_H265_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_H265, \ 40 | GstVaapiEncodeH265Class)) 41 | #define GST_VAAPIENCODE_H265_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_H265, \ 43 | GstVaapiEncodeH265Class)) 44 | #define GST_IS_VAAPIENCODE_H265(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_H265)) 46 | #define GST_IS_VAAPIENCODE_H265_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_H265)) 48 | 49 | typedef struct _GstVaapiEncodeH265 GstVaapiEncodeH265; 50 | typedef struct _GstVaapiEncodeH265Class GstVaapiEncodeH265Class; 51 | 52 | struct _GstVaapiEncodeH265 53 | { 54 | /*< private >*/ 55 | GstVaapiEncode parent_instance; 56 | 57 | guint is_hvc:1; /* [FALSE]=byte-stream (default); [TRUE]=hvcC */ 58 | }; 59 | 60 | struct _GstVaapiEncodeH265Class 61 | { 62 | /*< private >*/ 63 | GstVaapiEncodeClass parent_class; 64 | }; 65 | 66 | GType 67 | gst_vaapiencode_h265_get_type (void) G_GNUC_CONST; 68 | GType 69 | gst_vaapiencode_h265_register_type (GstVaapiDisplay * display); 70 | 71 | G_END_DECLS 72 | 73 | #endif /* GST_VAAPIENCODE_H265_H */ 74 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_jpeg.h - VA-API JPEG encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPIENCODE_JPEG_H 24 | #define GST_VAAPIENCODE_JPEG_H 25 | 26 | #include 27 | #include "gstvaapiencode.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPIENCODE_JPEG \ 32 | (gst_vaapiencode_jpeg_get_type ()) 33 | #define GST_VAAPIENCODE_JPEG_CAST(obj) \ 34 | ((GstVaapiEncodeJpeg *)(obj)) 35 | #define GST_VAAPIENCODE_JPEG(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_JPEG, \ 37 | GstVaapiEncodeJpeg)) 38 | #define GST_VAAPIENCODE_JPEG_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_JPEG, \ 40 | GstVaapiEncodeJpegClass)) 41 | #define GST_VAAPIENCODE_JPEG_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_JPEG, \ 43 | GstVaapiEncodeJpegClass)) 44 | #define GST_IS_VAAPIENCODE_JPEG(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_JPEG)) 46 | #define GST_IS_VAAPIENCODE_JPEG_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_JPEG)) 48 | 49 | typedef struct _GstVaapiEncodeJpeg GstVaapiEncodeJpeg; 50 | typedef struct _GstVaapiEncodeJpegClass GstVaapiEncodeJpegClass; 51 | 52 | struct _GstVaapiEncodeJpeg 53 | { 54 | /*< private >*/ 55 | GstVaapiEncode parent_instance; 56 | }; 57 | 58 | struct _GstVaapiEncodeJpegClass 59 | { 60 | /*< private >*/ 61 | GstVaapiEncodeClass parent_class; 62 | }; 63 | 64 | GType 65 | gst_vaapiencode_jpeg_get_type (void) G_GNUC_CONST; 66 | 67 | GType 68 | gst_vaapiencode_jpeg_register_type (GstVaapiDisplay * display); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_VAAPIENCODE_JPEG_H */ 73 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_mpeg2.h - VA-API MPEG2 encoder 3 | * 4 | * Copyright (C) 2012-2014 Intel Corporation 5 | * Author: Guangxin Xu 6 | * Author: Gwenole Beauchesne 7 | * 8 | * This library is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this library; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPIENCODE_MPEG2_H 25 | #define GST_VAAPIENCODE_MPEG2_H 26 | 27 | #include 28 | #include "gstvaapiencode.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPIENCODE_MPEG2 \ 33 | (gst_vaapiencode_mpeg2_get_type ()) 34 | #define GST_VAAPIENCODE_MPEG2_CAST(obj) \ 35 | ((GstVaapiEncodeMpeg2 *)(obj)) 36 | #define GST_VAAPIENCODE_MPEG2(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_MPEG2, \ 38 | GstVaapiEncodeMpeg2)) 39 | #define GST_VAAPIENCODE_MPEG2_CLASS(klass) \ 40 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_MPEG2, \ 41 | GstVaapiEncodeMpeg2Class)) 42 | #define GST_VAAPIENCODE_MPEG2_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_MPEG2, \ 44 | GstVaapiEncodeMpeg2Class)) 45 | #define GST_IS_VAAPIENCODE_MPEG2(obj) \ 46 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_MPEG2)) 47 | #define GST_IS_VAAPIENCODE_MPEG2_CLASS(klass) \ 48 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_MPEG2)) 49 | 50 | typedef struct _GstVaapiEncodeMpeg2 GstVaapiEncodeMpeg2; 51 | typedef struct _GstVaapiEncodeMpeg2Class GstVaapiEncodeMpeg2Class; 52 | 53 | struct _GstVaapiEncodeMpeg2 54 | { 55 | /*< private >*/ 56 | GstVaapiEncode parent_instance; 57 | 58 | guint32 quantizer; 59 | guint32 intra_period; 60 | guint32 ip_period; 61 | }; 62 | 63 | struct _GstVaapiEncodeMpeg2Class 64 | { 65 | /*< private >*/ 66 | GstVaapiEncodeClass parent_class; 67 | }; 68 | 69 | GType 70 | gst_vaapiencode_mpeg2_get_type (void) G_GNUC_CONST; 71 | 72 | GType 73 | gst_vaapiencode_mpeg2_register_type (GstVaapiDisplay * display); 74 | 75 | G_END_DECLS 76 | 77 | #endif /* GST_VAAPIENCODE_MPEG2_H */ 78 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_vp8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_vp8.h - VA-API VP8 encoder 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPIENCODE_VP8_H 24 | #define GST_VAAPIENCODE_VP8_H 25 | 26 | #include 27 | #include "gstvaapiencode.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPIENCODE_VP8 \ 32 | (gst_vaapiencode_vp8_get_type ()) 33 | #define GST_VAAPIENCODE_VP8_CAST(obj) \ 34 | ((GstVaapiEncodeVP8 *)(obj)) 35 | #define GST_VAAPIENCODE_VP8(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_VP8, \ 37 | GstVaapiEncodeVP8)) 38 | #define GST_VAAPIENCODE_VP8_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_VP8, \ 40 | GstVaapiEncodeVP8Class)) 41 | #define GST_VAAPIENCODE_VP8_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_VP8, \ 43 | GstVaapiEncodeVP8Class)) 44 | #define GST_IS_VAAPIENCODE_VP8(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_VP8)) 46 | #define GST_IS_VAAPIENCODE_VP8_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_VP8)) 48 | 49 | typedef struct _GstVaapiEncodeVP8 GstVaapiEncodeVP8; 50 | typedef struct _GstVaapiEncodeVP8Class GstVaapiEncodeVP8Class; 51 | 52 | struct _GstVaapiEncodeVP8 53 | { 54 | /*< private >*/ 55 | GstVaapiEncode parent_instance; 56 | }; 57 | 58 | struct _GstVaapiEncodeVP8Class 59 | { 60 | /*< private >*/ 61 | GstVaapiEncodeClass parent_class; 62 | }; 63 | 64 | GType 65 | gst_vaapiencode_vp8_get_type (void) G_GNUC_CONST; 66 | 67 | GType 68 | gst_vaapiencode_vp8_register_type (GstVaapiDisplay * display); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_VAAPIENCODE_VP8_H */ 73 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapiencode_vp9.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapiencode_vp9.h - VA-API VP9 encoder 3 | * 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Sreerenj Balachandran 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPIENCODE_VP9_H 24 | #define GST_VAAPIENCODE_VP9_H 25 | 26 | #include 27 | #include "gstvaapiencode.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_VAAPIENCODE_VP9 \ 32 | (gst_vaapiencode_vp9_get_type ()) 33 | #define GST_VAAPIENCODE_VP9_CAST(obj) \ 34 | ((GstVaapiEncodeVP9 *)(obj)) 35 | #define GST_VAAPIENCODE_VP9(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPIENCODE_VP9, \ 37 | GstVaapiEncodeVP9)) 38 | #define GST_VAAPIENCODE_VP9_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPIENCODE_VP9, \ 40 | GstVaapiEncodeVP9Class)) 41 | #define GST_VAAPIENCODE_VP9_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPIENCODE_VP9, \ 43 | GstVaapiEncodeVP9Class)) 44 | #define GST_IS_VAAPIENCODE_VP9(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPIENCODE_VP9)) 46 | #define GST_IS_VAAPIENCODE_VP9_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPIENCODE_VP9)) 48 | 49 | typedef struct _GstVaapiEncodeVP9 GstVaapiEncodeVP9; 50 | typedef struct _GstVaapiEncodeVP9Class GstVaapiEncodeVP9Class; 51 | 52 | struct _GstVaapiEncodeVP9 53 | { 54 | /*< private >*/ 55 | GstVaapiEncode parent_instance; 56 | }; 57 | 58 | struct _GstVaapiEncodeVP9Class 59 | { 60 | /*< private >*/ 61 | GstVaapiEncodeClass parent_class; 62 | }; 63 | 64 | GType 65 | gst_vaapiencode_vp9_get_type (void) G_GNUC_CONST; 66 | 67 | GType 68 | gst_vaapiencode_vp9_register_type (GstVaapiDisplay * display); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_VAAPIENCODE_VP9_H */ 73 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapioverlay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapioverlay.h - VA-API vpp overlay 3 | * 4 | * Copyright (C) 2019 Intel Corporation 5 | * Author: U. Artie Eoff 6 | * 7 | * This program is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this program; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef GST_VAAPI_OVERLAY_H 24 | #define GST_VAAPI_OVERLAY_H 25 | 26 | #include "gstvaapipluginbase.h" 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_VAAPI_OVERLAY (gst_vaapi_overlay_get_type ()) 33 | #define GST_VAAPI_OVERLAY(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_OVERLAY, GstVaapiOverlay)) 35 | #define GST_VAAPI_OVERLAY_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_OVERLAY, \ 37 | GstVaapiOverlayClass)) 38 | #define GST_IS_VAAPI_OVERLAY(obj) \ 39 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_OVERLAY)) 40 | #define GST_IS_VAAPI_OVERLAY_CLASS(klass) \ 41 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_OVERLAY)) 42 | #define GST_VAAPI_OVERLAY_GET_CLASS(obj) \ 43 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_VAAPI_OVERLAY, \ 44 | GstVaapiOverlayClass)) 45 | 46 | #define GST_TYPE_VAAPI_OVERLAY_SINK_PAD (gst_vaapi_overlay_sink_pad_get_type()) 47 | #define GST_VAAPI_OVERLAY_SINK_PAD(obj) \ 48 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_VAAPI_OVERLAY_SINK_PAD, \ 49 | GstVaapiOverlaySinkPad)) 50 | #define GST_VAAPI_OVERLAY_SINK_PAD_CLASS(klass) \ 51 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_VAAPI_OVERLAY_SINK_PAD, \ 52 | GstVaapiOverlaySinkPadClass)) 53 | #define GST_IS_VAAPI_OVERLAY_SINK_PAD(obj) \ 54 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_VAAPI_OVERLAY_SINK_PAD)) 55 | #define GST_IS_VAAPI_OVERLAY_SINK_PAD_CLASS(klass) \ 56 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_VAAPI_OVERLAY_SINK_PAD)) 57 | 58 | typedef struct _GstVaapiOverlay GstVaapiOverlay; 59 | typedef struct _GstVaapiOverlayClass GstVaapiOverlayClass; 60 | 61 | typedef struct _GstVaapiOverlaySinkPad GstVaapiOverlaySinkPad; 62 | typedef struct _GstVaapiOverlaySinkPadClass GstVaapiOverlaySinkPadClass; 63 | 64 | struct _GstVaapiOverlay 65 | { 66 | GstVaapiPluginBase parent_instance; 67 | 68 | GstVaapiBlend *blend; 69 | GstVaapiVideoPool *blend_pool; 70 | }; 71 | 72 | struct _GstVaapiOverlayClass 73 | { 74 | GstVaapiPluginBaseClass parent_class; 75 | }; 76 | 77 | struct _GstVaapiOverlaySinkPad 78 | { 79 | GstVideoAggregatorPad parent_instance; 80 | 81 | gint xpos, ypos; 82 | gdouble alpha; 83 | 84 | GstVaapiPadPrivate *priv; 85 | }; 86 | 87 | struct _GstVaapiOverlaySinkPadClass 88 | { 89 | GstVideoAggregatorPadClass parent_class; 90 | }; 91 | 92 | GType 93 | gst_vaapi_overlay_get_type (void) G_GNUC_CONST; 94 | 95 | GType 96 | gst_vaapi_overlay_sink_pad_get_type (void) G_GNUC_CONST; 97 | 98 | gboolean 99 | gst_vaapioverlay_register (GstPlugin * plugin, GstVaapiDisplay * display); 100 | 101 | G_END_DECLS 102 | 103 | #endif 104 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapipostprocutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapipostprocutil.h - VA-API video post processing utilities 3 | * 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * Author: Victor Jaquez 7 | * 8 | * This program is free software; you can redistribute it and/or 9 | * modify it under the terms of the GNU Lesser General Public License 10 | * as published by the Free Software Foundation; either version 2.1 11 | * of the License, or (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | * Lesser General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU Lesser General Public 19 | * License along with this program; if not, write to the Free 20 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 21 | * Boston, MA 02110-1301 USA 22 | */ 23 | 24 | #ifndef GST_VAAPIPOSTPROCUTIL_H 25 | #define GST_VAAPIPOSTPROCUTIL_H 26 | 27 | #include "gstvaapipostproc.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define DEFAULT_FORMAT GST_VIDEO_FORMAT_ENCODED 32 | #define DEFAULT_DEINTERLACE_MODE GST_VAAPI_DEINTERLACE_MODE_AUTO 33 | #define DEFAULT_DEINTERLACE_METHOD GST_VAAPI_DEINTERLACE_METHOD_BOB 34 | 35 | GstCaps *gst_vaapipostproc_transform_srccaps (GstVaapiPostproc * postproc); 36 | 37 | GstCaps *gst_vaapipostproc_fixate_srccaps (GstVaapiPostproc * postproc, 38 | GstCaps * sinkcaps, GstCaps * srccaps); 39 | 40 | gboolean is_deinterlace_enabled (GstVaapiPostproc * postproc, 41 | GstVideoInfo * vip); 42 | 43 | G_END_DECLS 44 | 45 | #endif /* GST_VAAPIPOSTPROCUTIL_H */ 46 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapivideobuffer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideobuffer.c - Gstreamer/VA video buffer 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | /** 26 | * SECTION:gstvaapivideobuffer 27 | * @short_description: VA video buffer for GStreamer 28 | * 29 | * This functions creates and decorates a #GstBuffer that is going to 30 | * be used by VA base gstreamer elements. 31 | */ 32 | 33 | #include "gstcompat.h" 34 | #include "gstvaapivideobuffer.h" 35 | 36 | static GstBuffer * 37 | new_vbuffer (GstVaapiVideoMeta * meta) 38 | { 39 | GstBuffer *buffer; 40 | 41 | g_return_val_if_fail (meta != NULL, NULL); 42 | 43 | buffer = gst_buffer_new (); 44 | if (buffer) 45 | gst_buffer_set_vaapi_video_meta (buffer, meta); 46 | gst_vaapi_video_meta_unref (meta); 47 | return buffer; 48 | } 49 | 50 | GstBuffer * 51 | gst_vaapi_video_buffer_new (GstVaapiVideoMeta * meta) 52 | { 53 | g_return_val_if_fail (meta != NULL, NULL); 54 | 55 | return new_vbuffer (gst_vaapi_video_meta_ref (meta)); 56 | } 57 | 58 | GstBuffer * 59 | gst_vaapi_video_buffer_new_empty (void) 60 | { 61 | return gst_buffer_new (); 62 | } 63 | 64 | GstBuffer * 65 | gst_vaapi_video_buffer_new_from_pool (GstVaapiVideoPool * pool) 66 | { 67 | return new_vbuffer (gst_vaapi_video_meta_new_from_pool (pool)); 68 | } 69 | 70 | GstBuffer * 71 | gst_vaapi_video_buffer_new_from_buffer (GstBuffer * buffer) 72 | { 73 | GstVaapiVideoMeta *const meta = gst_buffer_get_vaapi_video_meta (buffer); 74 | 75 | return meta ? new_vbuffer (gst_vaapi_video_meta_ref (meta)) : NULL; 76 | } 77 | 78 | GstBuffer * 79 | gst_vaapi_video_buffer_new_with_image (GstVaapiImage * image) 80 | { 81 | return new_vbuffer (gst_vaapi_video_meta_new_with_image (image)); 82 | } 83 | 84 | GstBuffer * 85 | gst_vaapi_video_buffer_new_with_surface_proxy (GstVaapiSurfaceProxy * proxy) 86 | { 87 | return new_vbuffer (gst_vaapi_video_meta_new_with_surface_proxy (proxy)); 88 | } 89 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapivideobuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideobuffer.h - Gstreamer/VA video buffer 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef GST_VAAPI_VIDEO_BUFFER_H 26 | #define GST_VAAPI_VIDEO_BUFFER_H 27 | 28 | #include "gstvaapivideometa.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | typedef struct _GstVaapiVideoBuffer GstVaapiVideoBuffer; 33 | 34 | G_GNUC_INTERNAL 35 | GstBuffer * 36 | gst_vaapi_video_buffer_new (GstVaapiVideoMeta * meta); 37 | 38 | G_GNUC_INTERNAL 39 | GstBuffer * 40 | gst_vaapi_video_buffer_new_empty (void); 41 | 42 | G_GNUC_INTERNAL 43 | GstBuffer * 44 | gst_vaapi_video_buffer_new_from_pool (GstVaapiVideoPool * pool); 45 | 46 | G_GNUC_INTERNAL 47 | GstBuffer * 48 | gst_vaapi_video_buffer_new_from_buffer (GstBuffer * buffer); 49 | 50 | G_GNUC_INTERNAL 51 | GstBuffer * 52 | gst_vaapi_video_buffer_new_with_image (GstVaapiImage * image); 53 | 54 | G_GNUC_INTERNAL 55 | GstBuffer * 56 | gst_vaapi_video_buffer_new_with_surface_proxy (GstVaapiSurfaceProxy * proxy); 57 | 58 | G_END_DECLS 59 | 60 | #endif /* GST_VAAPI_VIDEO_BUFFER_H */ 61 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapivideocontext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideocontext.h - GStreamer/VA video context 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * Copyright (C) 2013 Igalia 9 | * Author: Víctor Manuel Jáquez Leal 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public License 13 | * as published by the Free Software Foundation; either version 2.1 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This library is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, write to the Free 23 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 | * Boston, MA 02110-1301 USA 25 | */ 26 | 27 | #ifndef GST_VAAPI_VIDEO_CONTEXT_H 28 | #define GST_VAAPI_VIDEO_CONTEXT_H 29 | 30 | #include 31 | 32 | #define GST_VAAPI_DISPLAY_CONTEXT_TYPE_NAME "gst.vaapi.Display" 33 | #define GST_VAAPI_DISPLAY_APP_CONTEXT_TYPE_NAME "gst.vaapi.app.Display" 34 | 35 | G_GNUC_INTERNAL 36 | void 37 | gst_vaapi_video_context_set_display (GstContext * context, 38 | GstVaapiDisplay * display); 39 | 40 | G_GNUC_INTERNAL 41 | GstContext * 42 | gst_vaapi_video_context_new_with_display (GstVaapiDisplay * display, 43 | gboolean persistent); 44 | 45 | G_GNUC_INTERNAL 46 | gboolean 47 | gst_vaapi_video_context_get_display (GstContext * context, gboolean app_context, 48 | GstVaapiDisplay ** display_ptr); 49 | 50 | G_GNUC_INTERNAL 51 | gboolean 52 | gst_vaapi_video_context_prepare (GstElement * element, 53 | GstVaapiDisplay ** display_ptr); 54 | 55 | G_GNUC_INTERNAL 56 | void 57 | gst_vaapi_video_context_propagate (GstElement * element, 58 | GstVaapiDisplay * display); 59 | 60 | G_GNUC_INTERNAL 61 | gboolean 62 | gst_vaapi_find_gl_local_context (GstElement * element, 63 | GstObject ** gl_context_ptr); 64 | 65 | #endif /* GST_VAAPI_VIDEO_CONTEXT_H */ 66 | -------------------------------------------------------------------------------- /gst/vaapi/gstvaapivideometa_texture.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstvaapivideometa_texture.h - GStreamer/VA video meta (GLTextureUpload) 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2011-2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * Copyright (C) 2013 Igalia 9 | * Author: Víctor Manuel Jáquez Leal 10 | * 11 | * This library is free software; you can redistribute it and/or 12 | * modify it under the terms of the GNU Lesser General Public License 13 | * as published by the Free Software Foundation; either version 2.1 14 | * of the License, or (at your option) any later version. 15 | * 16 | * This library is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 | * Lesser General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU Lesser General Public 22 | * License along with this library; if not, write to the Free 23 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 24 | * Boston, MA 02110-1301 USA 25 | */ 26 | 27 | #ifndef GST_VAAPI_VIDEO_META_TEXTURE_H 28 | #define GST_VAAPI_VIDEO_META_TEXTURE_H 29 | 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | typedef struct _GstVaapiVideoMetaTexture GstVaapiVideoMetaTexture; 35 | 36 | G_GNUC_INTERNAL 37 | GstMeta * 38 | gst_buffer_add_texture_upload_meta (GstBuffer * buffer); 39 | 40 | G_GNUC_INTERNAL 41 | gboolean 42 | gst_buffer_ensure_texture_upload_meta (GstBuffer * buffer); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* GST_VAAPI_VIDEO_META_TEXTURE_H */ 47 | -------------------------------------------------------------------------------- /gst/vaapi/meson.build: -------------------------------------------------------------------------------- 1 | vaapi_sources = [ 2 | 'gstvaapi.c', 3 | 'gstvaapidecode.c', 4 | 'gstvaapidecodedoc.c', 5 | 'gstvaapioverlay.c', 6 | 'gstvaapipluginbase.c', 7 | 'gstvaapipluginutil.c', 8 | 'gstvaapipostproc.c', 9 | 'gstvaapipostprocutil.c', 10 | 'gstvaapisink.c', 11 | 'gstvaapivideobuffer.c', 12 | 'gstvaapivideocontext.c', 13 | 'gstvaapivideometa.c', 14 | 'gstvaapidecodebin.c', 15 | 'gstvaapivideobufferpool.c', 16 | 'gstvaapivideomemory.c', 17 | 'gstvaapivideometa_texture.c', 18 | 'gstvaapidecode_props.c', 19 | ] 20 | 21 | if USE_ENCODERS 22 | vaapi_sources += [ 23 | 'gstvaapiencode.c', 24 | 'gstvaapiencode_h264.c', 25 | 'gstvaapiencode_h265.c', 26 | 'gstvaapiencode_jpeg.c', 27 | 'gstvaapiencode_mpeg2.c', 28 | 'gstvaapiencode_vp8.c', 29 | ] 30 | endif 31 | 32 | if USE_VP9_ENCODER 33 | vaapi_sources += 'gstvaapiencode_vp9.c' 34 | endif 35 | 36 | gstvaapi = library('gstvaapi', 37 | vaapi_sources, 38 | c_args : gstreamer_vaapi_args + ['-DGST_USE_UNSTABLE_API'], 39 | include_directories : [configinc, libsinc], 40 | dependencies : [gstbase_dep, gstvideo_dep, gstallocators_dep, gstpbutils_dep, 41 | libva_dep, gstlibvaapi_dep, gstgl_dep, gstglproto_dep, gstglx11_dep, gstglegl_dep, 42 | gstglwayland_dep, libm], 43 | install : true, 44 | install_dir : plugins_install_dir, 45 | ) 46 | 47 | plugins = [gstvaapi] 48 | -------------------------------------------------------------------------------- /hooks/pre-commit.hook: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Check that the code follows a consistent code style 4 | # 5 | 6 | # Check for existence of indent, and error out if not present. 7 | # On some *bsd systems the binary seems to be called gnunindent, 8 | # so check for that first. 9 | 10 | version=`gnuindent --version 2>/dev/null` 11 | if test "x$version" = "x"; then 12 | version=`gindent --version 2>/dev/null` 13 | if test "x$version" = "x"; then 14 | version=`indent --version 2>/dev/null` 15 | if test "x$version" = "x"; then 16 | echo "GStreamer git pre-commit hook:" 17 | echo "Did not find GNU indent, please install it before continuing." 18 | exit 1 19 | else 20 | INDENT=indent 21 | fi 22 | else 23 | INDENT=gindent 24 | fi 25 | else 26 | INDENT=gnuindent 27 | fi 28 | 29 | case `$INDENT --version` in 30 | GNU*) 31 | ;; 32 | default) 33 | echo "GStreamer git pre-commit hook:" 34 | echo "Did not find GNU indent, please install it before continuing." 35 | echo "(Found $INDENT, but it doesn't seem to be GNU indent)" 36 | exit 1 37 | ;; 38 | esac 39 | 40 | INDENT_PARAMETERS="--braces-on-if-line \ 41 | --case-brace-indentation0 \ 42 | --case-indentation2 \ 43 | --braces-after-struct-decl-line \ 44 | --line-length80 \ 45 | --no-tabs \ 46 | --cuddle-else \ 47 | --dont-line-up-parentheses \ 48 | --continuation-indentation4 \ 49 | --honour-newlines \ 50 | --tab-size8 \ 51 | --indent-level2 \ 52 | --leave-preprocessor-space" 53 | 54 | echo "--Checking style--" 55 | for file in `git diff-index --cached --name-only HEAD --diff-filter=ACMR| grep "\.c$"` ; do 56 | # nf is the temporary checkout. This makes sure we check against the 57 | # revision in the index (and not the checked out version). 58 | nf=`git checkout-index --temp ${file} | cut -f 1` 59 | newfile=`mktemp /tmp/${nf}.XXXXXX` || exit 1 60 | $INDENT ${INDENT_PARAMETERS} \ 61 | $nf -o $newfile 2>> /dev/null 62 | # FIXME: Call indent twice as it tends to do line-breaks 63 | # different for every second call. 64 | $INDENT ${INDENT_PARAMETERS} \ 65 | $newfile 2>> /dev/null 66 | diff -u -p "${nf}" "${newfile}" 67 | r=$? 68 | rm "${newfile}" 69 | rm "${nf}" 70 | if [ $r != 0 ] ; then 71 | echo "=================================================================================================" 72 | echo " Code style error in: $file " 73 | echo " " 74 | echo " Please fix before committing. Don't forget to run git add before trying to commit again. " 75 | echo " If the whole file is to be committed, this should work (run from the top-level directory): " 76 | echo " " 77 | echo " gst-indent $file; git add $file; git commit" 78 | echo " " 79 | echo "=================================================================================================" 80 | exit 1 81 | fi 82 | done 83 | echo "--Checking style pass--" 84 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('with_encoders', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 2 | option('with_drm', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 3 | option('with_x11', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 4 | option('with_glx', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 5 | option('with_wayland', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 6 | option('with_egl', type : 'combo', choices : ['yes', 'no', 'auto'], value : 'auto') 7 | 8 | # Common feature options 9 | option('examples', type : 'feature', value : 'auto', yield : true) 10 | option('tests', type : 'feature', value : 'auto', yield : true) 11 | option('doc', type : 'feature', value : 'auto', yield: true, 12 | description: 'Enable documentation.') 13 | option('package-origin', type : 'string', 14 | value : 'https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues', 15 | yield : true, description : 'package origin URL to use in plugins') 16 | -------------------------------------------------------------------------------- /scripts/extract-release-date-from-doap-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | # 3 | # extract-release-date-from-doap-file.py VERSION DOAP-FILE 4 | # 5 | # Extract release date for the given release version from a DOAP file 6 | # 7 | # Copyright (C) 2020 Tim-Philipp Müller 8 | # 9 | # This library is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU Library General Public 11 | # License as published by the Free Software Foundation; either 12 | # version 2 of the License, or (at your option) any later version. 13 | # 14 | # This library is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | # Library General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU Library General Public 20 | # License along with this library; if not, write to the 21 | # Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, 22 | # Boston, MA 02110-1301, USA. 23 | 24 | import sys 25 | import xml.etree.ElementTree as ET 26 | 27 | if len(sys.argv) != 3: 28 | sys.exit('Usage: {} VERSION DOAP-FILE'.format(sys.argv[0])) 29 | 30 | release_version = sys.argv[1] 31 | doap_fn = sys.argv[2] 32 | 33 | tree = ET.parse(doap_fn) 34 | root = tree.getroot() 35 | 36 | namespaces = {'doap': 'http://usefulinc.com/ns/doap#'} 37 | 38 | for v in root.findall('doap:release/doap:Version', namespaces=namespaces): 39 | if v.findtext('doap:revision', namespaces=namespaces) == release_version: 40 | release_date = v.findtext('doap:created', namespaces=namespaces) 41 | if release_date: 42 | print(release_date) 43 | sys.exit(0) 44 | 45 | sys.exit('Could not find a release with version {} in {}'.format(release_version, doap_fn)) 46 | -------------------------------------------------------------------------------- /tests/check/meson.build: -------------------------------------------------------------------------------- 1 | tests = [ 2 | [ 'elements/vaapipostproc' ], 3 | ] 4 | 5 | if USE_DRM 6 | tests += [ 7 | [ 'elements/vaapioverlay' ] 8 | ] 9 | endif 10 | 11 | test_deps = [gst_dep, gstbase_dep, gstvideo_dep, gstcheck_dep] 12 | test_defines = [ 13 | '-UG_DISABLE_ASSERT', 14 | '-UG_DISABLE_CAST_CHECKS', 15 | '-DGST_USE_UNSTABLE_API', 16 | ] 17 | 18 | pluginsdirs = [] 19 | if gst_dep.type_name() == 'pkgconfig' 20 | pluginsdirs = [gst_dep.get_pkgconfig_variable('pluginsdir')] 21 | endif 22 | 23 | foreach t : tests 24 | fname = '@0@.c'.format(t.get(0)) 25 | test_name = t.get(0).underscorify() 26 | extra_sources = [ ] 27 | extra_deps = [ ] 28 | env = environment() 29 | env.set('CK_DEFAULT_TIMEOUT', '20') 30 | env.set('GST_PLUGIN_SYSTEM_PATH_1_0', '') 31 | env.set('GST_PLUGIN_PATH_1_0', [meson.build_root()] + pluginsdirs) 32 | env.set('GST_REGISTRY', join_paths(meson.current_build_dir(), '@0@.registry'.format(test_name))) 33 | exe = executable(test_name, fname, extra_sources, 34 | include_directories : [configinc, libsinc], 35 | c_args : ['-DHAVE_CONFIG_H=1' ] + test_defines, 36 | dependencies : test_deps + extra_deps, 37 | ) 38 | test(test_name, exe, env: env, timeout: 3 * 60) 39 | endforeach 40 | -------------------------------------------------------------------------------- /tests/examples/meson.build: -------------------------------------------------------------------------------- 1 | examples = [ 2 | 'test-vaapisink', 3 | 'test-vaapipostproc', 4 | 'test-roi', 5 | ] 6 | 7 | foreach example : examples 8 | executable(example, '@0@.c'.format(example), 9 | c_args : gstreamer_vaapi_args, 10 | include_directories: [configinc, libsinc], 11 | dependencies : [gst_dep, gstvideo_dep], 12 | install: false) 13 | endforeach 14 | 15 | if USE_X11 and USE_WAYLAND 16 | if gtk_dep.found() 17 | executable('test-vaapicontext', 'test-vaapicontext.c', 18 | c_args : gstreamer_vaapi_args, 19 | include_directories: [configinc, libsinc], 20 | dependencies : [ gst_dep, 21 | gstvideo_dep, 22 | libva_dep, 23 | x11_dep, 24 | gtk_dep, 25 | libva_wayland_dep, 26 | libva_x11_dep ], 27 | install: false) 28 | endif 29 | endif 30 | -------------------------------------------------------------------------------- /tests/internal/codec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * codec.h - Codec utilities for the tests 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef CODEC_H 24 | #define CODEC_H 25 | 26 | #include 27 | 28 | const gchar * 29 | string_from_codec(GstVaapiCodec codec); 30 | 31 | GstCaps * 32 | caps_from_codec(GstVaapiCodec codec); 33 | 34 | GstVaapiCodec 35 | identify_codec_from_string(const gchar *codec_str); 36 | 37 | GstVaapiCodec 38 | identify_codec(const gchar *filename); 39 | 40 | #endif /* CODEC_H */ 41 | -------------------------------------------------------------------------------- /tests/internal/decoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * decoder.h - Decoder utilities for the tests 3 | * 4 | * Copyright (C) 2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef DECODER_H 24 | #define DECODER_H 25 | 26 | #include 27 | 28 | GstVaapiDecoder * 29 | decoder_new(GstVaapiDisplay *display, const gchar *codec_name); 30 | 31 | gboolean 32 | decoder_put_buffers(GstVaapiDecoder *decoder); 33 | 34 | GstVaapiSurfaceProxy * 35 | decoder_get_surface(GstVaapiDecoder *decoder); 36 | 37 | const gchar * 38 | decoder_get_codec_name(GstVaapiDecoder *decoder); 39 | 40 | #endif /* DECODER_H */ 41 | -------------------------------------------------------------------------------- /tests/internal/image.h: -------------------------------------------------------------------------------- 1 | /* 2 | * image.h - Image utilities for the tests 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2013 Intel Corporation 7 | * Author: Gwenole Beauchesne 8 | * 9 | * This library is free software; you can redistribute it and/or 10 | * modify it under the terms of the GNU Lesser General Public License 11 | * as published by the Free Software Foundation; either version 2.1 12 | * of the License, or (at your option) any later version. 13 | * 14 | * This library is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | * Lesser General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU Lesser General Public 20 | * License along with this library; if not, write to the Free 21 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 22 | * Boston, MA 02110-1301 USA 23 | */ 24 | 25 | #ifndef IMAGE_H 26 | #define IMAGE_H 27 | 28 | #include 29 | #include 30 | 31 | GstVaapiImage * 32 | image_generate( 33 | GstVaapiDisplay *display, 34 | GstVideoFormat format, 35 | guint width, 36 | guint height 37 | ); 38 | 39 | GstVaapiImage * 40 | image_generate_full( 41 | GstVaapiDisplay *display, 42 | GstVideoFormat format, 43 | guint width, 44 | guint height, 45 | guint32 flags 46 | ); 47 | 48 | gboolean 49 | image_upload(GstVaapiImage *image, GstVaapiSurface *surface); 50 | 51 | #endif /* IMAGE_H */ 52 | -------------------------------------------------------------------------------- /tests/internal/meson.build: -------------------------------------------------------------------------------- 1 | libdecutils_sources = [ 2 | 'decoder.c', 3 | 'test-h264.c', 4 | 'test-jpeg.c', 5 | 'test-mpeg2.c', 6 | 'test-mpeg4.c', 7 | 'test-vc1.c', 8 | ] 9 | 10 | libdecutils_headers = [ 11 | 'decoder.h', 12 | 'test-h264.h', 13 | 'test-jpeg.h', 14 | 'test-mpeg2.h', 15 | 'test-mpeg4.h', 16 | 'test-vc1.h', 17 | ] 18 | 19 | libutils_sources = [ 20 | 'codec.c', 21 | 'image.c', 22 | 'output.c', 23 | 'test-subpicture-data.c', 24 | 'y4mreader.c', 25 | ] 26 | 27 | libutils_headers = [ 28 | 'codec.h', 29 | 'image.h', 30 | 'output.h', 31 | 'test-subpicture-data.h', 32 | 'y4mreader.h', 33 | ] 34 | 35 | test_examples = [ 36 | 'simple-decoder', 37 | 'test-decode', 38 | 'test-display', 39 | 'test-filter', 40 | 'test-surfaces', 41 | 'test-windows', 42 | 'test-subpicture', 43 | ] 44 | 45 | if USE_ENCODERS 46 | test_examples += [ 'simple-encoder' ] 47 | endif 48 | 49 | if USE_GLX 50 | test_examples += [ 'test-textures' ] 51 | endif 52 | 53 | libutils = static_library('libutils', 54 | libutils_sources + libutils_headers, 55 | c_args : gstreamer_vaapi_args, 56 | include_directories: [configinc, libsinc], 57 | dependencies : gstlibvaapi_deps, 58 | install: false) 59 | 60 | libdecutils = static_library('libdecutils', 61 | libdecutils_sources + libdecutils_headers, 62 | c_args : gstreamer_vaapi_args, 63 | include_directories: [configinc, libsinc], 64 | dependencies : gstlibvaapi_deps, 65 | install: false) 66 | 67 | foreach example : test_examples 68 | executable(example, '@0@.c'.format(example), 69 | c_args : gstreamer_vaapi_args, 70 | include_directories: [configinc, libsinc], 71 | dependencies : [gst_dep, libva_dep, gstlibvaapi_dep], 72 | link_with: [libutils, libdecutils], 73 | install: false) 74 | endforeach 75 | -------------------------------------------------------------------------------- /tests/internal/output.h: -------------------------------------------------------------------------------- 1 | /* 2 | * output.h - Video output helpers 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef OUTPUT_H 24 | #define OUTPUT_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | typedef GstVaapiDisplay *(*CreateDisplayFunc)(const gchar *display_name); 31 | typedef GstVaapiWindow *(*CreateWindowFunc)(GstVaapiDisplay *display, 32 | guint width, guint height); 33 | 34 | typedef struct _VideoOutputInfo VideoOutputInfo; 35 | struct _VideoOutputInfo { 36 | const gchar *name; 37 | CreateDisplayFunc create_display; 38 | CreateWindowFunc create_window; 39 | }; 40 | 41 | gboolean 42 | video_output_init(int *argc, char *argv[], GOptionEntry *options); 43 | 44 | void 45 | video_output_exit(void); 46 | 47 | const VideoOutputInfo * 48 | video_output_lookup(const gchar *output_name); 49 | 50 | GstVaapiDisplay * 51 | video_output_create_display(const gchar *display_name); 52 | 53 | GstVaapiWindow * 54 | video_output_create_window(GstVaapiDisplay *display, guint width, guint height); 55 | 56 | #endif /* OUTPUT_H */ 57 | -------------------------------------------------------------------------------- /tests/internal/test-decode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-decode.h - Test GstVaapiDecoder 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_DECODE_H 24 | #define TEST_DECODE_H 25 | 26 | #include 27 | #include 28 | 29 | typedef struct _VideoDecodeInfo VideoDecodeInfo; 30 | struct _VideoDecodeInfo { 31 | GstVaapiProfile profile; 32 | guint width; 33 | guint height; 34 | const guchar *data; 35 | guint data_size; 36 | }; 37 | 38 | #endif /* TEST_DECODE_H */ 39 | -------------------------------------------------------------------------------- /tests/internal/test-h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-h264.h - H.264 test data 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_H264_H 24 | #define TEST_H264_H 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | void h264_get_video_info(VideoDecodeInfo *info); 30 | 31 | #endif /* TEST_H264_H */ 32 | -------------------------------------------------------------------------------- /tests/internal/test-jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-jpeg.h - JPEG test data 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_JPEG_H 24 | #define TEST_JPEG_H 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | void jpeg_get_video_info(VideoDecodeInfo *info); 30 | 31 | #endif /* TEST_JPEG_H */ 32 | -------------------------------------------------------------------------------- /tests/internal/test-mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-mpeg2.h - MPEG-2 test data 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_MPEG2_H 24 | #define TEST_MPEG2_H 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | void mpeg2_get_video_info(VideoDecodeInfo *info); 30 | 31 | #endif /* TEST_MPEG2_H */ 32 | -------------------------------------------------------------------------------- /tests/internal/test-mpeg4.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-mpeg4.h - MPEG-4 test data 3 | * 4 | * Copyright (C) 2012-2013 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_MPEG4_H 24 | #define TEST_MPEG4_H 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | void mpeg4_get_video_info(VideoDecodeInfo *info); 30 | 31 | #endif /* TEST_MPEG4_H */ 32 | -------------------------------------------------------------------------------- /tests/internal/test-subpicture-data.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-subpicture-data.h - subpicture data 3 | * 4 | * Copyright (C) <2011> Intel Corporation 5 | * Copyright (C) <2011> Collabora Ltd. 6 | * Copyright (C) <2011> Thibault Saunier 7 | * 8 | * This program is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation; either version 2 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * This program is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with this program; if not, write to the Free Software 20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 21 | */ 22 | 23 | #ifndef TEST_SUBPICTURE_DATA 24 | #define TEST_SUBPICTURE_DATA 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | typedef struct _VideoSubpictureInfo VideoSubpictureInfo; 30 | 31 | struct _VideoSubpictureInfo { 32 | guint width; 33 | guint height; 34 | const guint32 *data; 35 | guint data_size; 36 | }; 37 | 38 | void subpicture_get_info(VideoSubpictureInfo *info); 39 | 40 | #endif /* TEST_SUBPICTURE_DATA*/ 41 | -------------------------------------------------------------------------------- /tests/internal/test-vc1.h: -------------------------------------------------------------------------------- 1 | /* 2 | * test-vc1.h - VC-1 test data 3 | * 4 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 5 | * Author: Gwenole Beauchesne 6 | * 7 | * This library is free software; you can redistribute it and/or 8 | * modify it under the terms of the GNU Lesser General Public License 9 | * as published by the Free Software Foundation; either version 2.1 10 | * of the License, or (at your option) any later version. 11 | * 12 | * This library is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | * Lesser General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU Lesser General Public 18 | * License along with this library; if not, write to the Free 19 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 20 | * Boston, MA 02110-1301 USA 21 | */ 22 | 23 | #ifndef TEST_VC1_H 24 | #define TEST_VC1_H 25 | 26 | #include 27 | #include "test-decode.h" 28 | 29 | void vc1_get_video_info(VideoDecodeInfo *info); 30 | 31 | #endif /* TEST_VC1_H */ 32 | -------------------------------------------------------------------------------- /tests/internal/y4mreader.h: -------------------------------------------------------------------------------- 1 | /* 2 | * y4mreader.h - Y4M parser 3 | * 4 | * Copyright (C) 2015 Intel Corporation 5 | * 6 | * This library is free software; you can redistribute it and/or 7 | * modify it under the terms of the GNU Lesser General Public License 8 | * as published by the Free Software Foundation; either version 2.1 9 | * of the License, or (at your option) any later version. 10 | * 11 | * This library is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | * Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public 17 | * License along with this library; if not, write to the Free 18 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 | * Boston, MA 02110-1301 USA 20 | */ 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | typedef struct _Y4MReader Y4MReader; 27 | 28 | struct _Y4MReader 29 | { 30 | FILE *fp; 31 | guint width; 32 | guint height; 33 | gint fps_n; 34 | gint fps_d; 35 | }; 36 | 37 | Y4MReader *y4m_reader_open (const gchar * filename); 38 | 39 | void y4m_reader_close (Y4MReader * file); 40 | 41 | gboolean y4m_reader_load_image (Y4MReader * file, GstVaapiImage * image); 42 | -------------------------------------------------------------------------------- /tests/meson.build: -------------------------------------------------------------------------------- 1 | if not get_option('tests').disabled() and gstcheck_dep.found() 2 | subdir('check') 3 | endif 4 | 5 | if not get_option('examples').disabled() 6 | subdir('examples') 7 | subdir('internal') 8 | endif 9 | --------------------------------------------------------------------------------