diff options
author | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2014-04-29 22:05:32 +0200 |
---|---|---|
committer | George Kiagiadakis <george.kiagiadakis@collabora.com> | 2014-05-03 22:31:56 +0300 |
commit | 54cbc81aaea7a71d2ae16e1824ed4ef8fa9cd9ad (patch) | |
tree | 1b8cb6472b52aa1c6cfd4d5f927d34de0ec8a7fd | |
parent | 1b61775e5f1af8b30c0943bce85a9036d556e8b9 (diff) |
qtvideosink: fix template caps
Now the formats are duplicated in the template caps and the painters, though.
This code could use some cleanups...
-rw-r--r-- | elements/gstqtvideosink/gstqtglvideosinkbase.cpp | 15 | ||||
-rw-r--r-- | elements/gstqtvideosink/gstqtvideosinkbase.cpp | 13 |
2 files changed, 9 insertions, 19 deletions
diff --git a/elements/gstqtvideosink/gstqtglvideosinkbase.cpp b/elements/gstqtvideosink/gstqtglvideosinkbase.cpp index 8e566cd..e94c273 100644 --- a/elements/gstqtvideosink/gstqtglvideosinkbase.cpp +++ b/elements/gstqtvideosink/gstqtglvideosinkbase.cpp @@ -19,6 +19,8 @@ #include "painters/openglsurfacepainter.h" #include "delegates/qtvideosinkdelegate.h" +#define CAPS_FORMATS "{ BGRA, BGRx, ARGB, xRGB, RGB, RGB16, BGR, v308, AYUV, YV12, I420 }" + const char * const GstQtGLVideoSinkBase::s_colorbalance_labels[] = { "contrast", "brightness", "hue", "saturation" }; @@ -47,18 +49,7 @@ void GstQtGLVideoSinkBase::base_init(gpointer g_class) static GstStaticPadTemplate sink_pad_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS( - "video/x-raw, " - "framerate = (fraction) [ 0, MAX ], " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]" - "; " - "video/x-raw, " - "framerate = (fraction) [ 0, MAX ], " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]" - "; " - ) + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (CAPS_FORMATS)) ); gst_element_class_add_pad_template( diff --git a/elements/gstqtvideosink/gstqtvideosinkbase.cpp b/elements/gstqtvideosink/gstqtvideosinkbase.cpp index fa13030..a7e2708 100644 --- a/elements/gstqtvideosink/gstqtvideosinkbase.cpp +++ b/elements/gstqtvideosink/gstqtvideosinkbase.cpp @@ -21,6 +21,11 @@ #include <cstring> #include <QCoreApplication> +#if Q_BYTE_ORDER == Q_BIG_ENDIAN +# define CAPS_FORMATS "{ ARGB, xRGB, RGB, RGB16 }" +#else +# define CAPS_FORMATS "{ BGRA, BGRx, RGB, RGB16 }" +#endif GstVideoSinkClass *GstQtVideoSinkBase::s_parent_class = NULL; @@ -34,13 +39,7 @@ void GstQtVideoSinkBase::base_init(gpointer g_class) static GstStaticPadTemplate sink_pad_template = GST_STATIC_PAD_TEMPLATE("sink", GST_PAD_SINK, GST_PAD_ALWAYS, - GST_STATIC_CAPS( - "video/x-raw,format=(string) rgb, " - "framerate = (fraction) [ 0, MAX ], " - "width = (int) [ 1, MAX ], " - "height = (int) [ 1, MAX ]" - "; " - ) + GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (CAPS_FORMATS)) ); gst_element_class_add_pad_template( |