aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Staessens <dstaessens@google.com>2020-09-02 07:18:31 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-02 07:18:31 +0000
commit0e3fec60684c65139cf0e98eea766f3a639c3d6c (patch)
treeaf5efff2da35b5ce8585f3433939d0c8f5942662
parent0fd4b1fa187cc3dccf1f5ebaec77d02c79502ab4 (diff)
parentefdbd3dc602f2866a30bdc5b7e5a7c0499131b72 (diff)
downloadv4l2_codec2-0e3fec60684c65139cf0e98eea766f3a639c3d6c.tar.gz
v4l2_codec2: Remove duplicated HalPixelFormat and InputCodec types. am: efdbd3dc60
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/v4l2_codec2/+/12269725 Change-Id: Ib0ecde74fa05dfc9dcb54c84d4fde10a7013949d
-rw-r--r--common/Android.bp1
-rw-r--r--common/FormatConverter.cpp4
-rw-r--r--common/VideoTypes.cpp (renamed from components/VideoTypes.cpp)4
-rw-r--r--common/include/v4l2_codec2/common/Common.h16
-rw-r--r--common/include/v4l2_codec2/common/VideoTypes.h (renamed from components/include/v4l2_codec2/components/VideoTypes.h)7
-rw-r--r--components/Android.bp1
-rw-r--r--components/V4L2DecodeComponent.cpp2
-rw-r--r--components/VideoFramePool.cpp2
-rw-r--r--components/include/v4l2_codec2/components/V4L2DecodeInterface.h2
-rw-r--r--components/include/v4l2_codec2/components/V4L2Decoder.h2
-rw-r--r--components/include/v4l2_codec2/components/VideoDecoder.h2
-rw-r--r--components/include/v4l2_codec2/components/VideoFramePool.h2
12 files changed, 17 insertions, 28 deletions
diff --git a/common/Android.bp b/common/Android.bp
index e9d407b..45334d0 100644
--- a/common/Android.bp
+++ b/common/Android.bp
@@ -10,6 +10,7 @@ cc_library {
"EncodeHelpers.cpp",
"FormatConverter.cpp",
"V4L2ComponentCommon.cpp",
+ "VideoTypes.cpp",
],
export_include_dirs: [
diff --git a/common/FormatConverter.cpp b/common/FormatConverter.cpp
index 657676e..9ab9161 100644
--- a/common/FormatConverter.cpp
+++ b/common/FormatConverter.cpp
@@ -20,7 +20,7 @@
#include <ui/GraphicBuffer.h>
#include <utils/Log.h>
-#include <v4l2_codec2/common/Common.h> // for HalPixelFormat
+#include <v4l2_codec2/common/VideoTypes.h> // for HalPixelFormat
using android::hardware::graphics::common::V1_0::BufferUsage;
@@ -131,7 +131,7 @@ c2_status_t FormatConverter::initialize(media::VideoPixelFormat outFormat,
// conversion to perform I420.
halFormat = HalPixelFormat::YV12;
} else {
- halFormat = HalPixelFormat::YCbCr_420_888; // will allocate NV12 by minigbm.
+ halFormat = HalPixelFormat::YCBCR_420_888; // will allocate NV12 by minigbm.
}
uint32_t bufferCount = std::max(inputCount, kMinInputBufferCount);
diff --git a/components/VideoTypes.cpp b/common/VideoTypes.cpp
index 9b71db8..1ecceca 100644
--- a/components/VideoTypes.cpp
+++ b/common/VideoTypes.cpp
@@ -5,7 +5,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "VideoTypes"
-#include <v4l2_codec2/components/VideoTypes.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <log/log.h>
@@ -24,6 +24,8 @@ const char* VideoCodecToString(VideoCodec codec) {
const char* HalPixelFormatToString(HalPixelFormat format) {
switch (format) {
+ case HalPixelFormat::UNKNOWN:
+ return "Unknown";
case HalPixelFormat::YCBCR_420_888:
return "YCBCR_420_888";
case HalPixelFormat::YV12:
diff --git a/common/include/v4l2_codec2/common/Common.h b/common/include/v4l2_codec2/common/Common.h
index 1b816ef..650b7a7 100644
--- a/common/include/v4l2_codec2/common/Common.h
+++ b/common/include/v4l2_codec2/common/Common.h
@@ -15,20 +15,6 @@ struct VideoFramePlane {
uint32_t mStride;
};
-enum class HalPixelFormat : uint32_t {
- UNKNOWN = 0x0,
- // The pixel formats defined in Android but are used among C2VDAComponent.
- YCbCr_420_888 = 0x23,
- YV12 = 0x32315659,
- NV12 = 0x3231564e,
-};
-
-enum class InputCodec {
- H264,
- VP8,
- VP9,
-};
-
-} // namespace android
+} // namespace android
#endif // ANDROID_V4L2_CODEC2_COMMON_COMMON_H
diff --git a/components/include/v4l2_codec2/components/VideoTypes.h b/common/include/v4l2_codec2/common/VideoTypes.h
index bcc9bc0..a5130d2 100644
--- a/components/include/v4l2_codec2/components/VideoTypes.h
+++ b/common/include/v4l2_codec2/common/VideoTypes.h
@@ -22,10 +22,11 @@ const char* VideoCodecToString(VideoCodec codec);
// Enumeration of supported pixel format. The value should be the same as
// ::android::hardware::graphics::common::V1_0::PixelFormat.
-using ::android::hardware::graphics::common::V1_0::PixelFormat;
+using HPixelFormat = ::android::hardware::graphics::common::V1_0::PixelFormat;
enum class HalPixelFormat : int32_t {
- YCBCR_420_888 = static_cast<int32_t>(PixelFormat::YCBCR_420_888),
- YV12 = static_cast<int32_t>(PixelFormat::YV12),
+ UNKNOWN = 0x0,
+ YCBCR_420_888 = static_cast<int32_t>(HPixelFormat::YCBCR_420_888),
+ YV12 = static_cast<int32_t>(HPixelFormat::YV12),
// NV12 is not defined at PixelFormat, follow the convention to use fourcc value.
NV12 = 0x3231564e,
};
diff --git a/components/Android.bp b/components/Android.bp
index 7f2b9dc..8273412 100644
--- a/components/Android.bp
+++ b/components/Android.bp
@@ -16,7 +16,6 @@ cc_library {
"V4L2EncodeComponent.cpp",
"V4L2EncodeInterface.cpp",
"VideoDecoder.cpp",
- "VideoTypes.cpp",
],
export_include_dirs: [
"include",
diff --git a/components/V4L2DecodeComponent.cpp b/components/V4L2DecodeComponent.cpp
index 1c8a0e8..1ea9a7b 100644
--- a/components/V4L2DecodeComponent.cpp
+++ b/components/V4L2DecodeComponent.cpp
@@ -24,10 +24,10 @@
#include <media/stagefright/foundation/ColorUtils.h>
#include <h264_parser.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <v4l2_codec2/components/BitstreamBuffer.h>
#include <v4l2_codec2/components/V4L2Decoder.h>
#include <v4l2_codec2/components/VideoFramePool.h>
-#include <v4l2_codec2/components/VideoTypes.h>
#include <v4l2_codec2/plugin_store/C2VdaBqBlockPool.h>
namespace android {
diff --git a/components/VideoFramePool.cpp b/components/VideoFramePool.cpp
index 0a0c914..0fdd260 100644
--- a/components/VideoFramePool.cpp
+++ b/components/VideoFramePool.cpp
@@ -16,7 +16,7 @@
#include <base/time/time.h>
#include <log/log.h>
-#include <v4l2_codec2/components/VideoTypes.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <v4l2_codec2/plugin_store/C2VdaBqBlockPool.h>
#include <v4l2_codec2/plugin_store/C2VdaPooledBlockPool.h>
#include <v4l2_codec2/plugin_store/V4L2AllocatorId.h>
diff --git a/components/include/v4l2_codec2/components/V4L2DecodeInterface.h b/components/include/v4l2_codec2/components/V4L2DecodeInterface.h
index 46c565e..b57f6c1 100644
--- a/components/include/v4l2_codec2/components/V4L2DecodeInterface.h
+++ b/components/include/v4l2_codec2/components/V4L2DecodeInterface.h
@@ -12,7 +12,7 @@
#include <util/C2InterfaceHelper.h>
#include <size.h>
-#include <v4l2_codec2/components/VideoTypes.h>
+#include <v4l2_codec2/common/VideoTypes.h>
namespace android {
diff --git a/components/include/v4l2_codec2/components/V4L2Decoder.h b/components/include/v4l2_codec2/components/V4L2Decoder.h
index eb12950..5539042 100644
--- a/components/include/v4l2_codec2/components/V4L2Decoder.h
+++ b/components/include/v4l2_codec2/components/V4L2Decoder.h
@@ -15,10 +15,10 @@
#include <rect.h>
#include <size.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <v4l2_codec2/components/VideoDecoder.h>
#include <v4l2_codec2/components/VideoFrame.h>
#include <v4l2_codec2/components/VideoFramePool.h>
-#include <v4l2_codec2/components/VideoTypes.h>
#include <v4l2_device.h>
namespace android {
diff --git a/components/include/v4l2_codec2/components/VideoDecoder.h b/components/include/v4l2_codec2/components/VideoDecoder.h
index 42b57c1..c737c65 100644
--- a/components/include/v4l2_codec2/components/VideoDecoder.h
+++ b/components/include/v4l2_codec2/components/VideoDecoder.h
@@ -10,10 +10,10 @@
#include <base/callback.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <v4l2_codec2/components/BitstreamBuffer.h>
#include <v4l2_codec2/components/VideoFrame.h>
#include <v4l2_codec2/components/VideoFramePool.h>
-#include <v4l2_codec2/components/VideoTypes.h>
namespace android {
diff --git a/components/include/v4l2_codec2/components/VideoFramePool.h b/components/include/v4l2_codec2/components/VideoFramePool.h
index c692cb0..ca26004 100644
--- a/components/include/v4l2_codec2/components/VideoFramePool.h
+++ b/components/include/v4l2_codec2/components/VideoFramePool.h
@@ -17,8 +17,8 @@
#include <base/threading/thread.h>
#include <size.h>
+#include <v4l2_codec2/common/VideoTypes.h>
#include <v4l2_codec2/components/VideoFrame.h>
-#include <v4l2_codec2/components/VideoTypes.h>
namespace android {