├── .gitignore ├── AUTHORS ├── CMakeLists.txt ├── COPYING.LIB ├── NEWS ├── README.USAGE ├── README.md ├── cmake ├── FindBaseDependencies.cmake ├── FindMediaSDK.cmake ├── FindSinkDependencies.cmake ├── FindVC1ParserDependencies.cmake ├── ProjectConfig.cmake ├── ProjectInfo.cmake └── cmake_uninstall.cmake.in ├── gst-libs ├── CMakeLists.txt ├── meson.build └── mfx │ ├── common │ ├── gstbitwriter.c │ └── gstbitwriter.h │ ├── egl │ ├── egl_compat.h │ ├── egl_vtable.h │ ├── gstmfxdisplay_egl.c │ ├── gstmfxdisplay_egl.h │ ├── gstmfxdisplay_egl_priv.h │ ├── gstmfxtexture_egl.c │ ├── gstmfxtexture_egl.h │ ├── gstmfxutils_egl.c │ ├── gstmfxutils_egl.h │ ├── gstmfxwindow_egl.c │ ├── gstmfxwindow_egl.h │ └── ogl_compat.h │ ├── gstmfxcompositefilter.c │ ├── gstmfxcompositefilter.h │ ├── gstmfxdebug.h │ ├── gstmfxdecoder.c │ ├── gstmfxdecoder.h │ ├── gstmfxdisplay.c │ ├── gstmfxdisplay.h │ ├── gstmfxdisplay_priv.h │ ├── gstmfxencoder.c │ ├── gstmfxencoder.h │ ├── gstmfxencoder_h264.c │ ├── gstmfxencoder_h264.h │ ├── gstmfxencoder_h265.c │ ├── gstmfxencoder_h265.h │ ├── gstmfxencoder_jpeg.c │ ├── gstmfxencoder_jpeg.h │ ├── gstmfxencoder_mpeg2.c │ ├── gstmfxencoder_mpeg2.h │ ├── gstmfxencoder_priv.h │ ├── gstmfxfilter.c │ ├── gstmfxfilter.h │ ├── gstmfxminiobject.c │ ├── gstmfxminiobject.h │ ├── gstmfxprimebufferproxy.c │ ├── gstmfxprimebufferproxy.h │ ├── gstmfxprofile.c │ ├── gstmfxprofile.h │ ├── gstmfxsurface.c │ ├── gstmfxsurface.h │ ├── gstmfxsurface_priv.h │ ├── gstmfxsurface_vaapi.c │ ├── gstmfxsurface_vaapi.h │ ├── gstmfxsurfacecomposition.c │ ├── gstmfxsurfacecomposition.h │ ├── gstmfxsurfacepool.c │ ├── gstmfxsurfacepool.h │ ├── gstmfxtask.c │ ├── gstmfxtask.h │ ├── gstmfxtaskaggregator.c │ ├── gstmfxtaskaggregator.h │ ├── gstmfxtypes.h │ ├── gstmfxutils_h264.c │ ├── gstmfxutils_h264.h │ ├── gstmfxutils_vaapi.c │ ├── gstmfxutils_vaapi.h │ ├── gstmfxvalue.c │ ├── gstmfxvalue.h │ ├── gstmfxwindow.c │ ├── gstmfxwindow.h │ ├── gstmfxwindow_priv.h │ ├── sysdeps.h │ ├── video-format.c │ ├── video-format.h │ ├── wayland │ ├── gstmfxdisplay_wayland.c │ ├── gstmfxdisplay_wayland.h │ ├── gstmfxdisplay_wayland_priv.h │ ├── gstmfxwindow_wayland.c │ ├── gstmfxwindow_wayland.h │ ├── scaler-client-protocol.h │ ├── scaler-protocol.c │ ├── viewporter-client-protocol.h │ ├── viewporter-protocol.c │ ├── wayland-drm-client-protocol.h │ └── wayland-drm-protocol.c │ └── x11 │ ├── gstmfxdisplay_x11.c │ ├── gstmfxdisplay_x11.h │ ├── gstmfxdisplay_x11_priv.h │ ├── gstmfxutils_x11.c │ ├── gstmfxutils_x11.h │ ├── gstmfxwindow_x11.c │ ├── gstmfxwindow_x11.h │ └── gstmfxwindow_x11_priv.h ├── gst ├── CMakeLists.txt ├── meson.build └── mfx │ ├── gstmfx.c │ ├── gstmfxdec.c │ ├── gstmfxdec.h │ ├── gstmfxenc.c │ ├── gstmfxenc.h │ ├── gstmfxenc_h264.c │ ├── gstmfxenc_h264.h │ ├── gstmfxenc_h265.c │ ├── gstmfxenc_h265.h │ ├── gstmfxenc_jpeg.c │ ├── gstmfxenc_jpeg.h │ ├── gstmfxenc_mpeg2.c │ ├── gstmfxenc_mpeg2.h │ ├── gstmfxpluginbase.c │ ├── gstmfxpluginbase.h │ ├── gstmfxpluginutil.c │ ├── gstmfxpluginutil.h │ ├── gstmfxpostproc.c │ ├── gstmfxpostproc.h │ ├── gstmfxsink.c │ ├── gstmfxsink.h │ ├── gstmfxsinkbin.c │ ├── gstmfxsinkbin.h │ ├── gstmfxvideobufferpool.c │ ├── gstmfxvideobufferpool.h │ ├── gstmfxvideocontext.c │ ├── gstmfxvideocontext.h │ ├── gstmfxvideomemory.c │ ├── gstmfxvideomemory.h │ ├── gstmfxvideometa.c │ └── gstmfxvideometa.h ├── meson.build ├── meson_options.txt ├── parsers ├── CMakeLists.txt ├── gstvc1parse.c ├── gstvc1parse.h └── meson.build └── version.h.in /.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | bin/ 3 | *.cbp 4 | gst_msdk.cbp 5 | *.layout 6 | gst_msdk.layout 7 | *.depend 8 | gst_msdk.depend 9 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | This project is maintained by Intel Corporation. 2 | 3 | Developers: 4 | Ishmael Visayana Sameen 5 | Puunithaaraj Gopal 6 | 7 | Contributors: 8 | Lee Tze Keong 9 | Lee Kin Yew 10 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.0) 2 | 3 | # This project use C source code 4 | project (GstMfx C) 5 | 6 | include(CMakeDependentOption) 7 | 8 | option (DEBUG "Turn on debug build." OFF) 9 | 10 | option (MFX_DECODER "Build MSDK decoder plugins." ON) 11 | option (USE_HEVC_DECODER "Build MSDK decoder plugin with HEVC support." ON) 12 | option (USE_HEVC_10BIT_DECODER "Build MSDK decoder plugin with HEVC 10bit support." OFF) 13 | option (USE_VP8_DECODER "Build MSDK decoder plugin with VP8 support." ON) 14 | option (USE_VP9_DECODER "Build MSDK decoder plugin with VP9 support." OFF) 15 | 16 | option (MFX_ENCODER "Build MSDK encoder plugin." ON) 17 | CMAKE_DEPENDENT_OPTION(MFX_H264_ENCODER "Build H.264 encoder plugin" ON 18 | "MFX_ENCODER" OFF) 19 | CMAKE_DEPENDENT_OPTION(MFX_H265_ENCODER "Build H.265 encoder plugin" ON 20 | "MFX_ENCODER" OFF) 21 | CMAKE_DEPENDENT_OPTION(MFX_JPEG_ENCODER "Build JPEG encoder plugin" ON 22 | "MFX_ENCODER" OFF) 23 | option (MFX_MPEG2_ENCODER "Build MPEG2 encoder plugin" OFF) 24 | 25 | option (MFX_VPP "Build MSDK VPP plugin." ON) 26 | 27 | option (MFX_SINK "Build MSDK sink plugin." ON) 28 | 29 | CMAKE_DEPENDENT_OPTION(WITH_WAYLAND "Enable Wayland support" 30 | ON "MFX_SINK" OFF) 31 | CMAKE_DEPENDENT_OPTION(WITH_X11 "Enable X11 support" 32 | ON "MFX_SINK" OFF) 33 | 34 | CMAKE_DEPENDENT_OPTION(USE_WAYLAND_RENDERER "Build sink plugin with Wayland backend" 35 | ON "WITH_WAYLAND" OFF) 36 | CMAKE_DEPENDENT_OPTION(USE_DRI3_RENDERER "Build sink plugin with X11 DRI3 backend" 37 | ON "WITH_X11" OFF) 38 | CMAKE_DEPENDENT_OPTION(USE_EGL_RENDERER "Build sink plugin with EGL backend" 39 | ON "MFX_SINK" OFF) 40 | 41 | CMAKE_DEPENDENT_OPTION (MFX_SINK_BIN "Build MSDK sinkbin plugin." 42 | ON "MFX_SINK;MFX_VPP" OFF) 43 | 44 | option (WITH_MSS_2016 "Build plugins for MSS 2016." OFF) 45 | 46 | option (MFX_VC1_PARSER "Build VC1 parser plugin" ON) 47 | 48 | include(${CMAKE_SOURCE_DIR}/cmake/ProjectInfo.cmake) 49 | include(${CMAKE_SOURCE_DIR}/cmake/ProjectConfig.cmake) 50 | 51 | if (DEBUG) 52 | set(CMAKE_BUILD_TYPE debug) 53 | else() 54 | set(CMAKE_BUILD_TYPE release) 55 | endif() 56 | 57 | set(LIBRARY_OUTPUT_PATH "${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}") 58 | 59 | configure_file ( 60 | "${PROJECT_SOURCE_DIR}/version.h.in" 61 | "${PROJECT_BINARY_DIR}/version.h" 62 | ) 63 | 64 | include_directories(${PROJECT_BINARY_DIR}) 65 | include_directories(${CMAKE_SOURCE_DIR}) 66 | 67 | if (CMAKE_C_COMPILER_VERSION VERSION_GREATER 4.9) 68 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -std=gnu99 -Wall -fPIE -fstack-protector-strong") 69 | else() 70 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -std=gnu99 -Wall -fPIE -fstack-protector") 71 | endif() 72 | 73 | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -D_FORTIFY_SOURCE=2 -O2") 74 | set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -ggdb -O0") 75 | 76 | set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -z noexecstack -z relro -z now") 77 | 78 | include_directories( 79 | gst/mfx 80 | gst-libs/mfx 81 | parsers) 82 | 83 | if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) 84 | set (CMAKE_INSTALL_PREFIX "${GSTREAMER_LIBDIR}") 85 | endif() 86 | 87 | SET(CMAKE_SKIP_BUILD_RPATH FALSE) 88 | 89 | # when building, don't use the install RPATH already 90 | # (but later on when installing) 91 | SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 92 | 93 | # add the automatically determined parts of the RPATH 94 | # which point to directories outside the build tree to the install RPATH 95 | SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) 96 | 97 | #Add gst and gst-libs as subdirectory 98 | add_subdirectory (gst-libs) 99 | add_subdirectory (gst) 100 | add_subdirectory (parsers) 101 | 102 | LIST(APPEND SOURCE ${GST_SOURCE}) 103 | LIST(APPEND SOURCE ${GST_LIBS_SOURCE}) 104 | LIST(APPEND SOURCE ${GST_PARSE}) 105 | 106 | add_library(gstmfx SHARED ${SOURCE}) 107 | target_link_libraries(gstmfx 108 | ${BASE_LIBRARIES} 109 | ${SINK_BACKEND} 110 | ${PARSER} 111 | stdc++ 112 | libmfx) 113 | 114 | # Add uninstall target. Taken from the KDE4 scripts 115 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake" @ONLY) 116 | add_custom_target(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_BINARY_DIR}/cmake_uninstall.cmake") 117 | 118 | install (TARGETS gstmfx 119 | LIBRARY DESTINATION gstreamer-1.0 120 | RUNTIME DESTINATION bin) 121 | 122 | message("Build: " ${CMAKE_BUILD_TYPE}) 123 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | Version 1.4.0-rc11 2 | * Enable gst-play-1.0 playback with dvdspu subtitle support fallback 3 | system memory. We only support it up to 720p on system memory. 4 | 5 | Version 1.4.0-rc10 6 | * Fixed dynamic video resolution playback in adaptive streaming. 7 | * Fixed meson build set install_dir 8 | * Fixed meson build linking to libmfx to be for the shared library. 9 | * Fixed meson build weston version check required issue. 10 | 11 | Version 1.4.0-rc9 12 | * Fixed libs debug message replace g_error to GST_ERROR. 13 | * Fixed libs warning message replace g_warning to GST_WARNING. 14 | * Fixed close dmabuf_fd. 15 | * Change wayland damage area to fix partial screen freeze on cerntain resolutuin. 16 | * Fixed wrong weston version checking. 17 | * Fixed wayland display wrong macro naming checking. 18 | * Fixed fail to fullscreen issue on weston 1.11.1 version. 19 | 20 | Version 1.4.0-rc8 21 | * Fixed MPEG2 decoder crashed issue. 22 | * Refactor on handle allocation PRIME buffer in NV12 linear dmabuf sharing. 23 | * Fixed mfxwindow compiler warning message. 24 | * Update from scaler to viewporter protocol on wayland 1.14 25 | 26 | Version 1.4.0-rc0 27 | * Enable NV12 linear dmabuf sharing support using by camera sensor. 28 | 29 | Version 1.3.3-rc10 30 | * Implemented wayland windown resize 31 | * Fixed wayland window resize race condition issue. 32 | * Only drop the NAL parameters set when convert AVC at first time. 33 | * Set the damage area according to the largest rect on Wayland. 34 | 35 | Version 1.3.3 36 | * Added H264 decoder support input format in NAL packaging format (AVC stream-format). 37 | 38 | Version 1.3.0 39 | * Split mfxdecode into separate MFX decoder plugins. 40 | * Added VCM rate control method and new properties in MFX encoder. 41 | * Fixed seeking issues with MFX-encoded videos by setting correct IDR intervals. 42 | * Fixed memory leak issue in MFX encoder plugin when muxing to avcc or hvc1. 43 | * Added a new framerate property in mfxvpp. 44 | * Fixed memory leak issues with mfxdecode and mfxvpp. 45 | * Refined CMake compile options for decoder and renderer support. 46 | * Fixed CMake compilation issues for Ubuntu 16.04 LTS. 47 | 48 | Version 1.2.0 49 | * Implemented text overlay support with MFX VPP surface composition. 50 | 51 | Version 1.1.0 52 | * Implemented GstColorBalance interface on mfxvpp. 53 | * Renamed mfxsink to mfxsinkelement. 54 | * Implemented mfxsink which is a bin plugin consist of mfxsinkelement and mfxvpp. 55 | * Fixed memory leak issues in mfxsinkelement and mfxdecode. 56 | * Implemented video seeking. 57 | * Added VP9 decode support. 58 | * Supports playback via gst-play-1.0 and playbin element. 59 | 60 | Version 1.0.0 61 | * Added X11 rendering with DRI3 backend. 62 | * Implemented decoder flushing mechanism after video finish decoding, 63 | * Implemented H.264, HEVC, JPEG and MPEG2 encoder plugins. 64 | * Fixed frame lagging bug at the start of the video 65 | * Implemented VC-1 parser for VC-1 Simple, Main, and Advanced profile. 66 | 67 | Version 0.1.0 68 | * Initial release 69 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DISCONTINUATION OF PROJECT 2 | 3 | This project will no longer be maintained by Intel. 4 | 5 | Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project. 6 | 7 | Intel no longer accepts patches to this project. 8 | 9 | If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project. 10 | 11 | Contact: webadmin@linux.intel.com 12 | GStreamer-MSDK 13 | ============== 14 | GStreamer plugins for Intel® Media SDK 15 | 16 | 17 | Overview 18 | -------- 19 | GStreamer-MSDK consists of a collection of GStreamer plugins for Intel® Media SDK (MSDK). 20 | This allows users to use MSDK in their GStreamer-based applications with minimal knowledge of 21 | the MSDK API. 22 | 23 | GStreamer-MSDK includes plugins to perform decode, encode, video postprocessing (VPP) 24 | and high performance rendering. Please refer to README.USAGE for more information about these 25 | plugins and their usage. 26 | 27 | 28 | Features 29 | -------- 30 | - Decode H264 AVC, MPEG-2, JPEG, VC-1, HEVC, VP8 and VP9 videos 31 | - Compatible with GStreamer-based video players such as Totem, Parole and gst-play 32 | through playbin element. 33 | - Support for zero-copy rendering with glimagesink using EGL 34 | - Support rendering using Wayland renderer 35 | - Support rendering using X11 renderer with DRI3 backend 36 | - Support X11 / Wayland rendering using EGL renderer 37 | - Support VPP acceleration of dynamic procamp control during video playback 38 | - Support for subtitles (text overlay) via MFX VPP surface composition 39 | - Support all Media SDK postprocessing capabilities as exposed by the MSDK API 40 | - Encode / transcode video into H.264, HEVC, MPEG-2 and JPEG formats 41 | 42 | 43 | Requirements 44 | ------------ 45 | 46 | **Software requirements** 47 | 48 | * Media Server Studio 2016 Community / Professional Edition (Haswell / Broadwell) 49 | Media Server Studio 2017 Community / Professional Edition (Broadwell / Skylake) 50 | Media SDK 2017 for Yocto Embedded Edition (Apollo Lake) 51 | * GStreamer 1.6.x (tested up to GStreamer 1.10.x) 52 | * gst-plugins-* 1.6.x (tested up to GStreamer 1.10.x) 53 | * CMake 54 | 55 | * Renderers: 56 | Wayland (>=1.7) 57 | X11 (DRI 3) 58 | EGL 59 | 60 | **Hardware requirements** 61 | 62 | * Intel Haswell / Broadwell / Skylake with Intel HD / Iris Pro graphics 63 | * Intel Apollo Lake 64 | 65 | 66 | Compiling 67 | --------- 68 | GStreamer-MSDK uses the CMake build tool to build the plugins. 69 | Create a build folder within the source directory and run the CMake 70 | command to configure the out-of-source build. 71 | 72 | mkdir build 73 | cd build 74 | cmake .. 75 | 76 | To make a debug build: 77 | 78 | cmake .. -DDEBUG=ON 79 | 80 | To build the plugins for Media Server Studio 2016 Linux Edition: 81 | 82 | cmake .. -DWITH_MSS_2016=ON 83 | 84 | Only Media SDK 2017 Embedded Edition supports VP9 decode for now. To enable VP9 decode support: 85 | 86 | cmake .. -DUSE_VP9_DECODER=ON 87 | 88 | For a list of more options when configuring the build, refer to the CMakeLists.txt file inside the source directory. 89 | 90 | Next step is to compile and install the GStreamer-MSDK plugins: 91 | 92 | make 93 | make install 94 | 95 | To uninstall the plugins: 96 | 97 | make uninstall 98 | 99 | If you intend to rebuild the plugins after making changes to the source code or you would 100 | want to change some of the build options after uninstalling the plugins, it is highly recommended to 101 | simply delete the build folder that you have created and repeat the build process as above. 102 | 103 | 104 | Usage 105 | ----- 106 | Please refer to README.USAGE for examples on how to accomplish various 107 | video-related tasks with the GStreamer-MSDK plugins. 108 | 109 | 110 | TODO 111 | ---- 112 | - Microsoft® Visual Studio support for Windows 10 enablement 113 | 114 | 115 | License 116 | ------- 117 | GStreamer-MSDK libraries and plugins are available under the 118 | terms of the GNU Lesser General Public License v2.1+. 119 | 120 | 121 | Acknowledgements 122 | ---------------- 123 | This project is heavily based on the well-established GStreamer VAAPI architecture, hence we would 124 | like to publicly thank the GStreamer VAAPI developers for their hard work and contributions. 125 | 126 | Reporting a security issue 127 | ---------------- 128 | Please mail to secure-opensource@intel.com directly for security issue. 129 | 130 | -------------------------------------------------------------------------------- /cmake/FindBaseDependencies.cmake: -------------------------------------------------------------------------------- 1 | function(FindGlib libs) 2 | pkg_check_modules(GLIB-2.0 REQUIRED glib-2.0) 3 | pkg_check_modules(GOBJECT-2.0 REQUIRED gobject-2.0) 4 | pkg_check_modules(GIO-2.0 REQUIRED gio-2.0) 5 | 6 | set(GLIB_LIBS "") 7 | if(GLIB-2.0_FOUND) 8 | list(APPEND GST_LIBS ${GLIB-2.0_LIBRARIES}) 9 | include_directories (${GLIB-2.0_INCLUDE_DIRS}) 10 | endif() 11 | 12 | if(GOBJECT-2.0_FOUND) 13 | list(APPEND GST_LIBS ${GOBJECT-2.0_LIBRARIES}) 14 | include_directories (${GOBJECT-2.0_INCLUDE_DIRS}) 15 | endif() 16 | 17 | if(GIO-2.0_FOUND) 18 | list(APPEND GST_LIBS ${GIO-2.0_LIBRARIES}) 19 | include_directories (${GIO-2.0_INCLUDE_DIRS}) 20 | endif() 21 | set(${libs} ${GLIB_LIBS} PARENT_SCOPE) 22 | endfunction(FindGlib) 23 | 24 | function(FindGstreamer libs) 25 | pkg_check_modules (GSTREAMER REQUIRED gstreamer-1.0>=1.6) 26 | pkg_check_modules (GSTREAMER_VIDEO REQUIRED gstreamer-video-1.0>=1.6) 27 | pkg_check_modules (GSTREAMER_ALLOCATORS REQUIRED gstreamer-allocators-1.0>=1.6) 28 | pkg_check_modules (GSTREAMER_GL gstreamer-gl-1.0) 29 | set(GST_LIBS "") 30 | if(GSTREAMER_FOUND) 31 | list(APPEND GST_LIBS ${GSTREAMER_LIBRARIES}) 32 | include_directories (${GSTREAMER_INCLUDE_DIRS}) 33 | endif() 34 | 35 | if(GSTREAMER_VIDEO_FOUND) 36 | list(APPEND GST_LIBS ${GSTREAMER_VIDEO_LIBRARIES}) 37 | include_directories (${GSTREAMER_VIDEO_INCLUDE_DIRS}) 38 | endif() 39 | 40 | if(GSTREAMER_ALLOCATORS_FOUND) 41 | list(APPEND GST_LIBS ${GSTREAMER_ALLOCATORS_LIBRARIES}) 42 | include_directories (${GSTREAMER_ALLOCATORS_INCLUDE_DIRS}) 43 | endif() 44 | 45 | if(GSTREAMER_GL_FOUND) 46 | list(APPEND GST_LIBS ${GSTREAMER_GL_LIBRARIES}) 47 | include_directories (${GSTREAMER_GL_INCLUDE_DIRS}) 48 | add_definitions(-DHAVE_GST_GL_LIBS) 49 | endif() 50 | set(${libs} ${GST_LIBS} PARENT_SCOPE) 51 | endfunction(FindGstreamer) 52 | 53 | function(FindVideoDriver libs) 54 | pkg_check_modules(LIBVA REQUIRED libva) 55 | pkg_check_modules(LIBDRM REQUIRED libdrm) 56 | pkg_check_modules(LIBDRM_INTEL REQUIRED libdrm_intel) 57 | pkg_check_modules(LIBVA_DRM REQUIRED libva-drm) 58 | pkg_check_modules(LIBUDEV REQUIRED libudev) 59 | 60 | set(VIDEO_DRIVER "") 61 | if(LIBVA_FOUND) 62 | list(APPEND VIDEO_DRIVER ${LIBVA_LIBRARIES}) 63 | include_directories (${LIBVA_INCLUDE_DIRS}) 64 | endif() 65 | 66 | if(LIBDRM_FOUND) 67 | list(APPEND VIDEO_DRIVER ${LIBDRM_LIBRARIES}) 68 | include_directories (${LIBDRM_INCLUDE_DIRS}) 69 | endif() 70 | 71 | if(LIBDRM_INTEL_FOUND) 72 | list(APPEND VIDEO_DRIVER ${LIBDRM_INTEL_LIBRARIES}) 73 | include_directories (${LIBDRM_INTEL_INCLUDE_DIRS}) 74 | endif() 75 | 76 | if(LIBVA_DRM_FOUND) 77 | list(APPEND VIDEO_DRIVER ${LIBVA_DRM_LIBRARIES}) 78 | include_directories (${LIBVA_DRM_INCLUDE_DIRS}) 79 | endif() 80 | 81 | if(LIBUDEV_FOUND) 82 | list(APPEND VIDEO_DRIVER ${LIBUDEV_LIBRARIES}) 83 | include_directories (${LIBUDEV_INCLUDE_DIRS}) 84 | endif() 85 | set(${libs} ${VIDEO_DRIVER} PARENT_SCOPE) 86 | endfunction(FindVideoDriver) 87 | 88 | function(FindBaseLibs libs) 89 | set(glib_libs "") 90 | set(gst_libs "") 91 | set(drv_libs "") 92 | FindGlib(glib_libs) 93 | FindGstreamer(gst_libs) 94 | FindVideoDriver(drv_libs) 95 | set(${libs} ${${libs}} ${glib_libs} ${gst_libs} ${drv_libs} PARENT_SCOPE) 96 | endfunction(FindBaseLibs) 97 | -------------------------------------------------------------------------------- /cmake/FindMediaSDK.cmake: -------------------------------------------------------------------------------- 1 | function(FindMediaSDK) 2 | pkg_check_modules(MFX QUIET mfx) 3 | set(MFX_LIBS "") 4 | if(MFX_FOUND) 5 | message(STATUS "MFX_LIBRARY_DIRS: ${MFX_LIBDIR}") 6 | include_directories (${MFX_INCLUDE_DIRS}) 7 | #set (${libs} ${MFX_LIBS} PARENT_SCOPE) 8 | set(MFX_LIBRARY "${MFX_LIBDIR}/libmfx.so") 9 | else() 10 | if(DEFINED ENV{MFX_HOME}) 11 | message(STATUS "MediaSDK distribution found in $ENV{MFX_HOME}") 12 | set(MFX_HOME $ENV{MFX_HOME}) 13 | elseif (EXISTS "/opt/intel/mediasdk") 14 | message(STATUS "MediaSDK distribution found in /opt/intel/mediasdk") 15 | set(MFX_HOME "/opt/intel/mediasdk") 16 | else() 17 | message(FATAL_ERROR "No MediaSDK distribution is found.") 18 | endif() 19 | set(MFX_INCLUDES "${MFX_HOME}/include") 20 | set(MFX_LIBRARY "${MFX_HOME}/lib/lin_x64/libmfx.a") 21 | message(STATUS "MediaSDK include directory: ${MFX_INCLUDES}") 22 | message( STATUS "MediaSDK library directory: ${MFX_LIBRARY}") 23 | include_directories(${MFX_INCLUDES}) 24 | endif() 25 | add_library(libmfx SHARED IMPORTED) 26 | set_property(TARGET libmfx PROPERTY IMPORTED_LOCATION ${MFX_LIBRARY}) 27 | endfunction(FindMediaSDK) 28 | -------------------------------------------------------------------------------- /cmake/FindSinkDependencies.cmake: -------------------------------------------------------------------------------- 1 | function(FindWayland libs) 2 | pkg_check_modules(WAYLAND_CLIENT REQUIRED wayland-client) 3 | pkg_check_modules(WAYLAND_CURSOR wayland-cursor) 4 | if(WAYLAND_CLIENT_FOUND) 5 | set(${libs} ${${libs}} ${WAYLAND_CLIENT_LIBRARIES} PARENT_SCOPE) 6 | include_directories (${WAYLAND_CLIENT_INCLUDE_DIRS}) 7 | pkg_check_modules (WESTON_4_0 weston>=3.0.0) 8 | if (WESTON_4_0_FOUND) 9 | add_definitions(-DUSE_WESTON_4_0) 10 | endif () 11 | endif() 12 | 13 | if(WAYLAND_CURSOR_FOUND) 14 | set(${libs} ${${libs}} ${WAYLAND_CURSOR_LIBRARIES} PARENT_SCOPE) 15 | include_directories (${WAYLAND_CURSOR_INCLUDE_DIRS}) 16 | endif() 17 | endfunction(FindWayland) 18 | 19 | function(FindX11 libs) 20 | pkg_check_modules(XCBDRI3 xcb-dri3) 21 | pkg_check_modules(XCBPRESENT xcb-present) 22 | pkg_check_modules(X11 REQUIRED x11) 23 | pkg_check_modules(XKB xkbcommon) 24 | pkg_check_modules(XRANDR xrandr) 25 | pkg_check_modules(XRENDER xrender) 26 | if(XCBDRI3_FOUND) 27 | set(${libs} ${${libs}} ${XCBDRI3_LIBRARIES} PARENT_SCOPE) 28 | include_directories (${XCBDRI3_INCLUDE_DIRS}) 29 | add_definitions(-DHAVE_XCBDRI3) 30 | endif() 31 | 32 | if(XCBPRESENT_FOUND) 33 | set(${libs} ${${libs}} ${XCBPRESENT_LIBRARIES} PARENT_SCOPE) 34 | include_directories (${XCBPRESENT_INCLUDE_DIRS}) 35 | add_definitions(-DHAVE_XCBPRESENT) 36 | endif() 37 | 38 | if(X11_FOUND) 39 | set(${libs} ${${libs}} ${X11_LIBRARIES} PARENT_SCOPE) 40 | include_directories (${X11_INCLUDE_DIRS}) 41 | endif() 42 | 43 | if(XKB_FOUND) 44 | set(${libs} ${${libs}} ${XKB_LIBRARIES} PARENT_SCOPE) 45 | include_directories (${XKB_INCLUDE_DIRS}) 46 | add_definitions(-DHAVE_XKBLIB) 47 | endif() 48 | 49 | if(XRENDER_FOUND) 50 | set(${libs} ${${libs}} ${XRENDER_LIBRARIES} PARENT_SCOPE) 51 | include_directories (${XRENDER_INCLUDE_DIRS}) 52 | add_definitions(-DHAVE_XRENDER) 53 | endif() 54 | 55 | if(XRANDR_FOUND) 56 | set(${libs} ${${libs}} ${XRANDR_LIBRARIES} PARENT_SCOPE) 57 | include_directories (${XRANDR_INCLUDE_DIRS}) 58 | add_definitions(-DHAVE_XRANDR) 59 | endif() 60 | endfunction(FindX11) 61 | 62 | function(FindEGL libs) 63 | pkg_check_modules(EGL REQUIRED egl) 64 | if(EGL_FOUND) 65 | set(${libs} ${${libs}} ${EGL_LIBRARIES} PARENT_SCOPE) 66 | include_directories(${EGL_INCLUDE_DIRS}) 67 | endif() 68 | endfunction(FindEGL) 69 | 70 | function(FindEGLWayland libs) 71 | pkg_check_modules(WAYLAND_EGL REQUIRED wayland-egl) 72 | if(WAYLAND_EGL_FOUND) 73 | set(${libs} ${${libs}} ${WAYLAND_EGL_LIBRARIES} PARENT_SCOPE) 74 | include_directories(${WAYLAND_EGL_INCLUDE_DIRS}) 75 | endif() 76 | endfunction(FindEGLWayland) 77 | -------------------------------------------------------------------------------- /cmake/FindVC1ParserDependencies.cmake: -------------------------------------------------------------------------------- 1 | function(FindVC1 libs) 2 | set(PARSER_LIB "") 3 | pkg_check_modules(GSTREAMER_CODECPARSERS gstreamer-codecparsers-1.0) 4 | pkg_check_modules(GSTREAMER_PBUTILS gstreamer-pbutils-1.0) 5 | if((NOT GSTREAMER_CODECPARSERS_FOUND) OR (NOT GSTREAMER_PBUTILS_FOUND)) 6 | set(MFX_VC1_PARSER 0 PARENT_SCOPE) 7 | endif() 8 | if(GSTREAMER_CODECPARSERS_FOUND) 9 | list(APPEND PARSER_LIB ${GSTREAMER_CODECPARSERS_LIBRARIES}) 10 | include_directories (${GSTREAMER_CODECPARSERS_INCLUDE_DIRS}) 11 | endif() 12 | if(GSTREAMER_PBUTILS_FOUND) 13 | list(APPEND PARSER_LIB ${GSTREAMER_PBUTILS_LIBRARIES}) 14 | include_directories (${GSTREAMER_PBUTILS_INCLUDE_DIRS}) 15 | endif() 16 | set(${libs} ${${libs}} ${PARSER_LIB} PARENT_SCOPE) 17 | endfunction(FindVC1) 18 | -------------------------------------------------------------------------------- /cmake/ProjectConfig.cmake: -------------------------------------------------------------------------------- 1 | set(BASE_LIBRARIES "") 2 | set(SINK_BACKEND "") 3 | set(PARSER "") 4 | 5 | if(UNIX) 6 | include(FindPkgConfig) 7 | endif() 8 | 9 | include(${CMAKE_SOURCE_DIR}/cmake/FindMediaSDK.cmake) 10 | include(${CMAKE_SOURCE_DIR}/cmake/FindBaseDependencies.cmake) 11 | include(${CMAKE_SOURCE_DIR}/cmake/FindSinkDependencies.cmake) 12 | include(${CMAKE_SOURCE_DIR}/cmake/FindVC1ParserDependencies.cmake) 13 | 14 | FindMediaSDK() 15 | FindBaseLibs(BASE_LIBRARIES) 16 | 17 | if(WITH_MSS_2016) 18 | add_definitions(-DWITH_MSS_2016) 19 | endif() 20 | 21 | if(MFX_DECODER) 22 | add_definitions(-DMFX_DECODER) 23 | if(USE_HEVC_DECODER) 24 | add_definitions(-DUSE_HEVC_DECODER) 25 | endif() 26 | if(USE_HEVC_10BIT_DECODER) 27 | add_definitions(-DUSE_HEVC_10BIT_DECODER) 28 | endif() 29 | if(USE_VP8_DECODER) 30 | add_definitions(-DUSE_VP8_DECODER) 31 | endif() 32 | if(USE_VP9_DECODER) 33 | add_definitions(-DUSE_VP9_DECODER) 34 | endif() 35 | endif() 36 | 37 | if(MFX_VPP) 38 | add_definitions(-DMFX_VPP) 39 | endif() 40 | 41 | if(MFX_SINK) 42 | add_definitions(-DMFX_SINK) 43 | if(WITH_WAYLAND) 44 | FindWayland(SINK_BACKEND) 45 | add_definitions(-DWITH_WAYLAND) 46 | if(USE_WAYLAND_RENDERER) 47 | add_definitions(-DUSE_WAYLAND) 48 | endif() 49 | if(USE_EGL_RENDERER) 50 | FindEGL(SINK_BACKEND) 51 | FindEGLWayland(SINK_BACKEND) 52 | add_definitions(-DUSE_EGL) 53 | endif() 54 | endif() 55 | 56 | if(WITH_X11) 57 | FindX11(SINK_BACKEND) 58 | add_definitions(-DWITH_X11) 59 | if(USE_DRI3_RENDERER) 60 | add_definitions(-DUSE_DRI3) 61 | endif() 62 | if(USE_EGL_RENDERER) 63 | FindEGL(SINK_BACKEND) 64 | add_definitions(-DUSE_EGL) 65 | endif() 66 | endif() 67 | endif() 68 | 69 | if(MFX_SINK_BIN) 70 | add_definitions(-DMFX_SINK_BIN) 71 | endif() 72 | 73 | if(MFX_H264_ENCODER) 74 | add_definitions(-DMFX_H264_ENCODER) 75 | endif() 76 | 77 | if(MFX_H265_ENCODER) 78 | add_definitions(-DMFX_H265_ENCODER) 79 | endif() 80 | 81 | if(MFX_MPEG2_ENCODER) 82 | add_definitions(-DMFX_MPEG2_ENCODER) 83 | endif() 84 | 85 | if(MFX_JPEG_ENCODER) 86 | add_definitions(-DMFX_JPEG_ENCODER) 87 | endif() 88 | 89 | if(MFX_JPEG_ENCODER) 90 | add_definitions(-DMFX_JPEG_ENCODER) 91 | endif() 92 | 93 | if(MFX_VC1_PARSER) 94 | FindVC1(PARSER) 95 | add_definitions(-DMFX_VC1_PARSER) 96 | endif() 97 | -------------------------------------------------------------------------------- /cmake/ProjectInfo.cmake: -------------------------------------------------------------------------------- 1 | set(GstMfx_VERSION_MAJOR 1) 2 | set(GstMfx_VERSION_MINOR 4) 3 | set(GstMfx_VERSION_MACRO 0) 4 | set(GstMfx_VERSION_PATCH rc11) 5 | set(GstMfx_PACKAGE "gstmfx") 6 | set(GstMfx_PACKAGE_NAME "GStreamer Media SDK") 7 | set(GstMfx_PACKAGE_TARNAME "gstreamer-msdk") 8 | set(GstMfx_VERSION 9 | ${GstMfx_VERSION_MAJOR}.${GstMfx_VERSION_MINOR}.${GstMfx_VERSION_MACRO}.${GstMfx_VERSION_PATCH}) 10 | -------------------------------------------------------------------------------- /cmake/cmake_uninstall.cmake.in: -------------------------------------------------------------------------------- 1 | IF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 2 | MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_BINARY_DIR@/install_manifest.txt\"") 3 | ENDIF(NOT EXISTS "@CMAKE_BINARY_DIR@/install_manifest.txt") 4 | 5 | FILE(READ "@CMAKE_BINARY_DIR@/install_manifest.txt" files) 6 | STRING(REGEX REPLACE "\n" ";" files "${files}") 7 | FOREACH(file ${files}) 8 | MESSAGE(STATUS "Uninstalling \"${file}\"") 9 | IF(EXISTS "${file}") 10 | EXEC_PROGRAM( 11 | "@CMAKE_COMMAND@" ARGS "-E remove \"${file}\"" 12 | OUTPUT_VARIABLE rm_out 13 | RETURN_VALUE rm_retval 14 | ) 15 | IF("${rm_retval}" STREQUAL 0) 16 | ELSE("${rm_retval}" STREQUAL 0) 17 | MESSAGE(FATAL_ERROR "Problem when removing \"${file}\"") 18 | ENDIF("${rm_retval}" STREQUAL 0) 19 | ELSE(EXISTS "${file}") 20 | MESSAGE(STATUS "File \"${file}\" does not exist.") 21 | ENDIF(EXISTS "${file}") 22 | ENDFOREACH(file) -------------------------------------------------------------------------------- /gst-libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCE 2 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxdisplay.c" 3 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxfilter.c" 4 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxminiobject.c" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxprimebufferproxy.c" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxprofile.c" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsurfacepool.c" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsurface.c" 9 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsurface_vaapi.c" 10 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxtaskaggregator.c" 11 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxtask.c" 12 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxutils_vaapi.c" 13 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxvalue.c" 14 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxwindow.c" 15 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/video-format.c" 16 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxcompositefilter.c" 17 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsurfacecomposition.c") 18 | 19 | if(MFX_DECODER) 20 | set(SOURCE ${SOURCE} 21 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxdecoder.c") 22 | endif() 23 | 24 | if(WITH_WAYLAND) 25 | set(SOURCE ${SOURCE} 26 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/wayland/gstmfxdisplay_wayland.c" 27 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/wayland/gstmfxwindow_wayland.c" 28 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/wayland/wayland-drm-protocol.c" 29 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/wayland/viewporter-protocol.c" 30 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/wayland/scaler-protocol.c") 31 | endif() 32 | 33 | if(WITH_X11) 34 | set(SOURCE ${SOURCE} 35 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/x11/gstmfxdisplay_x11.c" 36 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/x11/gstmfxutils_x11.c" 37 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/x11/gstmfxwindow_x11.c") 38 | endif() 39 | 40 | 41 | if(USE_EGL_RENDERER) 42 | set(SOURCE ${SOURCE} 43 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/egl/gstmfxdisplay_egl.c" 44 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/egl/gstmfxtexture_egl.c" 45 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/egl/gstmfxwindow_egl.c" 46 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/egl/gstmfxutils_egl.c") 47 | endif() 48 | 49 | if(MFX_ENCODER) 50 | set(SOURCE ${SOURCE} 51 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxencoder.c" 52 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/common/gstbitwriter.c") 53 | endif() 54 | 55 | if(MFX_H264_ENCODER) 56 | set(SOURCE ${SOURCE} 57 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxencoder_h264.c" 58 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxutils_h264.c") 59 | endif() 60 | 61 | if(MFX_H265_ENCODER) 62 | set(SOURCE ${SOURCE} 63 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxencoder_h265.c") 64 | endif() 65 | if(MFX_MPEG2_ENCODER) 66 | set(SOURCE ${SOURCE} 67 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxencoder_mpeg2.c") 68 | endif() 69 | if(MFX_JPEG_ENCODER) 70 | set(SOURCE ${SOURCE} 71 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxencoder_jpeg.c") 72 | endif() 73 | 74 | set(GST_LIBS_SOURCE ${SOURCE} PARENT_SCOPE) 75 | -------------------------------------------------------------------------------- /gst-libs/meson.build: -------------------------------------------------------------------------------- 1 | sources = ['mfx/gstmfxdisplay.c', 2 | 'mfx/gstmfxfilter.c', 3 | 'mfx/gstmfxminiobject.c', 4 | 'mfx/gstmfxprimebufferproxy.c', 5 | 'mfx/gstmfxprofile.c', 6 | 'mfx/gstmfxsurfacepool.c', 7 | 'mfx/gstmfxsurface.c', 8 | 'mfx/gstmfxsurface_vaapi.c', 9 | 'mfx/gstmfxtaskaggregator.c', 10 | 'mfx/gstmfxtask.c', 11 | 'mfx/gstmfxutils_vaapi.c', 12 | 'mfx/gstmfxvalue.c', 13 | 'mfx/gstmfxwindow.c', 14 | 'mfx/video-format.c', 15 | 'mfx/gstmfxcompositefilter.c', 16 | 'mfx/gstmfxsurfacecomposition.c' 17 | ] 18 | 19 | if mfx_decoder 20 | sources += ['mfx/gstmfxdecoder.c'] 21 | endif 22 | 23 | if with_wayland 24 | sources += ['mfx/wayland/gstmfxdisplay_wayland.c', 25 | 'mfx/wayland/gstmfxwindow_wayland.c', 26 | 'mfx/wayland/wayland-drm-protocol.c', 27 | 'mfx/wayland/viewporter-protocol.c', 28 | 'mfx/wayland/scaler-protocol.c'] 29 | endif 30 | 31 | if with_x11 32 | sources += ['mfx/x11/gstmfxdisplay_x11.c', 33 | 'mfx/x11/gstmfxutils_x11.c', 34 | 'mfx/x11/gstmfxwindow_x11.c'] 35 | endif 36 | 37 | if use_egl_renderer 38 | sources += ['mfx/egl/gstmfxdisplay_egl.c', 39 | 'mfx/egl/gstmfxtexture_egl.c', 40 | 'mfx/egl/gstmfxwindow_egl.c', 41 | 'mfx/egl/gstmfxutils_egl.c'] 42 | endif 43 | 44 | if mfx_encoder 45 | sources += ['mfx/gstmfxencoder.c', 46 | 'mfx/common/gstbitwriter.c'] 47 | encoders = [ 48 | ['MFX_H264_ENCODER', '-DMFX_H264_ENCODER', ['mfx/gstmfxencoder_h264.c', 'mfx/gstmfxutils_h264.c']], 49 | ['MFX_H265_ENCODER', '-DMFX_H265_ENCODER', ['mfx/gstmfxencoder_h265.c']], 50 | ['MFX_MPEG2_ENCODER', '-DMFX_MPEG2_ENCODER', ['mfx/gstmfxencoder_mpeg2.c']], 51 | ['MFX_JPEG_ENCODER', '-DMFX_JPEG_ENCODER', ['mfx/gstmfxencoder_jpeg.c']] 52 | ] 53 | foreach e: encoders 54 | if get_option (e.get(0)) != 'no' 55 | mfx_c_args += [e.get(1)] 56 | sources += e.get(2) 57 | endif 58 | endforeach 59 | endif 60 | 61 | 62 | foreach s: sources 63 | mfx_sources += ['@0@/@1@'.format(meson.current_source_dir(), s)] 64 | endforeach 65 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/egl_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 19 | */ 20 | 21 | #ifndef EGL_COMPAT_H 22 | #define EGL_COMPAT_H 23 | 24 | #include 25 | #include 26 | #include "ogl_compat.h" 27 | 28 | #ifndef GL_OES_EGL_image 29 | #define GL_OES_EGL_image 1 30 | typedef void *GLeglImageOES; 31 | typedef void(*PFNGLEGLIMAGETARGETTEXTURE2DOESPROC)(GLenum target, 32 | GLeglImageOES image); 33 | typedef void(*PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC)(GLenum target, 34 | GLeglImageOES image); 35 | #endif /* GL_OES_EGL_image */ 36 | 37 | #endif /* EGL_COMPAT_H */ 38 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/gstmfxdisplay_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) egl later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT EGL WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_DISPLAY_EGL_H 22 | #define GST_MFX_DISPLAY_EGL_H 23 | 24 | #include "gstmfxdisplay.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | typedef struct _GstMfxDisplayEGL GstMfxDisplayEGL; 29 | 30 | #define GST_MFX_DISPLAY_EGL(obj) ((GstMfxDisplayEGL *)(obj)) 31 | 32 | GstMfxDisplay * 33 | gst_mfx_display_egl_new (const gchar * display_name, guint gles_version); 34 | 35 | GstMfxDisplay * 36 | gst_mfx_display_egl_get_parent_display (GstMfxDisplay * display); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* GST_MFX_DISPLAY_EGL_H */ 41 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/gstmfxdisplay_egl_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_DISPLAY_EGL_PRIV_H 22 | #define GST_MFX_DISPLAY_EGL_PRIV_H 23 | 24 | #include "gstmfxwindow.h" 25 | #include "gstmfxwindow_priv.h" 26 | #include "gstmfxdisplay_egl.h" 27 | #include "gstmfxdisplay_priv.h" 28 | #include "gstmfxutils_egl.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_MFX_IS_DISPLAY_EGL(display) \ 33 | ((display) != NULL && \ 34 | GST_MFX_DISPLAY_GET_CLASS_TYPE (display) == GST_MFX_DISPLAY_TYPE_EGL) 35 | 36 | #define GST_MFX_DISPLAY_EGL_CLASS(klass) \ 37 | ((GstMfxDisplayEGLClass *)(klass)) 38 | 39 | #define GST_MFX_DISPLAY_EGL_GET_CLASS(obj) \ 40 | GST_MFX_DISPLAY_EGL_CLASS (GST_MFX_DISPLAY_GET_CLASS (obj)) 41 | 42 | /** 43 | * GST_MFX_DISPLAY_EGL_DISPLAY: 44 | * @display: a #GstMfxDisplay 45 | * 46 | * Macro that evaluates to #EglDisplay wrapper for @display. 47 | * This is an internal macro that does not do any run-time type check. 48 | */ 49 | #undef GST_MFX_DISPLAY_EGL_DISPLAY 50 | #define GST_MFX_DISPLAY_EGL_DISPLAY(display) \ 51 | (GST_MFX_DISPLAY_EGL (display)->egl_display) 52 | 53 | /** 54 | * GST_MFX_DISPLAY_EGL_CONTEXT: 55 | * @display: a #GstMfxDisplay 56 | * 57 | * Macro that evaluates to #EglContext wrapper for @display. 58 | * This is an internal macro that does not do any run-time type check. 59 | */ 60 | #undef GST_MFX_DISPLAY_EGL_CONTEXT 61 | #define GST_MFX_DISPLAY_EGL_CONTEXT(display) \ 62 | gst_mfx_display_egl_get_context (GST_MFX_DISPLAY_EGL (display)) 63 | 64 | typedef struct _GstMfxDisplayEGLClass GstMfxDisplayEGLClass; 65 | 66 | /** 67 | * GstMfxDisplayEGL: 68 | * 69 | * MFX/EGL display wrapper. 70 | */ 71 | struct _GstMfxDisplayEGL 72 | { 73 | /*< private >*/ 74 | GstMfxDisplay parent_instance; 75 | 76 | GstMfxDisplay *display; 77 | EglDisplay *egl_display; 78 | EglContext *egl_context; 79 | guint gles_version; 80 | }; 81 | 82 | /** 83 | * GstMfxDisplayEGLClass: 84 | * 85 | * MFX/EGL display wrapper clas. 86 | */ 87 | struct _GstMfxDisplayEGLClass 88 | { 89 | /*< private >*/ 90 | GstMfxDisplayClass parent_class; 91 | }; 92 | 93 | EglContext * 94 | gst_mfx_display_egl_get_context (GstMfxDisplayEGL * display); 95 | 96 | G_END_DECLS 97 | 98 | #endif /* GST_MFX_DISPLAY_EGL_PRIV_H */ 99 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/gstmfxtexture_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_TEXTURE_EGL_H 22 | #define GST_MFX_TEXTURE_EGL_H 23 | 24 | #include "gstmfxsurface.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GST_MFX_TEXTURE_EGL(obj) ((GstMfxTextureEGL *)(obj)) 29 | 30 | #define GST_MFX_TEXTURE_EGL_ID(texture) \ 31 | gst_mfx_texture_egl_get_id (texture) 32 | 33 | #define GST_MFX_TEXTURE_EGL_TARGET(texture) \ 34 | gst_mfx_texture_egl_get_target (texture) 35 | 36 | #define GST_MFX_TEXTURE_EGL_FORMAT(texture) \ 37 | gst_mfx_texture_egl_get_format (texture) 38 | 39 | #define GST_MFX_TEXTURE_EGL_WIDTH(texture) \ 40 | gst_mfx_texture_egl_get_width (texture) 41 | 42 | #define GST_MFX_TEXTURE_EGL_HEIGHT(texture) \ 43 | gst_mfx_texture_egl_get_height (texture) 44 | 45 | typedef struct _GstMfxTextureEGL GstMfxTextureEGL; 46 | 47 | GstMfxTextureEGL * 48 | gst_mfx_texture_egl_new (GstMfxDisplay * display, guint target, 49 | guint format, guint width, guint height); 50 | 51 | GstMfxTextureEGL * 52 | gst_mfx_texture_egl_ref (GstMfxTextureEGL * texture); 53 | 54 | void 55 | gst_mfx_texture_egl_unref (GstMfxTextureEGL * texture); 56 | 57 | void 58 | gst_mfx_texture_egl_replace (GstMfxTextureEGL ** old_texture_ptr, 59 | GstMfxTextureEGL * new_texture); 60 | 61 | GstMfxID 62 | gst_mfx_texture_egl_get_id (GstMfxTextureEGL * texture); 63 | 64 | guint 65 | gst_mfx_texture_egl_get_target (GstMfxTextureEGL * texture); 66 | 67 | guint 68 | gst_mfx_texture_egl_get_format (GstMfxTextureEGL * texture); 69 | 70 | guint 71 | gst_mfx_texture_egl_get_width (GstMfxTextureEGL * texture); 72 | 73 | guint 74 | gst_mfx_texture_egl_get_height (GstMfxTextureEGL * texture); 75 | 76 | gboolean 77 | gst_mfx_texture_egl_put_surface (GstMfxTextureEGL * texture, 78 | GstMfxSurface * surface); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* GST_MFX_TEXTURE_EGL_H */ 83 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/gstmfxwindow_egl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_WINDOW_EGL_H 24 | #define GST_MFX_WINDOW_EGL_H 25 | 26 | #include "gstmfxdisplay.h" 27 | #include "gstmfxwindow.h" 28 | #include "gstmfxwindow_priv.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | GstMfxWindow * 33 | gst_mfx_window_egl_new (GstMfxDisplay * display, guint width, guint height); 34 | 35 | GstMfxWindow * 36 | gst_mfx_window_egl_get_parent_window (GstMfxWindow *window); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* GST_MFX_WINDOW_EGL_H */ 41 | -------------------------------------------------------------------------------- /gst-libs/mfx/egl/ogl_compat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 19 | */ 20 | 21 | #ifndef OGL_COMPAT_H 22 | #define OGL_COMPAT_H 23 | 24 | typedef void GLvoid; 25 | typedef char GLchar; 26 | typedef unsigned char GLubyte; 27 | typedef unsigned char GLboolean; 28 | typedef int GLint; 29 | typedef unsigned int GLuint; 30 | typedef int GLsizei; 31 | typedef float GLfloat; 32 | typedef double GLdouble; 33 | typedef GLuint GLenum; 34 | typedef GLuint GLbitfield; 35 | typedef GLfloat GLclampf; 36 | 37 | #define GL_VENDOR 0x1F00 38 | #define GL_RENDERER 0x1F01 39 | #define GL_VERSION 0x1F02 40 | #define GL_EXTENSIONS 0x1F03 41 | #define GL_NEAREST 0x2600 42 | #define GL_LINEAR 0x2601 43 | 44 | #define GL_DEPTH_BUFFER_BIT 0x00000100 45 | #define GL_COLOR_BUFFER_BIT 0x00004000 46 | #define GL_FALSE 0 47 | #define GL_TRUE 1 48 | #define GL_NONE 0 49 | 50 | #define GL_BLEND 0x0BE2 51 | #define GL_DEPTH_TEST 0x0B71 52 | 53 | #define GL_TEXTURE0 0x84C0 54 | #define GL_TEXTURE1 0x84C1 55 | #define GL_TEXTURE2 0x84C2 56 | #define GL_TEXTURE3 0x84C3 57 | #define GL_TEXTURE_2D 0x0DE1 58 | #define GL_TEXTURE_EXTERNAL_OES 0x8D65 59 | #define GL_TEXTURE_MAG_FILTER 0x2800 60 | #define GL_TEXTURE_MIN_FILTER 0x2801 61 | #define GL_TEXTURE_WRAP_S 0x2802 62 | #define GL_TEXTURE_WRAP_T 0x2803 63 | 64 | #define GL_UNPACK_ALIGNMENT 0x0cf5 65 | 66 | #define GL_TRIANGLE_FAN 0x0006 67 | 68 | #define GL_BYTE 0x1400 69 | #define GL_UNSIGNED_BYTE 0x1401 70 | #define GL_SHORT 0x1402 71 | #define GL_UNSIGNED_SHORT 0x1403 72 | #define GL_INT 0x1404 73 | #define GL_UNSIGNED_INT 0x1405 74 | #define GL_FLOAT 0x1406 75 | 76 | #define GL_ALPHA 0x1906 77 | #define GL_RGB 0x1907 78 | #define GL_RGBA 0x1908 79 | #define GL_LUMINANCE 0x1909 80 | #define GL_LUMINANCE_ALPHA 0x190A 81 | 82 | #define GL_REPEAT 0x2901 83 | #define GL_CLAMP_TO_EDGE 0x812F 84 | 85 | #define GL_VERTEX_ARRAY 0x8074 86 | #define GL_TEXTURE_COORD_ARRAY 0x8078 87 | 88 | #define GL_FRAGMENT_SHADER 0x8B30 89 | #define GL_VERTEX_SHADER 0x8B31 90 | #define GL_COMPILE_STATUS 0x8B81 91 | #define GL_LINK_STATUS 0x8B82 92 | #define GL_INFO_LOG_LENGTH 0x8B84 93 | 94 | #define GL_BGRA_EXT 0x80e1 95 | #ifndef GL_R8 96 | #define GL_R8 GL_R8_EXT 97 | #endif 98 | #ifndef GL_RG8 99 | #define GL_RG8 GL_RG8_EXT 100 | #endif 101 | 102 | #endif /* OGL_COMPAT_H */ 103 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxcompositefilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstmfxcompositefilter.h - MFX composite filter abstraction 3 | * 4 | * Copyright (C) 2017 Intel Corporation 5 | * Author: Puunithaaraj Gopal 6 | * Author: Ishmael Visayana Sameen 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_MFX_COMPOSITE_FILTER_H 25 | #define GST_MFX_COMPOSITE_FILTER_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_MFX_COMPOSITE_FILTER(obj) \ 34 | ((GstMfxCompositeFilter *)(obj)) 35 | 36 | typedef struct _GstMfxCompositeFilter GstMfxCompositeFilter; 37 | 38 | GstMfxCompositeFilter * 39 | gst_mfx_composite_filter_new(GstMfxTaskAggregator * aggregator, 40 | gboolean memtype_is_system); 41 | 42 | GstMfxCompositeFilter * 43 | gst_mfx_composite_filter_ref(GstMfxCompositeFilter * filter); 44 | 45 | void 46 | gst_mfx_composite_filter_unref(GstMfxCompositeFilter * filter); 47 | 48 | void 49 | gst_mfx_composite_filter_replace(GstMfxCompositeFilter ** old_filter_ptr, 50 | GstMfxCompositeFilter * new_filter); 51 | 52 | gboolean 53 | gst_mfx_composite_filter_apply_composition (GstMfxCompositeFilter * filter, 54 | GstMfxSurfaceComposition * composition, GstMfxSurface ** out_surface); 55 | 56 | G_END_DECLS 57 | 58 | #endif /* GST_MFX_COMPOSITE_FILTER_H */ 59 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxdebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_DEBUG_H 22 | #define GST_MFX_DEBUG_H 23 | 24 | #include 25 | 26 | #ifdef DEBUG 27 | GST_DEBUG_CATEGORY_EXTERN(gst_debug_mfx); 28 | #define GST_CAT_DEFAULT gst_debug_mfx 29 | #endif 30 | 31 | #endif /* GST_MFX_DEBUG_H */ 32 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxdecoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_DECODER_H 24 | #define GST_MFX_DECODER_H 25 | 26 | #include "gstmfxsurface.h" 27 | #include "gstmfxtaskaggregator.h" 28 | #include "gstmfxprofile.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_MFX_DECODER(obj) ((GstMfxDecoder *)(obj)) 33 | 34 | typedef struct _GstMfxDecoder GstMfxDecoder; 35 | 36 | /** 37 | * GstMfxDecoderStatus: 38 | * @GST_MFX_DECODER_STATUS_SUCCESS: Success. 39 | * @GST_MFX_DECODER_STATUS_FLUSHED: Decoder is flushed. 40 | * @GST_MFX_DECODER_STATUS_ERROR_ALLOCATION_FAILED: No memory left. 41 | * @GST_MFX_DECODER_STATUS_ERROR_INIT_FAILED: Decoder initialization failure. 42 | * @GST_MFX_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC: Unsupported codec. 43 | * @GST_MFX_DECODER_STATUS_ERROR_MORE_DATA: Not enough input data to decode. 44 | * @GST_MFX_DECODER_STATUS_ERROR_MORE_SURFACE: No surface left to hold the decoded picture. 45 | * @GST_MFX_DECODER_STATUS_ERROR_INVALID_SURFACE: Invalid surface. 46 | * @GST_MFX_DECODER_STATUS_ERROR_BITSTREAM_PARSER: Invalid or unsupported bitstream data. 47 | * @GST_MFX_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE: Unsupported codec profile. 48 | * @GST_MFX_DECODER_STATUS_ERROR_UNSUPPORTED_CHROMA_FORMAT: Unsupported chroma format. 49 | * @GST_MFX_DECODER_STATUS_ERROR_INVALID_PARAMETER: Unsupported parameter. 50 | * @GST_MFX_DECODER_STATUS_ERROR_UNKNOWN: Unknown error. 51 | * 52 | * Decoder status for gst_mfx_decoder_get_surface(). 53 | */ 54 | typedef enum { 55 | GST_MFX_DECODER_STATUS_SUCCESS = 0, 56 | GST_MFX_DECODER_STATUS_FLUSHED, 57 | GST_MFX_DECODER_STATUS_ERROR_ALLOCATION_FAILED, 58 | GST_MFX_DECODER_STATUS_ERROR_INIT_FAILED, 59 | GST_MFX_DECODER_STATUS_ERROR_UNSUPPORTED_CODEC, 60 | GST_MFX_DECODER_STATUS_ERROR_MORE_DATA, 61 | GST_MFX_DECODER_STATUS_ERROR_MORE_SURFACE, 62 | GST_MFX_DECODER_STATUS_ERROR_INVALID_SURFACE, 63 | GST_MFX_DECODER_STATUS_ERROR_BITSTREAM_PARSER, 64 | GST_MFX_DECODER_STATUS_ERROR_UNSUPPORTED_PROFILE, 65 | GST_MFX_DECODER_STATUS_ERROR_INVALID_PARAMETER, 66 | GST_MFX_DECODER_STATUS_ERROR_UNKNOWN = -1 67 | } GstMfxDecoderStatus; 68 | 69 | GstMfxDecoder * 70 | gst_mfx_decoder_new (GstMfxTaskAggregator * aggregator, 71 | GstMfxProfile profile, const GstVideoInfo * info, mfxU16 async_depth, 72 | gboolean live_mode, gboolean is_avc, GstBuffer * codec_data); 73 | 74 | GstMfxDecoder * 75 | gst_mfx_decoder_ref (GstMfxDecoder * decoder); 76 | 77 | void 78 | gst_mfx_decoder_unref (GstMfxDecoder * decoder); 79 | 80 | void 81 | gst_mfx_decoder_replace (GstMfxDecoder ** old_decoder_ptr, 82 | GstMfxDecoder * new_decoder); 83 | 84 | GstMfxProfile 85 | gst_mfx_decoder_get_profile (GstMfxDecoder * decoder); 86 | 87 | gboolean 88 | gst_mfx_decoder_get_decoded_frames (GstMfxDecoder * decoder, 89 | GstVideoCodecFrame ** out_frame); 90 | 91 | GstVideoCodecFrame * 92 | gst_mfx_decoder_get_discarded_frame (GstMfxDecoder * decoder); 93 | 94 | GstVideoInfo * 95 | gst_mfx_decoder_get_video_info (GstMfxDecoder * decoder); 96 | 97 | void 98 | gst_mfx_decoder_skip_corrupted_frames (GstMfxDecoder * decoder); 99 | 100 | void 101 | gst_mfx_decoder_should_use_video_memory (GstMfxDecoder * decoder, 102 | gboolean memtype_is_video); 103 | 104 | void 105 | gst_mfx_decoder_reset (GstMfxDecoder * decoder); 106 | 107 | GstMfxDecoderStatus 108 | gst_mfx_decoder_decode (GstMfxDecoder * decoder, 109 | GstVideoCodecFrame * frame); 110 | 111 | GstMfxDecoderStatus 112 | gst_mfx_decoder_flush (GstMfxDecoder * decoder); 113 | 114 | gboolean 115 | gst_mfx_decoder_check_system_memory (GstMfxDecoder * decoder); 116 | 117 | void 118 | gst_mfx_decoder_reset_async_depth (GstMfxDecoder *decoder, mfxU16 async_depth); 119 | 120 | G_END_DECLS 121 | 122 | #endif /* GST_MFX_DECODER_H */ 123 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxdisplay.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_DISPLAY_H 24 | #define GST_MFX_DISPLAY_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include "gstmfxtypes.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_MFX_DISPLAY(obj) ((GstMfxDisplay *)(obj)) 34 | 35 | /** 36 | * GST_MFX_DISPLAY_TYPE: 37 | * @display: a #GstMfxDisplay 38 | * 39 | * Returns the underlying VADisplay @display type. 40 | */ 41 | #define GST_MFX_DISPLAY_TYPE(display) \ 42 | gst_mfx_display_get_display_type (GST_MFX_DISPLAY (display)) 43 | 44 | /** 45 | * GST_MFX_DISPLAY_VADISPLAY: 46 | * @display_: a #GstMfxDisplay 47 | * 48 | * Macro that evaluates to the #VADisplay of @display. 49 | */ 50 | #define GST_MFX_DISPLAY_VADISPLAY(display) \ 51 | gst_mfx_display_get_vadisplay (GST_MFX_DISPLAY (display)) 52 | 53 | /** 54 | * GST_MFX_DISPLAY_LOCK: 55 | * @display: a #GstMfxDisplay 56 | * 57 | * Locks @display 58 | */ 59 | #define GST_MFX_DISPLAY_LOCK(display) \ 60 | gst_mfx_display_lock (GST_MFX_DISPLAY (display)) 61 | 62 | /** 63 | * GST_MFX_DISPLAY_UNLOCK: 64 | * @display: a #GstMfxDisplay 65 | * 66 | * Unlocks @display 67 | */ 68 | #define GST_MFX_DISPLAY_UNLOCK(display) \ 69 | gst_mfx_display_unlock (GST_MFX_DISPLAY (display)) 70 | 71 | typedef struct _GstMfxDisplay GstMfxDisplay; 72 | 73 | typedef enum 74 | { 75 | GST_MFX_DISPLAY_TYPE_ANY = 0, 76 | GST_MFX_DISPLAY_TYPE_X11, 77 | GST_MFX_DISPLAY_TYPE_WAYLAND, 78 | GST_MFX_DISPLAY_TYPE_EGL, 79 | } GstMfxDisplayType; 80 | 81 | #define GST_MFX_TYPE_DISPLAY_TYPE (gst_mfx_display_get_type()) 82 | 83 | GType 84 | gst_mfx_display_get_type(void); 85 | 86 | GstMfxDisplay * 87 | gst_mfx_display_new (void); 88 | 89 | GstMfxDisplay * 90 | gst_mfx_display_ref (GstMfxDisplay * display); 91 | 92 | void 93 | gst_mfx_display_unref (GstMfxDisplay * display); 94 | 95 | void 96 | gst_mfx_display_replace (GstMfxDisplay ** old_display_ptr, 97 | GstMfxDisplay * new_display); 98 | 99 | void 100 | gst_mfx_display_lock (GstMfxDisplay * display); 101 | 102 | void 103 | gst_mfx_display_unlock (GstMfxDisplay * display); 104 | 105 | GstMfxDisplayType 106 | gst_mfx_display_get_display_type (GstMfxDisplay * display); 107 | 108 | VADisplay 109 | gst_mfx_display_get_vadisplay (GstMfxDisplay * display); 110 | 111 | void 112 | gst_mfx_display_get_size (GstMfxDisplay * display, guint * pwidth, 113 | guint * pheight); 114 | 115 | void 116 | gst_mfx_display_get_pixel_aspect_ratio (GstMfxDisplay * display, 117 | guint * par_n, guint * par_d); 118 | 119 | gboolean 120 | gst_mfx_display_init_vaapi (GstMfxDisplay * display); 121 | 122 | const gchar * 123 | gst_mfx_display_get_vendor_string (GstMfxDisplay * display); 124 | 125 | gboolean 126 | gst_mfx_display_has_opengl (GstMfxDisplay * display); 127 | 128 | void 129 | gst_mfx_display_use_opengl (GstMfxDisplay * display); 130 | 131 | int 132 | get_display_fd (GstMfxDisplay * display); 133 | 134 | drm_intel_bufmgr * 135 | get_display_bufmgr (GstMfxDisplay * display); 136 | 137 | G_END_DECLS 138 | 139 | #endif /* GST_MFX_DISPLAY_H */ 140 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_ENCODER_H264_H 24 | #define GST_MFX_ENCODER_H264_H 25 | 26 | #include "gstmfxencoder.h" 27 | #include "gstmfxutils_h264.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_MFX_ENCODER_H264 (encoder) \ 32 | ((GstMfxEncoderH264 *) (encoder)) 33 | 34 | typedef struct _GstMfxEncoderH264 GstMfxEncoderH264; 35 | 36 | /** 37 | * GstMfxEncoderH264Prop: 38 | * @GST_MFX_ENCODER_H264_PROP_MAX_SLICE_SIZE: 39 | * @GST_MFX_ENCODER_H264_PROP_LA_DEPTH: 40 | * @GST_MFX_ENCODER_H264_PROP_CABAC: Enable CABAC entropy coding mode (bool). 41 | * @GST_MFX_ENCODER_H264_PROP_TRELLIS: 42 | * @GST_MFX_ENCODER_H264_PROP_LOOKAHEAD_DS: 43 | * 44 | * The set of H.264 encoder specific configurable properties. 45 | */ 46 | typedef enum { 47 | GST_MFX_ENCODER_H264_PROP_MAX_SLICE_SIZE = -1, 48 | GST_MFX_ENCODER_H264_PROP_LA_DEPTH = -2, 49 | GST_MFX_ENCODER_H264_PROP_CABAC = -3, 50 | GST_MFX_ENCODER_H264_PROP_TRELLIS = -5, 51 | GST_MFX_ENCODER_H264_PROP_LOOKAHEAD_DS = -6, 52 | } GstMfxEncoderH264Prop; 53 | 54 | GstMfxEncoder * 55 | gst_mfx_encoder_h264_new (GstMfxTaskAggregator * aggregator, 56 | const GstVideoInfo * info, gboolean mapped); 57 | 58 | GPtrArray * 59 | gst_mfx_encoder_h264_get_default_properties (void); 60 | 61 | gboolean 62 | gst_mfx_encoder_h264_set_max_profile (GstMfxEncoder * encoder, mfxU16 profile); 63 | 64 | G_END_DECLS 65 | 66 | #endif /*GST_MFX_ENCODER_H264_H */ 67 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_h265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_ENCODER_H265_H 22 | #define GST_MFX_ENCODER_H265_H 23 | 24 | #include "gstmfxencoder.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GST_MFX_ENCODER_H265 (encoder) \ 29 | ((GstMfxEncoderH265 *) (encoder)) 30 | 31 | typedef struct _GstMfxEncoderH265 GstMfxEncoderH265; 32 | 33 | /** 34 | * GstMfxEncoderH265Prop: 35 | * @GST_MFX_ENCODER_H265_PROP_LA_DEPTH: 36 | * @GST_MFX_ENCODER_H265_PROP_LOOKAHEAD_DS: 37 | * 38 | * The set of H.265 encoder specific configurable properties. 39 | */ 40 | typedef enum { 41 | GST_MFX_ENCODER_H265_PROP_LA_DEPTH = -1, 42 | GST_MFX_ENCODER_H265_PROP_LOOKAHEAD_DS = -2, 43 | } GstMfxEncoderH265Prop; 44 | 45 | GstMfxEncoder * 46 | gst_mfx_encoder_h265_new (GstMfxTaskAggregator * aggregator, 47 | const GstVideoInfo * info, gboolean mapped); 48 | 49 | GPtrArray * 50 | gst_mfx_encoder_h265_get_default_properties (void); 51 | 52 | G_END_DECLS 53 | 54 | #endif /*GST_MFX_ENCODER_H265_H */ 55 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_jpeg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "sysdeps.h" 22 | #include "gstmfxencoder_priv.h" 23 | #include "gstmfxencoder_jpeg.h" 24 | 25 | #define DEBUG 1 26 | #include "gstmfxdebug.h" 27 | 28 | /* Define default rate control mode ("constant-qp") */ 29 | #define DEFAULT_RATECONTROL GST_MFX_RATECONTROL_NONE 30 | 31 | /* Supported set of rate control methods, within this implementation */ 32 | #define SUPPORTED_RATECONTROLS (GST_MFX_RATECONTROL_MASK (NONE)) 33 | 34 | /* ------------------------------------------------------------------------- */ 35 | /* --- JPEG Encoder --- */ 36 | /* ------------------------------------------------------------------------- */ 37 | 38 | #define GST_MFX_ENCODER_JPEG_CAST(encoder) \ 39 | ((GstMfxEncoderJpeg *)(encoder)) 40 | 41 | struct _GstMfxEncoderJpeg 42 | { 43 | GstMfxEncoder parent_instance; 44 | }; 45 | 46 | static GstMfxEncoderStatus 47 | gst_mfx_encoder_jpeg_reconfigure (GstMfxEncoder * base_encoder) 48 | { 49 | return GST_MFX_ENCODER_STATUS_SUCCESS; 50 | } 51 | 52 | static gboolean 53 | gst_mfx_encoder_jpeg_init (GstMfxEncoder * base_encoder) 54 | { 55 | base_encoder->codec = MFX_CODEC_JPEG; 56 | 57 | return TRUE; 58 | } 59 | 60 | static void 61 | gst_mfx_encoder_jpeg_finalize (GstMfxEncoder * base_encoder) 62 | { 63 | } 64 | 65 | static GstMfxEncoderStatus 66 | gst_mfx_encoder_jpeg_set_property (GstMfxEncoder * base_encoder, 67 | gint prop_id, const GValue * value) 68 | { 69 | switch (prop_id) { 70 | case GST_MFX_ENCODER_JPEG_PROP_QUALITY: 71 | base_encoder->jpeg_quality = g_value_get_uint (value); 72 | break; 73 | default: 74 | return GST_MFX_ENCODER_STATUS_ERROR_INVALID_PARAMETER; 75 | } 76 | return GST_MFX_ENCODER_STATUS_SUCCESS; 77 | } 78 | 79 | GST_MFX_ENCODER_DEFINE_CLASS_DATA (JPEG); 80 | 81 | static inline const GstMfxEncoderClass * 82 | gst_mfx_encoder_jpeg_class (void) 83 | { 84 | static const GstMfxEncoderClass GstMfxEncoderJpegClass = { 85 | GST_MFX_ENCODER_CLASS_INIT (Jpeg, jpeg), 86 | .set_property = gst_mfx_encoder_jpeg_set_property, 87 | }; 88 | return &GstMfxEncoderJpegClass; 89 | } 90 | 91 | GstMfxEncoder * 92 | gst_mfx_encoder_jpeg_new (GstMfxTaskAggregator * aggregator, 93 | const GstVideoInfo * info, gboolean mapped) 94 | { 95 | return gst_mfx_encoder_new (gst_mfx_encoder_jpeg_class (), 96 | aggregator, info, mapped); 97 | } 98 | 99 | /** 100 | * gst_mfx_encoder_jpeg_get_default_properties: 101 | * 102 | * Determines the set of JPEG specific encoder properties. 103 | * The caller owns an extra reference to the resulting array of 104 | * #GstMfxEncoderPropInfo elements, so it shall be released with 105 | * g_ptr_array_unref () after usage. 106 | * 107 | * Return value: the set of encoder properties for #GstMfxEncoderJpeg, 108 | * or %NULL if an error occurred. 109 | */ 110 | GPtrArray * 111 | gst_mfx_encoder_jpeg_get_default_properties (void) 112 | { 113 | GPtrArray *props = NULL; 114 | 115 | /** 116 | * GstMfxEncoderJpeg:quality 117 | * 118 | * Quality parameter for JPEG encoder 119 | */ 120 | GST_MFX_ENCODER_PROPERTIES_APPEND (props, 121 | GST_MFX_ENCODER_JPEG_PROP_QUALITY, 122 | g_param_spec_uint ("quality", 123 | "Quality", "quality parameter for JPEG encoder", 1, 100, 100, 124 | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); 125 | 126 | return props; 127 | } 128 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_ENCODER_JPEG_H 22 | #define GST_MFX_ENCODER_JPEG_H 23 | 24 | #include "gstmfxencoder.h" 25 | 26 | G_BEGIN_DECLS 27 | 28 | #define GST_MFX_ENCODER_JPEG(encoder) \ 29 | ((GstMfxEncoderJpeg *) (encoder)) 30 | 31 | typedef struct _GstMfxEncoderJpeg GstMfxEncoderJpeg; 32 | 33 | typedef enum { 34 | GST_MFX_ENCODER_JPEG_PROP_QUALITY = -1 35 | } GstMfxEncoderJpegProp; 36 | 37 | GstMfxEncoder * 38 | gst_mfx_encoder_jpeg_new(GstMfxTaskAggregator * aggregator, 39 | const GstVideoInfo * info, gboolean mapped); 40 | 41 | GPtrArray * 42 | gst_mfx_encoder_jpeg_get_default_properties(void); 43 | 44 | G_END_DECLS 45 | 46 | #endif /* GST_MFX_ENCODER_JPEG_H */ 47 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_mpeg2.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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 | #include "sysdeps.h" 24 | #include "gstmfxencoder_priv.h" 25 | #include "gstmfxencoder_mpeg2.h" 26 | 27 | #define DEBUG 1 28 | #include "gstmfxdebug.h" 29 | 30 | /* Define default rate control mode ("constant-qp") */ 31 | #define DEFAULT_RATECONTROL GST_MFX_RATECONTROL_CQP 32 | 33 | /* Supported set of rate control methods, within this implementation */ 34 | #define SUPPORTED_RATECONTROLS \ 35 | (GST_MFX_RATECONTROL_MASK (CQP) | \ 36 | GST_MFX_RATECONTROL_MASK (CBR) | \ 37 | GST_MFX_RATECONTROL_MASK (VBR) | \ 38 | GST_MFX_RATECONTROL_MASK (AVBR) | \ 39 | GST_MFX_RATECONTROL_MASK (ICQ)) 40 | 41 | /* ------------------------------------------------------------------------- */ 42 | /* --- MPEG2 Encoder --- */ 43 | /* ------------------------------------------------------------------------- */ 44 | 45 | #define GST_MFX_ENCODER_MPEG2_CAST(encoder) \ 46 | ((GstMfxEncoderMpeg2 *)(encoder)) 47 | 48 | struct _GstMfxEncoderMpeg2 49 | { 50 | GstMfxEncoder parent_instance; 51 | }; 52 | 53 | static void 54 | ensure_bitrate (GstMfxEncoderMpeg2 * encoder) 55 | { 56 | GstMfxEncoder *const base_encoder = GST_MFX_ENCODER_CAST (encoder); 57 | 58 | /* Default compression: 64 bits per macroblock */ 59 | switch (GST_MFX_ENCODER_RATE_CONTROL (encoder)) { 60 | case GST_MFX_RATECONTROL_CBR: 61 | case GST_MFX_RATECONTROL_VBR: 62 | case GST_MFX_RATECONTROL_AVBR: 63 | if (!base_encoder->bitrate) 64 | base_encoder->bitrate = GST_MFX_ENCODER_WIDTH (encoder) * 65 | GST_MFX_ENCODER_HEIGHT (encoder) * 66 | GST_MFX_ENCODER_FPS_N (encoder) / 67 | GST_MFX_ENCODER_FPS_D (encoder) / 4 / 1000; 68 | break; 69 | default: 70 | base_encoder->bitrate = 0; 71 | break; 72 | } 73 | } 74 | 75 | static GstMfxEncoderStatus 76 | gst_mfx_encoder_mpeg2_reconfigure (GstMfxEncoder * base_encoder) 77 | { 78 | GstMfxEncoderMpeg2 *const encoder = GST_MFX_ENCODER_MPEG2_CAST (base_encoder); 79 | 80 | /* Ensure bitrate if not set */ 81 | ensure_bitrate (encoder); 82 | 83 | GST_DEBUG ("resolution: %dx%d", GST_MFX_ENCODER_WIDTH (encoder), 84 | GST_MFX_ENCODER_HEIGHT (encoder)); 85 | 86 | return GST_MFX_ENCODER_STATUS_SUCCESS; 87 | } 88 | 89 | static gboolean 90 | gst_mfx_encoder_mpeg2_init (GstMfxEncoder * base_encoder) 91 | { 92 | base_encoder->codec = MFX_CODEC_MPEG2; 93 | 94 | return TRUE; 95 | } 96 | 97 | static void 98 | gst_mfx_encoder_mpeg2_finalize (GstMfxEncoder * base_encoder) 99 | { 100 | } 101 | 102 | GST_MFX_ENCODER_DEFINE_CLASS_DATA (MPEG2); 103 | 104 | static inline const GstMfxEncoderClass * 105 | gst_mfx_encoder_mpeg2_class (void) 106 | { 107 | static const GstMfxEncoderClass GstMfxEncoderMpeg2Class = { 108 | GST_MFX_ENCODER_CLASS_INIT (Mpeg2, mpeg2), 109 | }; 110 | return &GstMfxEncoderMpeg2Class; 111 | } 112 | 113 | GstMfxEncoder * 114 | gst_mfx_encoder_mpeg2_new (GstMfxTaskAggregator * aggregator, 115 | const GstVideoInfo * info, gboolean mapped) 116 | { 117 | return gst_mfx_encoder_new (gst_mfx_encoder_mpeg2_class (), 118 | aggregator, info, mapped); 119 | } 120 | 121 | /** 122 | * gst_mfx_encoder_mpeg2_get_default_properties: 123 | * 124 | * Determines the set of common and MPEG2 specific encoder properties. 125 | * The caller owns an extra reference to the resulting array of 126 | * #GstMfxEncoderPropInfo elements, so it shall be released with 127 | * g_ptr_array_unref () after usage. 128 | * 129 | * Return value: the set of encoder properties for #GstMfxEncoderMpeg2, 130 | * or %NULL if an error occurred. 131 | */ 132 | GPtrArray * 133 | gst_mfx_encoder_mpeg2_get_default_properties (void) 134 | { 135 | const GstMfxEncoderClass *const klass = gst_mfx_encoder_mpeg2_class (); 136 | GPtrArray *props; 137 | 138 | props = gst_mfx_encoder_properties_get_default (klass); 139 | if (!props) 140 | return NULL; 141 | 142 | return props; 143 | } 144 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxencoder_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_ENCODER_MPEG2_H 24 | #define GST_MFX_ENCODER_MPEG2_H 25 | 26 | #include "gstmfxencoder.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_ENCODER_MPEG2(encoder) \ 31 | ((GstMfxEncoderMpeg2 *) (encoder)) 32 | 33 | typedef struct _GstMfxEncoderMpeg2 GstMfxEncoderMpeg2; 34 | 35 | GstMfxEncoder * 36 | gst_mfx_encoder_mpeg2_new (GstMfxTaskAggregator * aggregator, 37 | const GstVideoInfo * info, gboolean mapped); 38 | 39 | GPtrArray * 40 | gst_mfx_encoder_mpeg2_get_default_properties(void); 41 | 42 | G_END_DECLS 43 | 44 | #endif /* GST_MFX_ENCODER_MPEG2_H */ 45 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxprimebufferproxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * Author: Puunithaaraj Gopal 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 | #ifndef GST_MFX_PRIME_BUFFER_PROXY_H 23 | #define GST_MFX_PRIME_BUFFER_PROXY_H 24 | 25 | #include "gstmfxutils_vaapi.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_MFX_PRIME_BUFFER_PROXY(obj) \ 30 | ((GstMfxPrimeBufferProxy *)(obj)) 31 | 32 | /** 33 | * GST_MFX_PRIME_BUFFER_PROXY_HANDLE: 34 | * @buf: a #GstMfxPrimeBufferProxy 35 | * 36 | * Macro that evaluates to the handle of the underlying VA buffer @buf 37 | */ 38 | #define GST_MFX_PRIME_BUFFER_PROXY_HANDLE(buf) \ 39 | gst_mfx_prime_buffer_proxy_get_handle (GST_MFX_PRIME_BUFFER_PROXY (buf)) 40 | 41 | #define GST_MFX_PRIME_BUFFER_PROXY_SIZE(buf) \ 42 | gst_mfx_prime_buffer_proxy_get_size (GST_MFX_PRIME_BUFFER_PROXY (buf)) 43 | 44 | typedef struct _GstMfxPrimeBufferProxy GstMfxPrimeBufferProxy; 45 | 46 | GstMfxPrimeBufferProxy * 47 | gst_mfx_prime_buffer_proxy_new_from_surface (GstMfxSurface * surface); 48 | 49 | GstMfxPrimeBufferProxy * 50 | gst_mfx_prime_buffer_proxy_ref (GstMfxPrimeBufferProxy * proxy); 51 | 52 | void 53 | gst_mfx_prime_buffer_proxy_unref (GstMfxPrimeBufferProxy * proxy); 54 | 55 | void 56 | gst_mfx_prime_buffer_proxy_replace (GstMfxPrimeBufferProxy ** old_proxy_ptr, 57 | GstMfxPrimeBufferProxy * new_proxy); 58 | 59 | guintptr 60 | gst_mfx_prime_buffer_proxy_get_handle (GstMfxPrimeBufferProxy * proxy); 61 | 62 | guint 63 | gst_mfx_prime_buffer_proxy_get_size (GstMfxPrimeBufferProxy * proxy); 64 | 65 | VaapiImage * 66 | gst_mfx_prime_buffer_proxy_get_vaapi_image (GstMfxPrimeBufferProxy *proxy); 67 | 68 | G_END_DECLS 69 | 70 | #endif /* GST_VAAPI_BUFFER_PROXY_H */ 71 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxprofile.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_PROFILE_H 24 | #define GST_MFX_PROFILE_H 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #ifdef USE_VP9_DECODER 32 | #include 33 | #endif 34 | 35 | G_BEGIN_DECLS 36 | 37 | /** 38 | * GST_MFX_MAKE_PROFILE: 39 | * @codec: the #GstMfxCodec without the GST_MFX_CODEC_ prefix 40 | * @sub_id: a non-zero sub-codec id 41 | * 42 | * Macro that evaluates to the profile composed from @codec and 43 | * @sub_id. 44 | */ 45 | #define GST_MFX_MAKE_PROFILE(codec, profile) \ 46 | (MFX_CODEC_##codec ^ MFX_PROFILE_##codec##_##profile) 47 | 48 | /** 49 | * GstMfxProfile: 50 | * @GST_MFX_PROFILE_UNKNOWN: 51 | * Unknown profile, used for initializers 52 | * @GST_MFX_PROFILE_MPEG2_SIMPLE: 53 | * MPEG-2 simple profile 54 | * @GST_MFX_PROFILE_MPEG2_MAIN: 55 | * MPEG-2 main profile 56 | * @GST_MFX_PROFILE_MPEG2_HIGH: 57 | * MPEG-2 high profile 58 | * @GST_MFX_PROFILE_H264_BASELINE: 59 | * H.264 (MPEG-4 Part-10) baseline profile [A.2.1] 60 | * @GST_MFX_PROFILE_H264_CONSTRAINED_BASELINE: 61 | * H.264 (MPEG-4 Part-10) constrained baseline profile [A.2.1.1] 62 | * @GST_MFX_PROFILE_H264_MAIN: 63 | * H.264 (MPEG-4 Part-10) main profile [A.2.2] 64 | * @GST_MFX_PROFILE_H264_EXTENDED: 65 | * H.264 (MPEG-4 Part 10) extended profile [A.2.3] 66 | * @GST_MFX_PROFILE_H264_HIGH: 67 | * H.264 (MPEG-4 Part-10) high profile [A.2.4] 68 | * @GST_MFX_PROFILE_H264_HIGH_422: 69 | * H.264 (MPEG-4 Part-10) high 4:2:2 profile [A.2.6], or high 4:2:2 70 | * intra profile [A.2.9], depending on constraint_set3_flag 71 | * @GST_MFX_PROFILE_VC1_SIMPLE: 72 | * VC-1 simple profile 73 | * @GST_MFX_PROFILE_VC1_MAIN: 74 | * VC-1 main profile 75 | * @GST_MFX_PROFILE_VC1_ADVANCED: 76 | * VC-1 advanced profile 77 | * @GST_MFX_PROFILE_JPEG_BASELINE: 78 | * JPEG baseline profile 79 | * @GST_MFX_PROFILE_H265_MAIN: 80 | * H.265 main profile [A.3.2] 81 | * @GST_MFX_PROFILE_H265_MAIN10: 82 | * H.265 main 10 profile [A.3.3] 83 | * @GST_MFX_PROFILE_H265_MAIN_STILL_PICTURE: 84 | * H.265 main still picture profile [A.3.4] 85 | * 86 | * The set of all profiles for #GstMfxProfile. 87 | */ 88 | typedef enum { 89 | GST_MFX_PROFILE_UNKNOWN = 0, 90 | GST_MFX_PROFILE_MPEG2_SIMPLE = GST_MFX_MAKE_PROFILE(MPEG2, SIMPLE), 91 | GST_MFX_PROFILE_MPEG2_MAIN = GST_MFX_MAKE_PROFILE(MPEG2, MAIN), 92 | GST_MFX_PROFILE_MPEG2_HIGH = GST_MFX_MAKE_PROFILE(MPEG2, HIGH), 93 | GST_MFX_PROFILE_AVC_BASELINE = GST_MFX_MAKE_PROFILE(AVC, BASELINE), 94 | GST_MFX_PROFILE_AVC_CONSTRAINED_BASELINE = 95 | GST_MFX_MAKE_PROFILE(AVC, CONSTRAINED_BASELINE), 96 | GST_MFX_PROFILE_AVC_MAIN = GST_MFX_MAKE_PROFILE(AVC, MAIN), 97 | GST_MFX_PROFILE_AVC_EXTENDED = GST_MFX_MAKE_PROFILE(AVC, EXTENDED), 98 | GST_MFX_PROFILE_AVC_HIGH = GST_MFX_MAKE_PROFILE(AVC, HIGH), 99 | GST_MFX_PROFILE_AVC_HIGH_422 = GST_MFX_MAKE_PROFILE(AVC, HIGH_422), 100 | GST_MFX_PROFILE_VC1_SIMPLE = GST_MFX_MAKE_PROFILE(VC1, SIMPLE), 101 | GST_MFX_PROFILE_VC1_MAIN = GST_MFX_MAKE_PROFILE(VC1, MAIN), 102 | GST_MFX_PROFILE_VC1_ADVANCED = GST_MFX_MAKE_PROFILE(VC1, ADVANCED), 103 | GST_MFX_PROFILE_JPEG_BASELINE = GST_MFX_MAKE_PROFILE(JPEG, BASELINE), 104 | GST_MFX_PROFILE_VP8 = GST_MFX_MAKE_PROFILE(VP8, 0), 105 | #ifdef USE_VP9_DECODER 106 | GST_MFX_PROFILE_VP9 = GST_MFX_MAKE_PROFILE(VP9, 0), 107 | #endif 108 | GST_MFX_PROFILE_HEVC_MAIN = GST_MFX_MAKE_PROFILE(HEVC, MAIN), 109 | GST_MFX_PROFILE_HEVC_MAIN10 = GST_MFX_MAKE_PROFILE(HEVC, MAIN10), 110 | GST_MFX_PROFILE_HEVC_MAIN_STILL_PICTURE = 111 | GST_MFX_MAKE_PROFILE(HEVC, MAINSP), 112 | } GstMfxProfile; 113 | 114 | const gchar * 115 | gst_mfx_codec_get_name (mfxU32 codec); 116 | 117 | GstMfxProfile 118 | gst_mfx_profile_from_caps (const GstCaps *caps); 119 | 120 | const gchar * 121 | gst_mfx_profile_get_name (GstMfxProfile profile); 122 | 123 | const gchar * 124 | gst_mfx_profile_get_media_type_name (GstMfxProfile profile); 125 | 126 | GstCaps * 127 | gst_mfx_profile_get_caps (GstMfxProfile profile); 128 | 129 | mfxU32 130 | gst_mfx_profile_get_codec (GstMfxProfile profile); 131 | 132 | mfxU32 133 | gst_mfx_profile_get_codec_profile (GstMfxProfile profile); 134 | 135 | 136 | G_END_DECLS 137 | 138 | #endif /* GST_MFX_PROFILE_H */ 139 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxsurface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_SURFACE_H 22 | #define GST_MFX_SURFACE_H 23 | 24 | #include "sysdeps.h" 25 | 26 | #include 27 | #include "gstmfxdisplay.h" 28 | #include "gstmfxtask.h" 29 | #include "video-format.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_MFX_SURFACE(obj) ((GstMfxSurface *) (obj)) 34 | 35 | #define GST_MFX_SURFACE_FRAME_SURFACE(surface) \ 36 | gst_mfx_surface_get_frame_surface (surface) 37 | 38 | #define GST_MFX_SURFACE_ID(surface) \ 39 | gst_mfx_surface_get_id (surface) 40 | 41 | #define GST_MFX_SURFACE_FORMAT(surface) \ 42 | gst_mfx_surface_get_format (surface) 43 | 44 | #define GST_MFX_SURFACE_WIDTH(surface) \ 45 | gst_mfx_surface_get_width (surface) 46 | 47 | #define GST_MFX_SURFACE_HEIGHT(surface) \ 48 | gst_mfx_surface_get_height (surface) 49 | 50 | typedef struct _GstMfxSurfacePool GstMfxSurfacePool; 51 | typedef struct _GstMfxSurface GstMfxSurface; 52 | typedef struct _GstMfxSurfaceClass GstMfxSurfaceClass; 53 | 54 | GstMfxSurface * 55 | gst_mfx_surface_new (const GstVideoInfo * info); 56 | 57 | GstMfxSurface * 58 | gst_mfx_surface_new_from_task (GstMfxTask * task); 59 | 60 | GstMfxSurface * 61 | gst_mfx_surface_new_from_pool(GstMfxSurfacePool * pool); 62 | 63 | GstMfxSurface * 64 | gst_mfx_surface_copy (GstMfxSurface * surface); 65 | 66 | GstMfxSurface * 67 | gst_mfx_surface_ref (GstMfxSurface * surface); 68 | 69 | void 70 | gst_mfx_surface_unref (GstMfxSurface * surface); 71 | 72 | void 73 | gst_mfx_surface_replace (GstMfxSurface ** old_surface_ptr, 74 | GstMfxSurface * new_surface); 75 | 76 | void 77 | gst_mfx_surface_class_init (GstMfxSurfaceClass * klass); 78 | 79 | mfxFrameSurface1 * 80 | gst_mfx_surface_get_frame_surface (GstMfxSurface * surface); 81 | 82 | GstMfxID 83 | gst_mfx_surface_get_id (GstMfxSurface * surface); 84 | 85 | GstVideoFormat 86 | gst_mfx_surface_get_format (GstMfxSurface * surface); 87 | 88 | guint 89 | gst_mfx_surface_get_width (GstMfxSurface * surface); 90 | 91 | guint 92 | gst_mfx_surface_get_height (GstMfxSurface * surface); 93 | 94 | void 95 | gst_mfx_surface_get_size (GstMfxSurface * surface, guint * width_ptr, 96 | guint * height_ptr); 97 | 98 | guint8 * 99 | gst_mfx_surface_get_plane (GstMfxSurface * surface, guint plane); 100 | 101 | guint16 102 | gst_mfx_surface_get_pitch (GstMfxSurface * surface, guint plane); 103 | 104 | GstMfxRectangle * 105 | gst_mfx_surface_get_crop_rect(GstMfxSurface * surface); 106 | 107 | gboolean 108 | gst_mfx_surface_has_video_memory(GstMfxSurface * surface); 109 | 110 | gboolean 111 | gst_mfx_surface_map (GstMfxSurface * surface); 112 | 113 | void 114 | gst_mfx_surface_unmap (GstMfxSurface * surface); 115 | 116 | gboolean 117 | gst_mfx_surface_is_queued(GstMfxSurface * surface); 118 | 119 | void 120 | gst_mfx_surface_queue(GstMfxSurface * surface); 121 | 122 | void 123 | gst_mfx_surface_dequeue(GstMfxSurface * surface); 124 | 125 | G_END_DECLS 126 | 127 | #endif /* GST_MFX_SURFACE_H */ 128 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxsurface_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_SURFACE_PRIV_H 22 | #define GST_MFX_SURFACE_PRIV_H 23 | 24 | #include "gstmfxsurface.h" 25 | #include "gstmfxminiobject.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_MFX_SURFACE_CLASS(klass) \ 30 | ((GstMfxSurfaceClass *)(klass)) 31 | 32 | #define GST_MFX_SURFACE_GET_CLASS(obj) \ 33 | GST_MFX_SURFACE_CLASS(GST_MFX_MINI_OBJECT_GET_CLASS(obj)) 34 | 35 | typedef gboolean(*GstMfxSurfaceAllocateFunc) (GstMfxSurface * surface, GstMfxTask * task); 36 | typedef void(*GstMfxSurfaceReleaseFunc) (GstMfxSurface * surface); 37 | typedef gboolean(*GstMfxSurfaceMapFunc) (GstMfxSurface * surface); 38 | typedef void(*GstMfxSurfaceUnmapFunc) (GstMfxSurface * surface); 39 | 40 | struct _GstMfxSurface 41 | { 42 | /*< private >*/ 43 | GstMfxMiniObject parent_instance; 44 | 45 | GstMfxDisplay *display; 46 | GstMfxTask *task; 47 | GstMfxMemoryId mem_id; 48 | GstMfxID surface_id; 49 | 50 | mfxFrameSurface1 surface; 51 | GstVideoFormat format; 52 | GstMfxRectangle crop_rect; 53 | guint width; 54 | guint height; 55 | guint data_size; 56 | guint8 *data; 57 | guchar *planes[3]; 58 | guint16 pitches[3]; 59 | gboolean mapped; 60 | gboolean has_video_memory; 61 | mfxExtVPPVideoSignalInfo siginfo; 62 | mfxExtBuffer **ext_buf; 63 | guint queued; 64 | 65 | gint gem_bo_handle; 66 | gboolean is_gem_linear; 67 | 68 | drm_intel_bufmgr *bufmgr; 69 | drm_intel_bo *bo; 70 | }; 71 | 72 | struct _GstMfxSurfaceClass 73 | { 74 | /*< private >*/ 75 | GstMfxMiniObjectClass parent_class; 76 | 77 | /*< protected >*/ 78 | GstMfxSurfaceAllocateFunc allocate; 79 | GstMfxSurfaceReleaseFunc release; 80 | GstMfxSurfaceMapFunc map; 81 | GstMfxSurfaceUnmapFunc unmap; 82 | }; 83 | 84 | GstMfxSurface * 85 | gst_mfx_surface_new_internal(const GstMfxSurfaceClass * klass, 86 | GstMfxDisplay * display, const GstVideoInfo * info, GstMfxTask * task, 87 | gboolean is_linear); 88 | 89 | #define gst_mfx_surface_ref_internal(surface) \ 90 | ((gpointer)gst_mfx_mini_object_ref(GST_MFX_MINI_OBJECT(surface))) 91 | 92 | #define gst_mfx_surface_unref_internal(surface) \ 93 | gst_mfx_mini_object_unref(GST_MFX_MINI_OBJECT(surface)) 94 | 95 | #define gst_mfx_surface_replace_internal(old_surface_ptr, new_surface) \ 96 | gst_mfx_mini_object_replace((GstMfxMiniObject **)(old_surface_ptr), \ 97 | GST_MFX_MINI_OBJECT(new_surface)) 98 | 99 | #undef gst_mfx_surface_ref 100 | #define gst_mfx_surface_ref(surface) \ 101 | gst_mfx_surface_ref_internal((surface)) 102 | 103 | #undef gst_mfx_surface_unref 104 | #define gst_mfx_surface_unref(surface) \ 105 | gst_mfx_surface_unref_internal((surface)) 106 | 107 | #undef gst_mfx_surface_replace 108 | #define gst_mfx_surface_replace(old_surface_ptr, new_surface) \ 109 | gst_mfx_surface_replace_internal((old_surface_ptr), (new_surface)) 110 | 111 | G_END_DECLS 112 | 113 | #endif /* GST_MFX_SURFACE_PRIV_H */ 114 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxsurface_vaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_SURFACE_VAAPI_H 22 | #define GST_MFX_SURFACE_VAAPI_H 23 | 24 | #include "gstmfxsurface.h" 25 | #include "gstmfxtask.h" 26 | #include "gstmfxutils_vaapi.h" 27 | #include "video-format.h" 28 | #include "gstmfxvideometa.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_MFX_SURFACE_VAAPI(obj) ((GstMfxSurfaceVaapi *) (obj)) 33 | 34 | typedef struct _GstMfxSurfaceVaapi GstMfxSurfaceVaapi; 35 | 36 | GstMfxSurface * 37 | gst_mfx_surface_vaapi_new (GstMfxDisplay * display, const GstVideoInfo * info, 38 | GstMfxVideoMeta *meta); 39 | 40 | GstMfxSurface * 41 | gst_mfx_surface_vaapi_new_from_task(GstMfxTask * task); 42 | 43 | GstMfxDisplay * 44 | gst_mfx_surface_vaapi_get_display(GstMfxSurface * surface); 45 | 46 | VaapiImage * 47 | gst_mfx_surface_vaapi_derive_image(GstMfxSurface * surface); 48 | 49 | G_END_DECLS 50 | 51 | #endif /* GST_MFX_SURFACE_VAAPI_H */ 52 | 53 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxsurfacecomposition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * gstmfxsubpicturecomposition.h - MFX subpicture composition abstraction 3 | * 4 | * Copyright (C) 2017 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_SUBPICTURE_COMPOSITION_H 24 | #define GST_MFX_SUBPICTURE_COMPOSITION_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_MFX_SURFACE_COMPOSITION(obj) \ 33 | ((GstMfxSurfaceComposition *)(obj)) 34 | 35 | typedef struct _GstMfxSurfaceComposition GstMfxSurfaceComposition; 36 | typedef struct _GstMfxSubpicture GstMfxSubpicture; 37 | 38 | struct _GstMfxSubpicture 39 | { 40 | GstMfxSurface *surface; 41 | gfloat global_alpha; 42 | GstMfxRectangle sub_rect; 43 | }; 44 | 45 | GstMfxSurfaceComposition * 46 | gst_mfx_surface_composition_new (GstMfxSurface * base_surface, 47 | GstVideoOverlayComposition * overlay); 48 | 49 | GstMfxSurfaceComposition * 50 | gst_mfx_surface_composition_ref (GstMfxSurfaceComposition * composition); 51 | 52 | void 53 | gst_mfx_surface_composition_unref(GstMfxSurfaceComposition * composition); 54 | 55 | void 56 | gst_mfx_surface_composition_replace( 57 | GstMfxSurfaceComposition ** old_composition_ptr, 58 | GstMfxSurfaceComposition * new_composition); 59 | 60 | GstMfxSurface * 61 | gst_mfx_surface_composition_get_base_surface (GstMfxSurfaceComposition * composition); 62 | 63 | guint 64 | gst_mfx_surface_composition_get_num_subpictures(GstMfxSurfaceComposition * composition); 65 | 66 | GstMfxSubpicture * 67 | gst_mfx_surface_composition_get_subpicture(GstMfxSurfaceComposition * composition, 68 | guint index); 69 | 70 | G_END_DECLS 71 | 72 | #endif /* GST_MFX_SUBPICTURE_COMPOSITION_H */ 73 | 74 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxsurfacepool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_SURFACE_POOL_H 22 | #define GST_MFX_SURFACE_POOL_H 23 | 24 | #include "gstmfxsurface.h" 25 | #include "gstmfxtask.h" 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_SURFACE_POOL(obj) \ 31 | ((GstMfxSurfacePool *)(obj)) 32 | 33 | GstMfxSurfacePool * 34 | gst_mfx_surface_pool_new (GstMfxDisplay * display, const GstVideoInfo * info, 35 | gboolean memtype_is_system); 36 | 37 | GstMfxSurfacePool * 38 | gst_mfx_surface_pool_new_with_task (GstMfxTask * task); 39 | 40 | GstMfxSurfacePool * 41 | gst_mfx_surface_pool_ref (GstMfxSurfacePool * pool); 42 | 43 | void 44 | gst_mfx_surface_pool_unref (GstMfxSurfacePool * pool); 45 | 46 | void 47 | gst_mfx_surface_pool_replace (GstMfxSurfacePool ** old_pool_ptr, 48 | GstMfxSurfacePool * new_pool); 49 | 50 | GstMfxSurface * 51 | gst_mfx_surface_pool_get_surface (GstMfxSurfacePool * pool); 52 | 53 | GstMfxSurface * 54 | gst_mfx_surface_pool_find_surface (GstMfxSurfacePool * pool, 55 | mfxFrameSurface1 * surface); 56 | 57 | G_END_DECLS 58 | 59 | #endif /* GST_MFX_SURFACE_POOL_H */ 60 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxtask.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_TASK_H 22 | #define GST_MFX_TASK_H 23 | 24 | #include "sysdeps.h" 25 | #include "gstmfxminiobject.h" 26 | #include "gstmfxdisplay.h" 27 | 28 | #include 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_MFX_TASK(obj) \ 35 | ((GstMfxTask *) (obj)) 36 | 37 | #define GST_MFX_TASK_SESSION(task) \ 38 | gst_mfx_task_get_session (task) 39 | 40 | #define GST_MFX_TASK_DISPLAY(task) \ 41 | gst_mfx_task_get_display (task) 42 | 43 | 44 | typedef struct _GstMfxTask GstMfxTask; 45 | typedef struct _GstMfxTaskAggregator GstMfxTaskAggregator; 46 | 47 | typedef enum { 48 | GST_MFX_TASK_INVALID = 0, 49 | GST_MFX_TASK_DECODER = (1 << 0), 50 | GST_MFX_TASK_VPP_IN = (1 << 1), 51 | GST_MFX_TASK_VPP_OUT = (1 << 2), 52 | GST_MFX_TASK_ENCODER = (1 << 3), 53 | } GstMfxTaskType; 54 | 55 | GstMfxTask * 56 | gst_mfx_task_new (GstMfxTaskAggregator * aggregator, 57 | guint type_flags); 58 | 59 | GstMfxTask * 60 | gst_mfx_task_new_with_session (GstMfxTaskAggregator * aggregator, 61 | mfxSession session, guint type_flags, gboolean is_joined); 62 | 63 | GstMfxTask * 64 | gst_mfx_task_ref (GstMfxTask * task); 65 | 66 | void 67 | gst_mfx_task_unref (GstMfxTask * task); 68 | 69 | void 70 | gst_mfx_task_replace (GstMfxTask ** old_task_ptr, 71 | GstMfxTask * new_task); 72 | 73 | mfxFrameAllocRequest * 74 | gst_mfx_task_get_request (GstMfxTask * task); 75 | 76 | void 77 | gst_mfx_task_set_request (GstMfxTask * task, mfxFrameAllocRequest * req); 78 | 79 | gboolean 80 | gst_mfx_task_has_type (GstMfxTask * task, guint flags); 81 | 82 | void 83 | gst_mfx_task_set_task_type (GstMfxTask * task, guint flags); 84 | 85 | guint 86 | gst_mfx_task_get_task_type (GstMfxTask * task); 87 | 88 | void 89 | gst_mfx_task_use_video_memory (GstMfxTask * task); 90 | 91 | gboolean 92 | gst_mfx_task_has_video_memory (GstMfxTask * task); 93 | 94 | void 95 | gst_mfx_task_set_video_params (GstMfxTask * task, mfxVideoParam * params); 96 | 97 | mfxVideoParam * 98 | gst_mfx_task_get_video_params (GstMfxTask * task); 99 | 100 | void 101 | gst_mfx_task_update_video_params (GstMfxTask * task, mfxVideoParam * params); 102 | 103 | void 104 | gst_mfx_task_ensure_memtype_is_system (GstMfxTask * task); 105 | 106 | GstMfxDisplay * 107 | gst_mfx_task_get_display (GstMfxTask * task); 108 | 109 | GstMfxMemoryId * 110 | gst_mfx_task_get_memory_id (GstMfxTask * task); 111 | 112 | guint 113 | gst_mfx_task_get_num_surfaces (GstMfxTask * task); 114 | 115 | void 116 | gst_mfx_task_set_num_surfaces (GstMfxTask *task, mfxU16 num_surf); 117 | 118 | mfxSession 119 | gst_mfx_task_get_session (GstMfxTask * task); 120 | 121 | void 122 | gst_mfx_task_set_soft_reinit (GstMfxTask * task, gboolean reinit_status); 123 | 124 | gboolean 125 | gst_mfx_task_get_soft_reinit (GstMfxTask * task); 126 | 127 | /* ------------------------------------------------------------------------ */ 128 | /* --- MFX Frame Allocator --- */ 129 | /* ------------------------------------------------------------------------ */ 130 | 131 | mfxStatus 132 | gst_mfx_task_frame_alloc (mfxHDL pthis, mfxFrameAllocRequest *req, 133 | mfxFrameAllocResponse *resp); 134 | 135 | mfxStatus 136 | gst_mfx_task_frame_free (mfxHDL pthis, mfxFrameAllocResponse *resp); 137 | 138 | G_END_DECLS 139 | 140 | #endif /* GST_MFX_TASK_H */ 141 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxtaskaggregator.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_TASK_AGGREGATOR_H 22 | #define GST_MFX_TASK_AGGREGATOR_H 23 | 24 | #include "sysdeps.h" 25 | #include "gstmfxminiobject.h" 26 | #include "gstmfxdisplay.h" 27 | #include "gstmfxtask.h" 28 | 29 | #include 30 | #include 31 | 32 | G_BEGIN_DECLS 33 | 34 | #define GST_MFX_TASK_AGGREGATOR (obj) \ 35 | ((GstMfxTaskAggregator *) (obj)) 36 | 37 | 38 | GstMfxTaskAggregator * 39 | gst_mfx_task_aggregator_new (void); 40 | 41 | GstMfxTask * 42 | gst_mfx_task_aggregator_get_current_task (GstMfxTaskAggregator * aggregator); 43 | 44 | gboolean 45 | gst_mfx_task_aggregator_set_current_task (GstMfxTaskAggregator * aggregator, 46 | GstMfxTask * task); 47 | 48 | void 49 | gst_mfx_task_aggregator_remove_current_task (GstMfxTaskAggregator * aggregator, 50 | GstMfxTask * task); 51 | 52 | void 53 | gst_mfx_task_aggregator_add_task (GstMfxTaskAggregator * aggregator, 54 | GstMfxTask * task); 55 | 56 | GstMfxTaskAggregator * 57 | gst_mfx_task_aggregator_ref (GstMfxTaskAggregator * aggregator); 58 | 59 | void 60 | gst_mfx_task_aggregator_unref (GstMfxTaskAggregator * aggregator); 61 | 62 | void 63 | gst_mfx_task_aggregator_replace (GstMfxTaskAggregator ** old_aggregator_ptr, 64 | GstMfxTaskAggregator * new_aggregator); 65 | 66 | GstMfxDisplay * 67 | gst_mfx_task_aggregator_get_display (GstMfxTaskAggregator * aggregator); 68 | 69 | mfxSession 70 | gst_mfx_task_aggregator_create_session (GstMfxTaskAggregator * aggregator, 71 | gboolean * is_joined); 72 | 73 | void 74 | gst_mfx_task_aggregator_remove_task (GstMfxTaskAggregator * aggregator, 75 | GstMfxTask * task); 76 | 77 | void 78 | gst_mfx_task_aggregator_update_peer_memtypes (GstMfxTaskAggregator * aggregator, 79 | gboolean memtype_is_system); 80 | 81 | 82 | G_END_DECLS 83 | 84 | #endif /* GST_MFX_TASK_AGGREGATOR_H */ 85 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxtypes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2012-2014 Intel Corporation 5 | * Author: Gwenole Beauchesne 6 | * Copyright (C) 2016 Intel Corporation 7 | * Author: Ishmael Visayana Sameen 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_MFX_TYPES_H 26 | #define GST_MFX_TYPES_H 27 | 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | /** 34 | * GstMfxID: 35 | * 36 | * An integer large enough to hold a generic VA id or a pointer 37 | * wherever necessary. 38 | */ 39 | typedef gsize GstMfxID; 40 | 41 | /** 42 | * GST_MFX_ID: 43 | * @id: an arbitrary integer value 44 | * 45 | * Macro that creates a #GstMfxID from @id. 46 | */ 47 | #define GST_MFX_ID(id) ((GstMfxID)(id)) 48 | 49 | /** 50 | * GST_MFX_ID_INVALID: 51 | * 52 | * Macro that evaluates to an invalid #GstMfxID value. 53 | */ 54 | #define GST_MFX_ID_INVALID GST_MFX_ID((gssize)(gint32)-1) 55 | 56 | /** 57 | * GST_MFX_ID_FORMAT: 58 | * 59 | * Can be used together with #GST_MFX_ID_ARGS to properly output an 60 | * integer value in a printf()-style text message. 61 | * 62 | * 63 | * printf("id: %" GST_MFX_ID_FORMAT "\n", GST_MFX_ID_ARGS(id)); 64 | * 65 | * 66 | */ 67 | #define GST_MFX_ID_FORMAT "p" 68 | 69 | /** 70 | * GST_MFX_ID_ARGS: 71 | * @id: a #GstMfxID 72 | * 73 | * Can be used together with #GST_MFX_ID_FORMAT to properly output 74 | * an integer value in a printf()-style text message. 75 | */ 76 | #define GST_MFX_ID_ARGS(id) GSIZE_TO_POINTER(id) 77 | 78 | /** 79 | * GstMfxRectangle: 80 | * @x: X coordinate 81 | * @y: Y coordinate 82 | * @width: region width 83 | * @height: region height 84 | * 85 | * A rectangle region within a surface. 86 | */ 87 | typedef struct _GstMfxRectangle GstMfxRectangle; 88 | struct _GstMfxRectangle { 89 | guint32 x; 90 | guint32 y; 91 | guint32 width; 92 | guint32 height; 93 | }; 94 | 95 | typedef struct _GstMfxMemoryId GstMfxMemoryId; 96 | struct _GstMfxMemoryId { 97 | mfxMemId mid; 98 | mfxFrameInfo *info; 99 | }; 100 | 101 | typedef enum { 102 | GST_MFX_OPTION_AUTO = -1, 103 | GST_MFX_OPTION_OFF, 104 | GST_MFX_OPTION_ON, 105 | } GstMfxOption; 106 | 107 | typedef enum { 108 | GST_MFX_RATECONTROL_NONE = 0, 109 | GST_MFX_RATECONTROL_CQP = MFX_RATECONTROL_CQP, 110 | GST_MFX_RATECONTROL_CBR = MFX_RATECONTROL_CBR, 111 | GST_MFX_RATECONTROL_VCM = MFX_RATECONTROL_VCM, 112 | GST_MFX_RATECONTROL_VBR = MFX_RATECONTROL_VBR, 113 | GST_MFX_RATECONTROL_AVBR = MFX_RATECONTROL_AVBR, 114 | GST_MFX_RATECONTROL_QVBR = MFX_RATECONTROL_QVBR, 115 | GST_MFX_RATECONTROL_LA_BRC = MFX_RATECONTROL_LA, 116 | GST_MFX_RATECONTROL_ICQ = MFX_RATECONTROL_ICQ, 117 | GST_MFX_RATECONTROL_LA_ICQ = MFX_RATECONTROL_LA_ICQ, 118 | GST_MFX_RATECONTROL_LA_HRD = MFX_RATECONTROL_LA_HRD, 119 | } GstMfxRateControl; 120 | 121 | /* Define a mask for GstVaapiRateControl */ 122 | #define GST_MFX_RATECONTROL_MASK(RC) \ 123 | (1U << G_PASTE(GST_MFX_RATECONTROL_,RC)) 124 | 125 | G_END_DECLS 126 | 127 | #endif /* GST_MFX_TYPES_H */ 128 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxutils_h264.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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 | #include "sysdeps.h" 24 | #include 25 | #include "gstmfxutils_h264.h" 26 | 27 | struct map 28 | { 29 | guint value; 30 | const gchar *name; 31 | }; 32 | 33 | /* Profile string map */ 34 | static const struct map gst_mfx_h264_profile_map[] = { 35 | {MFX_PROFILE_AVC_CONSTRAINED_BASELINE, "constrained-baseline"}, 36 | {MFX_PROFILE_AVC_BASELINE, "baseline"}, 37 | {MFX_PROFILE_AVC_MAIN, "main"}, 38 | {MFX_PROFILE_AVC_EXTENDED, "extended"}, 39 | {MFX_PROFILE_AVC_HIGH, "high"}, 40 | {MFX_PROFILE_AVC_HIGH_422, "high-4:2:2"}, 41 | {0, NULL} 42 | }; 43 | 44 | /* Lookup value in map */ 45 | static const struct map * 46 | map_lookup_value (const struct map *m, guint value) 47 | { 48 | g_return_val_if_fail (m != NULL, NULL); 49 | 50 | for (; m->name != NULL; m++) { 51 | if (m->value == value) 52 | return m; 53 | } 54 | return NULL; 55 | } 56 | 57 | /* Lookup name in map */ 58 | static const struct map * 59 | map_lookup_name (const struct map *m, const gchar * name) 60 | { 61 | g_return_val_if_fail (m != NULL, NULL); 62 | 63 | if (!name) 64 | return NULL; 65 | 66 | for (; m->name != NULL; m++) { 67 | if (strcmp (m->name, name) == 0) 68 | return m; 69 | } 70 | return NULL; 71 | } 72 | 73 | /** Returns a relative score for the supplied MFX profile */ 74 | guint 75 | gst_mfx_utils_h264_get_profile_score (mfxU16 profile) 76 | { 77 | const struct map *const m = 78 | map_lookup_value (gst_mfx_h264_profile_map, profile); 79 | 80 | return m ? 1 + (m - gst_mfx_h264_profile_map) : 0; 81 | } 82 | 83 | /** Returns MFX profile from a string representation */ 84 | mfxU16 85 | gst_mfx_utils_h264_get_profile_from_string (const gchar * str) 86 | { 87 | const struct map *const m = map_lookup_name (gst_mfx_h264_profile_map, str); 88 | 89 | return m ? m->value : MFX_PROFILE_UNKNOWN; 90 | } 91 | 92 | /** Returns a string representation for the supplied H.264 profile */ 93 | const gchar * 94 | gst_mfx_utils_h264_get_profile_string (mfxU16 profile) 95 | { 96 | const struct map *const m = 97 | map_lookup_value (gst_mfx_h264_profile_map, profile); 98 | 99 | return m ? m->name : NULL; 100 | } 101 | 102 | static guint16 read_ue(const guint8 *slice_buf, gint *nbits, gint size) 103 | { 104 | if (!slice_buf || !nbits) 105 | return 0; 106 | 107 | guint16 res = 0; 108 | gint offset = *nbits / 8, c = *nbits, i; 109 | guint8 bit = 0x80 >> (*nbits % 8); 110 | 111 | while (!(slice_buf[offset] & bit)) { 112 | bit >>= 1; 113 | ++(*nbits); 114 | if (!(*nbits % 8)) { 115 | ++offset; 116 | bit = 0x80; 117 | } 118 | } 119 | 120 | i = c = *nbits - c; 121 | while (c) { 122 | bit >>= 1; 123 | ++(*nbits); 124 | if (!(*nbits % 8)) { 125 | ++offset; 126 | bit = 0x80; 127 | } 128 | res <<= 1; 129 | res |= (slice_buf[offset] & bit) ? 1 : 0; 130 | --c; 131 | } 132 | 133 | ++(*nbits); 134 | res = res + (1 << i) - 1; 135 | 136 | return res; 137 | } 138 | 139 | gboolean 140 | gst_mfx_utils_h264_is_slice_intra (const guint8 *slice_buf, gint size) 141 | { 142 | gint nbits = 8; 143 | 144 | /* First UE value is fist_mb_in_slice */ 145 | read_ue(slice_buf, &nbits, size); 146 | 147 | /* Second UE value is slice type */ 148 | if ((read_ue(slice_buf, &nbits, size) % 5) == GST_H264_I_SLICE) 149 | return TRUE; 150 | 151 | return FALSE; 152 | } 153 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxutils_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_UTILS_H264_H 24 | #define GST_MFX_UTILS_H264_H 25 | 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | /* Returns a relative score for the supplied MFX profile */ 31 | guint 32 | gst_mfx_utils_h264_get_profile_score (mfxU16 profile); 33 | 34 | /* Returns MFX profile from a string representation */ 35 | mfxU16 36 | gst_mfx_utils_h264_get_profile_from_string (const gchar * str); 37 | 38 | /* Returns a string representation for the supplied H.264 profile */ 39 | const gchar * 40 | gst_mfx_utils_h264_get_profile_string (mfxU16 profile); 41 | 42 | /* Check if a H.264 slice contain I picture */ 43 | gboolean 44 | gst_mfx_utils_h264_is_slice_intra (const guint8 *slice_buf, gint size); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* GST_MFX_UTILS_H264_H */ 49 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxutils_vaapi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * Author: Puunithaaraj Gopal 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 | #ifndef GST_MFX_UTILS_VAAPI_H 23 | #define GST_MFX_UTILS_VAAPI_H 24 | 25 | #include "gstmfxdisplay.h" 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | typedef struct _VaapiImage VaapiImage; 31 | 32 | VaapiImage * 33 | vaapi_image_new (GstMfxDisplay * display, guint width, guint height, 34 | GstVideoFormat format); 35 | 36 | VaapiImage * 37 | vaapi_image_new_with_image (GstMfxDisplay *display, VAImage *va_image); 38 | 39 | VaapiImage * 40 | vaapi_image_ref (VaapiImage * image); 41 | 42 | void 43 | vaapi_image_unref (VaapiImage * image); 44 | 45 | void 46 | vaapi_image_replace (VaapiImage ** old_image_ptr, 47 | VaapiImage * new_image); 48 | 49 | VAImageID 50 | vaapi_image_get_id (VaapiImage *image); 51 | 52 | gboolean 53 | vaapi_image_get_image (VaapiImage *image, VAImage *va_image); 54 | 55 | GstVideoFormat 56 | vaapi_image_get_format (VaapiImage *image); 57 | 58 | guint 59 | vaapi_image_get_width (VaapiImage *image); 60 | 61 | guint 62 | vaapi_image_get_height (VaapiImage *image); 63 | 64 | void 65 | vaapi_image_get_size (VaapiImage *image, guint *pwidth, guint *pheight); 66 | 67 | gboolean 68 | vaapi_image_map (VaapiImage *image); 69 | 70 | gboolean 71 | vaapi_image_unmap (VaapiImage *image); 72 | 73 | guint 74 | vaapi_image_get_plane_count (VaapiImage *image); 75 | 76 | guchar * 77 | vaapi_image_get_plane (VaapiImage *image, guint plane); 78 | 79 | guint 80 | vaapi_image_get_pitch (VaapiImage *image, guint plane); 81 | 82 | guint 83 | vaapi_image_get_offset (VaapiImage *image, guint plane); 84 | 85 | guint 86 | vaapi_image_get_data_size (VaapiImage *image); 87 | 88 | gboolean 89 | vaapi_check_status (VAStatus status, const gchar *msg); 90 | 91 | G_END_DECLS 92 | 93 | #endif /* GST_MFX_UTILS_VAAPI_H */ 94 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxvalue.c: -------------------------------------------------------------------------------- 1 | #include "sysdeps.h" 2 | #include 3 | #include "gstmfxvalue.h" 4 | 5 | GType 6 | gst_mfx_option_get_type (void) 7 | { 8 | static volatile gsize g_type = 0; 9 | 10 | static const GEnumValue options[] = { 11 | {GST_MFX_OPTION_AUTO, 12 | "Let Media SDK decide", "auto"}, 13 | {GST_MFX_OPTION_ON, 14 | "Turn option on", "on"}, 15 | {GST_MFX_OPTION_OFF, 16 | "Turn option off", "off"}, 17 | {0, NULL, NULL}, 18 | }; 19 | 20 | if (g_once_init_enter (&g_type)) { 21 | GType type = g_enum_register_static ("GstMfxOption", options); 22 | g_once_init_leave (&g_type, type); 23 | } 24 | return g_type; 25 | } 26 | 27 | GType 28 | gst_mfx_rate_control_get_type (void) 29 | { 30 | static volatile gsize g_type = 0; 31 | 32 | static const GEnumValue rate_control_values[] = { 33 | {GST_MFX_RATECONTROL_NONE, 34 | "None", "none"}, 35 | {GST_MFX_RATECONTROL_CQP, 36 | "Constant QP", "cqp"}, 37 | {GST_MFX_RATECONTROL_CBR, 38 | "Constant bitrate", "cbr"}, 39 | {GST_MFX_RATECONTROL_VCM, 40 | "Video conference mode", "vcm"}, 41 | {GST_MFX_RATECONTROL_VBR, 42 | "Variable bitrate", "vbr"}, 43 | {GST_MFX_RATECONTROL_AVBR, 44 | "Average variable bitrate", "avbr"}, 45 | {GST_MFX_RATECONTROL_QVBR, 46 | "Quality variable bitrate", "qvbr"}, 47 | {GST_MFX_RATECONTROL_LA_BRC, 48 | "Bitrate control with look-ahead", "la-brc"}, 49 | {GST_MFX_RATECONTROL_ICQ, 50 | "Intelligent constant quality", "icq"}, 51 | {GST_MFX_RATECONTROL_LA_ICQ, 52 | "Intelligent constant quality with look-ahead", "la-icq"}, 53 | {GST_MFX_RATECONTROL_LA_HRD, 54 | "HRD-compliant bit rate coding with look-ahead", "la-hrd"}, 55 | {0, NULL, NULL}, 56 | }; 57 | 58 | if (g_once_init_enter (&g_type)) { 59 | GType type = g_enum_register_static ("GstMfxRateControl", 60 | rate_control_values); 61 | g_once_init_leave (&g_type, type); 62 | } 63 | return g_type; 64 | } 65 | 66 | static gboolean 67 | build_enum_subset_values_from_mask (GstMfxEnumSubset * subset, guint32 mask) 68 | { 69 | GEnumClass *enum_class; 70 | const GEnumValue *value; 71 | guint i, n; 72 | 73 | enum_class = g_type_class_ref (subset->parent_type); 74 | if (!enum_class) 75 | return FALSE; 76 | 77 | for (i = 0, n = 0; i < 32 && n < subset->num_values; i++) { 78 | if (!(mask & (1U << i))) 79 | continue; 80 | value = g_enum_get_value (enum_class, i); 81 | if (!value) 82 | continue; 83 | subset->values[n++] = *value; 84 | } 85 | g_type_class_unref (enum_class); 86 | if (n != subset->num_values - 1) 87 | goto error_invalid_num_values; 88 | return TRUE; 89 | 90 | /* ERRORS */ 91 | error_invalid_num_values: 92 | { 93 | GST_ERROR ("invalid number of static values for `%s'", subset->type_name); 94 | return FALSE; 95 | } 96 | } 97 | 98 | GType 99 | gst_mfx_type_define_enum_subset_from_mask (GstMfxEnumSubset * subset, 100 | guint32 mask) 101 | { 102 | if (g_once_init_enter (&subset->type)) { 103 | GType type; 104 | 105 | build_enum_subset_values_from_mask (subset, mask); 106 | memset (&subset->type_info, 0, sizeof (subset->type_info)); 107 | g_enum_complete_type_info (subset->parent_type, &subset->type_info, 108 | subset->values); 109 | 110 | type = g_type_register_static (G_TYPE_ENUM, subset->type_name, 111 | &subset->type_info, 0); 112 | g_once_init_leave (&subset->type, type); 113 | } 114 | return subset->type; 115 | } 116 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxvalue.h: -------------------------------------------------------------------------------- 1 | #ifndef GST_MFX_VALUE_H 2 | #define GST_MFX_VALUE_H 3 | 4 | #include 5 | #include "gstmfxtypes.h" 6 | 7 | G_BEGIN_DECLS 8 | 9 | #define GST_MFX_TYPE_OPTION gst_mfx_option_get_type () 10 | 11 | /** 12 | * GST_MFX_TYPE_ROTATION: 13 | * 14 | * A type that represents the MFX surface rotation. 15 | * 16 | * Return value: the #GType of GstMfxRotation 17 | */ 18 | #define GST_MFX_TYPE_ROTATION gst_mfx_rotation_get_type () 19 | 20 | /** 21 | * GST_MFX_TYPE_RATE_CONTROL: 22 | * 23 | * A type that represents the MFX rate control algorithm. 24 | * 25 | * Return value: the #GType of GstMfxRateControl 26 | */ 27 | #define GST_MFX_TYPE_RATE_CONTROL gst_mfx_rate_control_get_type () 28 | 29 | /** 30 | * GST_MFX_TYPE_DEINTERLACE_MODE: 31 | * 32 | * A type that represents the MFX deinterlace mode. 33 | * 34 | * Return value: the #GType of GstMfxDeinterlaceMode 35 | */ 36 | #define GST_MFX_TYPE_DEINTERLACE_MODE \ 37 | gst_mfx_deinterlace_mode_get_type () 38 | 39 | /** 40 | * GST_MFX_TYPE_FRC_ALGORITHM: 41 | * 42 | * A type that represents the MFX frame rate conversion algorithm. 43 | * 44 | * Return value: the #GType of GstMfxFrcAlgorithm 45 | */ 46 | 47 | #define GST_MFX_TYPE_FRC_ALGORITHM \ 48 | gst_mfx_frc_algorithm_get_type () 49 | 50 | GType 51 | gst_mfx_option_get_type (void); 52 | 53 | GType 54 | gst_mfx_rotation_get_type (void); 55 | 56 | GType 57 | gst_mfx_rate_control_get_type (void); 58 | 59 | GType 60 | gst_mfx_deinterlace_mode_get_type (void); 61 | 62 | GType 63 | gst_mfx_frc_algorithm_get_type (void); 64 | /** 65 | * GST_MFX_POPCOUNT32: 66 | * @x: the value from which to compute population count 67 | * 68 | * Computes the number of bits set in the supplied 32-bit value @x. 69 | * 70 | * Return value: the number of bits set in @x 71 | */ 72 | #define GST_MFX_POPCOUNT32(x) \ 73 | GST_MFX_POPCOUNT32_0(x) 74 | #define GST_MFX_POPCOUNT32_0(x) \ 75 | GST_MFX_POPCOUNT32_1((x) - (((x) >> 1) & 0x55555555)) 76 | #define GST_MFX_POPCOUNT32_1(x) \ 77 | GST_MFX_POPCOUNT32_2(((x) & 0x33333333) + (((x) >> 2) & 0x33333333)) 78 | #define GST_MFX_POPCOUNT32_2(x) \ 79 | GST_MFX_POPCOUNT32_3((x) + ((x) >> 4)) 80 | #define GST_MFX_POPCOUNT32_3(x) \ 81 | GST_MFX_POPCOUNT32_4((x) & 0x0f0f0f0f) 82 | #define GST_MFX_POPCOUNT32_4(x) \ 83 | (((x) * 0x01010101) >> 24) 84 | 85 | /* --- GstMfxEnumSubset --- */ 86 | 87 | /** 88 | * GstMfxEnumSubset: 89 | * @name: name of the enum subset 90 | * @parent_type: parent enum type 91 | * @type: registered #GType 92 | * @type_info: #GTypeInfo used to build the @type 93 | * @values: pointer to a static array of #GEnumValue elements 94 | * @num_values: number of elements in the @values array, including the 95 | * terminator 96 | * 97 | * Structure that holds the required information to build a GEnum 98 | * subset from the supplied @parent_type, i.e. a subset of its values. 99 | */ 100 | typedef struct { 101 | GType parent_type; 102 | GType type; 103 | GTypeInfo type_info; 104 | const gchar *type_name; 105 | GEnumValue *values; 106 | guint num_values; 107 | } GstMfxEnumSubset; 108 | 109 | GType 110 | gst_mfx_type_define_enum_subset_from_mask (GstMfxEnumSubset *subset, 111 | guint32 mask); 112 | 113 | #define GST_MFX_TYPE_DEFINE_ENUM_SUBSET_FROM_MASK(NAME, name, TYPE, MASK) \ 114 | static GType \ 115 | G_PASTE(name,_get_type)(void) \ 116 | { \ 117 | static GEnumValue enum_values[GST_MFX_POPCOUNT32(MASK) + 1]; \ 118 | static GstMfxEnumSubset subset = { \ 119 | .type_name = G_STRINGIFY(NAME), \ 120 | .values = enum_values, \ 121 | .num_values = G_N_ELEMENTS(enum_values), \ 122 | }; \ 123 | if (g_once_init_enter(&subset.parent_type)) \ 124 | g_once_init_leave(&subset.parent_type, TYPE); \ 125 | return gst_mfx_type_define_enum_subset_from_mask(&subset, MASK); \ 126 | } 127 | 128 | G_END_DECLS 129 | 130 | #endif /* GST_MFX_VALUE_H */ 131 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxwindow.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_WINDOW_H 24 | #define GST_MFX_WINDOW_H 25 | 26 | #include "gstmfxtypes.h" 27 | #include "gstmfxdisplay.h" 28 | #include "gstmfxsurface.h" 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_MFX_WINDOW(obj) ((GstMfxWindow *)(obj)) 33 | 34 | typedef struct _GstMfxWindow GstMfxWindow; 35 | typedef struct _GstMfxWindowClass GstMfxWindowClass; 36 | 37 | GstMfxWindow * 38 | gst_mfx_window_ref (GstMfxWindow * window); 39 | 40 | void 41 | gst_mfx_window_unref (GstMfxWindow * window); 42 | 43 | void 44 | gst_mfx_window_replace (GstMfxWindow ** old_window_ptr, 45 | GstMfxWindow * new_window); 46 | 47 | GstMfxDisplay * 48 | gst_mfx_window_get_display (GstMfxWindow * window); 49 | 50 | void 51 | gst_mfx_window_show (GstMfxWindow * window); 52 | 53 | void 54 | gst_mfx_window_hide (GstMfxWindow * window); 55 | 56 | guintptr 57 | gst_mfx_window_get_handle (GstMfxWindow * window); 58 | 59 | gboolean 60 | gst_mfx_window_get_fullscreen (GstMfxWindow * window); 61 | 62 | void 63 | gst_mfx_window_set_fullscreen (GstMfxWindow * window, gboolean fullscreen); 64 | 65 | guint 66 | gst_mfx_window_get_width (GstMfxWindow * window); 67 | 68 | guint 69 | gst_mfx_window_get_height (GstMfxWindow * window); 70 | 71 | void 72 | gst_mfx_window_get_size (GstMfxWindow * window, guint * width_ptr, 73 | guint * height_ptr); 74 | 75 | void 76 | gst_mfx_window_set_width (GstMfxWindow * window, guint width); 77 | 78 | void 79 | gst_mfx_window_set_height (GstMfxWindow * window, guint height); 80 | 81 | void 82 | gst_mfx_window_set_size (GstMfxWindow * window, guint width, guint height); 83 | 84 | gboolean 85 | gst_mfx_window_put_surface (GstMfxWindow * window, 86 | GstMfxSurface * surface, const GstMfxRectangle * src_rect, 87 | const GstMfxRectangle * dst_rect); 88 | 89 | void 90 | gst_mfx_window_reconfigure (GstMfxWindow * window); 91 | 92 | gboolean 93 | gst_mfx_window_unblock_cancel (GstMfxWindow * window); 94 | 95 | G_END_DECLS 96 | 97 | #endif /* GST_MFX_WINDOW_H */ 98 | -------------------------------------------------------------------------------- /gst-libs/mfx/gstmfxwindow_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_WINDOW_PRIV_H 24 | #define GST_MFX_WINDOW_PRIV_H 25 | 26 | #include "gstmfxminiobject.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_WINDOW_CLASS(klass) \ 31 | ((GstMfxWindowClass *)(klass)) 32 | 33 | #define GST_MFX_WINDOW_GET_CLASS(obj) \ 34 | GST_MFX_WINDOW_CLASS(GST_MFX_MINI_OBJECT_GET_CLASS(obj)) 35 | 36 | /* GstMfxWindowClass hooks */ 37 | typedef gboolean(*GstMfxWindowCreateFunc) (GstMfxWindow * window, 38 | guint * width, guint * height); 39 | typedef void(*GstMfxWindowDestroyFunc) (GstMfxWindow * window); 40 | typedef gboolean(*GstMfxWindowShowFunc) (GstMfxWindow * window); 41 | typedef gboolean(*GstMfxWindowHideFunc) (GstMfxWindow * window); 42 | typedef gboolean(*GstMfxWindowGetGeometryFunc) (GstMfxWindow * window, 43 | gint * px, gint * py, guint * pwidth, guint * pheight); 44 | typedef gboolean(*GstMfxWindowSetFullscreenFunc) (GstMfxWindow * window, 45 | gboolean fullscreen); 46 | typedef gboolean(*GstMfxWindowResizeFunc) (GstMfxWindow * window, 47 | guint width, guint height); 48 | typedef gboolean(*GstMfxWindowRenderFunc) (GstMfxWindow * window, 49 | GstMfxSurface * surface, const GstMfxRectangle * src_rect, 50 | const GstMfxRectangle * dst_rect); 51 | 52 | #undef GST_MFX_WINDOW_ID 53 | #define GST_MFX_WINDOW_ID(window) \ 54 | (GST_MFX_WINDOW (window)->handle) 55 | 56 | #undef GST_MFX_WINDOW_DISPLAY 57 | #define GST_MFX_WINDOW_DISPLAY(window) \ 58 | (GST_MFX_WINDOW (window)->display) 59 | 60 | /** 61 | * GstMfxWindow: 62 | * 63 | * Base class for system-dependent windows. 64 | */ 65 | struct _GstMfxWindow 66 | { 67 | /*< private >*/ 68 | GstMfxMiniObject parent_instance; 69 | 70 | GstMfxDisplay *display; 71 | guintptr handle; 72 | 73 | /*< protected >*/ 74 | guint width; 75 | guint height; 76 | guint display_width; 77 | guint display_height; 78 | guint use_foreign_window; 79 | guint is_fullscreen; 80 | guint check_geometry; 81 | }; 82 | 83 | /** 84 | * GstMfxWindowClass: 85 | * @create: virtual function to create a window with width and height 86 | * @show: virtual function to show (map) a window 87 | * @hide: virtual function to hide (unmap) a window 88 | * @get_geometry: virtual function to get the current window geometry 89 | * @set_fullscreen: virtual function to change window fullscreen state 90 | * @resize: virtual function to resize a window 91 | * @render: virtual function to render a #GstMfxSurface into a window 92 | * @get_visual_id: virtual function to get the desired visual id used to 93 | * create the window 94 | * @get_colormap: virtual function to get the desired colormap used to 95 | * create the window, or the currently allocated one 96 | * 97 | * Base class for system-dependent windows. 98 | */ 99 | struct _GstMfxWindowClass 100 | { 101 | /*< private >*/ 102 | GstMfxMiniObjectClass parent_class; 103 | 104 | /*< protected >*/ 105 | GstMfxWindowCreateFunc create; 106 | GstMfxWindowDestroyFunc destroy; 107 | GstMfxWindowShowFunc show; 108 | GstMfxWindowHideFunc hide; 109 | GstMfxWindowGetGeometryFunc get_geometry; 110 | GstMfxWindowSetFullscreenFunc set_fullscreen; 111 | GstMfxWindowResizeFunc resize; 112 | GstMfxWindowRenderFunc render; 113 | }; 114 | 115 | void 116 | gst_mfx_window_class_init(GstMfxWindowClass * klass); 117 | 118 | GstMfxWindow * 119 | gst_mfx_window_new_internal(const GstMfxWindowClass * window_class, 120 | GstMfxDisplay * display, GstMfxID handle, guint width, guint height); 121 | 122 | #define gst_mfx_window_ref_internal(window) \ 123 | ((gpointer)gst_mfx_mini_object_ref(GST_MFX_MINI_OBJECT(window))) 124 | 125 | #define gst_mfx_window_unref_internal(window) \ 126 | gst_mfx_mini_object_unref(GST_MFX_MINI_OBJECT(window)) 127 | 128 | #define gst_mfx_window_replace_internal(old_window_ptr, new_window) \ 129 | gst_mfx_mini_object_replace((GstMfxMiniObject **)(old_window_ptr), \ 130 | GST_MFX_MINI_OBJECT(new_window)) 131 | 132 | #undef gst_mfx_window_ref 133 | #define gst_mfx_window_ref(window) \ 134 | gst_mfx_window_ref_internal((window)) 135 | 136 | #undef gst_mfx_window_unref 137 | #define gst_mfx_window_unref(window) \ 138 | gst_mfx_window_unref_internal((window)) 139 | 140 | #undef gst_mfx_window_replace 141 | #define gst_mfx_window_replace(old_window_ptr, new_window) \ 142 | gst_mfx_window_replace_internal((old_window_ptr), (new_window)) 143 | 144 | G_END_DECLS 145 | 146 | #endif /* GST_MFX_WINDOW_PRIV_H */ 147 | -------------------------------------------------------------------------------- /gst-libs/mfx/sysdeps.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef SYSDEPS_H 22 | #define SYSDEPS_H 23 | 24 | #include "version.h" 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include 32 | 33 | #include 34 | #include 35 | 36 | /* Media SDK API version check */ 37 | #define MSDK_CHECK_VERSION(major,minor) \ 38 | (MFX_VERSION_MAJOR > major || \ 39 | (MFX_VERSION_MAJOR == major && MFX_VERSION_MINOR > minor) || \ 40 | (MFX_VERSION_MAJOR == major && MFX_VERSION_MINOR == minor)) 41 | 42 | #endif /* SYSDEPS_H */ 43 | -------------------------------------------------------------------------------- /gst-libs/mfx/video-format.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Puunithaaraj Gopal 4 | * Author: Ishmael Visayana Sameen 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 "video-format.h" 23 | 24 | typedef struct _GstMfxFormatMap GstMfxFormatMap; 25 | 26 | struct _GstMfxFormatMap 27 | { 28 | GstVideoFormat format; 29 | mfxU32 mfx_fourcc; 30 | guint va_fourcc; 31 | guint va_format; 32 | }; 33 | 34 | GstMfxFormatMap format_map[] = { 35 | {GST_VIDEO_FORMAT_NV12, MFX_FOURCC_NV12, 36 | VA_FOURCC_NV12, VA_RT_FORMAT_YUV420}, 37 | {GST_VIDEO_FORMAT_I420, MFX_FOURCC_YV12, 38 | VA_FOURCC_YV12, VA_RT_FORMAT_YUV420}, 39 | {GST_VIDEO_FORMAT_YV12, MFX_FOURCC_YV12, 40 | VA_FOURCC_YV12, VA_RT_FORMAT_YUV420}, 41 | {GST_VIDEO_FORMAT_YUY2, MFX_FOURCC_YUY2, 42 | VA_FOURCC_YUY2, VA_RT_FORMAT_YUV422}, 43 | {GST_VIDEO_FORMAT_UYVY, MFX_FOURCC_UYVY, 44 | VA_FOURCC_UYVY, VA_RT_FORMAT_YUV422}, 45 | {GST_VIDEO_FORMAT_BGRA, MFX_FOURCC_RGB4, 46 | VA_FOURCC_ARGB, VA_RT_FORMAT_RGB32}, 47 | {GST_VIDEO_FORMAT_BGRx, MFX_FOURCC_RGB4, 48 | VA_FOURCC_ARGB, VA_RT_FORMAT_RGB32}, 49 | {0,} 50 | }; 51 | 52 | GstVideoFormat 53 | gst_video_format_from_mfx_fourcc (mfxU32 fourcc) 54 | { 55 | GstMfxFormatMap *m; 56 | 57 | for (m = format_map; m->format; m++) { 58 | if (fourcc == m->mfx_fourcc) 59 | return m->format; 60 | } 61 | return GST_VIDEO_FORMAT_UNKNOWN; 62 | } 63 | 64 | mfxU32 65 | gst_video_format_to_mfx_fourcc (GstVideoFormat format) 66 | { 67 | GstMfxFormatMap *m; 68 | 69 | for (m = format_map; m->format; m++) { 70 | if (format == m->format) 71 | return m->mfx_fourcc; 72 | } 73 | return 0; 74 | } 75 | 76 | GstVideoFormat 77 | gst_video_format_from_va_fourcc (guint fourcc) 78 | { 79 | GstMfxFormatMap *m; 80 | 81 | for (m = format_map; m->format; m++) { 82 | if (fourcc == m->va_fourcc) 83 | return m->format; 84 | } 85 | return GST_VIDEO_FORMAT_UNKNOWN; 86 | } 87 | 88 | guint 89 | gst_video_format_to_va_fourcc (GstVideoFormat format) 90 | { 91 | GstMfxFormatMap *m; 92 | 93 | for (m = format_map; m->format; m++) { 94 | if (format == m->format) 95 | return m->va_fourcc; 96 | } 97 | return 0; 98 | } 99 | 100 | mfxU32 101 | gst_mfx_video_format_from_va_fourcc (guint fourcc) 102 | { 103 | GstMfxFormatMap *m; 104 | 105 | for (m = format_map; m->format; m++) { 106 | if (fourcc == m->va_fourcc) 107 | return m->mfx_fourcc; 108 | } 109 | return 0; 110 | } 111 | 112 | guint 113 | gst_mfx_video_format_to_va_fourcc (mfxU32 fourcc) 114 | { 115 | GstMfxFormatMap *m; 116 | 117 | for (m = format_map; m->format; m++) { 118 | if (fourcc == m->mfx_fourcc) 119 | return m->va_fourcc; 120 | } 121 | return 0; 122 | } 123 | 124 | guint 125 | gst_mfx_video_format_to_va_format (mfxU32 fourcc) 126 | { 127 | GstMfxFormatMap *m; 128 | 129 | for (m = format_map; m->format; m++) { 130 | if (fourcc == m->mfx_fourcc) 131 | return m->va_format; 132 | } 133 | return 0; 134 | } 135 | -------------------------------------------------------------------------------- /gst-libs/mfx/video-format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Puunithaaraj Gopal 4 | * Author: Ishmael Visayana Sameen 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 | #ifndef GST_MFX_VIDEO_FORMAT_H 23 | #define GST_MFX_VIDEO_FORMAT_H 24 | 25 | #include 26 | #include 27 | 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | const gchar * 33 | gst_mfx_video_format_to_string (GstVideoFormat format); 34 | 35 | GstVideoFormat 36 | gst_video_format_from_mfx_fourcc (mfxU32 fourcc); 37 | 38 | mfxU32 39 | gst_video_format_to_mfx_fourcc (GstVideoFormat format); 40 | 41 | GstVideoFormat 42 | gst_video_format_from_va_fourcc (guint fourcc); 43 | 44 | guint 45 | gst_video_format_to_va_fourcc (GstVideoFormat format); 46 | 47 | mfxU32 48 | gst_mfx_video_format_from_va_fourcc (guint fourcc); 49 | 50 | guint 51 | gst_mfx_video_format_to_va_fourcc (mfxU32 fourcc); 52 | 53 | guint 54 | gst_mfx_video_format_to_va_format (mfxU32 fourcc); 55 | 56 | G_END_DECLS 57 | 58 | #endif /* GST_MFX_VIDEO_FORMAT_H */ 59 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/gstmfxdisplay_wayland.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Sreerenj Balachandran 4 | * Author: Gwenole Beauchesne 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 | #ifndef GST_MFX_DISPLAY_WAYLAND_H 23 | #define GST_MFX_DISPLAY_WAYLAND_H 24 | 25 | #include 26 | #include "gstmfxdisplay.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_DISPLAY_WAYLAND(obj) \ 31 | ((GstMfxDisplayWayland *)(obj)) 32 | 33 | typedef struct _GstMfxDisplayWayland GstMfxDisplayWayland; 34 | 35 | GstMfxDisplay * 36 | gst_mfx_display_wayland_new (const gchar * display_name); 37 | 38 | G_END_DECLS 39 | 40 | #endif /* GST_MFX_DISPLAY_WAYLAND_H */ 41 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/gstmfxdisplay_wayland_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Sreerenj Balachandran 4 | * Author: Gwenole Beauchesne 5 | * Copyright (C) 2016 Intel Corporation 6 | * Author: Puunithaaraj Gopal 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_MFX_DISPLAY_WAYLAND_PRIV_H 25 | #define GST_MFX_DISPLAY_WAYLAND_PRIV_H 26 | 27 | #include 28 | #include "gstmfxdisplay_wayland.h" 29 | #include "gstmfxdisplay_priv.h" 30 | #include "wayland-drm-client-protocol.h" 31 | 32 | #ifdef USE_WESTON_4_0 33 | #include "viewporter-client-protocol.h" 34 | #else 35 | #include "scaler-client-protocol.h" 36 | #endif 37 | 38 | G_BEGIN_DECLS 39 | 40 | #define GST_MFX_IS_DISPLAY_WAYLAND(display) \ 41 | ((display) != NULL && \ 42 | GST_MFX_DISPLAY_TYPE (display) == GST_MFX_DISPLAY_TYPE_WAYLAND) 43 | 44 | #define GST_MFX_DISPLAY_WAYLAND_CAST(display) \ 45 | ((GstMfxDisplayWayland *)(display)) 46 | 47 | #define GST_MFX_DISPLAY_WAYLAND_GET_PRIVATE(display) \ 48 | (&GST_MFX_DISPLAY_WAYLAND_CAST(display)->priv) 49 | 50 | typedef struct _GstMfxDisplayWaylandPrivate GstMfxDisplayWaylandPrivate; 51 | typedef struct _GstMfxDisplayWaylandClass GstMfxDisplayWaylandClass; 52 | 53 | struct _GstMfxDisplayWaylandPrivate 54 | { 55 | gchar *display_name; 56 | struct wl_compositor *compositor; 57 | struct wl_shell *shell; 58 | struct wl_output *output; 59 | struct wl_registry *registry; 60 | struct wl_drm *drm; 61 | #ifdef USE_WESTON_4_0 62 | struct wp_viewporter *viewporter; 63 | #else 64 | struct wl_scaler *scaler; 65 | #endif 66 | guint width; 67 | guint height; 68 | guint phys_width; 69 | guint phys_height; 70 | gint event_fd; 71 | gint drm_fd; 72 | gchar *drm_device_name; 73 | drm_intel_bufmgr *bufmgr; 74 | gboolean is_auth; 75 | }; 76 | 77 | /** 78 | * GstMfxDisplayWayland: 79 | * 80 | * MFX/Wayland display wrapper. 81 | */ 82 | struct _GstMfxDisplayWayland 83 | { 84 | /*< private >*/ 85 | GstMfxDisplay parent_instance; 86 | 87 | GstMfxDisplayWaylandPrivate priv; 88 | }; 89 | 90 | /** 91 | * GstMfxDisplayWaylandClass: 92 | * 93 | * VA/Wayland display wrapper clas. 94 | */ 95 | struct _GstMfxDisplayWaylandClass 96 | { 97 | /*< private >*/ 98 | GstMfxDisplayClass parent_class; 99 | }; 100 | 101 | G_END_DECLS 102 | 103 | #endif /* GST_MFX_DISPLAY_WAYLAND_PRIV_H */ 104 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/gstmfxwindow_wayland.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2013 Intel Corporation 3 | * Author: Sreerenj Balachandran 4 | * Author: Gwenole Beauchesne 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 | #ifndef GST_MFX_WINDOW_WAYLAND_H 23 | #define GST_MFX_WINDOW_WAYLAND_H 24 | 25 | #include "gstmfxdisplay.h" 26 | #include "gstmfxwindow.h" 27 | #include "gstmfxwindow_priv.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | typedef struct _GstMfxWindowWayland GstMfxWindowWayland; 32 | 33 | GstMfxWindow * 34 | gst_mfx_window_wayland_new(GstMfxDisplay * display, guint width, 35 | guint height); 36 | 37 | G_END_DECLS 38 | 39 | #endif /* GST_MFX_WINDOW_WAYLAND_H */ 40 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/scaler-client-protocol.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013-2014 Collabora, Ltd. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this 5 | * software and its documentation for any purpose is hereby granted 6 | * without fee, provided that the above copyright notice appear in 7 | * all copies and that both that copyright notice and this permission 8 | * notice appear in supporting documentation, and that the name of 9 | * the copyright holders not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. The copyright holders make no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 17 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 18 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 22 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 23 | * THIS SOFTWARE. 24 | */ 25 | 26 | #ifndef SCALER_CLIENT_PROTOCOL_H 27 | #define SCALER_CLIENT_PROTOCOL_H 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include 34 | #include 35 | #include "wayland-client.h" 36 | 37 | struct wl_client; 38 | struct wl_resource; 39 | 40 | struct wl_scaler; 41 | struct wl_viewport; 42 | 43 | extern const struct wl_interface wl_scaler_interface; 44 | extern const struct wl_interface wl_viewport_interface; 45 | 46 | #ifndef WL_SCALER_ERROR_ENUM 47 | #define WL_SCALER_ERROR_ENUM 48 | enum wl_scaler_error { 49 | WL_SCALER_ERROR_VIEWPORT_EXISTS = 0, 50 | }; 51 | #endif /* WL_SCALER_ERROR_ENUM */ 52 | 53 | #define WL_SCALER_DESTROY 0 54 | #define WL_SCALER_GET_VIEWPORT 1 55 | 56 | static inline void 57 | wl_scaler_set_user_data(struct wl_scaler *wl_scaler, void *user_data) 58 | { 59 | wl_proxy_set_user_data((struct wl_proxy *) wl_scaler, user_data); 60 | } 61 | 62 | static inline void * 63 | wl_scaler_get_user_data(struct wl_scaler *wl_scaler) 64 | { 65 | return wl_proxy_get_user_data((struct wl_proxy *) wl_scaler); 66 | } 67 | 68 | static inline void 69 | wl_scaler_destroy(struct wl_scaler *wl_scaler) 70 | { 71 | wl_proxy_marshal((struct wl_proxy *) wl_scaler, 72 | WL_SCALER_DESTROY); 73 | 74 | wl_proxy_destroy((struct wl_proxy *) wl_scaler); 75 | } 76 | 77 | static inline struct wl_viewport * 78 | wl_scaler_get_viewport(struct wl_scaler *wl_scaler, struct wl_surface *surface) 79 | { 80 | struct wl_proxy *id; 81 | 82 | id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_scaler, 83 | WL_SCALER_GET_VIEWPORT, &wl_viewport_interface, NULL, surface); 84 | 85 | return (struct wl_viewport *) id; 86 | } 87 | 88 | #ifndef WL_VIEWPORT_ERROR_ENUM 89 | #define WL_VIEWPORT_ERROR_ENUM 90 | enum wl_viewport_error { 91 | WL_VIEWPORT_ERROR_BAD_VALUE = 0, 92 | }; 93 | #endif /* WL_VIEWPORT_ERROR_ENUM */ 94 | 95 | #define WL_VIEWPORT_DESTROY 0 96 | #define WL_VIEWPORT_SET 1 97 | #define WL_VIEWPORT_SET_SOURCE 2 98 | #define WL_VIEWPORT_SET_DESTINATION 3 99 | 100 | static inline void 101 | wl_viewport_set_user_data(struct wl_viewport *wl_viewport, void *user_data) 102 | { 103 | wl_proxy_set_user_data((struct wl_proxy *) wl_viewport, user_data); 104 | } 105 | 106 | static inline void * 107 | wl_viewport_get_user_data(struct wl_viewport *wl_viewport) 108 | { 109 | return wl_proxy_get_user_data((struct wl_proxy *) wl_viewport); 110 | } 111 | 112 | static inline void 113 | wl_viewport_destroy(struct wl_viewport *wl_viewport) 114 | { 115 | wl_proxy_marshal((struct wl_proxy *) wl_viewport, 116 | WL_VIEWPORT_DESTROY); 117 | 118 | wl_proxy_destroy((struct wl_proxy *) wl_viewport); 119 | } 120 | 121 | static inline void 122 | wl_viewport_set(struct wl_viewport *wl_viewport, wl_fixed_t src_x, wl_fixed_t src_y, wl_fixed_t src_width, wl_fixed_t src_height, int32_t dst_width, int32_t dst_height) 123 | { 124 | wl_proxy_marshal((struct wl_proxy *) wl_viewport, 125 | WL_VIEWPORT_SET, src_x, src_y, src_width, src_height, dst_width, dst_height); 126 | } 127 | 128 | static inline void 129 | wl_viewport_set_source(struct wl_viewport *wl_viewport, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height) 130 | { 131 | wl_proxy_marshal((struct wl_proxy *) wl_viewport, 132 | WL_VIEWPORT_SET_SOURCE, x, y, width, height); 133 | } 134 | 135 | static inline void 136 | wl_viewport_set_destination(struct wl_viewport *wl_viewport, int32_t width, int32_t height) 137 | { 138 | wl_proxy_marshal((struct wl_proxy *) wl_viewport, 139 | WL_VIEWPORT_SET_DESTINATION, width, height); 140 | } 141 | 142 | #ifdef __cplusplus 143 | } 144 | #endif 145 | 146 | #endif 147 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/scaler-protocol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2013-2014 Collabora, Ltd. 3 | * 4 | * Permission to use, copy, modify, distribute, and sell this 5 | * software and its documentation for any purpose is hereby granted 6 | * without fee, provided that the above copyright notice appear in 7 | * all copies and that both that copyright notice and this permission 8 | * notice appear in supporting documentation, and that the name of 9 | * the copyright holders not be used in advertising or publicity 10 | * pertaining to distribution of the software without specific, 11 | * written prior permission. The copyright holders make no 12 | * representations about the suitability of this software for any 13 | * purpose. It is provided "as is" without express or implied 14 | * warranty. 15 | * 16 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 17 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 18 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 19 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 20 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 21 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 22 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 23 | * THIS SOFTWARE. 24 | */ 25 | 26 | #include 27 | #include 28 | #include "wayland-util.h" 29 | 30 | extern const struct wl_interface wl_surface_interface; 31 | extern const struct wl_interface wl_viewport_interface; 32 | 33 | static const struct wl_interface *types[] = { 34 | NULL, 35 | NULL, 36 | NULL, 37 | NULL, 38 | NULL, 39 | NULL, 40 | &wl_viewport_interface, 41 | &wl_surface_interface, 42 | }; 43 | 44 | static const struct wl_message wl_scaler_requests[] = { 45 | { "destroy", "", types + 0 }, 46 | { "get_viewport", "no", types + 6 }, 47 | }; 48 | 49 | WL_EXPORT const struct wl_interface wl_scaler_interface = { 50 | "wl_scaler", 2, 51 | 2, wl_scaler_requests, 52 | 0, NULL, 53 | }; 54 | 55 | static const struct wl_message wl_viewport_requests[] = { 56 | { "destroy", "", types + 0 }, 57 | { "set", "ffffii", types + 0 }, 58 | { "set_source", "2ffff", types + 0 }, 59 | { "set_destination", "2ii", types + 0 }, 60 | }; 61 | 62 | WL_EXPORT const struct wl_interface wl_viewport_interface = { 63 | "wl_viewport", 2, 64 | 4, wl_viewport_requests, 65 | 0, NULL, 66 | }; 67 | 68 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/viewporter-protocol.c: -------------------------------------------------------------------------------- 1 | /* Generated by wayland-scanner 1.15.0 */ 2 | 3 | /* 4 | * Copyright © 2013-2016 Collabora, Ltd. 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a 7 | * copy of this software and associated documentation files (the "Software"), 8 | * to deal in the Software without restriction, including without limitation 9 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the 11 | * Software is furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice (including the next 14 | * paragraph) shall be included in all copies or substantial portions of the 15 | * Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 20 | * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | * DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | #include 27 | #include 28 | #include "wayland-util.h" 29 | 30 | extern const struct wl_interface wl_surface_interface; 31 | extern const struct wl_interface wp_viewport_interface; 32 | 33 | static const struct wl_interface *types[] = { 34 | NULL, 35 | NULL, 36 | NULL, 37 | NULL, 38 | &wp_viewport_interface, 39 | &wl_surface_interface, 40 | }; 41 | 42 | static const struct wl_message wp_viewporter_requests[] = { 43 | { "destroy", "", types + 0 }, 44 | { "get_viewport", "no", types + 4 }, 45 | }; 46 | 47 | WL_EXPORT const struct wl_interface wp_viewporter_interface = { 48 | "wp_viewporter", 1, 49 | 2, wp_viewporter_requests, 50 | 0, NULL, 51 | }; 52 | 53 | static const struct wl_message wp_viewport_requests[] = { 54 | { "destroy", "", types + 0 }, 55 | { "set_source", "ffff", types + 0 }, 56 | { "set_destination", "ii", types + 0 }, 57 | }; 58 | 59 | WL_EXPORT const struct wl_interface wp_viewport_interface = { 60 | "wp_viewport", 1, 61 | 3, wp_viewport_requests, 62 | 0, NULL, 63 | }; 64 | -------------------------------------------------------------------------------- /gst-libs/mfx/wayland/wayland-drm-protocol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2008-2011 Kristian Høgsberg 3 | * Copyright © 2010-2011 Intel Corporation 4 | * 5 | * Permission to use, copy, modify, distribute, and sell this 6 | * software and its documentation for any purpose is hereby granted 7 | * without fee, provided that\n the above copyright notice appear in 8 | * all copies and that both that copyright notice and this permission 9 | * notice appear in supporting documentation, and that the name of 10 | * the copyright holders not be used in advertising or publicity 11 | * pertaining to distribution of the software without specific, 12 | * written prior permission. The copyright holders make no 13 | * representations about the suitability of this software for any 14 | * purpose. It is provided "as is" without express or implied 15 | * warranty. 16 | * 17 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS 18 | * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 19 | * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 21 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 22 | * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 23 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF 24 | * THIS SOFTWARE. 25 | */ 26 | 27 | #include 28 | #include 29 | #include "wayland-util.h" 30 | 31 | extern const struct wl_interface wl_buffer_interface; 32 | 33 | static const struct wl_interface *types[] = { 34 | NULL, 35 | &wl_buffer_interface, 36 | NULL, 37 | NULL, 38 | NULL, 39 | NULL, 40 | NULL, 41 | &wl_buffer_interface, 42 | NULL, 43 | NULL, 44 | NULL, 45 | NULL, 46 | NULL, 47 | NULL, 48 | NULL, 49 | NULL, 50 | NULL, 51 | NULL, 52 | &wl_buffer_interface, 53 | NULL, 54 | NULL, 55 | NULL, 56 | NULL, 57 | NULL, 58 | NULL, 59 | NULL, 60 | NULL, 61 | NULL, 62 | NULL, 63 | }; 64 | 65 | static const struct wl_message wl_drm_requests[] = { 66 | { "authenticate", "u", types + 0 }, 67 | { "create_buffer", "nuiiuu", types + 1 }, 68 | { "create_planar_buffer", "nuiiuiiiiii", types + 7 }, 69 | { "create_prime_buffer", "2nhiiuiiiiii", types + 18 }, 70 | }; 71 | 72 | static const struct wl_message wl_drm_events[] = { 73 | { "device", "s", types + 0 }, 74 | { "format", "u", types + 0 }, 75 | { "authenticated", "", types + 0 }, 76 | { "capabilities", "u", types + 0 }, 77 | }; 78 | 79 | WL_EXPORT const struct wl_interface wl_drm_interface = { 80 | "wl_drm", 2, 81 | 4, wl_drm_requests, 82 | 4, wl_drm_events, 83 | }; 84 | 85 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxdisplay_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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_MFX_DISPLAY_X11_H 24 | #define GST_MFX_DISPLAY_X11_H 25 | 26 | #include 27 | #include "gstmfxdisplay.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_MFX_DISPLAY_X11(obj) ((GstMfxDisplayX11 *)(obj)) 32 | 33 | typedef struct _GstMfxDisplayX11 GstMfxDisplayX11; 34 | 35 | GstMfxDisplay * 36 | gst_mfx_display_x11_new (const gchar * display_name); 37 | 38 | Display * 39 | gst_mfx_display_x11_get_display (GstMfxDisplay * display); 40 | 41 | G_END_DECLS 42 | 43 | 44 | #endif /* GST_MFX_DISPLAY_X11_H */ 45 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxdisplay_x11_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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_MFX_DISPLAY_X11_PRIV_H 24 | #define GST_MFX_DISPLAY_X11_PRIV_H 25 | 26 | #include "gstmfxdisplay_x11.h" 27 | #include "gstmfxdisplay_priv.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_MFX_IS_DISPLAY_X11(display) \ 32 | ((display) != NULL && \ 33 | GST_MFX_DISPLAY_TYPE (display) == GST_MFX_DISPLAY_TYPE_X11) 34 | 35 | #define GST_MFX_DISPLAY_X11_CAST(display) \ 36 | ((GstMfxDisplayX11 *)(display)) 37 | 38 | #define GST_MFX_DISPLAY_X11_PRIVATE(display) \ 39 | (&GST_MFX_DISPLAY_X11_CAST(display)->priv) 40 | 41 | typedef struct _GstMfxDisplayX11Private GstMfxDisplayX11Private; 42 | typedef struct _GstMfxDisplayX11Class GstMfxDisplayX11Class; 43 | 44 | struct _GstMfxDisplayX11Private 45 | { 46 | gchar *display_name; 47 | int x11_screen; 48 | guint use_xrandr : 1; 49 | }; 50 | 51 | /** 52 | * GstMfxDisplayX11: 53 | * 54 | * VA/X11 display wrapper. 55 | */ 56 | struct _GstMfxDisplayX11 57 | { 58 | /*< private >*/ 59 | GstMfxDisplay parent_instance; 60 | 61 | GstMfxDisplayX11Private priv; 62 | }; 63 | 64 | /** 65 | * GstMfxDisplayX11Class: 66 | * 67 | * VA/X11 display wrapper clas. 68 | */ 69 | struct _GstMfxDisplayX11Class 70 | { 71 | /*< private >*/ 72 | GstMfxDisplayClass parent_class; 73 | }; 74 | 75 | 76 | G_END_DECLS 77 | 78 | #endif /* GST_MFX_DISPLAY_X11_PRIV_H */ 79 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxutils_x11.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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 | #include 24 | #include 25 | #include "gstmfxutils_x11.h" 26 | 27 | // X error trap 28 | static int x11_error_code = 0; 29 | static int (*old_error_handler) (Display *, XErrorEvent *); 30 | 31 | static int 32 | error_handler (Display * dpy, XErrorEvent * error) 33 | { 34 | x11_error_code = error->error_code; 35 | return 0; 36 | } 37 | 38 | void 39 | x11_trap_errors (void) 40 | { 41 | x11_error_code = 0; 42 | old_error_handler = XSetErrorHandler (error_handler); 43 | } 44 | 45 | int 46 | x11_untrap_errors (void) 47 | { 48 | XSetErrorHandler (old_error_handler); 49 | return x11_error_code; 50 | } 51 | 52 | // X window management 53 | static const int x11_event_mask = 54 | (KeyPressMask | 55 | KeyReleaseMask | 56 | ButtonPressMask | 57 | ButtonReleaseMask | 58 | PointerMotionMask | EnterWindowMask | ExposureMask | StructureNotifyMask); 59 | 60 | /** 61 | * x11_create_window: 62 | * @dpy: an X11 #Display 63 | * @w: the requested width, in pixels 64 | * @h: the requested height, in pixels 65 | * @vid: the requested visual id 66 | * @cmap: the requested colormap 67 | * 68 | * Creates a border-less window with the specified dimensions. If @vid 69 | * is zero, the default visual for @display will be used. If @cmap is 70 | * %None, no specific colormap will be bound to the window. Also note 71 | * the default background color is black. 72 | * 73 | * Return value: the newly created X #Window. 74 | */ 75 | Window 76 | x11_create_window (Display * dpy, guint w, guint h, guint vid, Colormap cmap) 77 | { 78 | Window rootwin, win; 79 | int screen, depth; 80 | XSetWindowAttributes xswa; 81 | unsigned long xswa_mask; 82 | XWindowAttributes wattr; 83 | unsigned long black_pixel; 84 | XVisualInfo visualInfo, *vi; 85 | int num_visuals; 86 | 87 | screen = DefaultScreen (dpy); 88 | rootwin = RootWindow (dpy, screen); 89 | black_pixel = BlackPixel (dpy, screen); 90 | 91 | XGetWindowAttributes (dpy, rootwin, &wattr); 92 | depth = wattr.depth; 93 | if (depth != 15 && depth != 16 && depth != 24 && depth != 32) 94 | depth = 24; 95 | 96 | xswa_mask = CWBorderPixel | CWBackPixel; 97 | xswa.border_pixel = black_pixel; 98 | xswa.background_pixel = black_pixel; 99 | 100 | if (cmap) { 101 | xswa_mask |= CWColormap; 102 | xswa.colormap = cmap; 103 | } 104 | 105 | if (vid) { 106 | visualInfo.visualid = vid; 107 | vi = XGetVisualInfo (dpy, VisualIDMask, &visualInfo, &num_visuals); 108 | if (!vi || num_visuals < 1) 109 | goto error_create_visual; 110 | } else { 111 | vi = &visualInfo; 112 | XMatchVisualInfo (dpy, screen, depth, TrueColor, vi); 113 | } 114 | 115 | win = XCreateWindow (dpy, rootwin, 0, 0, w, h, 0, depth, InputOutput, 116 | vi->visual, xswa_mask, &xswa); 117 | if (vi != &visualInfo) 118 | XFree (vi); 119 | if (!win) 120 | goto error_create_window; 121 | 122 | XSelectInput (dpy, win, x11_event_mask); 123 | return win; 124 | 125 | /* ERRORS */ 126 | error_create_visual: 127 | GST_ERROR ("failed to create X visual (id:%zu)", (gsize) visualInfo.visualid); 128 | if (vi) 129 | XFree (vi); 130 | return None; 131 | error_create_window: 132 | GST_ERROR ("failed to create X window of size %ux%u", w, h); 133 | return None; 134 | } 135 | 136 | gboolean 137 | x11_get_geometry (Display * dpy, Drawable drawable, gint * px, gint * py, 138 | guint * pwidth, guint * pheight, guint * pdepth) 139 | { 140 | Window rootwin; 141 | int x, y; 142 | guint width, height, border_width, depth; 143 | 144 | x11_trap_errors (); 145 | XGetGeometry (dpy, drawable, &rootwin, &x, &y, &width, &height, 146 | &border_width, &depth); 147 | if (x11_untrap_errors ()) 148 | return FALSE; 149 | 150 | if (px) 151 | *px = x; 152 | if (py) 153 | *py = y; 154 | if (pwidth) 155 | *pwidth = width; 156 | if (pheight) 157 | *pheight = height; 158 | if (pdepth) 159 | *pdepth = depth; 160 | return TRUE; 161 | } 162 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxutils_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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_MFX_UTILS_X11_H 24 | #define GST_MFX_UTILS_X11_H 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | void 31 | x11_trap_errors (void); 32 | 33 | int 34 | x11_untrap_errors (void); 35 | 36 | Window 37 | x11_create_window (Display * dpy, guint w, guint h, guint vid, Colormap cmap); 38 | 39 | gboolean 40 | x11_get_geometry (Display * dpy, Drawable drawable, gint * px, gint * py, 41 | guint * pwidth, guint * pheight, guint * pdepth); 42 | 43 | #endif /* GST_MFX_UTILS_X11_H */ 44 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxwindow_x11.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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_MFX_WINDOW_X11_H 24 | #define GST_MFX_WINDOW_X11_H 25 | 26 | #include 27 | #include "gstmfxdisplay.h" 28 | #include "gstmfxwindow.h" 29 | #include "gstmfxwindow_priv.h" 30 | 31 | G_BEGIN_DECLS 32 | 33 | #define GST_MFX_WINDOW_X11(obj) ((GstMfxWindowX11 *)(obj)) 34 | 35 | typedef struct _GstMfxWindowX11 GstMfxWindowX11; 36 | 37 | GstMfxWindow * 38 | gst_mfx_window_x11_new (GstMfxDisplay * display, guint width, guint height); 39 | 40 | GstMfxWindow * 41 | gst_mfx_window_x11_new_with_xid (GstMfxDisplay * display, Window xid); 42 | 43 | void 44 | gst_mfx_window_x11_clear (GstMfxWindow * window); 45 | 46 | G_END_DECLS 47 | 48 | #endif /* GST_MFX_WINDOW_X11_H */ 49 | -------------------------------------------------------------------------------- /gst-libs/mfx/x11/gstmfxwindow_x11_priv.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2010-2011 Splitted-Desktop Systems 3 | * Author: Gwenole Beauchesne 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_MFX_WINDOW_X11_PRIV_H 24 | #define GST_MFX_WINDOW_X11_PRIV_H 25 | 26 | #include "gstmfxwindow_priv.h" 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_WINDOW_X11_GET_PRIVATE(obj) \ 31 | (&GST_MFX_WINDOW_X11(obj)->priv) 32 | 33 | #define GST_MFX_WINDOW_X11_CLASS(klass) \ 34 | ((GstMfxWindowX11Class *)(klass)) 35 | 36 | #define GST_MFX_WINDOW_X11_GET_CLASS(obj) \ 37 | GST_MFX_WINDOW_X11_CLASS(GST_MFX_WINDOW_GET_CLASS(obj)) 38 | 39 | typedef struct _GstMfxWindowX11Private GstMfxWindowX11Private; 40 | typedef struct _GstMfxWindowX11Class GstMfxWindowX11Class; 41 | 42 | struct _GstMfxWindowX11Private 43 | { 44 | Atom atom_NET_WM_STATE; 45 | Atom atom_NET_WM_STATE_FULLSCREEN; 46 | 47 | guint is_mapped; 48 | guint fullscreen_on_map; 49 | #ifdef HAVE_XRENDER 50 | Picture picture; 51 | #endif 52 | xcb_connection_t *xcbconn; 53 | }; 54 | 55 | /** 56 | * GstMfxWindowX11: 57 | * 58 | * An X11 #Window wrapper. 59 | */ 60 | struct _GstMfxWindowX11 61 | { 62 | /*< private >*/ 63 | GstMfxWindow parent_instance; 64 | 65 | GstMfxWindowX11Private priv; 66 | }; 67 | 68 | /** 69 | * GstMfxWindowX11Class: 70 | * 71 | * An X11 #Window wrapper class. 72 | */ 73 | struct _GstMfxWindowX11Class 74 | { 75 | /*< private >*/ 76 | GstMfxWindowClass parent_class; 77 | }; 78 | 79 | void 80 | gst_mfx_window_x11_class_init(GstMfxWindowX11Class * klass); 81 | 82 | 83 | G_END_DECLS 84 | 85 | #endif /* GST_MFX_WINDOW_X11_PRIV_H */ 86 | -------------------------------------------------------------------------------- /gst/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCE 2 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfx.c" 3 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxpluginbase.c" 4 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxpluginutil.c" 5 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxvideobufferpool.c" 6 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxvideocontext.c" 7 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxvideomemory.c" 8 | "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxvideometa.c") 9 | 10 | if(MFX_DECODER) 11 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxdec.c") 12 | endif() 13 | 14 | if(MFX_SINK) 15 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsink.c") 16 | endif() 17 | 18 | if(MFX_VPP) 19 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxpostproc.c") 20 | endif() 21 | 22 | if(MFX_ENCODER) 23 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxenc.c") 24 | endif() 25 | 26 | if(MFX_H264_ENCODER) 27 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxenc_h264.c") 28 | endif() 29 | 30 | if(MFX_H265_ENCODER) 31 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxenc_h265.c") 32 | endif() 33 | 34 | if(MFX_MPEG2_ENCODER) 35 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxenc_mpeg2.c") 36 | endif() 37 | 38 | if(MFX_JPEG_ENCODER) 39 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxenc_jpeg.c") 40 | endif() 41 | 42 | if(MFX_SINK_BIN) 43 | list(APPEND SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/mfx/gstmfxsinkbin.c") 44 | endif() 45 | 46 | set(GST_SOURCE ${SOURCE} PARENT_SCOPE) 47 | -------------------------------------------------------------------------------- /gst/meson.build: -------------------------------------------------------------------------------- 1 | sources = ['mfx/gstmfx.c', 2 | 'mfx/gstmfxpluginbase.c', 3 | 'mfx/gstmfxpluginutil.c', 4 | 'mfx/gstmfxvideobufferpool.c', 5 | 'mfx/gstmfxvideocontext.c', 6 | 'mfx/gstmfxvideomemory.c', 7 | 'mfx/gstmfxvideometa.c'] 8 | 9 | if mfx_decoder 10 | sources += ['mfx/gstmfxdec.c'] 11 | if get_option ('USE_HEVC_DECODER') != 'no' 12 | mfx_c_args += ['-DUSE_HEVC_DECODER'] 13 | endif 14 | if get_option ('USE_HEVC_10BIT_DECODER') != 'no' 15 | mfx_c_args += ['-DUSE_HEVC_10BIT_DECODER'] 16 | endif 17 | if get_option ('USE_VP8_DECODER') != 'no' 18 | mfx_c_args += ['-DUSE_VP8_DECODER'] 19 | endif 20 | if get_option ('USE_VP9_DECODER') != 'no' 21 | mfx_c_args += ['-DUSE_VP9_DECODER'] 22 | endif 23 | else 24 | if get_option ('USE_HEVC_DECODER') == 'yes' 25 | error('USE_HEVC_DECODER required but MFX_DECODER is false') 26 | endif 27 | if get_option ('USE_HEVC_10BIT_DECODER') == 'yes' 28 | error('USE_HEVC_10BIT_DECODER required but MFX_DECODER is false') 29 | endif 30 | if get_option ('USE_VP8_DECODER') == 'yes' 31 | error('USE_VP8_DECODER required but MFX_DECODER is false') 32 | endif 33 | if get_option ('USE_VP9_DECODER') == 'yes' 34 | error('USE_VP9_DECODER required but MFX_DECODER is false') 35 | endif 36 | endif 37 | 38 | if mfx_sink 39 | sources += ['mfx/gstmfxsink.c'] 40 | endif 41 | 42 | mfx_vpp = get_option('MFX_VPP') 43 | if mfx_vpp 44 | sources += ['mfx/gstmfxpostproc.c'] 45 | mfx_c_args += ['-DMFX_VPP'] 46 | endif 47 | 48 | if mfx_sink and mfx_vpp and with_pbutils 49 | if get_option('MFX_SINK_BIN') != 'no' 50 | sources += ['mfx/gstmfxsinkbin.c'] 51 | mfx_c_args += ['-DMFX_SINK_BIN'] 52 | endif 53 | elif get_option('MFX_SINK_BIN') == 'yes' 54 | error('MFX_SINK_BIN required but MFX_SINK or MFX_VPP is false') 55 | endif 56 | 57 | if mfx_encoder 58 | sources += ['mfx/gstmfxenc.c'] 59 | encoders = [ 60 | ['MFX_H264_ENCODER', '-DMFX_H264_ENCODER', 'mfx/gstmfxenc_h264.c'], 61 | ['MFX_H265_ENCODER', '-DMFX_H265_ENCODER', 'mfx/gstmfxenc_h265.c'], 62 | ['MFX_MPEG2_ENCODER', '-DMFX_MPEG2_ENCODER', 'mfx/gstmfxenc_mpeg2.c'], 63 | ['MFX_JPEG_ENCODER', '-DMFX_JPEG_ENCODER', 'mfx/gstmfxenc_jpeg.c'] 64 | ] 65 | foreach e: encoders 66 | if get_option (e.get(0)) != 'no' 67 | mfx_c_args += [e.get(1)] 68 | sources += [e.get(2)] 69 | endif 70 | endforeach 71 | else 72 | foreach opt: ['MFX_H264_ENCODER', 'MFX_H265_ENCODER', 'MFX_MPEG2_ENCODER', 'MFX_JPEG_ENCODER'] 73 | if get_option (opt) == 'yes' 74 | error('@0@ required but MFX_ENCODER is false'.format(opt)) 75 | endif 76 | endforeach 77 | endif 78 | 79 | foreach s: sources 80 | mfx_sources += ['@0@/@1@'.format(meson.current_source_dir(), s)] 81 | endforeach 82 | -------------------------------------------------------------------------------- /gst/mfx/gstmfx.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #include "version.h" 22 | 23 | #ifdef MFX_DECODER 24 | #include "gstmfxdec.h" 25 | #endif 26 | #ifdef MFX_VPP 27 | # include "gstmfxpostproc.h" 28 | #endif 29 | #ifdef MFX_SINK 30 | # include "gstmfxsink.h" 31 | #endif 32 | #ifdef MFX_SINK_BIN 33 | # include "gstmfxsinkbin.h" 34 | #endif 35 | #ifdef MFX_H264_ENCODER 36 | # include "gstmfxenc_h264.h" 37 | #endif 38 | #ifdef MFX_H265_ENCODER 39 | # include "gstmfxenc_h265.h" 40 | #endif 41 | #ifdef MFX_MPEG2_ENCODER 42 | # include "gstmfxenc_mpeg2.h" 43 | #endif 44 | #ifdef MFX_JPEG_ENCODER 45 | # include "gstmfxenc_jpeg.h" 46 | #endif 47 | 48 | #ifdef MFX_VC1_PARSER 49 | # include "parsers/gstvc1parse.h" 50 | #endif 51 | 52 | static gboolean 53 | plugin_init (GstPlugin * plugin) 54 | { 55 | gboolean ret = FALSE; 56 | 57 | #ifdef MFX_DECODER 58 | ret |= gst_mfxdec_register (plugin); 59 | #endif 60 | 61 | #ifdef MFX_VPP 62 | ret |= gst_element_register (plugin, "mfxvpp", 63 | GST_RANK_NONE, GST_TYPE_MFXPOSTPROC); 64 | #endif 65 | 66 | #ifdef MFX_SINK 67 | ret |= gst_element_register (plugin, "mfxsinkelement", 68 | GST_RANK_NONE, GST_TYPE_MFXSINK); 69 | #endif 70 | 71 | #ifdef MFX_SINK_BIN 72 | ret |= gst_element_register (plugin, "mfxsink", 73 | GST_RANK_PRIMARY + 2, GST_TYPE_MFX_SINK_BIN); 74 | #endif 75 | 76 | #ifdef MFX_H264_ENCODER 77 | ret |= gst_element_register (plugin, "mfxh264enc", 78 | GST_RANK_NONE, GST_TYPE_MFXENC_H264); 79 | #endif 80 | 81 | #ifdef MFX_H265_ENCODER 82 | ret |= gst_element_register (plugin, "mfxhevcenc", 83 | GST_RANK_NONE, GST_TYPE_MFXENC_H265); 84 | #endif 85 | 86 | #ifdef MFX_MPEG2_ENCODER 87 | ret |= gst_element_register (plugin, "mfxmpeg2enc", 88 | GST_RANK_NONE, GST_TYPE_MFXENC_MPEG2); 89 | #endif 90 | 91 | #ifdef MFX_JPEG_ENCODER 92 | ret |= gst_element_register (plugin, "mfxjpegenc", 93 | GST_RANK_NONE, GST_TYPE_MFXENC_JPEG); 94 | #endif 95 | 96 | #ifdef MFX_VC1_PARSER 97 | ret |= gst_element_register (plugin, "mfxvc1parse", 98 | GST_RANK_MARGINAL, GST_MFX_TYPE_VC1_PARSE); 99 | #endif 100 | 101 | return ret; 102 | } 103 | 104 | 105 | GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, /* major */ 106 | GST_VERSION_MINOR, /* minor */ 107 | mfx, /* short unique name */ 108 | "MFX encoder/decoder/video post-processing plugins", /* info */ 109 | plugin_init, /* GstPlugin::plugin_init */ 110 | PACKAGE_VERSION, /* version */ 111 | "LGPL", /* license */ 112 | PACKAGE, /* package-name, usually the file archive name */ 113 | "http://www.intel.com" /* origin */ 114 | ) 115 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxdec.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef __GST_MFX_DEC_H__ 22 | #define __GST_MFX_DEC_H__ 23 | 24 | #include "gstmfxpluginbase.h" 25 | #include 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_MFXDEC(obj) ((GstMfxDec *)(obj)) 30 | 31 | typedef struct _GstMfxDec GstMfxDec; 32 | typedef struct _GstMfxDecClass GstMfxDecClass; 33 | 34 | struct _GstMfxDec { 35 | /*< private >*/ 36 | GstMfxPluginBase parent_instance; 37 | 38 | GstCaps *sinkpad_caps; 39 | GstCaps *srcpad_caps; 40 | GstMfxDecoder *decoder; 41 | guint async_depth; 42 | gboolean live_mode; 43 | gboolean skip_corrupted_frames; 44 | GstMfxSurface* prev_surf; 45 | gboolean dequeuing; 46 | gint flushing; 47 | 48 | GstVideoCodecState *input_state; 49 | volatile gboolean do_renego; 50 | volatile gboolean do_reconfigure; 51 | volatile gboolean mfxsurface_incompatibility; 52 | volatile gboolean mfxsink; 53 | 54 | }; 55 | 56 | struct _GstMfxDecClass { 57 | /*< private >*/ 58 | GstMfxPluginBaseClass parent_class; 59 | }; 60 | 61 | gboolean gst_mfxdec_register (GstPlugin * plugin); 62 | 63 | 64 | G_END_DECLS 65 | 66 | 67 | #endif /* __GST_MFX_DEC_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxenc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFXENCODE_H 24 | #define GST_MFXENCODE_H 25 | 26 | #include "gstmfxpluginbase.h" 27 | #include 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_MFXENC \ 32 | (gst_mfxenc_get_type ()) 33 | #define GST_MFXENC_CAST(obj) \ 34 | ((GstMfxEnc *)(obj)) 35 | #define GST_MFXENC(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXENC, GstMfxEnc)) 37 | #define GST_MFXENC_CLASS(klass) \ 38 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXENC, GstMfxEncClass)) 39 | #define GST_MFXENC_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXENC, GstMfxEncClass)) 41 | #define GST_IS_MFXENC(obj) \ 42 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXENC)) 43 | #define GST_IS_MFXENC_CLASS(klass) \ 44 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXENC)) 45 | 46 | typedef struct _GstMfxEnc GstMfxEnc; 47 | typedef struct _GstMfxEncClass GstMfxEncClass; 48 | 49 | struct _GstMfxEnc 50 | { 51 | /*< private >*/ 52 | GstMfxPluginBase parent_instance; 53 | 54 | GstMfxEncoder *encoder; 55 | GstVideoCodecState *input_state; 56 | gboolean input_state_changed; 57 | 58 | /* needs to be set by the subclass implementation */ 59 | gboolean need_codec_data; 60 | GstVideoCodecState *output_state; 61 | GPtrArray *prop_values; 62 | }; 63 | 64 | struct _GstMfxEncClass 65 | { 66 | /*< private >*/ 67 | GstMfxPluginBaseClass parent_class; 68 | 69 | GPtrArray * (*get_properties) (void); 70 | gboolean (*get_property) (GstMfxEnc * encode, guint prop_id, GValue * value); 71 | gboolean (*set_property) (GstMfxEnc * encode, guint prop_id, const GValue * value); 72 | 73 | gboolean (*set_config) (GstMfxEnc * encode); 74 | GstCaps * (*get_caps) (GstMfxEnc * encode); 75 | GstMfxEncoder * (*alloc_encoder) (GstMfxEnc * encode); 76 | GstFlowReturn (*format_buffer) (GstMfxEnc * encode, GstBuffer * in_buffer, GstBuffer ** out_buffer_ptr); 77 | }; 78 | 79 | GType 80 | gst_mfxenc_get_type (void); 81 | 82 | gboolean 83 | gst_mfxenc_init_properties (GstMfxEnc * encode); 84 | 85 | gboolean 86 | gst_mfxenc_class_init_properties (GstMfxEncClass * encode_class); 87 | 88 | G_END_DECLS 89 | 90 | #endif /* GST_MFXENC_H */ 91 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxenc_h264.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFXENC_H264_H 24 | #define GST_MFXENC_H264_H 25 | 26 | #include 27 | #include "gstmfxenc.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_MFXENC_H264 \ 32 | (gst_mfxenc_h264_get_type ()) 33 | #define GST_MFXENC_H264_CAST(obj) \ 34 | ((GstMfxEncH264 *)(obj)) 35 | #define GST_MFXENC_H264(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXENC_H264, \ 37 | GstMfxEncH264)) 38 | #define GST_MFXENC_H264_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXENC_H264, \ 40 | GstMfxEncH264Class)) 41 | #define GST_MFXENC_H264_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXENC_H264, \ 43 | GstMfxEncH264Class)) 44 | #define GST_IS_MFXENC_H264(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXENC_H264)) 46 | #define GST_IS_MFXENC_H264_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXENC_H264)) 48 | 49 | typedef struct _GstMfxEncH264 GstMfxEncH264; 50 | typedef struct _GstMfxEncH264Class GstMfxEncH264Class; 51 | 52 | struct _GstMfxEncH264 53 | { 54 | /*< private >*/ 55 | GstMfxEnc parent_instance; 56 | 57 | guint is_avc : 1; /* [FALSE]=byte-stream (default); [TRUE]=avcC */ 58 | }; 59 | 60 | struct _GstMfxEncH264Class 61 | { 62 | /*< private >*/ 63 | GstMfxEncClass parent_class; 64 | }; 65 | 66 | GType 67 | gst_mfxenc_h264_get_type (void); 68 | 69 | G_END_DECLS 70 | 71 | #endif /* GST_MFXENC_H264_H */ 72 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxenc_h265.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFXENC_H265_H 22 | #define GST_MFXENC_H265_H 23 | 24 | #include 25 | #include "gstmfxenc.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_TYPE_MFXENC_H265 \ 30 | (gst_mfxenc_h265_get_type ()) 31 | #define GST_MFXENC_H265_CAST(obj) \ 32 | ((GstMfxEncH265 *)(obj)) 33 | #define GST_MFXENC_H265(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXENC_H265, \ 35 | GstMfxEncH265)) 36 | #define GST_MFXENC_H265_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXENC_H265, \ 38 | GstMfxEncH265Class)) 39 | #define GST_MFXENC_H265_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXENC_H265, \ 41 | GstMfxEncH265Class)) 42 | #define GST_IS_MFXENC_H265(obj) \ 43 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXENC_H265)) 44 | #define GST_IS_MFXENC_H265_CLASS(klass) \ 45 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXENC_H265)) 46 | 47 | typedef struct _GstMfxEncH265 GstMfxEncH265; 48 | typedef struct _GstMfxEncH265Class GstMfxEncH265Class; 49 | 50 | struct _GstMfxEncH265 51 | { 52 | /*< private >*/ 53 | GstMfxEnc parent_instance; 54 | 55 | guint is_hvc : 1; /* [FALSE]=byte-stream (default); [TRUE]=hvcC */ 56 | }; 57 | 58 | struct _GstMfxEncH265Class 59 | { 60 | /*< private >*/ 61 | GstMfxEncClass parent_class; 62 | }; 63 | 64 | GType 65 | gst_mfxenc_h265_get_type (void); 66 | 67 | G_END_DECLS 68 | 69 | #endif /* GST_MFXENC_H265_H */ 70 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxenc_jpeg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Ishmael Visayana Sameen 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFXENC_JPEG_H 22 | #define GST_MFXENC_JPEG_H 23 | 24 | #include 25 | #include "gstmfxenc.h" 26 | 27 | G_BEGIN_DECLS 28 | 29 | #define GST_TYPE_MFXENC_JPEG \ 30 | (gst_mfxenc_jpeg_get_type ()) 31 | #define GST_MFXENC_JPEG_CAST(obj) \ 32 | ((GstMfxEncJpeg *)(obj)) 33 | #define GST_MFXENC_JPEG(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXENC_JPEG, \ 35 | GstMfxEncJpeg)) 36 | #define GST_MFXENC_JPEG_CLASS(klass) \ 37 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXENC_JPEG, \ 38 | GstMfxEncJpegClass)) 39 | #define GST_MFXENC_JPEG_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXENC_JPEG, \ 41 | GstMfxEncJpegClass)) 42 | #define GST_IS_MFXENC_JPEG(obj) \ 43 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXENC_JPEG)) 44 | #define GST_IS_MFXENC_JPEG_CLASS(klass) \ 45 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXENC_JPEG)) 46 | 47 | typedef struct _GstMfxEncJpeg GstMfxEncJpeg; 48 | typedef struct _GstMfxEncJpegClass GstMfxEncJpegClass; 49 | 50 | struct _GstMfxEncJpeg 51 | { 52 | /*< private >*/ 53 | GstMfxEnc parent_instance; 54 | }; 55 | 56 | struct _GstMfxEncJpegClass 57 | { 58 | /*< private >*/ 59 | GstMfxEncClass parent_class; 60 | }; 61 | 62 | GType 63 | gst_mfxenc_jpeg_get_type(void); 64 | 65 | G_END_DECLS 66 | 67 | #endif /* GST_MFXENC_JPEG_H */ 68 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxenc_mpeg2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2012-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFXENC_MPEG2_H 24 | #define GST_MFXENC_MPEG2_H 25 | 26 | #include 27 | #include "gstmfxenc.h" 28 | 29 | G_BEGIN_DECLS 30 | 31 | #define GST_TYPE_MFXENC_MPEG2 \ 32 | (gst_mfxenc_mpeg2_get_type ()) 33 | #define GST_MFXENC_MPEG2_CAST(obj) \ 34 | ((GstMfxEncMpeg2 *)(obj)) 35 | #define GST_MFXENC_MPEG2(obj) \ 36 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXENC_MPEG2, \ 37 | GstMfxEncMpeg2)) 38 | #define GST_MFXENC_MPEG2_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXENC_MPEG2, \ 40 | GstMfxEncMpeg2Class)) 41 | #define GST_MFXENC_MPEG2_GET_CLASS(obj) \ 42 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXENC_MPEG2, \ 43 | GstMfxEncMpeg2Class)) 44 | #define GST_IS_MFXENC_MPEG2(obj) \ 45 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXENC_MPEG2)) 46 | #define GST_IS_MFXENC_MPEG2_CLASS(klass) \ 47 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXENC_MPEG2)) 48 | 49 | typedef struct _GstMfxEncMpeg2 GstMfxEncMpeg2; 50 | typedef struct _GstMfxEncMpeg2Class GstMfxEncMpeg2Class; 51 | 52 | struct _GstMfxEncMpeg2 53 | { 54 | /*< private >*/ 55 | GstMfxEnc parent_instance; 56 | }; 57 | 58 | struct _GstMfxEncMpeg2Class 59 | { 60 | /*< private >*/ 61 | GstMfxEncClass parent_class; 62 | }; 63 | 64 | GType 65 | gst_mfxenc_mpeg2_get_type(void); 66 | 67 | G_END_DECLS 68 | 69 | #endif /* GST_MFXENC_MPEG2_H */ 70 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxpluginutil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_PLUGIN_UTIL_H 24 | #define GST_MFX_PLUGIN_UTIL_H 25 | 26 | #include "gstmfxvideomemory.h" 27 | 28 | #include 29 | #include 30 | 31 | gboolean 32 | gst_mfx_ensure_aggregator(GstElement * element); 33 | 34 | gboolean 35 | gst_mfx_handle_context_query (GstQuery * query, GstMfxTaskAggregator * context); 36 | 37 | gboolean 38 | gst_mfx_append_surface_caps(GstCaps * out_caps, GstCaps * in_caps); 39 | 40 | /* Helpers for GValue construction for video formats */ 41 | gboolean 42 | gst_mfx_value_set_format(GValue * value, GstVideoFormat format); 43 | 44 | /* Helpers to build video caps */ 45 | typedef enum 46 | { 47 | GST_MFX_CAPS_FEATURE_NOT_NEGOTIATED, 48 | GST_MFX_CAPS_FEATURE_SYSTEM_MEMORY, 49 | GST_MFX_CAPS_FEATURE_MFX_SURFACE, 50 | } GstMfxCapsFeature; 51 | 52 | GstCaps * 53 | gst_mfx_video_format_new_template_caps(GstVideoFormat format); 54 | 55 | GstCaps * 56 | gst_mfx_video_format_new_template_caps_from_list(GArray * formats); 57 | 58 | GstCaps * 59 | gst_mfx_video_format_new_template_caps_with_features(GstVideoFormat format, 60 | const gchar * features_string); 61 | 62 | gboolean 63 | gst_mfx_search_plugin (GstElement * element, const char *name); 64 | 65 | GstMfxCapsFeature 66 | gst_mfx_find_preferred_caps_feature(GstPad * pad, 67 | GstVideoFormat * out_format_ptr, gboolean insist_prefer); 68 | 69 | const gchar * 70 | gst_mfx_caps_feature_to_string(GstMfxCapsFeature feature); 71 | 72 | /* Helpers to handle interlaced contents */ 73 | #define GST_CAPS_INTERLACED_MODES \ 74 | "interlace-mode = (string){ progressive, interleaved, mixed }" 75 | 76 | #define GST_MFX_MAKE_SURFACE_CAPS \ 77 | GST_VIDEO_CAPS_MAKE_WITH_FEATURES( \ 78 | GST_CAPS_FEATURE_MEMORY_MFX_SURFACE, "{ NV12, BGRA }") 79 | 80 | #ifdef WITH_MSS_2016 81 | #define GST_MFX_SUPPORTED_INPUT_FORMATS \ 82 | "{ NV12, YV12, I420, YUY2, BGRA, BGRx }" 83 | #else 84 | #define GST_MFX_SUPPORTED_INPUT_FORMATS \ 85 | "{ NV12, YV12, I420, UYVY, YUY2, BGRA, BGRx }" 86 | #endif 87 | 88 | 89 | gboolean 90 | gst_caps_has_mfx_surface(GstCaps * caps); 91 | 92 | gboolean 93 | gst_mfx_query_peer_has_raw_caps(GstPad * pad); 94 | 95 | void 96 | gst_video_info_change_format(GstVideoInfo * vip, GstVideoFormat format, 97 | guint width, guint height); 98 | 99 | #endif /* GST_MFX_PLUGIN_UTIL_H */ 100 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxsink.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2014 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFXSINK_H 24 | #define GST_MFXSINK_H 25 | 26 | #include "gstmfxpluginbase.h" 27 | #include "gstmfxpluginutil.h" 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | #define GST_TYPE_MFXSINK \ 36 | (gst_mfxsink_get_type ()) 37 | #define GST_MFXSINK_CAST(obj) \ 38 | ((GstMfxSink *)(obj)) 39 | #define GST_MFXSINK(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFXSINK, GstMfxSink)) 41 | #define GST_MFXSINK_CLASS(klass) \ 42 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFXSINK, GstMfxSinkClass)) 43 | #define GST_IS_MFXSINK(obj) \ 44 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_MFXSINK)) 45 | #define GST_IS_MFXSINK_CLASS(klass) \ 46 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFXSINK)) 47 | #define GST_MFXSINK_GET_CLASS(obj) \ 48 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFXSINK, GstMfxSinkClass)) 49 | 50 | typedef struct _GstMfxSink GstMfxSink; 51 | typedef struct _GstMfxSinkClass GstMfxSinkClass; 52 | typedef struct _GstMfxSinkBackend GstMfxSinkBackend; 53 | 54 | typedef gboolean(*GstMfxSinkCreateWindowFunc) (GstMfxSink * sink, 55 | guint width, guint height); 56 | typedef gboolean(*GstMfxSinkCreateWindowFromHandleFunc) (GstMfxSink * sink, 57 | guintptr window); 58 | typedef gboolean(*GstMfxSinkHandleEventsFunc) (GstMfxSink * sink); 59 | typedef gboolean(*GstMfxSinkPreStartEventThreadFunc) (GstMfxSink * sink); 60 | typedef gboolean(*GstMfxSinkPreStopEventThreadFunc) (GstMfxSink * sink); 61 | 62 | typedef enum { 63 | GST_MFX_GLAPI_OPENGL = 0, 64 | GST_MFX_GLAPI_GLES2 = 2, 65 | } GstMfxGLAPI; 66 | 67 | struct _GstMfxSinkBackend 68 | { 69 | GstMfxSinkCreateWindowFunc create_window; 70 | GstMfxSinkCreateWindowFromHandleFunc create_window_from_handle; 71 | 72 | /* Event threads handling */ 73 | GstMfxSinkHandleEventsFunc handle_events; 74 | GstMfxSinkPreStartEventThreadFunc pre_start_event_thread; 75 | GstMfxSinkPreStopEventThreadFunc pre_stop_event_thread; 76 | }; 77 | 78 | struct _GstMfxSink 79 | { 80 | /*< private >*/ 81 | GstMfxPluginBase parent_instance; 82 | 83 | const GstMfxSinkBackend *backend; 84 | 85 | GstCaps *caps; 86 | GstMfxWindow *window; 87 | guint window_width; 88 | guint window_height; 89 | guint video_width; 90 | guint video_height; 91 | gint video_par_n; 92 | gint video_par_d; 93 | GstVideoInfo video_info; 94 | GstMfxRectangle display_rect; 95 | GThread *event_thread; 96 | volatile gboolean event_thread_cancel; 97 | 98 | GstMfxCompositeFilter *composite_filter; 99 | GstMfxDisplay *drm_display; 100 | 101 | GstMfxDisplay *display; 102 | GstMfxDisplayType display_type; 103 | GstMfxDisplayType display_type_req; 104 | gchar *display_name; 105 | 106 | GstMfxGLAPI gl_api; 107 | 108 | guint handle_events : 1; 109 | guint foreign_window : 1; 110 | guint fullscreen : 1; 111 | guint keep_aspect : 1; 112 | guint no_frame_drop : 1; 113 | guint full_color_range : 1; 114 | 115 | guintptr app_window_handle; 116 | }; 117 | 118 | struct _GstMfxSinkClass 119 | { 120 | /*< private >*/ 121 | GstMfxPluginBaseClass parent_class; 122 | }; 123 | 124 | GType 125 | gst_mfxsink_get_type(void); 126 | 127 | G_END_DECLS 128 | 129 | 130 | #endif /* GST_MFXSINK_H */ 131 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxsinkbin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2016 Intel Corporation 3 | * Author: Puunithaaraj Gopal 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public License 7 | * as published by the Free Software Foundation; either version 2.1 8 | * of the License, or (at your option) any later version. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free 17 | * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 | * Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef GST_MFX_SINK_BIN_H 22 | #define GST_MFX_SINK_BIN_H 23 | 24 | #include 25 | 26 | #include 27 | #include 28 | #include 29 | 30 | G_BEGIN_DECLS 31 | 32 | #define GST_TYPE_MFX_SINK_BIN (gst_mfx_sink_bin_get_type ()) 33 | #define GST_MFX_SINK_BIN(obj) \ 34 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_MFX_SINK_BIN, GstMfxSinkBin)) 35 | #define GST_MFX_SINK_BIN_CLASS(klass) \ 36 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_MFX_SINK_BIN, GstMfxSinkBinClass)) 37 | #define GST_IS_AUTO_DETECT(obj) \ 38 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_MFX_SINK_BIN)) 39 | #define GST_MFX_SINK_BIN_GET_CLASS(obj) \ 40 | (G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_MFX_SINK_BIN, GstMfxSinkBinClass)) 41 | 42 | typedef struct __GstMfxSinkBin { 43 | /* Private */ 44 | GstBin parent; 45 | 46 | GstElement *postproc; 47 | GstElement *sink; 48 | } GstMfxSinkBin; 49 | 50 | typedef struct __GstMfxSinkBinClass { 51 | GstBinClass parent_class; 52 | } GstMfxSinkBinClass; 53 | 54 | GType gst_mfx_sink_bin_get_type (void); 55 | 56 | G_END_DECLS; 57 | 58 | #endif /* GST_MFX_SINK_BIN_H */ 59 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxvideobufferpool.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_VIDEO_BUFFER_POOL_H__ 24 | #define __GST_MFX_VIDEO_BUFFER_POOL_H__ 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | 31 | G_BEGIN_DECLS 32 | 33 | typedef struct _GstMfxVideoBufferPool GstMfxVideoBufferPool; 34 | typedef struct _GstMfxVideoBufferPoolClass GstMfxVideoBufferPoolClass; 35 | typedef struct _GstMfxVideoBufferPoolPrivate GstMfxVideoBufferPoolPrivate; 36 | 37 | #define GST_MFX_TYPE_VIDEO_BUFFER_POOL \ 38 | (gst_mfx_video_buffer_pool_get_type ()) 39 | #define GST_MFX_VIDEO_BUFFER_POOL(obj) \ 40 | (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_MFX_TYPE_VIDEO_BUFFER_POOL, \ 41 | GstMfxVideoBufferPool)) 42 | #define GST_MFX_VIDEO_BUFFER_POOL_CLASS(klass) \ 43 | (G_TYPE_CHECK_CLASS_CAST ((klass), GST_MFX_TYPE_VIDEO_BUFFER_POOL, \ 44 | GstMfxVideoBufferPoolClass)) 45 | #define GST_MFX_IS_VIDEO_BUFFER_POOL(obj) \ 46 | (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_MFX_TYPE_VIDEO_BUFFER_POOL)) 47 | #define GST_MFX_IS_VIDEO_BUFFER_POOL_CLASS(klass) \ 48 | (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_MFX_TYPE_VIDEO_BUFFER_POOL)) 49 | 50 | 51 | #define GST_BUFFER_POOL_OPTION_MFX_VIDEO_META \ 52 | "GstBufferPoolOptionMfxVideoMeta" 53 | 54 | #ifndef GST_BUFFER_POOL_OPTION_DMABUF_MEMORY 55 | #define GST_BUFFER_POOL_OPTION_DMABUF_MEMORY \ 56 | "GstBufferPoolOptionDMABUFMemory" 57 | #endif 58 | 59 | struct _GstMfxVideoBufferPool 60 | { 61 | GstBufferPool bufferpool; 62 | 63 | GstMfxVideoBufferPoolPrivate *priv; 64 | }; 65 | 66 | struct _GstMfxVideoBufferPoolClass 67 | { 68 | GstBufferPoolClass parent_instance; 69 | }; 70 | 71 | GType gst_mfx_video_buffer_pool_get_type (void); 72 | 73 | GstBufferPool * 74 | gst_mfx_video_buffer_pool_new (GstMfxTaskAggregator * aggregator, 75 | gboolean memtype_is_system); 76 | 77 | void 78 | gst_mfx_video_buffer_pool_set_untiled (GstBufferPool *pool, gboolean untiled); 79 | 80 | G_END_DECLS 81 | 82 | #endif /* __GST_MFX_VIDEO_BUFFER_POOL_H__ */ 83 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxvideocontext.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2013 Igalia 5 | * Author: Víctor Manuel Jáquez Leal 6 | * Copyright (C) 2016 Intel Corporation 7 | * Author: Ishmael Visayana Sameen 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_MFX_VIDEO_CONTEXT_H 26 | #define GST_MFX_VIDEO_CONTEXT_H 27 | 28 | #include 29 | 30 | #define GST_MFX_AGGREGATOR_CONTEXT_TYPE_NAME "gst.mfx.Aggregator" 31 | 32 | void 33 | gst_mfx_video_context_set_aggregator(GstContext * context, 34 | GstMfxTaskAggregator * aggregator); 35 | 36 | GstContext * 37 | gst_mfx_video_context_new_with_aggregator(GstMfxTaskAggregator * aggregator, 38 | gboolean persistent); 39 | 40 | gboolean 41 | gst_mfx_video_context_get_aggregator(GstContext * context, 42 | GstMfxTaskAggregator ** aggregator_ptr); 43 | 44 | gboolean 45 | gst_mfx_video_context_prepare(GstElement * element, 46 | GstMfxTaskAggregator ** aggregator_ptr); 47 | 48 | void 49 | gst_mfx_video_context_propagate(GstElement * element, 50 | GstMfxTaskAggregator * aggregator); 51 | 52 | #endif /* GST_MFX_VIDEO_CONTEXT_H */ 53 | -------------------------------------------------------------------------------- /gst/mfx/gstmfxvideometa.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011-2013 Intel Corporation 3 | * Author: Gwenole Beauchesne 4 | * Copyright (C) 2016 Intel Corporation 5 | * Author: Ishmael Visayana Sameen 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_MFX_VIDEO_META_H 24 | #define GST_MFX_VIDEO_META_H 25 | 26 | #include 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | G_BEGIN_DECLS 34 | 35 | typedef struct _GstMfxVideoMeta GstMfxVideoMeta; 36 | 37 | #define GST_MFX_VIDEO_META_API_TYPE \ 38 | gst_mfx_video_meta_api_get_type () 39 | 40 | GType 41 | gst_mfx_video_meta_api_get_type (void); 42 | 43 | GstMfxVideoMeta * 44 | gst_mfx_video_meta_copy (GstMfxVideoMeta * meta); 45 | 46 | GstMfxVideoMeta * 47 | gst_mfx_video_meta_new (void); 48 | 49 | GstMfxVideoMeta * 50 | gst_mfx_video_meta_ref (GstMfxVideoMeta * meta); 51 | 52 | void 53 | gst_mfx_video_meta_unref (GstMfxVideoMeta * meta); 54 | 55 | void 56 | gst_mfx_video_meta_replace (GstMfxVideoMeta ** old_meta_ptr, 57 | GstMfxVideoMeta * new_meta); 58 | 59 | GstMfxSurface * 60 | gst_mfx_video_meta_get_surface (GstMfxVideoMeta * meta); 61 | 62 | void 63 | gst_mfx_video_meta_set_surface (GstMfxVideoMeta * meta, 64 | GstMfxSurface * surface); 65 | 66 | gboolean 67 | gst_mfx_video_meta_get_linear (GstMfxVideoMeta *meta); 68 | 69 | void 70 | gst_mfx_video_meta_set_linear (GstMfxVideoMeta *meta, 71 | gboolean is_linear); 72 | 73 | GstMfxVideoMeta * 74 | gst_buffer_get_mfx_video_meta (GstBuffer * buffer); 75 | 76 | void 77 | gst_buffer_set_mfx_video_meta (GstBuffer * buffer, GstMfxVideoMeta * meta); 78 | 79 | G_END_DECLS 80 | 81 | #endif /* GST_MFX_VIDEO_META_H */ 82 | -------------------------------------------------------------------------------- /meson_options.txt: -------------------------------------------------------------------------------- 1 | option('MFX_DECODER', type : 'boolean', value : true, description : 'Build MSDK decoder plugins.') 2 | option('USE_HEVC_DECODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 3 | description : 'Build MSDK decoder plugin with HEVC support.') 4 | option('USE_HEVC_10BIT_DECODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'no', 5 | description : 'Build MSDK decoder plugin with HEVC 10bit support.') 6 | option('USE_VP8_DECODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 7 | description : 'Build MSDK decoder plugin with VP8 support.') 8 | option('USE_VP9_DECODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'no', 9 | description : 'Build MSDK decoder plugin with VP9 support.') 10 | 11 | option('MFX_ENCODER', type : 'boolean', value : true, description : 'Build MSDK encoder plugin.') 12 | option('MFX_H264_ENCODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 13 | description : 'Build H.264 encoder plugin.') 14 | option('MFX_H265_ENCODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 15 | description : 'Build H.265 encoder plugin.') 16 | option('MFX_MPEG2_ENCODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'no', 17 | description : 'Build MPEG2 encoder plugin.') 18 | option('MFX_JPEG_ENCODER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 19 | description : 'Build JPEG encoder plugin.') 20 | 21 | option('MFX_VPP', type : 'boolean', value : true, description : 'Build MSDK VPP plugin.') 22 | 23 | option('MFX_SINK', type : 'boolean', value : true, description : 'Build MSDK sink plugin.') 24 | option('WITH_WAYLAND', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 25 | description : 'Enable Wayland support.') 26 | option('WITH_X11', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 27 | description : 'Enable X11 support.') 28 | option('USE_EGL_RENDERER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 29 | description : 'Build sink plugin with EGL backend.') 30 | option('USE_WAYLAND_RENDERER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 31 | description : 'Build sink plugin with Wayland backend.') 32 | option('USE_DRI3_RENDERER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 33 | description : 'Build sink plugin with X11 DRI3 backend.') 34 | 35 | option('MFX_SINK_BIN', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 36 | description : 'Build MSDK sink bin plugin.') 37 | 38 | option('WITH_MSS_2016', type : 'boolean', value : false, description : 'Build plugins for MSS 2016.') 39 | 40 | option('MFX_VC1_PARSER', type : 'combo', choices : ['yes', 'no', 'auto'], value: 'auto', 41 | description : 'Build VC1 parser plugin') 42 | 43 | option('MFX_HOME', type: 'string', value: '/opt/intel/mediasdk', description: 'path to the media SDK, defaults to "/opt/intel/mediasdk"') 44 | -------------------------------------------------------------------------------- /parsers/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(SOURCE "") 2 | if(MFX_VC1_PARSER) 3 | set(SOURCE 4 | "${CMAKE_CURRENT_SOURCE_DIR}/gstvc1parse.c") 5 | endif() 6 | set(GST_PARSE ${SOURCE} PARENT_SCOPE) 7 | -------------------------------------------------------------------------------- /parsers/gstvc1parse.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2011, Hewlett-Packard Development Company, L.P. 3 | * Author: Sebastian Dröge , Collabora Ltd. 4 | * 5 | * This library is free software; you can redistribute it and/or 6 | * modify it under the terms of the GNU Lesser General Public 7 | * License as published by the Free Software Foundation 8 | * version 2.1 of the License. 9 | * 10 | * This library is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | * Lesser General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU Lesser General Public 16 | * License along with this library; if not, write to the Free Software 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 | * 19 | */ 20 | 21 | #ifndef __GST_VC1_PARSE_H__ 22 | #define __GST_VC1_PARSE_H__ 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | G_BEGIN_DECLS 29 | 30 | #define GST_MFX_TYPE_VC1_PARSE \ 31 | (gst_mfx_vc1_parse_get_type()) 32 | #define GST_VC1_PARSE(obj) \ 33 | (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_MFX_TYPE_VC1_PARSE,GstMfxVC1Parse)) 34 | #define GST_VC1_PARSE_CLASS(klass) \ 35 | (G_TYPE_CHECK_CLASS_CAST((klass),GST_MFX_TYPE_VC1_PARSE,GstMfxVC1ParseClass)) 36 | #define GST_IS_VC1_PARSE(obj) \ 37 | (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_MFX_TYPE_VC1_PARSE)) 38 | #define GST_IS_VC1_PARSE_CLASS(klass) \ 39 | (G_TYPE_CHECK_CLASS_TYPE((klass),GST_MFX_TYPE_VC1_PARSE)) 40 | 41 | typedef enum { 42 | VC1_HEADER_FORMAT_NONE = 0, 43 | VC1_HEADER_FORMAT_ASF, 44 | VC1_HEADER_FORMAT_SEQUENCE_LAYER 45 | } VC1HeaderFormat; 46 | 47 | typedef enum { 48 | VC1_STREAM_FORMAT_BDU = 0, 49 | VC1_STREAM_FORMAT_BDU_FRAME, 50 | VC1_STREAM_FORMAT_SEQUENCE_LAYER_BDU, 51 | VC1_STREAM_FORMAT_SEQUENCE_LAYER_BDU_FRAME, 52 | VC1_STREAM_FORMAT_SEQUENCE_LAYER_RAW_FRAME, 53 | VC1_STREAM_FORMAT_SEQUENCE_LAYER_FRAME_LAYER, 54 | VC1_STREAM_FORMAT_ASF, 55 | VC1_STREAM_FORMAT_FRAME_LAYER 56 | } VC1StreamFormat; 57 | 58 | typedef enum { 59 | GST_VC1_PARSE_FORMAT_WMV3 = 0, 60 | GST_VC1_PARSE_FORMAT_WVC1 61 | } GstVC1ParseFormat; 62 | 63 | /* FIXME move into baseparse, or anything equivalent; 64 | * see https://bugzilla.gnome.org/show_bug.cgi?id=650093 65 | * #define GST_BASE_PARSE_FRAME_FLAG_PARSING 0x100000 */ 66 | 67 | typedef struct _GstVC1Parse GstMfxVC1Parse; 68 | typedef struct _GstVC1ParseClass GstMfxVC1ParseClass; 69 | 70 | struct _GstVC1Parse 71 | { 72 | GstBaseParse baseparse; 73 | 74 | /* Caps */ 75 | GstVC1Profile profile; 76 | GstVC1Level level; 77 | GstVC1ParseFormat format; 78 | gint width, height; 79 | 80 | gint fps_n, fps_d; 81 | gboolean fps_from_caps; 82 | GstClockTime frame_duration; 83 | gint par_n, par_d; 84 | gboolean par_from_caps; 85 | 86 | /* TRUE if we should negotiate with downstream */ 87 | gboolean renegotiate; 88 | /* TRUE if the srcpads should be updated */ 89 | gboolean update_caps; 90 | 91 | gboolean sent_codec_tag; 92 | 93 | VC1HeaderFormat input_header_format; 94 | VC1StreamFormat input_stream_format; 95 | VC1StreamFormat output_stream_format; 96 | gboolean detecting_stream_format; 97 | 98 | GstVC1SeqHdr seq_hdr; 99 | GstBuffer *seq_hdr_buffer; 100 | GstBuffer *entrypoint_buffer; 101 | 102 | GstVC1SeqLayer seq_layer; 103 | GstBuffer *seq_layer_buffer; 104 | 105 | /* Metadata about the currently parsed frame, only 106 | * valid if the GstBaseParseFrame has the 107 | * GST_BASE_PARSE_FRAME_FLAG_PARSING flag */ 108 | GstVC1StartCode startcode; 109 | 110 | /* TRUE if we have already sent the codec-data, 111 | * use for stream-format conversion */ 112 | gboolean codec_data_sent; 113 | }; 114 | 115 | struct _GstVC1ParseClass 116 | { 117 | GstBaseParseClass parent_class; 118 | }; 119 | 120 | G_END_DECLS 121 | 122 | GType gst_mfx_vc1_parse_get_type (void); 123 | 124 | #endif /* __GST_VC1_PARSE_H__ */ 125 | -------------------------------------------------------------------------------- /parsers/meson.build: -------------------------------------------------------------------------------- 1 | if get_option ('MFX_VC1_PARSER') != 'no' 2 | if with_codecparsers and with_pbutils 3 | mfx_deps += [gstcodecparsers_dep, gstpbutils_dep] 4 | mfx_sources += ['@0@/@1@'.format(meson.current_source_dir(), 'gstvc1parse.c')] 5 | elif get_option ('MFX_VC1_PARSER') == 'yes' 6 | error ('MFX_VC1_PARSER required, but pbutils or codecparsers are not present') 7 | endif 8 | endif 9 | -------------------------------------------------------------------------------- /version.h.in: -------------------------------------------------------------------------------- 1 | /* Name of package */ 2 | #define PACKAGE "@GstMfx_PACKAGE@" 3 | 4 | /* Define to the full name of this package. */ 5 | #define PACKAGE_NAME "@GstMfx_PACKAGE_NAME@" 6 | 7 | /* Define to the full name and version of this package. */ 8 | #define PACKAGE_STRING "@GstMfx_PACKAGE_NAME@ @GstMfx_VERSION@" 9 | 10 | /* Define to the one symbol short name of this package. */ 11 | #define PACKAGE_TARNAME "@GstMfx_PACKAGE_TARNAME@" 12 | 13 | /* Define to the version of this package. */ 14 | #define PACKAGE_VERSION "@GstMfx_VERSION@" 15 | --------------------------------------------------------------------------------