From 33023d4d4d4fe2ce304adce8ebe0695d586a4d0c Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Mon, 13 Apr 2015 14:51:51 +0300 Subject: [PATCH] HEVC: Allow to build h265 codecparser internally Signed-off-by: Sreerenj Balachandran --- configure.ac | 26 ++++++++++++++++++++++++++ ext/Makefile.am | 2 ++ gst-libs/gst/codecparsers/Makefile.am | 5 +++++ 3 files changed, 33 insertions(+) diff --git a/configure.ac b/configure.ac index 91e3419fad..72dbabc3ea 100644 --- a/configure.ac +++ b/configure.ac @@ -269,6 +269,7 @@ if test "$enable_builtin_codecparsers" = "yes"; then ac_cv_have_gst_h264_parser="no" ac_cv_have_gst_jpeg_parser="no" ac_cv_have_gst_vp8_parser="no" + ac_cv_have_gst_h265_parser="no" else PKG_CHECK_MODULES([GST_CODEC_PARSERS], [gstreamer-codecparsers-$GST_PKG_VERSION >= $GST_PLUGINS_BAD_VERSION_REQUIRED]) @@ -371,6 +372,31 @@ AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_VP8], [test "$ac_cv_have_gst_vp8_parser" != "yes"]) AM_CONDITIONAL([USE_BUILTIN_LIBVPX], [test "$enable_builtin_libvpx" = "yes"]) +dnl ... H.265 parser, with the required extensions +AC_CACHE_CHECK([for H.265 parser], + ac_cv_have_gst_h265_parser, [ + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $GST_CFLAGS $GST_CODEC_PARSERS_CFLAGS" + saved_LIBS="$LIBS" + LIBS="$LIBS $GST_LIBS $GST_CODEC_PARSERS_LIBS" + AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include ]], + [[GstH265SliceHdr slice_hdr; + GstH265VUIParams vui_params; + GstH265Profile profile = GST_H265_PROFILE_MAIN_STILL_PICTURE; + slice_hdr.n_emulation_prevention_bytes = 0; + vui_params.par_n = 0; + vui_params.par_d = 0;]])], + [ac_cv_have_gst_h265_parser="yes"], + [ac_cv_have_gst_h265_parser="no"] + ) + CPPFLAGS="$saved_CPPFLAGS" + LIBS="$saved_LIBS" +]) +AM_CONDITIONAL([USE_LOCAL_CODEC_PARSERS_H265], + [test "$ac_cv_have_gst_h265_parser" != "yes"]) + dnl ... video parsers AM_CONDITIONAL([USE_LOCAL_VIDEO_PARSERS], [test "$enable_builtin_videoparsers" = "yes"]) diff --git a/ext/Makefile.am b/ext/Makefile.am index 1444152870..8450b85d50 100644 --- a/ext/Makefile.am +++ b/ext/Makefile.am @@ -17,6 +17,7 @@ codecparsers_source_c = \ nalutils.c \ parserutils.c \ vp8utils.c \ + gsth265parser.c \ $(NULL) EXTRA_DIST += $(codecparsers_source_c:%.c=$(codecparsers_srcdir)/%.c) @@ -33,6 +34,7 @@ codecparsers_source_h = \ nalutils.h \ parserutils.h \ vp8utils.h \ + gsth265parser.h \ $(NULL) EXTRA_DIST += $(codecparsers_source_h:%.h=$(codecparsers_srcdir)/%.h) diff --git a/gst-libs/gst/codecparsers/Makefile.am b/gst-libs/gst/codecparsers/Makefile.am index 56102ed697..a160450cde 100644 --- a/gst-libs/gst/codecparsers/Makefile.am +++ b/gst-libs/gst/codecparsers/Makefile.am @@ -62,6 +62,11 @@ gen_source_h += dboolhuff.h endif endif +if USE_LOCAL_CODEC_PARSERS_H265 +gen_source_c += gsth265parser.c +gen_source_h += gsth265parser.h +endif + GENFILES = \ $(gen_source_c) \ $(gen_source_h) \