summaryrefslogtreecommitdiff
path: root/test/media_device
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-04-13 23:58:31 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-05-17 01:33:53 +0200
commit5868d73e77916812d60cb60ee3cade785f6492f8 (patch)
tree304a342be36bae9de07eb1506b6149a20e4b8e27 /test/media_device
parent12053cf8e6a98104b6c765e1ac8a34b8f7a02eed (diff)
libcamera: media_device: Open and close media device inside populate()
Remove the need for the caller to open and close the media device when populating the MediaDevice. This is done as an effort to make the usage of the MediaDevice less error prone and the interface stricter. The rework also revealed and fixes a potential memory leak in MediaDevice::populate() where resources would not be deleted if the second MEDIA_IOC_G_TOPOLOGY would fail. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'test/media_device')
-rw-r--r--test/media_device/media_device_print_test.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/test/media_device/media_device_print_test.cpp b/test/media_device/media_device_print_test.cpp
index 3eef9739..ceffd538 100644
--- a/test/media_device/media_device_print_test.cpp
+++ b/test/media_device/media_device_print_test.cpp
@@ -124,10 +124,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)
dev.close();
- ret = dev.open();
- if (ret)
- return ret;
-
ret = dev.populate();
if (ret)
return ret;
@@ -135,8 +131,6 @@ int MediaDevicePrintTest::testMediaDevice(const string deviceNode)
/* Print out the media graph. */
printMediaGraph(dev, cerr);
- dev.close();
-
return 0;
}