Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlRequestClient ¶
type ControlRequestClient interface {
/*
InstallReferenceToManager used by a VideoSourceOperator to add a reference of itself
into the client
@param newManager VideoSourceOperator - reference to the manager
*/
InstallReferenceToManager(newManager VideoSourceOperator)
/*
GetVideoSourceInfo query control for a video source's information
@param ctxt context.Context - execution context
@param sourceName string - video source name
@returns video source info
*/
GetVideoSourceInfo(ctxt context.Context, sourceName string) (common.VideoSource, error)
/*
ListActiveRecordingsOfSource list all active video recording sessions of a video source
@param ctxt context.Context - execution context
@param sourceID string - the video source ID
@returns all active recording sessions of a video source
*/
ListActiveRecordingsOfSource(ctxt context.Context, sourceID string) ([]common.Recording, error)
/*
ExchangeVideoSourceStatus exchange video source status report with control
@param ctxt context.Context - execution context
@param sourceID string - the video source ID
@param reqRespTargetID string - the request-response target ID for reaching video source
over request-response network.
@param localTime time.Time - video source local time
@returns: current state of the video source from control side, and any active
recordings associated with the video source.
*/
ExchangeVideoSourceStatus(
ctxt context.Context, sourceID string, reqRespTargetID string, localTime time.Time,
) (common.VideoSource, []common.Recording, error)
/*
StopAllAssociatedRecordings request all recording associated this this source is stopped
@param ctxt context.Context - execution context
@param sourceID string - video source ID
*/
StopAllAssociatedRecordings(ctxt context.Context, sourceID string) error
}
ControlRequestClient request-response client for edge to call control
func NewPubSubControlRequestClient ¶ added in v0.4.0
func NewPubSubControlRequestClient( ctxt context.Context, clientName string, controlRRTargetID string, coreClient goutils.RequestResponseClient, requestTimeout time.Duration, ) (ControlRequestClient, error)
NewPubSubControlRequestClient define a new edge to control request-response client based on PubSub
@param ctxt context.Context - execution context @param clientName string - name of this client instance @param controlRRTargetID string - control's target ID for request-response targeting @param coreClient goutils.RequestResponseClient - core request-response client @param requestTimeout time.Duration - request-response request timeout @returns new client
func NewRestControlRequestClient ¶ added in v0.4.0
func NewRestControlRequestClient( ctxt context.Context, controllerBaseURI *url.URL, requestIDHeader string, httpClient *resty.Client, ) (ControlRequestClient, error)
NewRestControlRequestClient define a new edge to control request-response client based on REST
@param ctxt context.Context - execution context @param controllerBaseURI *url.URL - control node base URL @param requestIDHeader string - HTTP header to set for the request ID @param httpClient *resty.Client - HTTP client to use @return new client
type VideoSourceOperator ¶
type VideoSourceOperator interface {
/*
Ready check whether the DB connection is working
@param ctxt context.Context - execution context
*/
Ready(ctxt context.Context) error
/*
Stop stop any support background tasks which were started
@param ctxt context.Context - execution context
*/
Stop(ctxt context.Context) error
/*
RecordKnownVideoSource create record for a known video source
@param ctxt context.Context - execution context
@param id string - source entry ID
@param name string - source name
@param segmentLen int - target segment length in secs
@param playlistURI *string - video source playlist URI
@param description *string - optionally, source description
@param streaming int - whether the video source is currently streaming
*/
RecordKnownVideoSource(
ctxt context.Context,
id, name string,
segmentLen int,
playlistURI, description *string,
streaming int,
) error
/*
ChangeVideoSourceStreamState change the streaming state for a video source
@param ctxt context.Context - execution context
@param id string - source ID
@param streaming int - new streaming state
*/
ChangeVideoSourceStreamState(ctxt context.Context, id string, streaming int) error
/*
StartRecording process new recording request
@param ctxt context.Context - execution context
@param newRecording common.Recording - new recording session to be started
*/
StartRecording(ctxt context.Context, newRecording common.Recording) error
/*
StopRecording process recording stop request
@param ctxt context.Context - execution context
@param recordingID string - recording session ID
@param endTime time.Time
*/
StopRecording(ctxt context.Context, recordingID string, endTime time.Time) error
/*
NewSegmentFromSource process new video segment produced by a video source
@param ctxt context.Context - execution context
@param segment common.VideoSegmentWithData - the new video segment
*/
NewSegmentFromSource(ctxt context.Context, segment common.VideoSegmentWithData) error
/*
SyncActiveRecordingState sync the local recording states with that of system control node
@param timestamp time.Time - current timestamp
*/
SyncActiveRecordingState(timestamp time.Time) error
/*
CacheEntryCount return the number of cached entries
@param ctxt context.Context - execution context
@returns the number of cached entries
*/
CacheEntryCount(ctxt context.Context) (int, error)
}
VideoSourceOperator video source operations manager
func NewManager ¶
func NewManager( parentCtxt context.Context, params VideoSourceOperatorConfig, rrClient ControlRequestClient, metrics goutils.MetricsCollector, tpMetrics goutils.TaskProcessorMetricHelper, ) (VideoSourceOperator, error)
NewManager define a new video source operator
@param parentCtxt context.Context - parent execution context @param params VideoSourceOperatorConfig - operator configuration @param params rrClient ControlRequestClient - request-response client for edge to call control @param metrics goutils.MetricsCollector - metrics framework client @return new operator
type VideoSourceOperatorConfig ¶
type VideoSourceOperatorConfig struct {
// Self a reference to the video source being managed
Self common.VideoSource
// SelfReqRespTargetID the request-response target ID to send inbound request to this operator
SelfReqRespTargetID string
// DBConns DB connection manager
DBConns db.ConnectionManager
// VideoCache video segment cache
VideoCache utils.VideoSegmentCache
// RecordingSegmentForwarder client for forwarding segments associated with recording sessions
RecordingSegmentForwarder forwarder.RecordingSegmentForwarder
// LiveStreamSegmentForwarder client for forwarding segments associated with live stream
LiveStreamSegmentForwarder forwarder.LiveStreamSegmentForwarder
// StatusReportInterval status report interval
StatusReportInterval time.Duration
}
VideoSourceOperatorConfig video source operations manager configuration
Click to show internal directories.
Click to hide internal directories.