mirror of
https://github.com/ossrs/srs.git
synced 2025-11-24 03:44:02 +08:00
78 lines
3.0 KiB
Plaintext
78 lines
3.0 KiB
Plaintext
# Augment Guidelines for SRS Repository
|
|
|
|
project:
|
|
name: "SRS (Simple Realtime Server)"
|
|
description: "A C++ streaming media server supporting RTMP, WebRTC, WHIP, WHEP, SRT, HLS, and HTTP-FLV"
|
|
type: "media-server"
|
|
|
|
architecture:
|
|
overview: |
|
|
Core C++ streaming server with protocol implementations and media processing capabilities.
|
|
Uses State Threads (ST) for high-performance coroutine-based networking.
|
|
|
|
threading_model: |
|
|
Single-threaded, coroutine/goroutine-based application architecture:
|
|
- No traditional multi-threading issues (no thread switching, async race conditions)
|
|
- Uses coroutines/goroutines that cooperatively yield control
|
|
- Context switching occurs during async I/O operations
|
|
- Different context switch problems compared to multi-threaded applications:
|
|
* Coroutine state must be preserved across yields by async I/O operations
|
|
* Shared state can be modified between context switches
|
|
* Timing-dependent bugs related to when coroutines yield
|
|
|
|
key_directories:
|
|
- path: "trunk/src/"
|
|
description: "Main source code directory"
|
|
- path: "trunk/src/main/"
|
|
description: "Entry points including srs_main_server.cpp"
|
|
- path: "trunk/src/core/"
|
|
description: "Core platform abstractions and common definitions"
|
|
- path: "trunk/src/kernel/"
|
|
description: "Low-level codec implementations (AAC, H.264, FLV, MP4, RTC, etc.)"
|
|
- path: "trunk/src/protocol/"
|
|
description: "Protocol implementations (RTMP, HTTP, RTC, SRT, etc.)"
|
|
- path: "trunk/src/app/"
|
|
description: "High-level application logic and server components"
|
|
|
|
key_files:
|
|
- path: "trunk/src/main/srs_main_server.cpp"
|
|
description: "Main entry point and server initialization"
|
|
- path: "trunk/src/app/srs_app_server.hpp"
|
|
description: "Core server class definition"
|
|
- path: "trunk/src/core/srs_core.hpp"
|
|
description: "Core definitions and project metadata"
|
|
- path: "trunk/src/core/srs_core_autofree.hpp"
|
|
description: "Smart pointer definitions for memory management"
|
|
|
|
code_patterns:
|
|
memory_management:
|
|
- pattern: "srs_freep"
|
|
description: "Custom macro for freeing pointers"
|
|
- pattern: "srs_freepa"
|
|
description: "Custom macro for freeing arrays"
|
|
|
|
error_handling:
|
|
- pattern: "srs_error_t"
|
|
description: "Custom error handling system"
|
|
|
|
conditional_compilation:
|
|
- pattern: "#ifdef SRS_VALGRIND"
|
|
description: "Valgrind support"
|
|
|
|
key_components:
|
|
- name: "SrsServer"
|
|
description: "Main server class of live stream for RTMP/HTTP-FLV/HLS/DASH and HTTP-API"
|
|
- name: "SrsLiveSource"
|
|
description: "Central management of live stream sources for RTMP/HTTP-FLV/HLS/DASH"
|
|
|
|
build:
|
|
command: "cd trunk && make -j"
|
|
description: "Build the SRS server using parallel make in the trunk directory"
|
|
working_directory: "trunk"
|
|
|
|
run-utests:
|
|
command: "cd trunk && make utest -j && ./objs/srs_utest"
|
|
description: "Run the unit tests for SRS"
|
|
working_directory: "trunk"
|
|
|