diff options
author | gb <gb@5584edef-b1fe-4b99-b61b-dd2bab72e969> | 2010-05-03 16:54:23 +0000 |
---|---|---|
committer | Gwenole Beauchesne <gbeauchesne@splitted-desktop.com> | 2010-09-20 12:55:43 +0200 |
commit | 585a273532261a1349a04be5f569e1e8f215d49c (patch) | |
tree | fd44a006366a052dc6bb63679227554ecd9f465e /tests | |
parent | 3ed565553517954893c7062e6e199b04fe7b6e38 (diff) |
Use gst_vaapi_decoder_ffmpeg_new_from_caps().
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-decode.c | 17 | ||||
-rw-r--r-- | tests/test-decode.h | 1 |
2 files changed, 17 insertions, 1 deletions
diff --git a/tests/test-decode.c b/tests/test-decode.c index 0fea7501..c5f7f918 100644 --- a/tests/test-decode.c +++ b/tests/test-decode.c @@ -79,6 +79,7 @@ main(int argc, char *argv[]) GstVaapiWindow *window; GstVaapiDecoder *decoder; GstCaps *decoder_caps; + GstStructure *structure; GstVaapiDecoderStatus status; const CodecDefs *codec; GstVaapiSurfaceProxy *proxy; @@ -111,7 +112,20 @@ main(int argc, char *argv[]) g_error("could not create window"); codec->get_video_info(&info); - decoder = gst_vaapi_decoder_ffmpeg_new(display, gst_vaapi_profile_get_codec(info.profile), NULL); + decoder_caps = gst_vaapi_profile_get_caps(info.profile); + if (!decoder_caps) + g_error("could not create decoder caps"); + + structure = gst_caps_get_structure(decoder_caps, 0); + if (info.width > 0 && info.height > 0) + gst_structure_set( + structure, + "width", G_TYPE_INT, info.width, + "height", G_TYPE_INT, info.height, + NULL + ); + + decoder = gst_vaapi_decoder_ffmpeg_new_from_caps(display, decoder_caps); if (!decoder) g_error("could not create FFmpeg decoder"); @@ -136,6 +150,7 @@ main(int argc, char *argv[]) pause(); g_object_unref(proxy); + gst_caps_unref(decoder_caps); g_object_unref(decoder); g_object_unref(window); g_object_unref(display); diff --git a/tests/test-decode.h b/tests/test-decode.h index 0ef55cca..6d9aa2b0 100644 --- a/tests/test-decode.h +++ b/tests/test-decode.h @@ -21,6 +21,7 @@ #ifndef TEST_DECODE_H #define TEST_DECODE_H +#include <gst/vaapi/gstvaapidisplay.h> #include <gst/vaapi/gstvaapiprofile.h> typedef struct _VideoDecodeInfo VideoDecodeInfo; |