summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media/codec2/sfplugin/utils/Codec2CommonUtils.cpp12
-rw-r--r--media/mtp/MtpProperty.h3
2 files changed, 9 insertions, 6 deletions
diff --git a/media/codec2/sfplugin/utils/Codec2CommonUtils.cpp b/media/codec2/sfplugin/utils/Codec2CommonUtils.cpp
index bb6c1b86c3..f428fce50c 100644
--- a/media/codec2/sfplugin/utils/Codec2CommonUtils.cpp
+++ b/media/codec2/sfplugin/utils/Codec2CommonUtils.cpp
@@ -83,7 +83,7 @@ bool isHalPixelFormatSupported(AHardwareBuffer_Format format) {
}
// Default scenario --- the consumer is display or GPU
- const AHardwareBuffer_Desc desc = {
+ const AHardwareBuffer_Desc consumableForDisplayOrGpu = {
.width = 320,
.height = 240,
.format = format,
@@ -98,7 +98,7 @@ bool isHalPixelFormatSupported(AHardwareBuffer_Format format) {
};
// The consumer is a HW encoder
- const AHardwareBuffer_Desc descHwEncoder = {
+ const AHardwareBuffer_Desc consumableForHwEncoder = {
.width = 320,
.height = 240,
.format = format,
@@ -114,7 +114,7 @@ bool isHalPixelFormatSupported(AHardwareBuffer_Format format) {
};
// The consumer is a SW encoder
- const AHardwareBuffer_Desc descSwEncoder = {
+ const AHardwareBuffer_Desc consumableForSwEncoder = {
.width = 320,
.height = 240,
.format = format,
@@ -128,9 +128,9 @@ bool isHalPixelFormatSupported(AHardwareBuffer_Format format) {
.rfu1 = 0,
};
- return AHardwareBuffer_isSupported(&desc)
- && AHardwareBuffer_isSupported(&descHwEncoder)
- && AHardwareBuffer_isSupported(&descSwEncoder);
+ return AHardwareBuffer_isSupported(&consumableForDisplayOrGpu)
+ && AHardwareBuffer_isSupported(&consumableForHwEncoder)
+ && AHardwareBuffer_isSupported(&consumableForSwEncoder);
}
} // namespace android
diff --git a/media/mtp/MtpProperty.h b/media/mtp/MtpProperty.h
index 36d736065f..2bdbfd3262 100644
--- a/media/mtp/MtpProperty.h
+++ b/media/mtp/MtpProperty.h
@@ -26,6 +26,9 @@ namespace android {
class MtpDataPacket;
struct MtpPropertyValue {
+ // pointer str initialized to NULL so that free operation
+ // is not called for pre-assigned value
+ MtpPropertyValue() : str (NULL) {}
union {
int8_t i8;
uint8_t u8;