Documentation
¶
Index ¶
- Constants
- func DetectCodecFromRTPSession(session interface{ ... }) types.CodecType
- type CodecDetector
- type ConnectionStats
- type ConnectionStatsDTO
- type DriftStatusDTO
- type ErrorResponse
- type FrameBufferStatsDTO
- type FrameData
- type FramePreviewResponse
- type Handlers
- type IngestionStats
- type Manager
- func (m *Manager) CreateStreamHandler(streamID string, conn StreamConnection) (*StreamHandler, error)
- func (m *Manager) GetActiveStreams(ctx context.Context) ([]*registry.Stream, error)
- func (m *Manager) GetRegistry() registry.Registry
- func (m *Manager) GetStats(ctx context.Context) IngestionStats
- func (m *Manager) GetStream(ctx context.Context, streamID string) (*registry.Stream, error)
- func (m *Manager) GetStreamHandler(streamID string) (*StreamHandler, bool)
- func (m *Manager) GetStreamHandlerAndStats(streamID string) (*StreamHandler, StreamStats, bool)
- func (m *Manager) GetStreamHandlerWithStats(streamID string) (StreamStats, bool)
- func (m *Manager) GetStreamMetrics(streamID string) (*StreamMetrics, error)
- func (m *Manager) HandleDeleteStream(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleGetStream(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleListStreams(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandlePauseStream(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleRTPSession(session *rtp.Session) error
- func (m *Manager) HandleRTPStreamWithBackpressure(session *rtp.Session) error
- func (m *Manager) HandleResumeStream(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleSRTConnection(conn *srt.Connection) error
- func (m *Manager) HandleSRTStreamWithBackpressure(conn *srt.Connection) error
- func (m *Manager) HandleStats(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamBackpressure(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamBackpressureControl(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamBuffer(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamData(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamIframe(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamParameters(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamPreview(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamRecovery(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamStats(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleStreamSync(w http.ResponseWriter, r *http.Request)
- func (m *Manager) HandleVideoStats(w http.ResponseWriter, r *http.Request)
- func (m *Manager) MonitorSystemHealth(ctx context.Context)
- func (m *Manager) PauseStream(ctx context.Context, streamID string) error
- func (m *Manager) RemoveStreamHandler(streamID string)
- func (m *Manager) ResumeStream(ctx context.Context, streamID string) error
- func (m *Manager) Start() error
- func (m *Manager) Stop() error
- func (m *Manager) TerminateStream(ctx context.Context, streamID string) error
- type RTPConnection
- type RTPConnectionAdapter
- func (a *RTPConnectionAdapter) Close() error
- func (a *RTPConnectionAdapter) GetAudioOutput() <-chan types.TimestampedPacket
- func (a *RTPConnectionAdapter) GetBitrate() int64
- func (a *RTPConnectionAdapter) GetSSRC() uint32
- func (a *RTPConnectionAdapter) GetStreamID() string
- func (a *RTPConnectionAdapter) GetVideoOutput() <-chan types.TimestampedPacket
- func (a *RTPConnectionAdapter) ProcessPacket(rtpPkt *rtp.Packet) error
- func (a *RTPConnectionAdapter) Read(buf []byte) (int, error)
- func (a *RTPConnectionAdapter) SendRTCP(pkt rtcp.Packet) error
- func (a *RTPConnectionAdapter) SetDepacketizer(depacketizer codec.Depacketizer)
- type SRTConnection
- type SRTConnectionAdapter
- func (a *SRTConnectionAdapter) Close() error
- func (a *SRTConnectionAdapter) GetAudioOutput() <-chan types.TimestampedPacket
- func (a *SRTConnectionAdapter) GetDetectedVideoCodec() types.CodecType
- func (a *SRTConnectionAdapter) GetMaxBW() int64
- func (a *SRTConnectionAdapter) GetParameterSetCache() *types.ParameterSetContext
- func (a *SRTConnectionAdapter) GetStreamID() string
- func (a *SRTConnectionAdapter) GetVideoOutput() <-chan types.TimestampedPacket
- func (a *SRTConnectionAdapter) Read(buf []byte) (int, error)
- func (a *SRTConnectionAdapter) SetMaxBW(bw int64) error
- func (a *SRTConnectionAdapter) SetPIDs(videoPID, audioPID uint16)
- type StreamConnection
- type StreamDTO
- type StreamHandler
- func (h *StreamHandler) GetDetectedResolution() resolution.Resolution
- func (h *StreamHandler) GetFramePreview(durationSeconds float64) ([]byte, int)
- func (h *StreamHandler) GetLatestIFrameWithSessionContext() (*types.VideoFrame, *types.ParameterSetContext)
- func (h *StreamHandler) GetSessionParameterCache() *types.ParameterSetContext
- func (h *StreamHandler) GetStats() StreamStats
- func (h *StreamHandler) GetSyncManager() *isync.Manager
- func (h *StreamHandler) RecoverFromError() error
- func (h *StreamHandler) SeekToKeyframe(targetPTS int64) (*types.VideoFrame, error)
- func (h *StreamHandler) Start()
- func (h *StreamHandler) Stop() error
- type StreamListResponse
- type StreamMetrics
- type StreamStats
- type StreamStatsDTO
- type SuccessResponse
- type SyncStatusResponse
- type TrackStatusDTO
- type VideoAwareConnection
Constants ¶
const ( // DefaultMaxMemory is the default total memory limit (2.5GB) DefaultMaxMemory = int64(2684354560) // DefaultMaxPerStream is the default per-stream memory limit (200MB) DefaultMaxPerStream = int64(209715200) // DefaultBitrate is the default stream bitrate (50 Mbps) DefaultBitrate = int64(52428800) )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CodecDetector ¶
type CodecDetector struct {
// contains filtered or unexported fields
}
CodecDetector detects codec from various sources
func NewCodecDetector ¶
func NewCodecDetector() *CodecDetector
NewCodecDetector creates a new codec detector
func (*CodecDetector) AddPayloadTypeMapping ¶
func (d *CodecDetector) AddPayloadTypeMapping(payloadType uint8, codec types.CodecType)
AddPayloadTypeMapping adds a custom payload type to codec mapping
func (*CodecDetector) DetectFromRTPPacket ¶
func (d *CodecDetector) DetectFromRTPPacket(packet *rtp.Packet) types.CodecType
DetectFromRTPPacket attempts to detect codec from RTP packet
func (*CodecDetector) DetectFromSDP ¶
DetectFromSDP parses SDP and extracts codec information
type ConnectionStats ¶
type ConnectionStats struct {
PacketsLost int64
PacketsRetrans int64
RTTMs float64
BandwidthMbps float64
DeliveryDelayMs float64
ConnectionTimeMs int64
}
ConnectionStats contains connection-level statistics
type ConnectionStatsDTO ¶
type DriftStatusDTO ¶
type DriftStatusDTO struct {
CurrentDrift time.Duration `json:"current_drift"`
MaxDrift time.Duration `json:"max_drift"`
MinDrift time.Duration `json:"min_drift"`
AvgDrift time.Duration `json:"avg_drift"`
SampleCount int `json:"sample_count"`
LastCorrected time.Time `json:"last_corrected,omitempty"`
}
DriftStatusDTO represents drift statistics
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
Time time.Time `json:"time"`
}
Error response
type FrameBufferStatsDTO ¶
type FrameBufferStatsDTO struct {
Capacity int64 `json:"capacity"` // Max frames in buffer
Used int64 `json:"used"` // Current frames in buffer
Available int64 `json:"available"` // Available frame slots
FramesAssembled uint64 `json:"frames_assembled"` // Total frames assembled
FramesDropped uint64 `json:"frames_dropped"` // Frames dropped due to pressure
QueuePressure float64 `json:"queue_pressure"` // Current pressure (0-1)
Keyframes uint64 `json:"keyframes"` // Number of keyframes
PFrames uint64 `json:"p_frames"` // Number of P frames
BFrames uint64 `json:"b_frames"` // Number of B frames
}
FrameBufferStatsDTO contains video-aware buffer statistics
type FramePreviewResponse ¶
type FramePreviewResponse struct {
StreamID string `json:"stream_id"`
FrameCount int64 `json:"frame_count"`
Frames []FrameData `json:"frames"`
}
FramePreviewResponse contains frame preview data
type Handlers ¶
type Handlers struct {
// contains filtered or unexported fields
}
Handlers wraps the ingestion manager to provide HTTP handlers
func NewHandlers ¶
NewHandlers creates a new handlers wrapper
func (*Handlers) RegisterRoutes ¶
RegisterRoutes registers all ingestion API routes
type IngestionStats ¶
type IngestionStats struct {
Started bool `json:"started"`
SRTEnabled bool `json:"srt_enabled"`
RTPEnabled bool `json:"rtp_enabled"`
SRTSessions int `json:"srt_sessions"`
RTPSessions int `json:"rtp_sessions"`
TotalStreams int `json:"total_streams"`
ActiveHandlers int `json:"active_handlers"` // Number of active stream handlers
}
IngestionStats holds ingestion statistics
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager coordinates all ingestion components
func NewManager ¶
NewManager creates a new ingestion manager
func (*Manager) CreateStreamHandler ¶
func (m *Manager) CreateStreamHandler(streamID string, conn StreamConnection) (*StreamHandler, error)
CreateStreamHandler creates a new stream handler with backpressure support
func (*Manager) GetActiveStreams ¶
GetActiveStreams returns all active streams from the registry
func (*Manager) GetRegistry ¶
GetRegistry returns the stream registry
func (*Manager) GetStats ¶
func (m *Manager) GetStats(ctx context.Context) IngestionStats
GetStats returns ingestion statistics
func (*Manager) GetStreamHandler ¶
func (m *Manager) GetStreamHandler(streamID string) (*StreamHandler, bool)
GetStreamHandler returns a stream handler by ID
func (*Manager) GetStreamHandlerAndStats ¶
func (m *Manager) GetStreamHandlerAndStats(streamID string) (*StreamHandler, StreamStats, bool)
GetStreamHandlerAndStats atomically gets both handler and stats to prevent race conditions
func (*Manager) GetStreamHandlerWithStats ¶
func (m *Manager) GetStreamHandlerWithStats(streamID string) (StreamStats, bool)
GetStreamHandlerWithStats atomically gets handler stats to prevent race conditions
func (*Manager) GetStreamMetrics ¶
func (m *Manager) GetStreamMetrics(streamID string) (*StreamMetrics, error)
GetStreamMetrics returns metrics for a specific stream
func (*Manager) HandleDeleteStream ¶
func (m *Manager) HandleDeleteStream(w http.ResponseWriter, r *http.Request)
HandleDeleteStream - DELETE /api/v1/streams/{id}
func (*Manager) HandleGetStream ¶
func (m *Manager) HandleGetStream(w http.ResponseWriter, r *http.Request)
HandleGetStream - GET /api/v1/streams/{id}
func (*Manager) HandleListStreams ¶
func (m *Manager) HandleListStreams(w http.ResponseWriter, r *http.Request)
HandleListStreams - GET /api/v1/streams
func (*Manager) HandlePauseStream ¶
func (m *Manager) HandlePauseStream(w http.ResponseWriter, r *http.Request)
HandlePauseStream - POST /api/v1/streams/{id}/pause
func (*Manager) HandleRTPSession ¶
HandleRTPSession handles a new RTP session with proper backpressure
func (*Manager) HandleRTPStreamWithBackpressure ¶
HandleRTPStreamWithBackpressure integrates RTP session with backpressure handling
func (*Manager) HandleResumeStream ¶
func (m *Manager) HandleResumeStream(w http.ResponseWriter, r *http.Request)
HandleResumeStream - POST /api/v1/streams/{id}/resume
func (*Manager) HandleSRTConnection ¶
func (m *Manager) HandleSRTConnection(conn *srt.Connection) error
HandleSRTConnection handles a new SRT connection with proper backpressure
func (*Manager) HandleSRTStreamWithBackpressure ¶
func (m *Manager) HandleSRTStreamWithBackpressure(conn *srt.Connection) error
HandleSRTStreamWithBackpressure integrates SRT connection with backpressure handling
func (*Manager) HandleStats ¶
func (m *Manager) HandleStats(w http.ResponseWriter, r *http.Request)
HandleStats - GET /api/v1/stats
func (*Manager) HandleStreamBackpressure ¶
func (m *Manager) HandleStreamBackpressure(w http.ResponseWriter, r *http.Request)
HandleStreamBackpressure - GET /api/v1/streams/{id}/backpressure Returns backpressure statistics and current state
func (*Manager) HandleStreamBackpressureControl ¶
func (m *Manager) HandleStreamBackpressureControl(w http.ResponseWriter, r *http.Request)
HandleStreamBackpressureControl - POST /api/v1/streams/{id}/backpressure/control Allows manual control of backpressure settings
func (*Manager) HandleStreamBuffer ¶
func (m *Manager) HandleStreamBuffer(w http.ResponseWriter, r *http.Request)
HandleStreamBuffer - GET /api/v1/streams/{id}/buffer Returns frame buffer statistics
func (*Manager) HandleStreamData ¶
func (m *Manager) HandleStreamData(w http.ResponseWriter, r *http.Request)
HandleStreamData - GET /api/v1/streams/{id}/data Returns a stream of frame data (video-aware)
func (*Manager) HandleStreamIframe ¶
func (m *Manager) HandleStreamIframe(w http.ResponseWriter, r *http.Request)
HandleStreamIframe - GET /api/v1/streams/{id}/iframe Returns the latest iframe as JPEG
func (*Manager) HandleStreamParameters ¶
func (m *Manager) HandleStreamParameters(w http.ResponseWriter, r *http.Request)
HandleStreamParameters handles GET /api/v1/streams/{id}/parameters - Production monitoring endpoint
func (*Manager) HandleStreamPreview ¶
func (m *Manager) HandleStreamPreview(w http.ResponseWriter, r *http.Request)
HandleStreamPreview - GET /api/v1/streams/{id}/preview Returns a preview of recent frames
func (*Manager) HandleStreamRecovery ¶
func (m *Manager) HandleStreamRecovery(w http.ResponseWriter, r *http.Request)
HandleStreamRecovery - GET /api/v1/streams/{id}/recovery Returns error recovery statistics and current state
func (*Manager) HandleStreamStats ¶
func (m *Manager) HandleStreamStats(w http.ResponseWriter, r *http.Request)
HandleStreamStats - GET /api/v1/streams/{id}/stats
func (*Manager) HandleStreamSync ¶
func (m *Manager) HandleStreamSync(w http.ResponseWriter, r *http.Request)
HandleStreamSync - GET /api/v1/streams/{id}/sync Returns A/V synchronization status for a stream
func (*Manager) HandleVideoStats ¶
func (m *Manager) HandleVideoStats(w http.ResponseWriter, r *http.Request)
HandleVideoStats - GET /api/v1/streams/stats/video
func (*Manager) MonitorSystemHealth ¶
MonitorSystemHealth monitors overall system health and applies global backpressure if needed
func (*Manager) PauseStream ¶
PauseStream pauses data ingestion for a stream
func (*Manager) RemoveStreamHandler ¶
RemoveStreamHandler removes a stream handler
func (*Manager) ResumeStream ¶
ResumeStream resumes data ingestion for a paused stream
type RTPConnection ¶
type RTPConnection interface {
StreamConnection
GetBitrate() int64
GetSSRC() uint32
SendRTCP(rtcp.Packet) error
}
RTPConnection wraps rtp.Session to implement StreamConnection
type RTPConnectionAdapter ¶
RTPConnectionAdapter adapts rtp.Session to implement StreamConnection and RTPConnection interfaces Now also emits TimestampedPackets for video-aware processing
func NewRTPConnectionAdapter ¶
func NewRTPConnectionAdapter(session *rtpPkg.Session, codecType types.CodecType) *RTPConnectionAdapter
NewRTPConnectionAdapter creates a new adapter
func (*RTPConnectionAdapter) Close ¶
func (a *RTPConnectionAdapter) Close() error
Close implements StreamConnection
func (*RTPConnectionAdapter) GetAudioOutput ¶
func (a *RTPConnectionAdapter) GetAudioOutput() <-chan types.TimestampedPacket
GetAudioOutput returns the channel of audio TimestampedPackets
func (*RTPConnectionAdapter) GetBitrate ¶
func (a *RTPConnectionAdapter) GetBitrate() int64
GetBitrate returns the current bitrate
func (*RTPConnectionAdapter) GetSSRC ¶
func (a *RTPConnectionAdapter) GetSSRC() uint32
GetSSRC returns the SSRC of the stream
func (*RTPConnectionAdapter) GetStreamID ¶
func (a *RTPConnectionAdapter) GetStreamID() string
GetStreamID implements StreamConnection
func (*RTPConnectionAdapter) GetVideoOutput ¶
func (a *RTPConnectionAdapter) GetVideoOutput() <-chan types.TimestampedPacket
GetVideoOutput returns the channel of video TimestampedPackets
func (*RTPConnectionAdapter) ProcessPacket ¶
func (a *RTPConnectionAdapter) ProcessPacket(rtpPkt *rtp.Packet) error
ProcessPacket converts an RTP packet to TimestampedPacket This should be called by the Session when it receives packets
func (*RTPConnectionAdapter) Read ¶
func (a *RTPConnectionAdapter) Read(buf []byte) (int, error)
Read implements StreamConnection
func (*RTPConnectionAdapter) SendRTCP ¶
func (a *RTPConnectionAdapter) SendRTCP(pkt rtcp.Packet) error
SendRTCP sends an RTCP packet
func (*RTPConnectionAdapter) SetDepacketizer ¶
func (a *RTPConnectionAdapter) SetDepacketizer(depacketizer codec.Depacketizer)
SetDepacketizer sets the depacketizer for frame analysis
type SRTConnection ¶
type SRTConnection interface {
StreamConnection
GetMaxBW() int64
SetMaxBW(int64) error
}
SRTConnection wraps srt.Connection to implement StreamConnection
type SRTConnectionAdapter ¶
type SRTConnectionAdapter struct {
*srt.Connection
// contains filtered or unexported fields
}
SRTConnectionAdapter adapts srt.Connection to implement StreamConnection and SRTConnection interfaces Now also parses MPEG-TS and emits TimestampedPackets with parameter set extraction
func NewSRTConnectionAdapter ¶
func NewSRTConnectionAdapter(conn *srt.Connection) *SRTConnectionAdapter
NewSRTConnectionAdapter creates a new adapter
func (*SRTConnectionAdapter) Close ¶
func (a *SRTConnectionAdapter) Close() error
Close implements StreamConnection
func (*SRTConnectionAdapter) GetAudioOutput ¶
func (a *SRTConnectionAdapter) GetAudioOutput() <-chan types.TimestampedPacket
GetAudioOutput returns the channel of audio TimestampedPackets
func (*SRTConnectionAdapter) GetDetectedVideoCodec ¶
func (a *SRTConnectionAdapter) GetDetectedVideoCodec() types.CodecType
GetDetectedVideoCodec returns the codec detected from MPEG-TS PMT
func (*SRTConnectionAdapter) GetMaxBW ¶
func (a *SRTConnectionAdapter) GetMaxBW() int64
GetMaxBW returns the current max bandwidth setting
func (*SRTConnectionAdapter) GetParameterSetCache ¶
func (a *SRTConnectionAdapter) GetParameterSetCache() *types.ParameterSetContext
GetParameterSetCache returns the parameter set cache for external access
func (*SRTConnectionAdapter) GetStreamID ¶
func (a *SRTConnectionAdapter) GetStreamID() string
GetStreamID implements StreamConnection
func (*SRTConnectionAdapter) GetVideoOutput ¶
func (a *SRTConnectionAdapter) GetVideoOutput() <-chan types.TimestampedPacket
GetVideoOutput returns the channel of video TimestampedPackets
func (*SRTConnectionAdapter) Read ¶
func (a *SRTConnectionAdapter) Read(buf []byte) (int, error)
Read implements StreamConnection
func (*SRTConnectionAdapter) SetMaxBW ¶
func (a *SRTConnectionAdapter) SetMaxBW(bw int64) error
SetMaxBW sets the max bandwidth for backpressure
func (*SRTConnectionAdapter) SetPIDs ¶
func (a *SRTConnectionAdapter) SetPIDs(videoPID, audioPID uint16)
SetPIDs sets the PIDs for video and audio streams
type StreamConnection ¶
StreamConnection is a common interface for SRT and RTP connections
type StreamDTO ¶
type StreamDTO struct {
ID string `json:"id"`
Type string `json:"type"`
SourceAddr string `json:"source_addr"`
Status string `json:"status"`
CreatedAt time.Time `json:"created_at"`
LastHeartbeat time.Time `json:"last_heartbeat"`
VideoCodec string `json:"video_codec"`
Resolution string `json:"resolution"`
Bitrate int64 `json:"bitrate"`
FrameRate float64 `json:"frame_rate"`
Stats StreamStatsDTO `json:"stats"`
}
type StreamHandler ¶
type StreamHandler struct {
// contains filtered or unexported fields
}
StreamHandler handles a single stream with full video awareness
func NewStreamHandler ¶
func NewStreamHandler( ctx context.Context, streamID string, conn StreamConnection, queue *queue.HybridQueue, memController *memory.Controller, logger logger.Logger, ) *StreamHandler
NewStreamHandler creates a new unified video-aware stream handler
func (*StreamHandler) GetDetectedResolution ¶
func (h *StreamHandler) GetDetectedResolution() resolution.Resolution
GetDetectedResolution returns the detected resolution
func (*StreamHandler) GetFramePreview ¶
func (h *StreamHandler) GetFramePreview(durationSeconds float64) ([]byte, int)
GetFramePreview returns a preview of recent frames
func (*StreamHandler) GetLatestIFrameWithSessionContext ¶
func (h *StreamHandler) GetLatestIFrameWithSessionContext() (*types.VideoFrame, *types.ParameterSetContext)
GetLatestIFrameWithSessionContext returns the latest iframe with session-long parameter context This replaces the GOP buffer approach with session-scoped parameter management
func (*StreamHandler) GetSessionParameterCache ¶
func (h *StreamHandler) GetSessionParameterCache() *types.ParameterSetContext
GetSessionParameterCache returns the session parameter cache for external access
func (*StreamHandler) GetStats ¶
func (h *StreamHandler) GetStats() StreamStats
GetStats returns current statistics
func (*StreamHandler) GetSyncManager ¶
func (h *StreamHandler) GetSyncManager() *isync.Manager
GetSyncManager returns the sync manager for this stream
func (*StreamHandler) RecoverFromError ¶
func (h *StreamHandler) RecoverFromError() error
RecoverFromError attempts to recover from an error using GOP buffer
func (*StreamHandler) SeekToKeyframe ¶
func (h *StreamHandler) SeekToKeyframe(targetPTS int64) (*types.VideoFrame, error)
SeekToKeyframe seeks to the nearest keyframe before the given timestamp
func (*StreamHandler) Start ¶
func (h *StreamHandler) Start()
Start begins processing the stream with video awareness
type StreamListResponse ¶
type StreamListResponse struct {
Streams []StreamDTO `json:"streams"`
Count int `json:"count"`
Time time.Time `json:"time"`
}
API Response DTOs
type StreamMetrics ¶
type StreamMetrics struct {
StreamID string `json:"stream_id"`
Type string `json:"type"`
Status string `json:"status"`
Bitrate int64 `json:"bitrate"`
FramesAssembled uint64 `json:"frames_assembled"`
FramesDropped uint64 `json:"frames_dropped"`
QueueDepth int64 `json:"queue_depth"`
QueuePressure float64 `json:"queue_pressure"`
MemoryUsage int64 `json:"memory_usage"`
MemoryPressure float64 `json:"memory_pressure"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
StreamMetrics contains detailed metrics for a stream
type StreamStats ¶
type StreamStats struct {
StreamID string
Codec string
PacketsReceived uint64
FramesAssembled uint64
FramesDropped uint64
BytesProcessed uint64
Errors uint64
Bitrate float64 // Bits per second
QueueDepth int64
QueuePressure float64
Backpressure bool
Started bool
PipelineStats pipeline.PipelineStats
// Connection-level statistics
ConnectionStats *ConnectionStats
// Frame type breakdown
KeyframeCount uint64
PFrameCount uint64
BFrameCount uint64
// Video information
Resolution resolution.Resolution
Framerate float64
// GOP statistics
GOPStats gop.GOPStatistics
// GOP buffer statistics
GOPBufferStats gop.BufferStatistics
// Backpressure statistics
BackpressureStats backpressure.Statistics
// Recovery statistics
RecoveryStats recovery.Statistics
}
StreamStats contains unified statistics
type StreamStatsDTO ¶
type StreamStatsDTO struct {
BytesReceived int64 `json:"bytes_received"`
PacketsReceived int64 `json:"packets_received"`
PacketsLost int64 `json:"packets_lost"`
Bitrate int64 `json:"bitrate"`
FrameBufferStats FrameBufferStatsDTO `json:"frame_buffer_stats"`
ConnectionStats *ConnectionStatsDTO `json:"connection_stats,omitempty"`
}
type SuccessResponse ¶
type SuccessResponse struct {
Message string `json:"message"`
Data interface{} `json:"data,omitempty"`
Timestamp time.Time `json:"timestamp"`
}
SuccessResponse for simple success messages
type SyncStatusResponse ¶
type SyncStatusResponse struct {
StreamID string `json:"stream_id"`
Status sync.SyncStatusType `json:"status"`
Video *TrackStatusDTO `json:"video,omitempty"`
Audio *TrackStatusDTO `json:"audio,omitempty"`
Drift *DriftStatusDTO `json:"drift,omitempty"`
Time time.Time `json:"time"`
}
SyncStatusResponse represents the sync status for a stream
type TrackStatusDTO ¶
type TrackStatusDTO struct {
Type string `json:"type"`
LastPTS int64 `json:"last_pts"`
LastDTS int64 `json:"last_dts"`
BaseTime time.Time `json:"base_time"`
PacketCount int64 `json:"packet_count"`
DroppedCount int64 `json:"dropped_count"`
WrapCount int `json:"wrap_count"`
JumpCount int `json:"jump_count"`
ErrorCount int `json:"error_count"`
}
TrackStatusDTO represents the status of a single track
type VideoAwareConnection ¶
type VideoAwareConnection interface {
StreamConnection
GetVideoOutput() <-chan types.TimestampedPacket
GetAudioOutput() <-chan types.TimestampedPacket
}
VideoAwareConnection is an interface for connections that provide video/audio channels