android: Convert to pragma once

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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
This commit is contained in:
Kieran Bingham 2021-11-23 17:23:07 +00:00
parent b426b778c6
commit 0382fcb22b
17 changed files with 34 additions and 66 deletions

View file

@ -4,8 +4,8 @@
* *
* camera_buffer.h - Frame buffer handling interface definition * camera_buffer.h - Frame buffer handling interface definition
*/ */
#ifndef __ANDROID_CAMERA_BUFFER_H__
#define __ANDROID_CAMERA_BUFFER_H__ #pragma once
#include <hardware/camera3.h> #include <hardware/camera3.h>
@ -82,4 +82,3 @@ size_t CameraBuffer::jpegBufferSize(size_t maxJpegBufferSize) const \
{ \ { \
return _d()->jpegBufferSize(maxJpegBufferSize); \ return _d()->jpegBufferSize(maxJpegBufferSize); \
} }
#endif /* __ANDROID_CAMERA_BUFFER_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_capabilities.h - Camera static properties manager * camera_capabilities.h - Camera static properties manager
*/ */
#ifndef __ANDROID_CAMERA_CAPABILITIES_H__
#define __ANDROID_CAMERA_CAPABILITIES_H__ #pragma once
#include <map> #include <map>
#include <memory> #include <memory>
@ -84,5 +84,3 @@ private:
std::set<int32_t> availableRequestKeys_; std::set<int32_t> availableRequestKeys_;
std::set<int32_t> availableResultKeys_; std::set<int32_t> availableResultKeys_;
}; };
#endif /* __ANDROID_CAMERA_CAPABILITIES_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_device.h - libcamera Android Camera Device * camera_device.h - libcamera Android Camera Device
*/ */
#ifndef __ANDROID_CAMERA_DEVICE_H__
#define __ANDROID_CAMERA_DEVICE_H__ #pragma once
#include <map> #include <map>
#include <memory> #include <memory>
@ -130,5 +130,3 @@ private:
CameraMetadata lastSettings_; CameraMetadata lastSettings_;
}; };
#endif /* __ANDROID_CAMERA_DEVICE_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_hal_config.h - Camera HAL configuration file manager * 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 <map>
#include <string> #include <string>
@ -36,4 +36,3 @@ private:
int parseConfigurationFile(); int parseConfigurationFile();
}; };
#endif /* __ANDROID_CAMERA_HAL_CONFIG_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_hal_manager.h - libcamera Android Camera Manager * camera_hal_manager.h - libcamera Android Camera Manager
*/ */
#ifndef __ANDROID_CAMERA_MANAGER_H__
#define __ANDROID_CAMERA_MANAGER_H__ #pragma once
#include <map> #include <map>
#include <mutex> #include <mutex>
@ -69,5 +69,3 @@ private:
unsigned int numInternalCameras_; unsigned int numInternalCameras_;
unsigned int nextExternalCameraId_; unsigned int nextExternalCameraId_;
}; };
#endif /* __ANDROID_CAMERA_MANAGER_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_metadata.h - libcamera Android Camera Metadata Helper * camera_metadata.h - libcamera Android Camera Metadata Helper
*/ */
#ifndef __ANDROID_CAMERA_METADATA_H__
#define __ANDROID_CAMERA_METADATA_H__ #pragma once
#include <stdint.h> #include <stdint.h>
#include <vector> #include <vector>
@ -99,5 +99,3 @@ private:
bool valid_; bool valid_;
bool resized_; bool resized_;
}; };
#endif /* __ANDROID_CAMERA_METADATA_H__ */

View file

@ -4,12 +4,10 @@
* *
* camera_ops.h - Android Camera HAL Operations * camera_ops.h - Android Camera HAL Operations
*/ */
#ifndef __ANDROID_CAMERA_OPS_H__
#define __ANDROID_CAMERA_OPS_H__ #pragma once
#include <hardware/camera3.h> #include <hardware/camera3.h>
int hal_dev_close(hw_device_t *hw_device); int hal_dev_close(hw_device_t *hw_device);
extern camera3_device_ops hal_dev_ops; extern camera3_device_ops hal_dev_ops;
#endif /* __ANDROID_CAMERA_OPS_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_request.h - libcamera Android Camera Request Descriptor * camera_request.h - libcamera Android Camera Request Descriptor
*/ */
#ifndef __ANDROID_CAMERA_REQUEST_H__
#define __ANDROID_CAMERA_REQUEST_H__ #pragma once
#include <map> #include <map>
#include <memory> #include <memory>
@ -80,5 +80,3 @@ public:
private: private:
LIBCAMERA_DISABLE_COPY(Camera3RequestDescriptor) LIBCAMERA_DISABLE_COPY(Camera3RequestDescriptor)
}; };
#endif /* __ANDROID_CAMERA_REQUEST_H__ */

View file

@ -4,8 +4,8 @@
* *
* camera_stream.h - Camera HAL stream * camera_stream.h - Camera HAL stream
*/ */
#ifndef __ANDROID_CAMERA_STREAM_H__
#define __ANDROID_CAMERA_STREAM_H__ #pragma once
#include <condition_variable> #include <condition_variable>
#include <memory> #include <memory>
@ -179,5 +179,3 @@ private:
std::unique_ptr<PostProcessorWorker> worker_; std::unique_ptr<PostProcessorWorker> worker_;
}; };
#endif /* __ANDROID_CAMERA_STREAM__ */

View file

@ -4,8 +4,8 @@
* *
* camera_worker.h - Process capture requests on behalf of the Camera HAL * 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 <memory>
#include <stdint.h> #include <stdint.h>
@ -68,5 +68,3 @@ private:
Worker worker_; Worker worker_;
}; };
#endif /* __ANDROID_CAMERA_WORKER_H__ */

View file

@ -4,8 +4,8 @@
* *
* encoder.h - Image encoding interface * encoder.h - Image encoding interface
*/ */
#ifndef __ANDROID_JPEG_ENCODER_H__
#define __ANDROID_JPEG_ENCODER_H__ #pragma once
#include <libcamera/base/span.h> #include <libcamera/base/span.h>
@ -23,5 +23,3 @@ public:
libcamera::Span<const uint8_t> exifData, libcamera::Span<const uint8_t> exifData,
unsigned int quality) = 0; unsigned int quality) = 0;
}; };
#endif /* __ANDROID_JPEG_ENCODER_H__ */

View file

@ -4,8 +4,8 @@
* *
* encoder_libjpeg.h - JPEG encoding using libjpeg * encoder_libjpeg.h - JPEG encoding using libjpeg
*/ */
#ifndef __ANDROID_JPEG_ENCODER_LIBJPEG_H__
#define __ANDROID_JPEG_ENCODER_LIBJPEG_H__ #pragma once
#include "encoder.h" #include "encoder.h"
@ -43,5 +43,3 @@ private:
bool nv_; bool nv_;
bool nvSwap_; bool nvSwap_;
}; };
#endif /* __ANDROID_JPEG_ENCODER_LIBJPEG_H__ */

View file

@ -4,8 +4,8 @@
* *
* exif.h - EXIF tag creator using libexif * exif.h - EXIF tag creator using libexif
*/ */
#ifndef __ANDROID_JPEG_EXIF_H__
#define __ANDROID_JPEG_EXIF_H__ #pragma once
#include <chrono> #include <chrono>
#include <string> #include <string>
@ -107,5 +107,3 @@ private:
unsigned char *exifData_; unsigned char *exifData_;
unsigned int size_; unsigned int size_;
}; };
#endif /* __ANDROID_JPEG_EXIF_H__ */

View file

@ -4,8 +4,8 @@
* *
* post_processor_jpeg.h - JPEG Post Processor * 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 "../post_processor.h"
#include "encoder_libjpeg.h" #include "encoder_libjpeg.h"
@ -36,5 +36,3 @@ private:
EncoderLibJpeg thumbnailEncoder_; EncoderLibJpeg thumbnailEncoder_;
Thumbnailer thumbnailer_; Thumbnailer thumbnailer_;
}; };
#endif /* __ANDROID_POST_PROCESSOR_JPEG_H__ */

View file

@ -4,8 +4,8 @@
* *
* thumbnailer.h - Simple image thumbnailer * thumbnailer.h - Simple image thumbnailer
*/ */
#ifndef __ANDROID_JPEG_THUMBNAILER_H__
#define __ANDROID_JPEG_THUMBNAILER_H__ #pragma once
#include <libcamera/framebuffer.h> #include <libcamera/framebuffer.h>
#include <libcamera/geometry.h> #include <libcamera/geometry.h>
@ -30,5 +30,3 @@ private:
bool valid_; bool valid_;
}; };
#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */

View file

@ -4,8 +4,8 @@
* *
* post_processor.h - CameraStream Post Processing Interface * post_processor.h - CameraStream Post Processing Interface
*/ */
#ifndef __ANDROID_POST_PROCESSOR_H__
#define __ANDROID_POST_PROCESSOR_H__ #pragma once
#include <libcamera/base/signal.h> #include <libcamera/base/signal.h>
@ -31,5 +31,3 @@ public:
libcamera::Signal<Camera3RequestDescriptor::StreamBuffer *, Status> processComplete; libcamera::Signal<Camera3RequestDescriptor::StreamBuffer *, Status> processComplete;
}; };
#endif /* __ANDROID_POST_PROCESSOR_H__ */

View file

@ -4,8 +4,8 @@
* *
* post_processor_yuv.h - Post Processor using libyuv * 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" #include "../post_processor.h"
@ -33,5 +33,3 @@ private:
unsigned int sourceStride_[2] = {}; unsigned int sourceStride_[2] = {};
unsigned int destinationStride_[2] = {}; unsigned int destinationStride_[2] = {};
}; };
#endif /* __ANDROID_POST_PROCESSOR_YUV_H__ */