APV: fixing color conversions and adding P210 and RGBA1010102 support
This patch fixes the following:
- Adding P210 and RGBA1010102 support to APV codec
- moving color conversion functions to proper location
- advertising adaptive playback
Test: CodecEncoderTest, CodecDecoderTest, CodecInfoTest
Bug: 376770121
Change-Id: Ic542c26d720763cd62c65f77239b12dbfbc3cb70
diff --git a/media/codec2/components/apv/C2SoftApvDec.h b/media/codec2/components/apv/C2SoftApvDec.h
index f5beb8f..05afdb2 100644
--- a/media/codec2/components/apv/C2SoftApvDec.h
+++ b/media/codec2/components/apv/C2SoftApvDec.h
@@ -118,6 +118,26 @@
uint32_t mHeight;
bool mSignalledOutputEos;
bool mSignalledError;
+ // Color aspects. These are ISO values and are meant to detect changes in aspects to avoid
+ // converting them to C2 values for each frame
+ struct VuiColorAspects {
+ uint8_t primaries;
+ uint8_t transfer;
+ uint8_t coeffs;
+ uint8_t fullRange;
+
+ // default color aspects
+ VuiColorAspects()
+ : primaries(C2Color::PRIMARIES_UNSPECIFIED),
+ transfer(C2Color::TRANSFER_UNSPECIFIED),
+ coeffs(C2Color::MATRIX_UNSPECIFIED),
+ fullRange(C2Color::RANGE_UNSPECIFIED) { }
+
+ bool operator==(const VuiColorAspects &o) {
+ return primaries == o.primaries && transfer == o.transfer && coeffs == o.coeffs
+ && fullRange == o.fullRange;
+ }
+ } mBitstreamColorAspects;
oapvd_t oapvdHandle;
oapvm_t oapvmHandle;
@@ -126,6 +146,8 @@
int outputCsp;
+ void getVuiParams(VuiColorAspects* buffer);
+
C2_DO_NOT_COPY(C2SoftApvDec);
};