From 94a5b4d27574f46c5e0aa398ae8a2ab6b60fac0a Mon Sep 17 00:00:00 2001 From: Joao Carreira Date: Thu, 26 Mar 2015 02:13:56 +0000 Subject: [PATCH] list color spaces supported --- lib/PlaYUVerFrame.cpp | 12 ++++++++++++ lib/PlaYUVerFrame.h | 1 + 2 files changed, 13 insertions(+) diff --git a/lib/PlaYUVerFrame.cpp b/lib/PlaYUVerFrame.cpp index 602d6ef..513fe45 100644 --- a/lib/PlaYUVerFrame.cpp +++ b/lib/PlaYUVerFrame.cpp @@ -62,6 +62,18 @@ std::vector PlaYUVerFrame::supportedPixelFormatListNames() return formatsList; } +std::vector PlaYUVerFrame::supportedPixelFormatListNames( Int colorSpace ) +{ + std::vector formatsList; + Int numberFormats = PLAYUVER_NUMBER_FORMATS; + for( Int i = 0; i < numberFormats; i++ ) + { + if( g_PlaYUVerPixFmtDescriptorsList[i].colorSpace == colorSpace ) + formatsList.push_back( g_PlaYUVerPixFmtDescriptorsList[i].name ); + } + return formatsList; +} + PlaYUVerFrame::Pixel PlaYUVerFrame::ConvertPixel( Pixel inputPixel, ColorSpace eOutputSpace ) { Int outA, outB, outC; diff --git a/lib/PlaYUVerFrame.h b/lib/PlaYUVerFrame.h index dd5be01..271da41 100644 --- a/lib/PlaYUVerFrame.h +++ b/lib/PlaYUVerFrame.h @@ -151,6 +151,7 @@ public: * @return vector of strings with pixel formats names */ static std::vector supportedPixelFormatListNames(); + static std::vector supportedPixelFormatListNames( Int colorSpace ); /** * Get number of bytes per frame of a specific