rocket-welder-sdk 1.0.5__tar.gz → 1.1.24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/PKG-INFO +19 -11
  2. rocket_welder_sdk-1.1.24/README.md +454 -0
  3. rocket_welder_sdk-1.1.24/pyproject.toml +138 -0
  4. rocket_welder_sdk-1.1.24/rocket_welder_sdk/__init__.py +56 -0
  5. rocket_welder_sdk-1.1.24/rocket_welder_sdk/bytes_size.py +234 -0
  6. rocket_welder_sdk-1.1.24/rocket_welder_sdk/connection_string.py +232 -0
  7. rocket_welder_sdk-1.1.24/rocket_welder_sdk/controllers.py +668 -0
  8. rocket_welder_sdk-1.1.24/rocket_welder_sdk/gst_metadata.py +411 -0
  9. rocket_welder_sdk-1.1.24/rocket_welder_sdk/py.typed +2 -0
  10. rocket_welder_sdk-1.1.24/rocket_welder_sdk/rocket_welder_client.py +167 -0
  11. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/rocket_welder_sdk.egg-info/PKG-INFO +19 -11
  12. rocket_welder_sdk-1.1.24/rocket_welder_sdk.egg-info/SOURCES.txt +27 -0
  13. rocket_welder_sdk-1.1.24/rocket_welder_sdk.egg-info/requires.txt +13 -0
  14. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/setup.py +16 -4
  15. rocket_welder_sdk-1.1.24/tests/test_bytes_size.py +169 -0
  16. rocket_welder_sdk-1.1.24/tests/test_connection_string.py +169 -0
  17. rocket_welder_sdk-1.1.24/tests/test_controllers.py +315 -0
  18. rocket_welder_sdk-1.1.24/tests/test_external_controls_serialization.py +129 -0
  19. rocket_welder_sdk-1.1.24/tests/test_external_controls_serialization_v2.py +125 -0
  20. rocket_welder_sdk-1.1.24/tests/test_gst_metadata.py +205 -0
  21. rocket_welder_sdk-1.1.24/tests/test_icons.py +96 -0
  22. rocket_welder_sdk-1.1.24/tests/test_ui_controls.py +365 -0
  23. rocket_welder_sdk-1.1.24/tests/test_ui_service_happy_path.py +422 -0
  24. rocket_welder_sdk-1.0.5/rocket_welder_sdk/__init__.py +0 -8
  25. rocket_welder_sdk-1.0.5/rocket_welder_sdk/client.py +0 -183
  26. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/__init__.py +0 -20
  27. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/client.py +0 -326
  28. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/connection_string.py +0 -190
  29. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/exceptions.py +0 -23
  30. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/gst_caps.py +0 -224
  31. rocket_welder_sdk-1.0.5/rocket_welder_sdk/rocket_welder_sdk/gst_metadata.py +0 -43
  32. rocket_welder_sdk-1.0.5/rocket_welder_sdk.egg-info/SOURCES.txt +0 -17
  33. rocket_welder_sdk-1.0.5/rocket_welder_sdk.egg-info/requires.txt +0 -8
  34. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/MANIFEST.in +0 -0
  35. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/logo.png +0 -0
  36. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/rocket_welder_sdk.egg-info/dependency_links.txt +0 -0
  37. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/rocket_welder_sdk.egg-info/top_level.txt +0 -0
  38. {rocket_welder_sdk-1.0.5 → rocket_welder_sdk-1.1.24}/setup.cfg +0 -0
@@ -1,37 +1,45 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: rocket-welder-sdk
3
- Version: 1.0.5
4
- Summary: High-performance video streaming client library for RocketWelder services
3
+ Version: 1.1.24
4
+ Summary: High-performance video streaming SDK for RocketWelder services using ZeroBuffer IPC
5
5
  Home-page: https://github.com/modelingevolution/rocket-welder-sdk
6
6
  Author: ModelingEvolution
7
- Classifier: Development Status :: 3 - Alpha
7
+ Author-email: ModelingEvolution <info@modelingevolution.com>
8
+ Maintainer-email: ModelingEvolution <info@modelingevolution.com>
9
+ License: MIT
10
+ Project-URL: Homepage, https://github.com/modelingevolution/rocket-welder-sdk
11
+ Project-URL: Repository, https://github.com/modelingevolution/rocket-welder-sdk.git
12
+ Project-URL: Issues, https://github.com/modelingevolution/rocket-welder-sdk/issues
13
+ Keywords: video,streaming,gstreamer,ipc,shared-memory,zerobuffer,computer-vision
14
+ Classifier: Development Status :: 4 - Beta
8
15
  Classifier: Intended Audience :: Developers
9
16
  Classifier: Topic :: Multimedia :: Video
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
10
18
  Classifier: License :: OSI Approved :: MIT License
11
19
  Classifier: Programming Language :: Python :: 3
12
- Classifier: Programming Language :: Python :: 3.8
13
20
  Classifier: Programming Language :: Python :: 3.9
14
21
  Classifier: Programming Language :: Python :: 3.10
15
22
  Classifier: Programming Language :: Python :: 3.11
16
23
  Classifier: Programming Language :: Python :: 3.12
24
+ Classifier: Operating System :: OS Independent
25
+ Classifier: Typing :: Typed
17
26
  Requires-Python: >=3.8
18
27
  Description-Content-Type: text/markdown
19
28
  Requires-Dist: numpy>=1.20.0
20
29
  Requires-Dist: opencv-python>=4.5.0
21
- Requires-Dist: zerobuffer-ipc>=1.1.0
30
+ Requires-Dist: zerobuffer-ipc>=1.1.17
31
+ Requires-Dist: pydantic>=2.5.0
22
32
  Provides-Extra: dev
23
33
  Requires-Dist: pytest>=7.0; extra == "dev"
34
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
35
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
24
36
  Requires-Dist: black>=22.0; extra == "dev"
25
37
  Requires-Dist: mypy>=1.0; extra == "dev"
38
+ Requires-Dist: ruff>=0.1.0; extra == "dev"
39
+ Requires-Dist: types-setuptools; extra == "dev"
26
40
  Dynamic: author
27
- Dynamic: classifier
28
- Dynamic: description
29
- Dynamic: description-content-type
30
41
  Dynamic: home-page
31
- Dynamic: provides-extra
32
- Dynamic: requires-dist
33
42
  Dynamic: requires-python
34
- Dynamic: summary
35
43
 
36
44
  # Rocket Welder SDK
37
45
 
@@ -0,0 +1,454 @@
1
+ # Rocket Welder SDK
2
+
3
+ [![NuGet](https://img.shields.io/nuget/v/RocketWelder.SDK.svg)](https://www.nuget.org/packages/RocketWelder.SDK/)
4
+ [![PyPI](https://img.shields.io/pypi/v/rocket-welder-sdk.svg)](https://pypi.org/project/rocket-welder-sdk/)
5
+ [![vcpkg](https://img.shields.io/badge/vcpkg-rocket--welder--sdk-blue)](https://github.com/modelingevolution/rocket-welder-sdk-vcpkg-registry)
6
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
+
8
+ Multi-language client libraries for interacting with RocketWelder video streaming services.
9
+
10
+ ## Overview
11
+
12
+ The Rocket Welder SDK provides high-performance video streaming capabilities for containerized applications. It offers native client libraries in C++, C#, and Python, enabling seamless integration with RocketWelder video streaming pipelines.
13
+
14
+ ## Features
15
+
16
+ - **High Performance**: Optimized for minimal latency and maximum throughput
17
+ - **Multi-Language Support**: Native libraries for C++, C#, and Python
18
+ - **Protocol Flexibility**: Support for multiple streaming protocols via connection strings
19
+ - **Container-Ready**: Designed for Docker/Kubernetes deployments
20
+ - **Simple Integration**: Easy-to-use API with minimal configuration
21
+
22
+ ## Client Libraries
23
+
24
+ | Language | Package Manager | Package Name |
25
+ |----------|----------------|--------------|
26
+ | C++ | vcpkg | rocket-welder-sdk |
27
+ | C# | NuGet | RocketWelder.SDK |
28
+ | Python | pip | rocket-welder-sdk |
29
+
30
+ ## Connection String Format
31
+
32
+ The SDK uses URI-style connection strings to specify data sources and protocols:
33
+
34
+ ```
35
+ protocol://[host[:port]]/[path][?param1=value1&param2=value2]
36
+ ```
37
+
38
+ ### Supported Protocols
39
+
40
+ #### Shared Memory (High-Performance Local)
41
+ ```
42
+ shm://<buffer_name>
43
+ shm://<buffer_name>?buffer_size=10MB&metadata_size=1024KB
44
+ shm://<buffer_name>?mode=duplex&buffer_size=10MB
45
+ ```
46
+
47
+ **Optional Parameters:**
48
+ - `mode`: Communication mode (`duplex` for bidirectional/mutable, `oneway` for one-way communication; default: `duplex`)
49
+ - `buffer_size`: Size of the data buffer (default: 20MB, supports units: B, KB, MB, GB)
50
+ - `metadata_size`: Size of the metadata buffer (default: 4KB, supports units: B, KB, MB)
51
+
52
+ #### MJPEG over HTTP
53
+ ```
54
+ mjpeg+http://192.168.1.100:8080
55
+ mjpeg+http://camera.local:8080
56
+ ```
57
+
58
+ #### MJPEG over TCP
59
+ ```
60
+ mjpeg+tcp://192.168.1.100:5000
61
+ mjpeg+tcp://camera.local:5000
62
+ ```
63
+
64
+ ### Environment Variable
65
+
66
+ When deployed in a Rocket Welder container, the connection string is provided via:
67
+ ```bash
68
+ CONNECTION_STRING=shm://camera_feed?buffer_size=20MB&metadata_size=4KB
69
+ ```
70
+
71
+ ## Installation
72
+
73
+ ### C++ with vcpkg
74
+
75
+ Configure the custom registry in your `vcpkg-configuration.json`:
76
+ ```json
77
+ {
78
+ "registries": [
79
+ {
80
+ "kind": "git",
81
+ "repository": "https://github.com/modelingevolution/rocket-welder-sdk-vcpkg-registry",
82
+ "baseline": "YOUR_BASELINE_HERE",
83
+ "packages": ["rocket-welder-sdk"]
84
+ }
85
+ ]
86
+ }
87
+ ```
88
+
89
+ Then install:
90
+ ```bash
91
+ # Install via vcpkg
92
+ vcpkg install rocket-welder-sdk
93
+
94
+ # Or integrate with CMake
95
+ find_package(rocket-welder-sdk CONFIG REQUIRED)
96
+ target_link_libraries(your_app PRIVATE rocket-welder-sdk::rocket-welder-sdk)
97
+ ```
98
+
99
+ ### C# with NuGet
100
+
101
+ [![NuGet Downloads](https://img.shields.io/nuget/dt/RocketWelder.SDK.svg)](https://www.nuget.org/packages/RocketWelder.SDK/)
102
+
103
+ ```bash
104
+ # Package Manager Console
105
+ Install-Package RocketWelder.SDK
106
+
107
+ # .NET CLI
108
+ dotnet add package RocketWelder.SDK
109
+
110
+ # PackageReference in .csproj
111
+ <PackageReference Include="RocketWelder.SDK" Version="1.0.*" />
112
+ ```
113
+
114
+ ### Python with pip
115
+
116
+ [![PyPI Downloads](https://img.shields.io/pypi/dm/rocket-welder-sdk.svg)](https://pypi.org/project/rocket-welder-sdk/)
117
+
118
+ ```bash
119
+ # Install from PyPI
120
+ pip install rocket-welder-sdk
121
+
122
+ # Install with optional dependencies
123
+ pip install rocket-welder-sdk[opencv] # Includes OpenCV
124
+ pip install rocket-welder-sdk[all] # All optional dependencies
125
+
126
+ # Install specific version
127
+ pip install rocket-welder-sdk==1.0.0
128
+ ```
129
+
130
+ ## Quick Start
131
+
132
+ ### C++ Quick Start
133
+ ```cpp
134
+ #include <rocket_welder/client.hpp>
135
+
136
+ auto client = rocket_welder::Client::from_connection_string("shm://my-buffer");
137
+ client.on_frame([](cv::Mat& frame) {
138
+ // Process frame
139
+ });
140
+ client.start();
141
+ ```
142
+
143
+ ### C# Quick Start
144
+ ```csharp
145
+ using RocketWelder.SDK;
146
+
147
+ var client = RocketWelderClient.FromConnectionString("shm://my-buffer");
148
+ client.Start(frame => {
149
+ // Process frame
150
+ });
151
+ ```
152
+
153
+ ### Python Quick Start
154
+ ```python
155
+ import rocket_welder_sdk as rw
156
+
157
+ client = rw.Client.from_connection_string("shm://my-buffer")
158
+
159
+ @client.on_frame
160
+ def process(frame):
161
+ # Process frame
162
+ pass
163
+
164
+ client.start()
165
+ ```
166
+
167
+ ## Usage Examples
168
+
169
+ ### C++
170
+
171
+ ```cpp
172
+ #include <rocket_welder/client.hpp>
173
+ #include <opencv2/opencv.hpp>
174
+
175
+ int main(int argc, char* argv[]) {
176
+ // Best practice: use from() which:
177
+ // 1. Checks environment variable (CONNECTION_STRING)
178
+ // 2. Overrides with command line args if provided
179
+ auto client = rocket_welder::Client::from(argc, argv);
180
+
181
+ // Or specify connection string directly
182
+ auto client = rocket_welder::Client::from_connection_string(
183
+ "shm://camera_feed?buffer_size=20MB&metadata_size=4KB"
184
+ );
185
+
186
+ // Process frames as OpenCV Mat (mutable by default)
187
+ client.on_frame([](cv::Mat& frame) {
188
+ // Add overlay text - zero copy!
189
+ cv::putText(frame, "Processing", cv::Point(10, 30),
190
+ cv::FONT_HERSHEY_SIMPLEX, 1.0, cv::Scalar(0, 255, 0), 2);
191
+
192
+ // Add timestamp overlay
193
+ auto now = std::chrono::system_clock::now();
194
+ auto time_t = std::chrono::system_clock::to_time_t(now);
195
+ cv::putText(frame, std::ctime(&time_t), cv::Point(10, 60),
196
+ cv::FONT_HERSHEY_SIMPLEX, 0.5, cv::Scalar(255, 255, 255), 1);
197
+ });
198
+
199
+ client.start();
200
+ return 0;
201
+ }
202
+ ```
203
+
204
+ ### C#
205
+
206
+ ```csharp
207
+ using RocketWelder.SDK;
208
+ using OpenCvSharp;
209
+
210
+ class Program
211
+ {
212
+ static void Main(string[] args)
213
+ {
214
+ // Best practice: use From() which:
215
+ // 1. Checks environment variable (CONNECTION_STRING)
216
+ // 2. Overrides with command line args if provided
217
+ var client = RocketWelderClient.From(args);
218
+
219
+ // Or specify connection string directly
220
+ var client = RocketWelderClient.FromConnectionString(
221
+ "shm://camera_feed?buffer_size=20MB&metadata_size=4KB"
222
+ );
223
+
224
+ int frameCount = 0;
225
+
226
+ // Process frames as OpenCV Mat
227
+ client.Start((Mat frame) =>
228
+ {
229
+ // Add overlay text
230
+ Cv2.PutText(frame, "Processing", new Point(10, 30),
231
+ HersheyFonts.HersheySimplex, 1.0, new Scalar(0, 255, 0), 2);
232
+
233
+ // Add frame counter overlay
234
+ Cv2.PutText(frame, $"Frame: {frameCount++}", new Point(10, 60),
235
+ HersheyFonts.HersheySimplex, 0.5, new Scalar(255, 255, 255), 1);
236
+ });
237
+ }
238
+ }
239
+ ```
240
+
241
+ ### Python
242
+
243
+ ```python
244
+ import rocket_welder_sdk as rw
245
+ import cv2
246
+ import sys
247
+
248
+ # Best practice: use from_args() which:
249
+ # 1. Checks environment variable (CONNECTION_STRING)
250
+ # 2. Overrides with command line args if provided
251
+ client = rw.Client.from_args(sys.argv)
252
+
253
+ # Or specify connection string directly
254
+ client = rw.Client.from_connection_string("shm://camera_feed?buffer_size=20MB&metadata_size=4KB")
255
+
256
+ # Process frames as numpy arrays (OpenCV compatible)
257
+ @client.on_frame
258
+ def process_frame(frame: np.ndarray):
259
+ # Add overlay text - zero copy!
260
+ cv2.putText(frame, "Processing", (10, 30),
261
+ cv2.FONT_HERSHEY_SIMPLEX, 1.0, (0, 255, 0), 2)
262
+
263
+ # Add timestamp overlay
264
+ from datetime import datetime
265
+ timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
266
+ cv2.putText(frame, timestamp, (10, 60),
267
+ cv2.FONT_HERSHEY_SIMPLEX, 0.5, (255, 255, 255), 1)
268
+
269
+ client.start()
270
+
271
+ # Or use iterator pattern
272
+ for frame in client.frames():
273
+ # Each frame is a numpy array
274
+ print(f"Received frame: {frame.shape}")
275
+ ```
276
+
277
+ ## Docker Integration
278
+
279
+ ### C++ Dockerfile
280
+
281
+ ```dockerfile
282
+ FROM ubuntu:22.04 AS builder
283
+
284
+ # Install build tools and OpenCV
285
+ RUN apt-get update && apt-get install -y \
286
+ build-essential \
287
+ cmake \
288
+ libopencv-dev
289
+
290
+ # Install Rocket Welder SDK via vcpkg
291
+ RUN vcpkg install rocket-welder-sdk
292
+
293
+ # Build your application
294
+ WORKDIR /app
295
+ COPY . .
296
+ RUN cmake . && make
297
+
298
+ FROM ubuntu:22.04
299
+ RUN apt-get update && apt-get install -y libopencv-dev
300
+ COPY --from=builder /app/my_app /usr/local/bin/
301
+ CMD ["my_app"]
302
+ ```
303
+
304
+ ### C# Dockerfile
305
+
306
+ ```dockerfile
307
+ FROM mcr.microsoft.com/dotnet/sdk:8.0 AS builder
308
+
309
+ WORKDIR /app
310
+ COPY *.csproj ./
311
+ RUN dotnet restore
312
+
313
+ COPY . ./
314
+ RUN dotnet publish -c Release -o out
315
+
316
+ FROM mcr.microsoft.com/dotnet/runtime:8.0
317
+ WORKDIR /app
318
+ COPY --from=builder /app/out .
319
+ CMD ["dotnet", "MyApp.dll"]
320
+ ```
321
+
322
+ ### Python Dockerfile
323
+
324
+ ```dockerfile
325
+ FROM python:3.11-slim
326
+
327
+ # Install OpenCV and other dependencies
328
+ RUN apt-get update && apt-get install -y \
329
+ python3-opencv \
330
+ && rm -rf /var/lib/apt/lists/*
331
+
332
+ # Install Rocket Welder SDK and ML frameworks
333
+ RUN pip install --no-cache-dir \
334
+ rocket-welder-sdk \
335
+ numpy \
336
+ ultralytics # Example: YOLO
337
+
338
+ WORKDIR /app
339
+ COPY . .
340
+
341
+ CMD ["python", "app.py"]
342
+ ```
343
+
344
+ ## Protocol Details
345
+
346
+ ### Shared Memory Protocol (shm://)
347
+
348
+ High-performance local data transfer between processes:
349
+
350
+ - **Performance**: Minimal latency, maximum throughput
351
+ - **Use Cases**: Local processing, multi-container applications on same host
352
+
353
+ ### MJPEG over HTTP (mjpeg+http://)
354
+
355
+ Motion JPEG streaming over HTTP:
356
+
357
+ - **Performance**: Good balance of quality and bandwidth
358
+ - **Advantages**: Wide compatibility, firewall-friendly, browser support
359
+ - **Use Cases**: Network streaming, web applications, remote monitoring
360
+
361
+ ### MJPEG over TCP (mjpeg+tcp://)
362
+
363
+ Motion JPEG streaming over raw TCP socket:
364
+
365
+ - **Performance**: Lower latency than HTTP, less protocol overhead
366
+ - **Advantages**: Direct socket connection, minimal overhead, suitable for local networks
367
+ - **Use Cases**: Low-latency streaming, embedded systems, industrial applications
368
+
369
+ ## Building from Source
370
+
371
+ ### Prerequisites
372
+
373
+ - CMake 3.20+
374
+ - C++20 compiler
375
+ - Python 3.8+ (for Python bindings)
376
+ - .NET 6.0+ SDK (for C# bindings)
377
+ - OpenCV 4.0+ (optional, for image processing)
378
+
379
+ ### Build Instructions
380
+
381
+ ```bash
382
+ git clone https://github.com/modelingevolution/rocket-welder-sdk.git
383
+ cd rocket-welder-sdk
384
+
385
+ # Build all libraries
386
+ mkdir build && cd build
387
+ cmake ..
388
+ make -j$(nproc)
389
+
390
+ # Run tests
391
+ ctest
392
+
393
+ # Install
394
+ sudo make install
395
+ ```
396
+
397
+ ## API Reference
398
+
399
+ Detailed API documentation for each language:
400
+
401
+ - [C++ API Reference](docs/cpp-api.md)
402
+ - [C# API Reference](docs/csharp-api.md)
403
+ - [Python API Reference](docs/python-api.md)
404
+
405
+ ## Examples
406
+
407
+ See the [examples](examples/) directory for complete working examples:
408
+
409
+ - [Simple Frame Reader](examples/simple-reader/)
410
+ - [Frame Processor](examples/frame-processor/)
411
+ - [Multi-Stream Handler](examples/multi-stream/)
412
+ - [Performance Benchmark](examples/benchmark/)
413
+
414
+ ## Contributing
415
+
416
+ Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
417
+
418
+ ## License
419
+
420
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
421
+
422
+ ## Support
423
+
424
+ - **Issues**: [GitHub Issues](https://github.com/modelingevolution/rocket-welder-sdk/issues)
425
+ - **Discussions**: [GitHub Discussions](https://github.com/modelingevolution/rocket-welder-sdk/discussions)
426
+ - **Documentation**: [https://docs.rocket-welder.io](https://docs.rocket-welder.io)
427
+
428
+ ## Technical Details
429
+
430
+ ### GStreamer Integration
431
+
432
+ The SDK integrates with GStreamer pipelines through specialized elements:
433
+ - **zerosink**: Simple sink element for writing video frames
434
+ - **zerobuffer**: Processing element with bidirectional communication using DuplexChannel
435
+
436
+ ### Zero-Copy Buffer Technology
437
+
438
+ For shared memory protocol, the SDK uses:
439
+ - **C++**: Zero-Copy-Buffer (via vcpkg) - Returns cv::Mat with zero-copy access
440
+ - **C#**: ZeroBuffer (via NuGet) - Returns OpenCvSharp.Mat with zero-copy access
441
+ - **Python**: zero-buffer (via pip) - Returns numpy arrays compatible with OpenCV
442
+
443
+ The SDK leverages DuplexChannel for bidirectional communication, enabling:
444
+ - Zero-copy frame access as OpenCV Mat objects
445
+ - In-place frame processing without memory allocation
446
+ - Direct memory mapping between producer and consumer
447
+ - Efficient metadata passing alongside frame data
448
+
449
+ This technology enables direct memory access without data duplication, providing maximum performance for local processing scenarios.
450
+
451
+ ## Acknowledgments
452
+
453
+ - GStreamer Project for the multimedia framework
454
+ - ZeroBuffer contributors for the zero-copy buffer implementation
@@ -0,0 +1,138 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "rocket-welder-sdk"
7
+ dynamic = ["version"]
8
+ description = "High-performance video streaming SDK for RocketWelder services using ZeroBuffer IPC"
9
+ readme = "README.md"
10
+ requires-python = ">=3.9"
11
+ license = {text = "MIT"}
12
+ authors = [
13
+ {name = "ModelingEvolution", email = "info@modelingevolution.com"}
14
+ ]
15
+ maintainers = [
16
+ {name = "ModelingEvolution", email = "info@modelingevolution.com"}
17
+ ]
18
+ keywords = ["video", "streaming", "gstreamer", "ipc", "shared-memory", "zerobuffer", "computer-vision"]
19
+ classifiers = [
20
+ "Development Status :: 4 - Beta",
21
+ "Intended Audience :: Developers",
22
+ "Topic :: Multimedia :: Video",
23
+ "Topic :: Software Development :: Libraries :: Python Modules",
24
+ "License :: OSI Approved :: MIT License",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3.9",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Operating System :: OS Independent",
31
+ "Typing :: Typed",
32
+ ]
33
+
34
+ dependencies = [
35
+ "numpy>=1.20.0",
36
+ "opencv-python>=4.5.0",
37
+ "zerobuffer-ipc>=1.1.17",
38
+ "pydantic>=2.5.0",
39
+ ]
40
+
41
+ [project.optional-dependencies]
42
+ dev = [
43
+ "pytest>=7.0",
44
+ "pytest-cov>=4.0",
45
+ "pytest-asyncio>=0.21",
46
+ "black>=22.0",
47
+ "mypy>=1.0",
48
+ "ruff>=0.1.0",
49
+ "types-setuptools",
50
+ ]
51
+
52
+ [project.urls]
53
+ Homepage = "https://github.com/modelingevolution/rocket-welder-sdk"
54
+ Repository = "https://github.com/modelingevolution/rocket-welder-sdk.git"
55
+ Issues = "https://github.com/modelingevolution/rocket-welder-sdk/issues"
56
+
57
+ [tool.setuptools.packages.find]
58
+ where = ["."]
59
+ include = ["rocket_welder_sdk*"]
60
+
61
+ [tool.setuptools.package-data]
62
+ rocket_welder_sdk = ["py.typed"]
63
+
64
+ [tool.mypy]
65
+ python_version = "3.9"
66
+ strict = true
67
+ warn_return_any = true
68
+ warn_unused_configs = true
69
+ no_implicit_reexport = true
70
+ namespace_packages = true
71
+ show_error_codes = true
72
+ show_column_numbers = true
73
+ pretty = true
74
+
75
+ [[tool.mypy.overrides]]
76
+ module = [
77
+ "cv2",
78
+ "cv2.*",
79
+ "zerobuffer",
80
+ "zerobuffer.*",
81
+ ]
82
+ ignore_missing_imports = true
83
+
84
+ [tool.black]
85
+ line-length = 100
86
+ target-version = ['py39', 'py310', 'py311', 'py312']
87
+ include = '\.pyi?$'
88
+
89
+ [tool.ruff]
90
+ line-length = 100
91
+ target-version = "py39"
92
+
93
+ [tool.ruff.lint]
94
+ select = [
95
+ "E", # pycodestyle errors
96
+ "W", # pycodestyle warnings
97
+ "F", # pyflakes
98
+ "I", # isort
99
+ "B", # flake8-bugbear
100
+ "C4", # flake8-comprehensions
101
+ "UP", # pyupgrade
102
+ "N", # pep8-naming
103
+ "TID", # flake8-tidy-imports
104
+ "SIM", # flake8-simplify
105
+ "TCH", # flake8-type-checking
106
+ "RUF", # Ruff-specific rules
107
+ ]
108
+ ignore = [
109
+ "E501", # line too long (handled by black)
110
+ "B008", # do not perform function calls in argument defaults
111
+ "C901", # too complex
112
+ ]
113
+
114
+ [tool.ruff.lint.per-file-ignores]
115
+ "__init__.py" = ["F401"] # imported but unused
116
+ "tests/*" = ["S101"] # use of assert
117
+
118
+ [tool.pytest.ini_options]
119
+ minversion = "7.0"
120
+ testpaths = ["tests"]
121
+ pythonpath = ["."]
122
+ addopts = [
123
+ "--strict-markers",
124
+ "--tb=short",
125
+ "--cov=rocket_welder_sdk",
126
+ "--cov-report=term-missing",
127
+ "--cov-report=html",
128
+ "--cov-fail-under=55", # Adjusted due to ZeroBuffer dependency for controllers
129
+ ]
130
+
131
+ [tool.coverage.run]
132
+ source = ["rocket_welder_sdk"]
133
+ branch = true
134
+
135
+ [tool.coverage.report]
136
+ precision = 2
137
+ show_missing = true
138
+ skip_covered = false
@@ -0,0 +1,56 @@
1
+ """
2
+ RocketWelder SDK - Enterprise-grade Python client library for video streaming services.
3
+
4
+ High-performance video streaming using shared memory (ZeroBuffer) for zero-copy operations.
5
+ """
6
+
7
+ import logging
8
+ import os
9
+
10
+ from .bytes_size import BytesSize
11
+ from .connection_string import ConnectionMode, ConnectionString, Protocol
12
+ from .controllers import DuplexShmController, IController, OneWayShmController
13
+ from .gst_metadata import GstCaps, GstMetadata
14
+ from .rocket_welder_client import RocketWelderClient
15
+
16
+ # Alias for backward compatibility
17
+ Client = RocketWelderClient
18
+
19
+ __version__ = "1.1.0"
20
+
21
+ # Configure library logger with NullHandler (best practice for libraries)
22
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
23
+
24
+ # Configure from environment variable and propagate to zerobuffer
25
+ _log_level = os.environ.get("ROCKET_WELDER_LOG_LEVEL")
26
+ if _log_level:
27
+ try:
28
+ # Set rocket-welder-sdk log level
29
+ logging.getLogger(__name__).setLevel(getattr(logging, _log_level.upper()))
30
+
31
+ # Propagate to zerobuffer if not already set
32
+ if not os.environ.get("ZEROBUFFER_LOG_LEVEL"):
33
+ os.environ["ZEROBUFFER_LOG_LEVEL"] = _log_level
34
+ # Also configure zerobuffer logger if already imported
35
+ zerobuffer_logger = logging.getLogger("zerobuffer")
36
+ zerobuffer_logger.setLevel(getattr(logging, _log_level.upper()))
37
+ except AttributeError:
38
+ pass # Invalid log level, ignore
39
+
40
+ __all__ = [
41
+ # Core types
42
+ "BytesSize",
43
+ "Client", # Backward compatibility
44
+ "ConnectionMode",
45
+ "ConnectionString",
46
+ "DuplexShmController",
47
+ # GStreamer metadata
48
+ "GstCaps",
49
+ "GstMetadata",
50
+ # Controllers
51
+ "IController",
52
+ "OneWayShmController",
53
+ "Protocol",
54
+ # Main client
55
+ "RocketWelderClient",
56
+ ]