summaryrefslogtreecommitdiff
path: root/test/controls/control_info.cpp
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-25 17:51:06 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:38 +0100
commita1c5450be573ebcb1a5acc6453b5fcfdaa9593a4 (patch)
tree5377b161d97616930a1031dc01a6d3fdbd694d20 /test/controls/control_info.cpp
parent6cd505ac89a6ee41865a2ecb32ed5f344544295d (diff)
libcamera: camera: Remove the prepared state
With the FrameBuffer rework completed there is no reason to keep the camera prepared state around as buffer allocations are now decoupled from the camera state. Remove the camera state simplifying the API. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/controls/control_info.cpp')
0 files changed, 0 insertions, 0 deletions
pps">"test.h" using namespace std; using namespace libcamera; static EventDispatcher *dispatcher; static bool interrupt; class EventDispatcherTest : public Test { protected: static void sigAlarmHandler(int) { cout << "SIGALARM received" << endl; if (interrupt) dispatcher->interrupt(); } int init() { dispatcher = Thread::current()->eventDispatcher(); struct sigaction sa = {}; sa.sa_handler = &sigAlarmHandler; sigaction(SIGALRM, &sa, nullptr); return 0; } int run() { Timer timer; /* Event processing interruption by signal. */ std::chrono::steady_clock::time_point start = std::chrono::steady_clock::now(); timer.start(1000); struct itimerval itimer = {}; itimer.it_value.tv_usec = 500000; interrupt = false; setitimer(ITIMER_REAL, &itimer, nullptr); dispatcher->processEvents(); std::chrono::steady_clock::time_point stop = std::chrono::steady_clock::now(); std::chrono::steady_clock::duration duration = stop - start; int msecs = std::chrono::duration_cast<std::chrono::milliseconds>(duration).count(); if (abs(msecs - 1000) > 50) { cout << "Event processing restart test failed" << endl; return TestFail; } /* Event processing interruption. */ timer.start(1000); dispatcher->interrupt(); dispatcher->processEvents(); if (!timer.isRunning()) { cout << "Event processing immediate interruption failed" << endl; return TestFail; } timer.start(1000); itimer.it_value.tv_usec = 500000; interrupt = true; setitimer(ITIMER_REAL, &itimer, nullptr); dispatcher->processEvents(); if (!timer.isRunning()) { cout << "Event processing delayed interruption failed" << endl; return TestFail; } return TestPass; } void cleanup() { } }; TEST_REGISTER(EventDispatcherTest)