mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-06-30 13:14:16 -04:00
spa: libcamera: compile fully as C++
There was one file "libcamera.c" that was a C source file, which prevents the addition of C++ functions, includes, etc. to "libcamera.h". So compile that file as C++ as well.
This commit is contained in:
parent
d46361a1b9
commit
390a4ce432
6 changed files with 11 additions and 11 deletions
40
spa/plugins/libcamera/libcamera.cpp
Normal file
40
spa/plugins/libcamera/libcamera.cpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
/* Spa libcamera support */
|
||||
/* SPDX-FileCopyrightText: Copyright © 2020 collabora */
|
||||
/* SPDX-License-Identifier: MIT */
|
||||
|
||||
#include <spa/support/plugin.h>
|
||||
#include <spa/support/log.h>
|
||||
|
||||
#include "libcamera.hpp"
|
||||
|
||||
extern "C" {
|
||||
|
||||
SPA_LOG_TOPIC_DEFINE(libcamera_log_topic, "spa.libcamera");
|
||||
|
||||
SPA_LOG_TOPIC_ENUM_DEFINE_REGISTERED;
|
||||
|
||||
SPA_EXPORT
|
||||
int spa_handle_factory_enum(const struct spa_handle_factory **factory,
|
||||
uint32_t *index)
|
||||
{
|
||||
spa_return_val_if_fail(factory != NULL, -EINVAL);
|
||||
spa_return_val_if_fail(index != NULL, -EINVAL);
|
||||
|
||||
switch (*index) {
|
||||
case 0:
|
||||
*factory = &spa_libcamera_manager_factory;
|
||||
break;
|
||||
case 1:
|
||||
*factory = &spa_libcamera_device_factory;
|
||||
break;
|
||||
case 2:
|
||||
*factory = &spa_libcamera_source_factory;
|
||||
break;
|
||||
default:
|
||||
return 0;
|
||||
}
|
||||
(*index)++;
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue