summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt
ModeNameSize
-rwxr-xr-xctt.py31244logplain
-rw-r--r--ctt_alsc.py10172logplain
-rw-r--r--ctt_awb.py13271logplain
-rw-r--r--ctt_ccm.py6680logplain
-rw-r--r--ctt_config_example.json210logplain
-rw-r--r--ctt_geq.py6297logplain
-rw-r--r--ctt_image_load.py14070logplain
-rw-r--r--ctt_lux.py1925logplain
-rw-r--r--ctt_macbeth_locator.py26321logplain
-rw-r--r--ctt_noise.py3662logplain
-rw-r--r--ctt_pretty_print_json.py3082logplain
-rw-r--r--ctt_ransac.py2327logplain
-rw-r--r--ctt_ref.pgm9641logplain
-rw-r--r--ctt_tools.py3980logplain
class MediaDeviceLinkTest : public MediaDeviceTest { int init() { int ret = MediaDeviceTest::init(); if (ret) return ret; if (!media_->acquire()) { cerr << "Unable to acquire media device " << media_->deviceNode() << endl; return TestFail; } return TestPass; } int run() { /* * First of all disable all links in the media graph to * ensure we start from a known state. */ if (media_->disableLinks()) { cerr << "Failed to disable all links in the media graph"; return TestFail; } /* * Test if link can be consistently retrieved through the * different functions the media device offers. */ string linkName("'Debayer A':[1] -> 'Scaler':[0]'"); MediaLink *link = media_->link("Debayer A", 1, "Scaler", 0); if (!link) { cerr << "Unable to find link: " << linkName << " using lookup by name" << endl; return TestFail; } MediaEntity *source = media_->getEntityByName("Debayer A"); if (!source) { cerr << "Unable to find entity: 'Debayer A'" << endl; return TestFail; } MediaEntity *sink = media_->getEntityByName("Scaler"); if (!sink) { cerr << "Unable to find entity: 'Scaler'" << endl; return TestFail; } MediaLink *link2 = media_->link(source, 1, sink, 0); if (!link2) { cerr << "Unable to find link: " << linkName << " using lookup by entity" << endl; return TestFail; } if (link != link2) { cerr << "Link lookup by name and by entity don't match" << endl; return TestFail; } link2 = media_->link(source->getPadByIndex(1), sink->getPadByIndex(0)); if (!link2) { cerr << "Unable to find link: " << linkName << " using lookup by pad" << endl; return TestFail; } if (link != link2) { cerr << "Link lookup by name and by pad don't match" << endl; return TestFail; } /* After reset the link shall not be enabled. */ if (link->flags() & MEDIA_LNK_FL_ENABLED) { cerr << "Link " << linkName << " should not be enabled after a device reset" << endl; return TestFail; } /* Enable the link and test if enabling was successful. */ if (link->setEnabled(true)) { cerr << "Failed to enable link: " << linkName << endl; return TestFail; } if (!(link->flags() & MEDIA_LNK_FL_ENABLED)) { cerr << "Link " << linkName << " was enabled but it is reported as disabled" << endl; return TestFail; } /* Disable the link and test if disabling was successful. */ if (link->setEnabled(false)) { cerr << "Failed to disable link: " << linkName << endl; return TestFail; } if (link->flags() & MEDIA_LNK_FL_ENABLED) { cerr << "Link " << linkName << " was disabled but it is reported as enabled" << endl; return TestFail; } /* Try to get a non existing link. */ linkName = "'Sensor A':[1] -> 'Scaler':[0]"; link = media_->link("Sensor A", 1, "Scaler", 0); if (link) {