From 80e5b1ba173ee3b2f4c104049016ee272a7fbec7 Mon Sep 17 00:00:00 2001 From: gb Date: Fri, 7 May 2010 06:35:31 +0000 Subject: [PATCH] Factor out VA surface caps. --- gst-libs/gst/vaapi/gstvaapisurface.h | 11 +++++++++++ gst/vaapiconvert/gstvaapiconvert.c | 4 +--- gst/vaapidecode/gstvaapidecode.c | 4 +--- gst/vaapisink/gstvaapisink.c | 5 +---- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapisurface.h b/gst-libs/gst/vaapi/gstvaapisurface.h index 0cb27759f2..11fc35567a 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.h +++ b/gst-libs/gst/vaapi/gstvaapisurface.h @@ -33,6 +33,17 @@ typedef enum _GstVaapiChromaType GstVaapiChromaType; typedef enum _GstVaapiSurfaceStatus GstVaapiSurfaceStatus; typedef enum _GstVaapiSurfaceRenderFlags GstVaapiSurfaceRenderFlags; +/** + * GST_VAAPI_SURFACE_CAPS: + * + * Generic caps for VA surfaces. + */ +#define GST_VAAPI_SURFACE_CAPS \ + "video/x-vaapi-surface, " \ + "width = (int) [ 1, MAX ]," \ + "height = (int) [ 1, MAX ]," \ + "framerate = (fraction) [ 0, MAX ]" + /** * GstVaapiChromaType: * @GST_VAAPI_CHROMA_TYPE_YUV420: 4:2:0 chroma format diff --git a/gst/vaapiconvert/gstvaapiconvert.c b/gst/vaapiconvert/gstvaapiconvert.c index 352e0e6267..652974e7ab 100644 --- a/gst/vaapiconvert/gstvaapiconvert.c +++ b/gst/vaapiconvert/gstvaapiconvert.c @@ -53,9 +53,7 @@ static const char gst_vaapiconvert_yuv_caps_str[] = "height = (int) [ 1, MAX ]; "; static const char gst_vaapiconvert_vaapi_caps_str[] = - "video/x-vaapi-surface, " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]; "; + GST_VAAPI_SURFACE_CAPS; static GstStaticPadTemplate gst_vaapiconvert_sink_factory = GST_STATIC_PAD_TEMPLATE( diff --git a/gst/vaapidecode/gstvaapidecode.c b/gst/vaapidecode/gstvaapidecode.c index dd1f2ab613..191665650e 100644 --- a/gst/vaapidecode/gstvaapidecode.c +++ b/gst/vaapidecode/gstvaapidecode.c @@ -63,9 +63,7 @@ static const char gst_vaapidecode_sink_caps_str[] = ; static const char gst_vaapidecode_src_caps_str[] = - "video/x-vaapi-surface, " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]; "; + GST_VAAPI_SURFACE_CAPS; static GstStaticPadTemplate gst_vaapidecode_sink_factory = GST_STATIC_PAD_TEMPLATE( diff --git a/gst/vaapisink/gstvaapisink.c b/gst/vaapisink/gstvaapisink.c index c849f18c50..25da39feb9 100644 --- a/gst/vaapisink/gstvaapisink.c +++ b/gst/vaapisink/gstvaapisink.c @@ -60,10 +60,7 @@ static GstStaticPadTemplate gst_vaapisink_sink_factory = "sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS( - "video/x-vaapi-surface, " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]; ")); + GST_STATIC_CAPS(GST_VAAPI_SURFACE_CAPS)); static void gst_vaapisink_iface_init(GType type);