diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-01-07 15:51:53 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-01-08 13:14:29 +0000 |
commit | eda3cfa1e3b8c6ad0558ea03e96fefbfef029c05 (patch) | |
tree | e4b7f39be4bd5d1462410bb81896656993b1746c /src | |
parent | 5af15d1931de3f931b37930c5fa254a4ff92a7c5 (diff) |
libcamera: media_object: Rename major/minor functions
The system libraries define macro's for major/minor through
<sys/types.h> on some versions of GCC/GLibc.
To prevent namespace collisions with these macros, rename our major and
minor device node accessors.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/device_enumerator.cpp | 4 | ||||
-rw-r--r-- | src/libcamera/include/media_object.h | 4 | ||||
-rw-r--r-- | src/libcamera/media_object.cpp | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/libcamera/device_enumerator.cpp b/src/libcamera/device_enumerator.cpp index 7ad1c501..c088f3e5 100644 --- a/src/libcamera/device_enumerator.cpp +++ b/src/libcamera/device_enumerator.cpp @@ -208,10 +208,10 @@ int DeviceEnumerator::addDevice(const std::string &devnode) /* Associate entities to device node paths. */ for (MediaEntity *entity : media->entities()) { - if (entity->major() == 0 && entity->minor() == 0) + if (entity->deviceMajor() == 0 && entity->deviceMinor() == 0) continue; - std::string devnode = lookupDevnode(entity->major(), entity->minor()); + std::string devnode = lookupDevnode(entity->deviceMajor(), entity->deviceMinor()); if (devnode.empty()) return -EINVAL; diff --git a/src/libcamera/include/media_object.h b/src/libcamera/include/media_object.h index 950a3328..04b9a890 100644 --- a/src/libcamera/include/media_object.h +++ b/src/libcamera/include/media_object.h @@ -80,8 +80,8 @@ class MediaEntity : public MediaObject { public: const std::string &name() const { return name_; } - unsigned int major() const { return major_; } - unsigned int minor() const { return minor_; } + unsigned int deviceMajor() const { return major_; } + unsigned int deviceMinor() const { return minor_; } const std::vector<MediaPad *> &pads() const { return pads_; } diff --git a/src/libcamera/media_object.cpp b/src/libcamera/media_object.cpp index 581e1c08..06a8d642 100644 --- a/src/libcamera/media_object.cpp +++ b/src/libcamera/media_object.cpp @@ -212,14 +212,14 @@ void MediaPad::addLink(MediaLink *link) */ /** - * \fn MediaEntity::major() + * \fn MediaEntity::deviceMajor() * \brief Retrieve the major number of the interface associated with the entity * \return The interface major number, or 0 if the entity isn't associated with * an interface */ /** - * \fn MediaEntity::minor() + * \fn MediaEntity::deviceMinor() * \brief Retrieve the minor number of the interface associated with the entity * \return The interface minor number, or 0 if the entity isn't associated with * an interface |