Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc fixes #1012

Merged
merged 2 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion picamera2/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"BGGR16_PISP_COMP1", "GBRG16_PISP_COMP1", "GRBG16_PISP_COMP1", "RGGB16_PISP_COMP1",
"SBGGR16", "SGBRG16", "SGRBG16", "SRGGB16", }

MONO_FORMATS = {"R8", "R10", "R12", "R8_CSI2P", "R10_CSI2P", "R12_CSI2P"}
MONO_FORMATS = {"R8", "R10", "R12", "R16", "R8_CSI2P", "R10_CSI2P", "R12_CSI2P"}

ALL_FORMATS = YUV_FORMATS | RGB_FORMATS | BAYER_FORMATS | MONO_FORMATS

Expand Down
5 changes: 3 additions & 2 deletions picamera2/picamera2.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ def __init__(self, camera_num=0, verbose_console=None, tuning=None, allocator=No
os.environ.pop("LIBCAMERA_RPI_TUNING_FILE", None) # Use default tuning
self.notifyme_r, self.notifyme_w = os.pipe2(os.O_NONBLOCK)
self.notifymeread = os.fdopen(self.notifyme_r, 'rb')
# Set these before trying to open the camera in case that fails (shutting stuff down may check them).
self._preview = None
self.is_open = False
# Get the real libcamera internal number.
camera_num = self.global_camera_info()[camera_num]['Num']
self._cm.add(camera_num, self)
Expand Down Expand Up @@ -279,9 +282,7 @@ def camera_manager(self):

def _reset_flags(self) -> None:
self.camera = None
self.is_open = False
self.camera_ctrl_info = {}
self._preview = None
self.camera_config = None
self.libcamera_config = None
self.streams = None
Expand Down
Loading