Skip to content

Commit

Permalink
Removed unnecessary return and updated the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fernando79513 committed Sep 18, 2024
1 parent 1cf61c5 commit 87f88ab
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions providers/base/bin/camera_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,10 @@ def _capture_image_gstreamer(self, filename, width, height, pixelformat):
# Add a timeout of 90 seconds to capture the image
self.timeout = self.GLib.timeout_add_seconds(90, self._on_timeout)

# Start the main loop
# Start the main loop. If the loop finishes successfully, we will
# remove the timeout. If the timeout is reached, we will stop the
# pipeline calling the _on_timeout method and stop both the gstreamer
# pipeline and the GLib main loop.
self.main_loop = self.GLib.MainLoop()
try:
self.main_loop.run()
Expand All @@ -565,7 +568,6 @@ def _capture_image_gstreamer(self, filename, width, height, pixelformat):
# iteration.
if self.timeout:
self.GLib.source_remove(self.timeout)
return 0

def _display_image(self, filename, width, height):
"""
Expand Down Expand Up @@ -712,17 +714,17 @@ def _get_supported_pixel_formats(self, device, maxformats=5):

def _get_supported_formats(self, device):
"""
Query the camera for supported format info for a given pixel_format.
Data is returned in a list of dictionaries with supported pixel
formats as the following example shows:
format_info['pixelformat'] = "YUYV"
format_info['description'] = "(YUV 4:2:2 (YUYV))"
format_info['resolutions'] = [[width, height], [640, 480], [1280, 720]]
If we are unable to gather any information from the driver, then we
return YUYV and 640x480 which seems to be a safe default.
Per the v4l2 spec the ioctl used here is experimental
but seems to be well supported.
Query the camera for supported format info for a given pixel_format.
Data is returned in a list of dictionaries with supported pixel
formats as the following example shows:
format_info['pixelformat'] = "YUYV"
format_info['description'] = "(YUV 4:2:2 (YUYV))"
format_info['resolutions'] = [[width, height], [640, 480], [1280, 720]]
If we are unable to gather any information from the driver, then we
return YUYV and 640x480 which seems to be a safe default.
Per the v4l2 spec the ioctl used here is experimental
ç but seems to be well supported.
"""
supported_formats_info = self._get_supported_pixel_formats(device)

Expand Down

0 comments on commit 87f88ab

Please sign in to comment.