@@ -4,8 +4,8 @@
*
* camera_buffer.h - Frame buffer handling interface definition
*/
-#ifndef __ANDROID_CAMERA_BUFFER_H__
-#define __ANDROID_CAMERA_BUFFER_H__
+
+#pragma once
#include <hardware/camera3.h>
@@ -82,4 +82,3 @@ size_t CameraBuffer::jpegBufferSize(size_t maxJpegBufferSize) const \
{ \
return _d()->jpegBufferSize(maxJpegBufferSize); \
}
-#endif /* __ANDROID_CAMERA_BUFFER_H__ */
@@ -4,8 +4,8 @@
*
* camera_capabilities.h - Camera static properties manager
*/
-#ifndef __ANDROID_CAMERA_CAPABILITIES_H__
-#define __ANDROID_CAMERA_CAPABILITIES_H__
+
+#pragma once
#include <map>
#include <memory>
@@ -84,5 +84,3 @@ private:
std::set<int32_t> availableRequestKeys_;
std::set<int32_t> availableResultKeys_;
};
-
-#endif /* __ANDROID_CAMERA_CAPABILITIES_H__ */
@@ -4,8 +4,8 @@
*
* camera_device.h - libcamera Android Camera Device
*/
-#ifndef __ANDROID_CAMERA_DEVICE_H__
-#define __ANDROID_CAMERA_DEVICE_H__
+
+#pragma once
#include <map>
#include <memory>
@@ -130,5 +130,3 @@ private:
CameraMetadata lastSettings_;
};
-
-#endif /* __ANDROID_CAMERA_DEVICE_H__ */
@@ -4,8 +4,8 @@
*
* camera_hal_config.h - Camera HAL configuration file manager
*/
-#ifndef __ANDROID_CAMERA_HAL_CONFIG_H__
-#define __ANDROID_CAMERA_HAL_CONFIG_H__
+
+#pragma once
#include <map>
#include <string>
@@ -36,4 +36,3 @@ private:
int parseConfigurationFile();
};
-#endif /* __ANDROID_CAMERA_HAL_CONFIG_H__ */
@@ -4,8 +4,8 @@
*
* camera_hal_manager.h - libcamera Android Camera Manager
*/
-#ifndef __ANDROID_CAMERA_MANAGER_H__
-#define __ANDROID_CAMERA_MANAGER_H__
+
+#pragma once
#include <map>
#include <mutex>
@@ -69,5 +69,3 @@ private:
unsigned int numInternalCameras_;
unsigned int nextExternalCameraId_;
};
-
-#endif /* __ANDROID_CAMERA_MANAGER_H__ */
@@ -4,8 +4,8 @@
*
* camera_metadata.h - libcamera Android Camera Metadata Helper
*/
-#ifndef __ANDROID_CAMERA_METADATA_H__
-#define __ANDROID_CAMERA_METADATA_H__
+
+#pragma once
#include <stdint.h>
#include <vector>
@@ -99,5 +99,3 @@ private:
bool valid_;
bool resized_;
};
-
-#endif /* __ANDROID_CAMERA_METADATA_H__ */
@@ -4,12 +4,10 @@
*
* camera_ops.h - Android Camera HAL Operations
*/
-#ifndef __ANDROID_CAMERA_OPS_H__
-#define __ANDROID_CAMERA_OPS_H__
+
+#pragma once
#include <hardware/camera3.h>
int hal_dev_close(hw_device_t *hw_device);
extern camera3_device_ops hal_dev_ops;
-
-#endif /* __ANDROID_CAMERA_OPS_H__ */
@@ -4,8 +4,8 @@
*
* camera_request.h - libcamera Android Camera Request Descriptor
*/
-#ifndef __ANDROID_CAMERA_REQUEST_H__
-#define __ANDROID_CAMERA_REQUEST_H__
+
+#pragma once
#include <map>
#include <memory>
@@ -80,5 +80,3 @@ public:
private:
LIBCAMERA_DISABLE_COPY(Camera3RequestDescriptor)
};
-
-#endif /* __ANDROID_CAMERA_REQUEST_H__ */
@@ -4,8 +4,8 @@
*
* camera_stream.h - Camera HAL stream
*/
-#ifndef __ANDROID_CAMERA_STREAM_H__
-#define __ANDROID_CAMERA_STREAM_H__
+
+#pragma once
#include <condition_variable>
#include <memory>
@@ -179,5 +179,3 @@ private:
std::unique_ptr<PostProcessorWorker> worker_;
};
-
-#endif /* __ANDROID_CAMERA_STREAM__ */
@@ -4,8 +4,8 @@
*
* camera_worker.h - Process capture requests on behalf of the Camera HAL
*/
-#ifndef __ANDROID_CAMERA_WORKER_H__
-#define __ANDROID_CAMERA_WORKER_H__
+
+#pragma once
#include <memory>
#include <stdint.h>
@@ -68,5 +68,3 @@ private:
Worker worker_;
};
-
-#endif /* __ANDROID_CAMERA_WORKER_H__ */
@@ -4,8 +4,8 @@
*
* encoder.h - Image encoding interface
*/
-#ifndef __ANDROID_JPEG_ENCODER_H__
-#define __ANDROID_JPEG_ENCODER_H__
+
+#pragma once
#include <libcamera/base/span.h>
@@ -23,5 +23,3 @@ public:
libcamera::Span<const uint8_t> exifData,
unsigned int quality) = 0;
};
-
-#endif /* __ANDROID_JPEG_ENCODER_H__ */
@@ -4,8 +4,8 @@
*
* encoder_libjpeg.h - JPEG encoding using libjpeg
*/
-#ifndef __ANDROID_JPEG_ENCODER_LIBJPEG_H__
-#define __ANDROID_JPEG_ENCODER_LIBJPEG_H__
+
+#pragma once
#include "encoder.h"
@@ -43,5 +43,3 @@ private:
bool nv_;
bool nvSwap_;
};
-
-#endif /* __ANDROID_JPEG_ENCODER_LIBJPEG_H__ */
@@ -4,8 +4,8 @@
*
* exif.h - EXIF tag creator using libexif
*/
-#ifndef __ANDROID_JPEG_EXIF_H__
-#define __ANDROID_JPEG_EXIF_H__
+
+#pragma once
#include <chrono>
#include <string>
@@ -107,5 +107,3 @@ private:
unsigned char *exifData_;
unsigned int size_;
};
-
-#endif /* __ANDROID_JPEG_EXIF_H__ */
@@ -4,8 +4,8 @@
*
* post_processor_jpeg.h - JPEG Post Processor
*/
-#ifndef __ANDROID_POST_PROCESSOR_JPEG_H__
-#define __ANDROID_POST_PROCESSOR_JPEG_H__
+
+#pragma once
#include "../post_processor.h"
#include "encoder_libjpeg.h"
@@ -36,5 +36,3 @@ private:
EncoderLibJpeg thumbnailEncoder_;
Thumbnailer thumbnailer_;
};
-
-#endif /* __ANDROID_POST_PROCESSOR_JPEG_H__ */
@@ -4,8 +4,8 @@
*
* thumbnailer.h - Simple image thumbnailer
*/
-#ifndef __ANDROID_JPEG_THUMBNAILER_H__
-#define __ANDROID_JPEG_THUMBNAILER_H__
+
+#pragma once
#include <libcamera/framebuffer.h>
#include <libcamera/geometry.h>
@@ -30,5 +30,3 @@ private:
bool valid_;
};
-
-#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */
@@ -4,8 +4,8 @@
*
* post_processor.h - CameraStream Post Processing Interface
*/
-#ifndef __ANDROID_POST_PROCESSOR_H__
-#define __ANDROID_POST_PROCESSOR_H__
+
+#pragma once
#include <libcamera/base/signal.h>
@@ -31,5 +31,3 @@ public:
libcamera::Signal<Camera3RequestDescriptor::StreamBuffer *, Status> processComplete;
};
-
-#endif /* __ANDROID_POST_PROCESSOR_H__ */
@@ -4,8 +4,8 @@
*
* post_processor_yuv.h - Post Processor using libyuv
*/
-#ifndef __ANDROID_POST_PROCESSOR_YUV_H__
-#define __ANDROID_POST_PROCESSOR_YUV_H__
+
+#pragma once
#include "../post_processor.h"
@@ -33,5 +33,3 @@ private:
unsigned int sourceStride_[2] = {};
unsigned int destinationStride_[2] = {};
};
-
-#endif /* __ANDROID_POST_PROCESSOR_YUV_H__ */
Remove the verbose #ifndef/#define/#endif pattern for maintaining header idempotency, and replace it with a simple #pragma once. This simplifies the headers, and prevents redundant changes when header files get moved. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- src/android/camera_buffer.h | 5 ++--- src/android/camera_capabilities.h | 6 ++---- src/android/camera_device.h | 6 ++---- src/android/camera_hal_config.h | 5 ++--- src/android/camera_hal_manager.h | 6 ++---- src/android/camera_metadata.h | 6 ++---- src/android/camera_ops.h | 6 ++---- src/android/camera_request.h | 6 ++---- src/android/camera_stream.h | 6 ++---- src/android/camera_worker.h | 6 ++---- src/android/jpeg/encoder.h | 6 ++---- src/android/jpeg/encoder_libjpeg.h | 6 ++---- src/android/jpeg/exif.h | 6 ++---- src/android/jpeg/post_processor_jpeg.h | 6 ++---- src/android/jpeg/thumbnailer.h | 6 ++---- src/android/post_processor.h | 6 ++---- src/android/yuv/post_processor_yuv.h | 6 ++---- 17 files changed, 34 insertions(+), 66 deletions(-)