libcamera: Include header related to source file first
Include the header file corresponding to the source file in the very first position. This complies with the Google C++ coding style guideliens, and helps ensuring that the headers are self-contained. Three bugs are already caught by this change (missing includes or forward declarations) in device_enumerator.h, event_dispatcher_poll.h and pipeline_handler.h. Fix them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
0af0fb9ca9
commit
1ba441cae6
23 changed files with 45 additions and 22 deletions
|
@ -5,13 +5,13 @@
|
|||
* buffer.cpp - Buffer handling
|
||||
*/
|
||||
|
||||
#include <libcamera/buffer.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <libcamera/buffer.h>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
* camera.cpp - Camera device
|
||||
*/
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
|
||||
#include <iomanip>
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/request.h>
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
|
|
|
@ -5,8 +5,9 @@
|
|||
* camera_manager.h - Camera management
|
||||
*/
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/camera_manager.h>
|
||||
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/event_dispatcher.h>
|
||||
|
||||
#include "device_enumerator.h"
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
* camera_sensor.cpp - A camera sensor
|
||||
*/
|
||||
|
||||
#include "camera_sensor.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <float.h>
|
||||
#include <iomanip>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "camera_sensor.h"
|
||||
#include "formats.h"
|
||||
#include "v4l2_subdevice.h"
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* device_enumerator.cpp - Enumeration and matching
|
||||
*/
|
||||
|
||||
#include "device_enumerator.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <libudev.h>
|
||||
#include <string.h>
|
||||
|
@ -13,7 +15,6 @@
|
|||
|
||||
#include <libcamera/event_notifier.h>
|
||||
|
||||
#include "device_enumerator.h"
|
||||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "utils.h"
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* event_dispatcher_poll.cpp - Poll-based event dispatcher
|
||||
*/
|
||||
|
||||
#include "event_dispatcher_poll.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iomanip>
|
||||
#include <poll.h>
|
||||
|
@ -16,7 +18,6 @@
|
|||
#include <libcamera/event_notifier.h>
|
||||
#include <libcamera/timer.h>
|
||||
|
||||
#include "event_dispatcher_poll.h"
|
||||
#include "log.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
* event_notifier.cpp - File descriptor event notifier
|
||||
*/
|
||||
|
||||
#include <libcamera/event_notifier.h>
|
||||
|
||||
#include <libcamera/camera_manager.h>
|
||||
#include <libcamera/event_dispatcher.h>
|
||||
#include <libcamera/event_notifier.h>
|
||||
|
||||
/**
|
||||
* \file event_notifier.h
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* geometry.cpp - Geometry-related structures
|
||||
*/
|
||||
|
||||
#include <libcamera/geometry.h>
|
||||
|
||||
#include <sstream>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <libcamera/geometry.h>
|
||||
|
||||
/**
|
||||
* \file geometry.h
|
||||
* \brief Data structures related to geometric objects
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
|
||||
#include <linux/media.h>
|
||||
|
||||
struct udev;
|
||||
struct udev_monitor;
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class EventNotifier;
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
|
||||
struct pollfd;
|
||||
|
||||
namespace libcamera {
|
||||
|
||||
class EventNotifier;
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include <list>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* log.cpp - Logging infrastructure
|
||||
*/
|
||||
|
||||
#include "log.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
|
@ -15,7 +17,6 @@
|
|||
#include <string.h>
|
||||
#include <unordered_set>
|
||||
|
||||
#include "log.h"
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* media_device.cpp - Media device handler
|
||||
*/
|
||||
|
||||
#include "media_device.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <string.h>
|
||||
|
@ -17,7 +19,6 @@
|
|||
#include <linux/media.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
|
||||
/**
|
||||
* \file media_device.h
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* media_object.cpp - Media device objects: entities, pads and links
|
||||
*/
|
||||
|
||||
#include "media_object.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
@ -16,7 +18,6 @@
|
|||
|
||||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "media_object.h"
|
||||
|
||||
/**
|
||||
* \file media_object.h
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
*/
|
||||
|
||||
#include <libcamera/object.h>
|
||||
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,13 +5,14 @@
|
|||
* pipeline_handler.cpp - Pipeline handler infrastructure
|
||||
*/
|
||||
|
||||
#include "pipeline_handler.h"
|
||||
|
||||
#include <libcamera/buffer.h>
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/camera_manager.h>
|
||||
|
||||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "pipeline_handler.h"
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
* request.cpp - Capture request handling
|
||||
*/
|
||||
|
||||
#include <libcamera/request.h>
|
||||
|
||||
#include <map>
|
||||
|
||||
#include <libcamera/buffer.h>
|
||||
#include <libcamera/camera.h>
|
||||
#include <libcamera/request.h>
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
#include "log.h"
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* signal.cpp - Signal & slot implementation
|
||||
*/
|
||||
|
||||
#include <libcamera/signal.h>
|
||||
|
||||
/**
|
||||
* \file signal.h
|
||||
* \brief Signal & slot implementation
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* stream.cpp - Video stream for a Camera
|
||||
*/
|
||||
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
||||
#include <libcamera/stream.h>
|
||||
|
||||
/**
|
||||
* \file stream.h
|
||||
* \brief Video stream for a Camera
|
||||
|
|
|
@ -5,11 +5,12 @@
|
|||
* timer.cpp - Generic timer
|
||||
*/
|
||||
|
||||
#include <libcamera/timer.h>
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <libcamera/camera_manager.h>
|
||||
#include <libcamera/event_dispatcher.h>
|
||||
#include <libcamera/timer.h>
|
||||
|
||||
#include "log.h"
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
* utils.cpp - Miscellaneous utility functions
|
||||
*/
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <sys/auxv.h>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
/**
|
||||
* \file utils.h
|
||||
* \brief Miscellaneous utility functions
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* v4l2_device.cpp - V4L2 Device
|
||||
*/
|
||||
|
||||
#include "v4l2_device.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
@ -21,7 +23,6 @@
|
|||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "media_object.h"
|
||||
#include "v4l2_device.h"
|
||||
|
||||
/**
|
||||
* \file v4l2_device.h
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
* v4l2_subdevice.cpp - V4L2 Subdevice
|
||||
*/
|
||||
|
||||
#include "v4l2_subdevice.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <iomanip>
|
||||
#include <sstream>
|
||||
|
@ -19,7 +21,6 @@
|
|||
#include "log.h"
|
||||
#include "media_device.h"
|
||||
#include "media_object.h"
|
||||
#include "v4l2_subdevice.h"
|
||||
|
||||
/**
|
||||
* \file v4l2_subdevice.h
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue