m4_define([gst_plugins_base_version],
[gst_plugins_base_major_version.gst_plugins_base_minor_version.gst_plugins_base_micro_version])
-# VA-API minimum version number
-m4_define([va_api_x11_version], [0.31.0])
-m4_define([va_api_glx_version], [0.32.0])
-
# gst plugins-bad version number
m4_define([gst_plugins_bad_major_version], [0])
m4_define([gst_plugins_bad_minor_version], [10])
m4_define([gst_plugins_bad_version],
[gst_plugins_bad_major_version.gst_plugins_bad_minor_version.gst_plugins_bad_micro_version])
+# VA-API minimum version number
+m4_define([va_api_x11_version], [0.31.0])
+m4_define([va_api_glx_version], [0.32.0])
+
# libva package version number
m4_define([libva_x11_package_version], [1.0.3])
m4_define([libva_glx_package_version], [1.0.9])
[enable OpenGL/X11 to vaapisink @<:@default=yes@:>@]),
[], [enable_vaapisink_glx="no"])
-AC_ARG_ENABLE(codecparsers,
- AS_HELP_STRING([--enable-codecparsers],
- [enable adhoc bitstream parsers from GStreamer @<:@default=yes@:>@]),
- [], [enable_codecparsers="yes"])
-
dnl Check for __attribute__((visibility()))
AC_CACHE_CHECK([whether __attribute__((visibility())) is supported],
vaapi_cv_visibility_attribute,
)
dnl Check for GStreamer codec parsers
-USE_CODEC_PARSERS=0
-if test "$enable_codecparsers" = "yes"; then
+USE_CODEC_PARSERS=1
+USE_LOCAL_CODEC_PARSERS=0
+
PKG_CHECK_MODULES([GST_CODEC_PARSERS],
- [gstreamer-codecparsers-$GST_MAJORMINOR >= $GST_VERSION_REQUIRED],
- [enable_codecparsers="yes" USE_CODEC_PARSERS=1],
- [enable_codecparsers="no" USE_CODEC_PARSERS=0]
+ [gstreamer-codecparsers-$GST_MAJORMINOR >= $GST_PLUGINS_BAD_VERSION_REQUIRED]
)
-fi
-
-AC_DEFINE_UNQUOTED(USE_CODEC_PARSERS, $USE_CODEC_PARSERS,
- [Defined to 1 if GStreamer codec parsers are used])
-AM_CONDITIONAL(USE_CODEC_PARSERS, test $USE_CODEC_PARSERS -eq 1)
-USE_LOCAL_CODEC_PARSERS=0
-if test "$enable_codecparsers" = "yes"; then
AC_CACHE_CHECK([for GstH264SliceHdr::n_emulation_prevention_bytes],
ac_cv_have_gst_h264_slice_hdr_epb_count, [
saved_CFLAGS="$CFLAGS"
LIBS="$saved_LIBS"
])
+if test "$ac_cv_have_gst_h264_slice_hdr_epb_count" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_GST_H264_SLICE_HDR_EPB_COUNT, 1,
+ [Defined to 1 if GstH264SliceHdr::n_emulation_prevention_bytes exists.])
+fi
+
AC_CACHE_CHECK([for JPEG parser],
ac_cv_have_gst_jpeg_parser, [
saved_CFLAGS="$CFLAGS"
CFLAGS="$saved_CFLAGS"
LIBS="$saved_LIBS"
])
-fi
-
-if test "$ac_cv_have_gst_h264_slice_hdr_epb_count" = "yes"; then
- AC_DEFINE_UNQUOTED(HAVE_GST_H264_SLICE_HDR_EPB_COUNT, 1,
- [Defined to 1 if GstH264SliceHdr::n_emulation_prevention_bytes exists.])
-fi
if test "$ac_cv_have_gst_jpeg_parser" = "yes"; then
AC_DEFINE_UNQUOTED(HAVE_GST_JPEG_PARSER, 1,
dnl Check for JPEG decoding API (0.33+)
USE_JPEG_DECODER=0
-if test "$enable_codecparsers" = "yes"; then
AC_CACHE_CHECK([for JPEG decoding API],
ac_cv_have_jpeg_decoding_api, [
saved_CFLAGS="$CFLAGS"
CFLAGS="$saved_CFLAGS"
LIBS="$saved_LIBS"
])
-fi
AC_DEFINE_UNQUOTED(USE_JPEG_DECODER, $USE_JPEG_DECODER,
[Defined to 1 if JPEG decoder is used])
USE_VAAPISINK_GLX=0
fi
-if test "$enable_codecparsers" = "no"; then
- AC_MSG_ERROR([Found no suitable GStreamer bitstream parsers])
-fi
-
AC_DEFINE_UNQUOTED(USE_GLX, $USE_GLX,
[Defined to 1 if GLX is enabled])
AM_CONDITIONAL(USE_GLX, test $USE_GLX -eq 1)
echo GLX support ...................... : $(yesno $USE_GLX)
echo VA/GLX support ................... : $(yesno $USE_VAAPI_GLX)
echo VaapiSink/GL ..................... : $(yesno $USE_VAAPISINK_GLX)
-echo GStreamer bitstream parsers ...... : $(yesno $USE_CODEC_PARSERS)
echo
$(GST_BASEVIDEO_CFLAGS) \
$(GST_VIDEO_CFLAGS) \
$(GST_CFLAGS) \
+ $(GST_CODEC_PARSERS_CFLAGS) \
$(LIBVA_CFLAGS) \
$(NULL)
$(GST_BASEVIDEO_LIBS) \
$(GST_LIBS) \
$(GST_VIDEO_LIBS) \
+ $(GST_CODEC_PARSERS_LIBS) \
$(LIBVA_LIBS) \
$(NULL)
libgstvaapi_source_c = \
+ gstvaapicodec_objects.c \
gstvaapicontext.c \
gstvaapidecoder.c \
+ gstvaapidecoder_dpb.c \
+ gstvaapidecoder_h264.c \
+ gstvaapidecoder_mpeg2.c \
+ gstvaapidecoder_mpeg4.c \
+ gstvaapidecoder_objects.c \
+ gstvaapidecoder_vc1.c \
gstvaapidisplay.c \
gstvaapidisplaycache.c \
gstvaapiimage.c \
libgstvaapi_source_h = \
gstvaapicontext.h \
gstvaapidecoder.h \
+ gstvaapidecoder_h264.h \
+ gstvaapidecoder_mpeg2.h \
+ gstvaapidecoder_mpeg4.h \
+ gstvaapidecoder_vc1.h \
gstvaapidisplay.h \
gstvaapidisplaycache.h \
gstvaapiimage.h \
libgstvaapi_source_priv_h = \
glibcompat.h \
gstvaapi_priv.h \
+ gstvaapicodec_objects.h \
gstvaapicompat.h \
gstvaapidebug.h \
+ gstvaapidecoder_dpb.h \
+ gstvaapidecoder_objects.h \
gstvaapidecoder_priv.h \
gstvaapidisplay_priv.h \
gstvaapiobject_priv.h \
gstvaapiutils_x11.h \
$(NULL)
-if USE_CODEC_PARSERS
-libgstvaapi_source_c += \
- gstvaapicodec_objects.c \
- gstvaapidecoder_dpb.c \
- gstvaapidecoder_h264.c \
- gstvaapidecoder_mpeg2.c \
- gstvaapidecoder_mpeg4.c \
- gstvaapidecoder_objects.c \
- gstvaapidecoder_vc1.c \
- $(NULL)
-libgstvaapi_source_h += \
- gstvaapidecoder_h264.h \
- gstvaapidecoder_mpeg2.h \
- gstvaapidecoder_mpeg4.h \
- gstvaapidecoder_vc1.h \
- $(NULL)
-libgstvaapi_source_priv_h += \
- gstvaapicodec_objects.h \
- gstvaapidecoder_dpb.h \
- gstvaapidecoder_objects.h \
- $(NULL)
-libgstvaapi_cflags += $(GST_CODEC_PARSERS_CFLAGS)
-libgstvaapi_libs += $(GST_CODEC_PARSERS_LIBS)
-
if USE_JPEG_DECODER
libgstvaapi_source_c += gstvaapidecoder_jpeg.c
libgstvaapi_source_h += gstvaapidecoder_jpeg.h
endif
-endif
if USE_LOCAL_CODEC_PARSERS
libgstvaapi_libs += \
#include "gstvaapidecode.h"
#include "gstvaapipluginutil.h"
-#if USE_CODEC_PARSERS
-# include <gst/vaapi/gstvaapidecoder_h264.h>
-# include <gst/vaapi/gstvaapidecoder_jpeg.h>
-# include <gst/vaapi/gstvaapidecoder_mpeg2.h>
-# include <gst/vaapi/gstvaapidecoder_mpeg4.h>
-# include <gst/vaapi/gstvaapidecoder_vc1.h>
-#endif
+#include <gst/vaapi/gstvaapidecoder_h264.h>
+#include <gst/vaapi/gstvaapidecoder_jpeg.h>
+#include <gst/vaapi/gstvaapidecoder_mpeg2.h>
+#include <gst/vaapi/gstvaapidecoder_mpeg4.h>
+#include <gst/vaapi/gstvaapidecoder_vc1.h>
#define GST_PLUGIN_NAME "vaapidecode"
#define GST_PLUGIN_DESC "A VA-API based video decoder"
if (!gst_vaapi_ensure_display(decode, &decode->display))
return FALSE;
+ dpy = decode->display;
decode->decoder_mutex = g_mutex_new();
if (!decode->decoder_mutex)
if (!decode->decoder_ready)
return FALSE;
- dpy = decode->display;
-#if USE_CODEC_PARSERS
- structure = gst_caps_get_structure(caps, 0);
- if (!structure)
+ structure = gst_caps_get_structure(caps, 0);
+ if (!structure)
+ return FALSE;
+
+ if (gst_structure_has_name(structure, "video/x-h264"))
+ decode->decoder = gst_vaapi_decoder_h264_new(dpy, caps);
+ else if (gst_structure_has_name(structure, "video/mpeg")) {
+ if (!gst_structure_get_int(structure, "mpegversion", &version))
return FALSE;
- if (gst_structure_has_name(structure, "video/x-h264"))
- decode->decoder = gst_vaapi_decoder_h264_new(dpy, caps);
- else if (gst_structure_has_name(structure, "video/mpeg")) {
- if (!gst_structure_get_int(structure, "mpegversion", &version))
- return FALSE;
- if (version == 2)
- decode->decoder = gst_vaapi_decoder_mpeg2_new(dpy, caps);
- else if (version == 4)
- decode->decoder = gst_vaapi_decoder_mpeg4_new(dpy, caps);
- }
- else if (gst_structure_has_name(structure, "video/x-wmv"))
- decode->decoder = gst_vaapi_decoder_vc1_new(dpy, caps);
- else if (gst_structure_has_name(structure, "video/x-h263") ||
- gst_structure_has_name(structure, "video/x-divx") ||
- gst_structure_has_name(structure, "video/x-xvid"))
+ if (version == 2)
+ decode->decoder = gst_vaapi_decoder_mpeg2_new(dpy, caps);
+ else if (version == 4)
decode->decoder = gst_vaapi_decoder_mpeg4_new(dpy, caps);
+ }
+ else if (gst_structure_has_name(structure, "video/x-wmv"))
+ decode->decoder = gst_vaapi_decoder_vc1_new(dpy, caps);
+ else if (gst_structure_has_name(structure, "video/x-h263") ||
+ gst_structure_has_name(structure, "video/x-divx") ||
+ gst_structure_has_name(structure, "video/x-xvid"))
+ decode->decoder = gst_vaapi_decoder_mpeg4_new(dpy, caps);
#if USE_JPEG_DECODER
- else if (gst_structure_has_name(structure, "image/jpeg"))
- decode->decoder = gst_vaapi_decoder_jpeg_new(dpy, caps);
-#endif
+ else if (gst_structure_has_name(structure, "image/jpeg"))
+ decode->decoder = gst_vaapi_decoder_jpeg_new(dpy, caps);
#endif
if (!decode->decoder)
return FALSE;
#include <gst/vaapi/gstvaapiwindow_x11.h>
#include <gst/vaapi/gstvaapidecoder.h>
#include <gst/vaapi/gstvaapisurface.h>
+#include <gst/vaapi/gstvaapidecoder_h264.h>
+#include <gst/vaapi/gstvaapidecoder_jpeg.h>
+#include <gst/vaapi/gstvaapidecoder_mpeg2.h>
+#include <gst/vaapi/gstvaapidecoder_vc1.h>
#include "test-jpeg.h"
#include "test-mpeg2.h"
#include "test-h264.h"
#include "test-vc1.h"
-#if USE_CODEC_PARSERS
-# include <gst/vaapi/gstvaapidecoder_h264.h>
-# include <gst/vaapi/gstvaapidecoder_jpeg.h>
-# include <gst/vaapi/gstvaapidecoder_mpeg2.h>
-# include <gst/vaapi/gstvaapidecoder_vc1.h>
-#endif
-
/* Set to 1 to check display cache works (shared VA display) */
#define CHECK_DISPLAY_CACHE 1
NULL
);
-#if USE_CODEC_PARSERS
- switch (gst_vaapi_profile_get_codec(info.profile)) {
- case GST_VAAPI_CODEC_H264:
- decoder = gst_vaapi_decoder_h264_new(display, decoder_caps);
- break;
+ switch (gst_vaapi_profile_get_codec(info.profile)) {
+ case GST_VAAPI_CODEC_H264:
+ decoder = gst_vaapi_decoder_h264_new(display, decoder_caps);
+ break;
#if USE_JPEG_DECODER
- case GST_VAAPI_CODEC_JPEG:
- decoder = gst_vaapi_decoder_jpeg_new(display, decoder_caps);
- break;
-#endif
- case GST_VAAPI_CODEC_MPEG2:
- decoder = gst_vaapi_decoder_mpeg2_new(display, decoder_caps);
- break;
- case GST_VAAPI_CODEC_VC1:
- decoder = gst_vaapi_decoder_vc1_new(display, decoder_caps);
- break;
- default:
- decoder = NULL;
- break;
- }
+ case GST_VAAPI_CODEC_JPEG:
+ decoder = gst_vaapi_decoder_jpeg_new(display, decoder_caps);
+ break;
#endif
+ case GST_VAAPI_CODEC_MPEG2:
+ decoder = gst_vaapi_decoder_mpeg2_new(display, decoder_caps);
+ break;
+ case GST_VAAPI_CODEC_VC1:
+ decoder = gst_vaapi_decoder_vc1_new(display, decoder_caps);
+ break;
+ default:
+ decoder = NULL;
+ break;
+ }
if (!decoder)
g_error("could not create decoder");
gst_caps_unref(decoder_caps);
#include <gst/vaapi/gstvaapidisplay_x11.h>
#include <gst/vaapi/gstvaapiwindow_x11.h>
#include <gst/vaapi/gstvaapidecoder.h>
+#include <gst/vaapi/gstvaapidecoder_mpeg2.h>
#include <gst/vaapi/gstvaapisurface.h>
#include "test-mpeg2.h"
#include "test-subpicture-data.h"
-#if USE_CODEC_PARSERS
-# include <gst/vaapi/gstvaapidecoder_mpeg2.h>
-#endif
-
typedef void (*GetVideoInfoFunc)(VideoDecodeInfo *info);
typedef struct _CodecDefs CodecDefs;
NULL
);
-#if USE_CODEC_PARSERS
decoder = gst_vaapi_decoder_mpeg2_new(display, decoder_caps);
-#endif
if (!decoder)
g_error("could not create video decoder");
gst_caps_unref(decoder_caps);