diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-05 21:16:13 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-07 17:05:42 +0300 |
commit |
* Copyright (C) 2019, Google Inc.
*
* event_loop.h - cam - Event loop
*/
#ifndef __CAM_EVENT_LOOP_H__
#define __CAM_EVENT_LOOP_H__
#include <functional>
#include <list>
#include <mutex>
#include <event2/util.h>
struct event_base;
class EventLoop
{
public:
EventLoop();
~EventLoop();
static EventLoop *instance();
int exec();
void exit(int code = 0);
void callLater(const std::function<void()> &func);
private:
static EventLoop *instance_;
struct event_base *base_;
int exitCode_;
std::list<std::function<void()>> calls_;
std::mutex lock_;
static void dispatchCallback(evutil_socket_t fd, short flags,
void *param);
void dispatchCall();
};
test/stream/meson.build @@ -1,14 +1,14 @@ # SPDX-License-Identifier: CC0-1.0 stream_tests = [ - ['stream_colorspace', 'stream_colorspace.cpp'], - ['stream_formats', 'stream_formats.cpp'], + {'name': 'stream_colorspace', 'sources': ['stream_colorspace.cpp']}, + {'name': 'stream_formats', 'sources': ['stream_formats.cpp']}, ] foreach test : stream_tests - exe = executable(test[0], test[1], + exe = executable(test['name'], test['sources'], dependencies : libcamera_public, link_with : test_libraries, include_directories : test_includes_internal) - test(test[0], exe, suite: 'stream') + test(test['name'], exe, suite: 'stream') endforeach |