Skip to content

Commit 948227d

Browse files
committed
Release Python SDK 0.21.2
1 parent 290cf8a commit 948227d

File tree

4 files changed

+32
-21
lines changed

4 files changed

+32
-21
lines changed

demos/python/sdk_wireless_camera_control/docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ All notable changes to this project will be documented in this file.
99
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
1010
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
1111

12+
0.21.2 (June-26-2025)
13+
---------------------
14+
* Fix wireless webcam demo
15+
1216
0.21.1 (June-26-2025)
1317
---------------------
1418
* Add user streaming guidance to webcam demo

demos/python/sdk_wireless_camera_control/open_gopro/demos/gui/webcam.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import argparse
77
import asyncio
8+
import logging
89
import sys
910

1011
from returns.pipeline import is_successful
@@ -15,7 +16,7 @@
1516
from open_gopro.gopro_base import GoProBase
1617
from open_gopro.models.streaming import StreamType, WebcamProtocol, WebcamStreamOptions
1718
from open_gopro.util import add_cli_args_and_parse
18-
from open_gopro.util.logger import setup_logging
19+
from open_gopro.util.logger import set_stream_logging_level, setup_logging
1920
from open_gopro.util.util import ainput
2021

2122
console = Console()
@@ -40,6 +41,7 @@ async def main(args: argparse.Namespace) -> int:
4041
if wireless_interfaces
4142
else WiredGoPro(args.identifier)
4243
) as gopro:
44+
set_stream_logging_level(logging.WARNING)
4345
with console.status(f"Starting webcam stream with protocol {args.protocol}..."):
4446
if not is_successful(
4547
result := (
@@ -52,23 +54,23 @@ async def main(args: argparse.Namespace) -> int:
5254
console.print(f"[red]Failed to start webcam stream: {result.failure()}")
5355
return 1
5456

55-
url = gopro.streaming.url if args.protocol == WebcamProtocol.RTSP else "udp://@:8554"
56-
console.print(f"Preview stream started. It can be viewed in VLC at [yellow]{url}")
57-
console.print(
58-
"Press Enter to view the preview stream using Python CV2. Once started, it won't be viewable in VLC."
59-
)
60-
await ainput("")
61-
62-
with console.status("Displaying the preview stream..."):
63-
assert gopro.streaming.url
64-
BufferlessVideoCapture(
65-
source=gopro.streaming.url,
66-
protocol=BufferlessVideoCapture.Protocol(args.protocol.name),
67-
printer=console.print,
68-
).display_blocking()
69-
70-
with console.status("Stopping preview stream..."):
71-
await gopro.streaming.stop_active_stream()
57+
url = gopro.streaming.url if args.protocol == WebcamProtocol.RTSP else "udp://@:8554"
58+
console.print(f"Preview stream started. It can be viewed in VLC at [yellow]{url}")
59+
console.print(
60+
"Press Enter to view the preview stream using Python CV2. Once started, it won't be viewable in VLC."
61+
)
62+
await ainput("")
63+
64+
with console.status("Displaying the preview stream..."):
65+
assert gopro.streaming.url
66+
BufferlessVideoCapture(
67+
source=gopro.streaming.url,
68+
protocol=BufferlessVideoCapture.Protocol(args.protocol.name),
69+
printer=console.print,
70+
).display_blocking()
71+
72+
with console.status("Stopping preview stream..."):
73+
await gopro.streaming.stop_active_stream()
7274
return 0
7375

7476
except Exception as e: # pylint: disable = broad-except

demos/python/sdk_wireless_camera_control/open_gopro/features/streaming/stream_feature.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import logging
99

10-
from returns.result import ResultE
10+
from returns.result import Failure, ResultE, Success
1111

1212
from open_gopro.domain.exceptions import GoProError
1313
from open_gopro.features.base_feature import BaseFeature
@@ -113,7 +113,12 @@ async def start_stream(
113113

114114
self._current = controller
115115
logger.info(f"Starting {stream_type.name.title()} stream")
116-
return await self._current.start(options)
116+
match (result := await self._current.start(options)):
117+
case Success():
118+
logger.info("Stream started successfully.")
119+
case Failure():
120+
logger.error(f"Stream failed to start: {result.failure()}")
121+
return result
117122

118123
async def stop_active_stream(self) -> ResultE[None]:
119124
"""Stop the currently active stream.

demos/python/sdk_wireless_camera_control/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "open_gopro"
3-
version = "0.21.1"
3+
version = "0.21.2"
44
description = "Open GoPro API and Examples"
55
authors = ["Tim Camise <[email protected]>"]
66
readme = "README.md"

0 commit comments

Comments
 (0)