From 8f0eda896440812820b8e206edaf999e1c92e8f2 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Fri, 12 Aug 2011 10:21:19 +0200 Subject: Allow conditional build of GStreamer/FFmpeg bitstream parsers. --- tests/test-decode.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) (limited to 'tests/test-decode.c') diff --git a/tests/test-decode.c b/tests/test-decode.c index 0aece942..67b00db9 100644 --- a/tests/test-decode.c +++ b/tests/test-decode.c @@ -19,16 +19,22 @@ * Boston, MA 02110-1301 USA */ +#include "config.h" #include #include #include #include -#include #include #include "test-mpeg2.h" #include "test-h264.h" #include "test-vc1.h" +#if USE_FFMPEG +# include +#endif +#if USE_CODEC_PARSERS +#endif + /* Set to 1 to check display cache works (shared VA display) */ #define CHECK_DISPLAY_CACHE 1 @@ -66,12 +72,21 @@ static inline void pause(void) } static gchar *g_codec_str; +static gboolean g_use_ffmpeg = FALSE; static GOptionEntry g_options[] = { { "codec", 'c', 0, G_OPTION_ARG_STRING, &g_codec_str, "codec to test", NULL }, + { "ffmpeg", 0, + 0, + G_OPTION_ARG_NONE, &g_use_ffmpeg, + "use ffmpeg", NULL }, + { "codecparsers", 0, + G_OPTION_FLAG_REVERSE, + G_OPTION_ARG_NONE, &g_use_ffmpeg, + "use codec parsers", NULL }, { NULL, } }; @@ -137,9 +152,22 @@ main(int argc, char *argv[]) NULL ); - decoder = gst_vaapi_decoder_ffmpeg_new(display, decoder_caps); + if (g_use_ffmpeg) { +#if USE_FFMPEG + decoder = gst_vaapi_decoder_ffmpeg_new(display, decoder_caps); +#endif + } + else { +#if USE_CODEC_PARSERS + switch (gst_vaapi_profile_get_codec(info.profile)) { + default: + decoder = NULL; + break; + } +#endif + } if (!decoder) - g_error("could not create FFmpeg decoder"); + g_error("could not create decoder"); gst_caps_unref(decoder_caps); buffer = gst_buffer_new(); -- cgit v1.2.1