From 4b2d81d3c498ae2985cd09004ff9e93dcfeadde9 Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Mon, 24 Mar 2014 04:50:16 +0000 Subject: [PATCH] Put formats definition in Types.h --- source/PlaYUVerFrame.cpp | 11 ++++------- source/TypeDef.h | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source/PlaYUVerFrame.cpp b/source/PlaYUVerFrame.cpp index 6986839..b1506db 100755 --- a/source/PlaYUVerFrame.cpp +++ b/source/PlaYUVerFrame.cpp @@ -34,13 +34,10 @@ namespace plaYUVer QStringList PlaYUVerFrame::supportedPixelFormatList() { QStringList formats; - formats << "yuv420p" - << "yuv444p" - << "yuv422p" - << "yuv410p" - << "yuv411p" - << "gray" - << "rgb24"; + for( Int i = 0; i < NUMBER_FORMATS; i++ ) + { + formats.append(gInputStreamFormatsNames[i].data()); + } return formats; } diff --git a/source/TypeDef.h b/source/TypeDef.h index ae146a4..f440fbc 100644 --- a/source/TypeDef.h +++ b/source/TypeDef.h @@ -27,6 +27,7 @@ #ifndef __MAKE_LIB__ #include "config.h" #endif +#include namespace plaYUVer { @@ -110,7 +111,7 @@ typedef UChar Pel; ///< 8-bit pixel type // PlaYUVer definitions // ==================================================================================================================== -enum InputStreamColorSpace +enum InputStreamFormats { NO_FMT = -1, YUV420p, @@ -120,6 +121,18 @@ enum InputStreamColorSpace YUV410p, GRAY, RGB8, + NUMBER_FORMATS +}; + +const std::string gInputStreamFormatsNames[] = +{ + "YUV420p", + "YUV444p", + "YUV422p", + "YUV411p", + "YUV410p", + "GRAY", + "RGB8", }; enum ColorSpace