Style fix: renaming and include guards.
Fixes file name style and include guard style, before
even more and more files get added.
BUG: 30224839
Change-Id: Ie5ebcf14672c7e9d3faae86b88d4f62b516ae00d
TEST: test program that takes a picture still works.
diff --git a/modules/camera/3_4/Android.mk b/modules/camera/3_4/Android.mk
index ad02c20..e785015 100644
--- a/modules/camera/3_4/Android.mk
+++ b/modules/camera/3_4/Android.mk
@@ -47,13 +47,13 @@
$(call include-path-for, camera)
LOCAL_SRC_FILES := \
- Camera.cpp \
- Stream.cpp \
- StreamFormat.cpp \
- V4L2Camera.cpp \
- V4L2CameraHAL.cpp \
- V4L2Gralloc.cpp \
- V4L2Wrapper.cpp \
+ camera.cpp \
+ stream.cpp \
+ stream_format.cpp \
+ v4l2_camera.cpp \
+ v4l2_camera_hal.cpp \
+ v4l2_gralloc.cpp \
+ v4l2_wrapper.cpp \
LOCAL_CFLAGS += -Wall -Wextra -fvisibility=hidden
diff --git a/modules/camera/3_4/ArrayVector.h b/modules/camera/3_4/array_vector.h
similarity index 90%
rename from modules/camera/3_4/ArrayVector.h
rename to modules/camera/3_4/array_vector.h
index 53d09c5..50fee6c 100644
--- a/modules/camera/3_4/ArrayVector.h
+++ b/modules/camera/3_4/array_vector.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ARRAY_VECTOR_H
-#define ARRAY_VECTOR_H
+#ifndef V4L2_CAMERA_HAL_ARRAY_VECTOR_H_
+#define V4L2_CAMERA_HAL_ARRAY_VECTOR_H_
#include <array>
#include <vector>
@@ -47,6 +47,6 @@
std::vector<T> mItems;
};
-} // namespace v4l2_camera_hal
+} // namespace v4l2_camera_hal
-#endif // ARRAY_VECTOR_H
+#endif // V4L2_CAMERA_HAL_ARRAY_VECTOR_H_
diff --git a/modules/camera/3_4/Camera.cpp b/modules/camera/3_4/camera.cpp
similarity index 99%
rename from modules/camera/3_4/Camera.cpp
rename to modules/camera/3_4/camera.cpp
index eb8ad18..755ed02 100644
--- a/modules/camera/3_4/Camera.cpp
+++ b/modules/camera/3_4/camera.cpp
@@ -25,7 +25,7 @@
#include <system/camera_metadata.h>
#include <system/graphics.h>
#include <utils/Mutex.h>
-#include "Stream.h"
+#include "stream.h"
//#define LOG_NDEBUG 0
#define LOG_TAG "Camera"
@@ -34,7 +34,7 @@
#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL)
#include <utils/Trace.h>
-#include "Camera.h"
+#include "camera.h"
#define CAMERA_SYNC_TIMEOUT 5000 // in msecs
@@ -646,4 +646,4 @@
.reserved = {0},
};
-} // namespace default_camera_hal
+} // namespace default_camera_hal
diff --git a/modules/camera/3_4/Camera.h b/modules/camera/3_4/camera.h
similarity index 97%
rename from modules/camera/3_4/Camera.h
rename to modules/camera/3_4/camera.h
index d4b7272..a3a5d92 100644
--- a/modules/camera/3_4/Camera.h
+++ b/modules/camera/3_4/camera.h
@@ -16,13 +16,13 @@
// Modified from hardware/libhardware/modules/camera/Camera.h
-#ifndef CAMERA_H_
-#define CAMERA_H_
+#ifndef DEFAULT_CAMERA_HAL_CAMERA_H_
+#define DEFAULT_CAMERA_HAL_CAMERA_H_
#include <hardware/hardware.h>
#include <hardware/camera3.h>
#include <utils/Mutex.h>
-#include "Stream.h"
+#include "stream.h"
namespace default_camera_hal {
// Camera represents a physical camera on a device.
@@ -133,6 +133,6 @@
// Most recent request settings seen, memoized to be reused
camera_metadata_t *mSettings;
};
-} // namespace default_camera_hal
+} // namespace default_camera_hal
-#endif // CAMERA_H_
+#endif // DEFAULT_CAMERA_HAL_CAMERA_H_
diff --git a/modules/camera/3_4/Common.h b/modules/camera/3_4/common.h
similarity index 94%
rename from modules/camera/3_4/Common.h
rename to modules/camera/3_4/common.h
index f1ef23a..e77c0b2 100644
--- a/modules/camera/3_4/Common.h
+++ b/modules/camera/3_4/common.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef ANDROID_DEVICE_CAMERA_COMMON_H
-#define ANDROID_DEVICE_CAMERA_COMMON_H
+#ifndef V4L2_CAMERA_HAL_COMMON_H_
+#define V4L2_CAMERA_HAL_COMMON_H_
// #define LOG_NDEBUG 0
#include <cutils/log.h>
@@ -58,4 +58,4 @@
void operator=(const TypeName&);
#endif
-#endif
+#endif // V4L2_CAMERA_HAL_COMMON_H_
diff --git a/modules/camera/3_4/Stream.cpp b/modules/camera/3_4/stream.cpp
similarity index 98%
rename from modules/camera/3_4/Stream.cpp
rename to modules/camera/3_4/stream.cpp
index 0d021ef..97d8634 100644
--- a/modules/camera/3_4/Stream.cpp
+++ b/modules/camera/3_4/stream.cpp
@@ -29,7 +29,7 @@
#define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL)
#include <utils/Trace.h>
-#include "Stream.h"
+#include "stream.h"
namespace default_camera_hal {
@@ -196,4 +196,4 @@
dprintf(fd, "Max Buffer Count: %" PRIu32 "\n", mMaxBuffers);
}
-} // namespace default_camera_hal
+} // namespace default_camera_hal
diff --git a/modules/camera/3_4/Stream.h b/modules/camera/3_4/stream.h
similarity index 95%
rename from modules/camera/3_4/Stream.h
rename to modules/camera/3_4/stream.h
index 1531b12..781f946 100644
--- a/modules/camera/3_4/Stream.h
+++ b/modules/camera/3_4/stream.h
@@ -16,8 +16,8 @@
// Modified from hardware/libhardware/modules/camera/Stream.h
-#ifndef STREAM_H_
-#define STREAM_H_
+#ifndef DEFAULT_CAMERA_HAL_STREAM_H_
+#define DEFAULT_CAMERA_HAL_STREAM_H_
#include <hardware/camera3.h>
#include <hardware/gralloc.h>
@@ -78,6 +78,6 @@
// Lock protecting the Stream object for modifications
android::Mutex mLock;
};
-} // namespace default_camera_hal
+} // namespace default_camera_hal
-#endif // STREAM_H_
+#endif // DEFAULT_CAMERA_HAL_STREAM_H_
diff --git a/modules/camera/3_4/StreamFormat.cpp b/modules/camera/3_4/stream_format.cpp
similarity index 97%
rename from modules/camera/3_4/StreamFormat.cpp
rename to modules/camera/3_4/stream_format.cpp
index ec1c1cd..43f4cae 100644
--- a/modules/camera/3_4/StreamFormat.cpp
+++ b/modules/camera/3_4/stream_format.cpp
@@ -14,12 +14,12 @@
* limitations under the License.
*/
-#include "StreamFormat.h"
+#include "stream_format.h"
#include <linux/videodev2.h>
-#include "Common.h"
-#include "Stream.h"
+#include "common.h"
+#include "stream.h"
namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/StreamFormat.h b/modules/camera/3_4/stream_format.h
similarity index 91%
rename from modules/camera/3_4/StreamFormat.h
rename to modules/camera/3_4/stream_format.h
index e434595..9358d3d 100644
--- a/modules/camera/3_4/StreamFormat.h
+++ b/modules/camera/3_4/stream_format.h
@@ -14,13 +14,13 @@
* limitations under the License.
*/
-#ifndef V4L2_STREAM_FORMAT_H_
-#define V4L2_STREAM_FORMAT_H_
+#ifndef V4L2_CAMERA_HAL_STREAM_FORMAT_H_
+#define V4L2_CAMERA_HAL_STREAM_FORMAT_H_
#include <linux/videodev2.h>
-#include "Common.h"
-#include "Stream.h"
+#include "common.h"
+#include "stream.h"
namespace v4l2_camera_hal {
@@ -65,4 +65,4 @@
} // namespace v4l2_camera_hal
-#endif // V4L2_STREAM_FORMAT_H_
+#endif // V4L2_CAMERA_HAL_STREAM_FORMAT_H_
diff --git a/modules/camera/3_4/V4L2Camera.cpp b/modules/camera/3_4/v4l2_camera.cpp
similarity index 99%
rename from modules/camera/3_4/V4L2Camera.cpp
rename to modules/camera/3_4/v4l2_camera.cpp
index 870cbcf..81cbf64 100644
--- a/modules/camera/3_4/V4L2Camera.cpp
+++ b/modules/camera/3_4/v4l2_camera.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "V4L2Camera.h"
+#include "v4l2_camera.h"
#include <fcntl.h>
#include <linux/videodev2.h>
@@ -27,9 +27,9 @@
#include <hardware/camera3.h>
#include <nativehelper/ScopedFd.h>
-#include "Common.h"
-#include "StreamFormat.h"
-#include "V4L2Gralloc.h"
+#include "common.h"
+#include "stream_format.h"
+#include "v4l2_gralloc.h"
#define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
@@ -1543,4 +1543,4 @@
return 0;
}
-} // namespace v4l2_camera_hal
+} // namespace v4l2_camera_hal
diff --git a/modules/camera/3_4/V4L2Camera.h b/modules/camera/3_4/v4l2_camera.h
similarity index 94%
rename from modules/camera/3_4/V4L2Camera.h
rename to modules/camera/3_4/v4l2_camera.h
index d890da2..2638993 100644
--- a/modules/camera/3_4/V4L2Camera.h
+++ b/modules/camera/3_4/v4l2_camera.h
@@ -16,8 +16,8 @@
// Loosely based on hardware/libhardware/modules/camera/ExampleCamera.h
-#ifndef V4L2_CAMERA_H
-#define V4L2_CAMERA_H
+#ifndef V4L2_CAMERA_HAL_V4L2_CAMERA_H_
+#define V4L2_CAMERA_HAL_V4L2_CAMERA_H_
#include <array>
#include <string>
@@ -25,11 +25,11 @@
#include <system/camera_metadata.h>
-#include "ArrayVector.h"
-#include "Camera.h"
-#include "Common.h"
-#include "V4L2Gralloc.h"
-#include "V4L2Wrapper.h"
+#include "array_vector.h"
+#include "camera.h"
+#include "common.h"
+#include "v4l2_gralloc.h"
+#include "v4l2_wrapper.h"
namespace v4l2_camera_hal {
// V4L2Camera is a specific V4L2-supported camera device. The Camera object
@@ -131,6 +131,6 @@
DISALLOW_COPY_AND_ASSIGN(V4L2Camera);
};
-} // namespace v4l2_camera_hal
+} // namespace v4l2_camera_hal
-#endif // V4L2_CAMERA_H
+#endif // V4L2_CAMERA_HAL_V4L2_CAMERA_H
diff --git a/modules/camera/3_4/V4L2CameraHAL.cpp b/modules/camera/3_4/v4l2_camera_hal.cpp
similarity index 98%
rename from modules/camera/3_4/V4L2CameraHAL.cpp
rename to modules/camera/3_4/v4l2_camera_hal.cpp
index 40797e9..7996da9 100644
--- a/modules/camera/3_4/V4L2CameraHAL.cpp
+++ b/modules/camera/3_4/v4l2_camera_hal.cpp
@@ -16,7 +16,7 @@
// Modified from hardware/libhardware/modules/camera/CameraHAL.cpp
-#include "V4L2CameraHAL.h"
+#include "v4l2_camera_hal.h"
#include <dirent.h>
#include <fcntl.h>
@@ -32,8 +32,8 @@
#include <android-base/parseint.h>
-#include "Common.h"
-#include "V4L2Camera.h"
+#include "common.h"
+#include "v4l2_camera.h"
/*
* This file serves as the entry point to the HAL. It is modified from the
diff --git a/modules/camera/3_4/V4L2CameraHAL.h b/modules/camera/3_4/v4l2_camera_hal.h
similarity index 91%
rename from modules/camera/3_4/V4L2CameraHAL.h
rename to modules/camera/3_4/v4l2_camera_hal.h
index 55d84c9..91983b0 100644
--- a/modules/camera/3_4/V4L2CameraHAL.h
+++ b/modules/camera/3_4/v4l2_camera_hal.h
@@ -16,16 +16,16 @@
// Modified from hardware/libhardware/modules/camera/CameraHAL.h
-#ifndef V4L2_CAMERA_HAL_H
-#define V4L2_CAMERA_HAL_H
+#ifndef V4L2_CAMERA_HAL_V4L2_CAMERA_HAL_H_
+#define V4L2_CAMERA_HAL_V4L2_CAMERA_HAL_H_
#include <vector>
#include <hardware/camera_common.h>
#include <hardware/hardware.h>
-#include "Camera.h"
-#include "Common.h"
+#include "camera.h"
+#include "common.h"
namespace v4l2_camera_hal {
/*
@@ -63,4 +63,4 @@
extern camera_module_t HAL_MODULE_INFO_SYM;
-#endif // V4L2_CAMERA_HAL_H
+#endif // V4L2_CAMERA_HAL_V4L2_CAMERA_HAL_H_
diff --git a/modules/camera/3_4/V4L2Gralloc.cpp b/modules/camera/3_4/v4l2_gralloc.cpp
similarity index 99%
rename from modules/camera/3_4/V4L2Gralloc.cpp
rename to modules/camera/3_4/v4l2_gralloc.cpp
index 111996e..bb708c9 100644
--- a/modules/camera/3_4/V4L2Gralloc.cpp
+++ b/modules/camera/3_4/v4l2_gralloc.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "V4L2Gralloc.h"
+#include "v4l2_gralloc.h"
#include <linux/videodev2.h>
@@ -24,7 +24,7 @@
#include <hardware/gralloc.h>
#include <system/graphics.h>
-#include "Common.h"
+#include "common.h"
namespace v4l2_camera_hal {
@@ -289,5 +289,4 @@
return 0;
}
-
-} // namespace default_camera_hal
+} // namespace default_camera_hal
diff --git a/modules/camera/3_4/V4L2Gralloc.h b/modules/camera/3_4/v4l2_gralloc.h
similarity index 93%
rename from modules/camera/3_4/V4L2Gralloc.h
rename to modules/camera/3_4/v4l2_gralloc.h
index ebec963..4a49b9b 100644
--- a/modules/camera/3_4/V4L2Gralloc.h
+++ b/modules/camera/3_4/v4l2_gralloc.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef V4L2_GRALLOC_H
-#define V4L2_GRALLOC_H
+#ifndef V4L2_CAMERA_HAL_V4L2_GRALLOC_H_
+#define V4L2_CAMERA_HAL_V4L2_GRALLOC_H_
#include <linux/videodev2.h>
@@ -65,6 +65,7 @@
// Map data pointer : BufferData about that buffer.
std::unordered_map<void*, const BufferData*> mBufferMap;
};
-} // namespace default_camera_hal
-#endif // CAMERA_GRALLOC_H_
+} // namespace default_camera_hal
+
+#endif // V4L2_CAMERA_HAL_V4L2_GRALLOC_H_
diff --git a/modules/camera/3_4/V4L2Wrapper.cpp b/modules/camera/3_4/v4l2_wrapper.cpp
similarity index 98%
rename from modules/camera/3_4/V4L2Wrapper.cpp
rename to modules/camera/3_4/v4l2_wrapper.cpp
index 16061bf..bce3200 100644
--- a/modules/camera/3_4/V4L2Wrapper.cpp
+++ b/modules/camera/3_4/v4l2_wrapper.cpp
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "V4L2Wrapper.h"
+#include "v4l2_wrapper.h"
#include <fcntl.h>
#include <linux/videodev2.h>
@@ -25,10 +25,10 @@
#include <nativehelper/ScopedFd.h>
-#include "Common.h"
-#include "Stream.h"
-#include "StreamFormat.h"
-#include "V4L2Gralloc.h"
+#include "common.h"
+#include "stream.h"
+#include "stream_format.h"
+#include "v4l2_gralloc.h"
namespace v4l2_camera_hal {
diff --git a/modules/camera/3_4/V4L2Wrapper.h b/modules/camera/3_4/v4l2_wrapper.h
similarity index 92%
rename from modules/camera/3_4/V4L2Wrapper.h
rename to modules/camera/3_4/v4l2_wrapper.h
index 1d42973..fd4ac34 100644
--- a/modules/camera/3_4/V4L2Wrapper.h
+++ b/modules/camera/3_4/v4l2_wrapper.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef V4L2_WRAPPER_H
-#define V4L2_WRAPPER_H
+#ifndef V4L2_CAMERA_HAL_V4L2_WRAPPER_H_
+#define V4L2_CAMERA_HAL_V4L2_WRAPPER_H_
#include <memory>
#include <mutex>
@@ -23,10 +23,10 @@
#include <nativehelper/ScopedFd.h>
-#include "Common.h"
-#include "Stream.h"
-#include "StreamFormat.h"
-#include "V4L2Gralloc.h"
+#include "common.h"
+#include "stream.h"
+#include "stream_format.h"
+#include "v4l2_gralloc.h"
namespace v4l2_camera_hal {
class V4L2Wrapper {
@@ -87,4 +87,4 @@
} // namespace v4l2_camera_hal
-#endif // V4L2_WRAPPER_H
+#endif // V4L2_CAMERA_HAL_V4L2_WRAPPER_H_