|
ascii-chat 0.6.0
Real-time terminal-based video chat with ASCII art conversion
|
📹 Webcam video capture and transmission to server More...
Files | |
| file | capture.c |
| 📹 Client webcam capture: dedicated capture thread with frame rate limiting and network transmission | |
| file | capture.h |
| ascii-chat Client Media Capture Management Interface | |
Functions | |
| __attribute__ ((unused)) | |
| Webcam capture thread handle. | |
| int | capture_init () |
| Initialize capture subsystem. | |
| int | capture_start_thread () |
| Start capture thread. | |
| void | capture_stop_thread () |
| Stop capture thread. | |
| bool | capture_thread_exited () |
| Check if capture thread has exited. | |
| void | capture_cleanup () |
| Cleanup capture subsystem. | |
📹 Webcam video capture and transmission to server
The media capture subsystem manages webcam video capture, frame compression, and transmission to the server. Supports platform-specific webcam backends and test pattern mode for testing without hardware.
Implementation: src/client/capture.c, src/client/capture.h
Webcam Backends:
Snapshot mode (--snapshot, --snapshot-delay <seconds>):
--snapshot: Capture single frame and exit--snapshot-delay N: Capture for N seconds then exitTest pattern mode (--test-pattern):
| __attribute__ | ( | (unused) | ) |
#include <capture.c>
Webcam capture thread handle.
Thread handle for the background thread that captures video frames from the webcam device. Created during connection establishment, joined during shutdown.
Definition at line 125 of file capture.c.
| void capture_cleanup | ( | ) |
#include <capture.c>
Cleanup capture subsystem.
Cleanup capture subsystem
Stops capture thread and cleans up webcam resources. Called during client shutdown.
Definition at line 526 of file capture.c.
References capture_stop_thread(), and webcam_cleanup().
Referenced by client_crypto_handshake().
| int capture_init | ( | ) |
#include <capture.c>
Initialize capture subsystem.
Initialize capture subsystem
Sets up webcam device and prepares capture system for operation. Must be called once during client initialization.
Definition at line 428 of file capture.c.
References ERROR_WEBCAM, GET_OPTION, SET_ERRNO, and webcam_init().
| int capture_start_thread | ( | ) |
#include <capture.c>
Start capture thread.
Start capture thread
Creates and starts the webcam capture thread. Also sends stream start notification to server.
Definition at line 449 of file capture.c.
References ASCIICHAT_OK, ERROR_THREAD, g_client_worker_pool, LOG_ERRNO_IF_SET, log_info, log_warn, SET_ERRNO, STREAM_TYPE_VIDEO, THREAD_IS_CREATED, thread_pool_spawn(), and threaded_send_stream_start_packet().
Referenced by protocol_start_connection().
| void capture_stop_thread | ( | ) |
#include <capture.c>
Stop capture thread.
Stop capture thread
Gracefully stops the capture thread and cleans up resources. Safe to call multiple times.
Definition at line 481 of file capture.c.
References log_warn, platform_sleep_usec(), THREAD_IS_CREATED, and webcam_flush().
Referenced by capture_cleanup(), and protocol_stop_connection().
| bool capture_thread_exited | ( | ) |