Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents

MediaPipeline

Create

Note

This sequence is aspirational and does not reflect the current implementation which uses a timer to create the pipeline in one call when it is assumed that all sources have been attached, to be addressed by

Jira
serverJIRA - 2
serverId11deff04-0380-3a3d-a916-0849d4e573f7
keyRIALTO-23

PlantUML Macro
formatSVG
titleCreate Player
@startuml

autonumber

box "Container" #LightGreen
participant Cobalt
participant Starboard
participant GStreamer_client
participant rialtoClient
end box

box "Platform" #LightBlue
participant rialtoServer
participant GStreamer_server
end box


== Create Media Pipeline ==

Cobalt            ->  Starboard:        SbPlayerCreate(media_keys_handle, video_info, audio_info)
Starboard         ->  GStreamer_client: Create Gst pipeline with Rialto sinks

activate GStreamer_client

note right of GStreamer_client
As the Gst pipeline is brought up the creation of
the first rialto sink for a pipeline triggers the
createMediaPipeline() call. Creation of additional
rialto sinks increments a ref count to the media
pipeline. To identify which pipeline a sink relates
to it will pass a unique ID for that pipeline which
is TBD but could be pointer to the pipeline root
element or the gstreamer pipeline bus handle.

For now videoRequirements can be set to 2160x3840
until resource management comes into scope.
end note

GStreamer_client  ->  rialtoClient:     createMediaPipeline(client, videoRequirements)
rialtoClient      ->  rialtoServer:     createMediaPipeline(client, videoRequirements)
rialtoServer      ->  rialtoServer:     Check resource permissions that were granted to app and currently\nallocated pipelines allows creation of this new pipeline
note left: Currently this check is simply num_current_pipeline_sessions < max_playback_sessions

opt Permission check passed
rialtoServer      ->  rialtoServer:     Store video requirements
rialtoServer      --> rialtoClient:     pipeline_session
rialtoClient      --> GStreamer_client: pipeline_session

GStreamer_client  ->  rialtoClient:     load(pipeline_session, MEDIA_TYPE_MSE, ~"", ~""). 
rialtoClient      ->  rialtoServer:     load(pipeline_session, MEDIA_TYPE_MSE, ~"", ~"")
rialtoServer      ->  GStreamer_server: Create rialto server MSE pipeline
GStreamer_server  --> rialtoServer:
rialtoServer      -/  rialtoClient:     notifyNetworkState(pipeline_session, NETWORK_STATE_BUFFERING)
rialtoClient      -/  GStreamer_client: notifyNetworkState(pipeline_session, NETWORK_STATE_BUFFERING)
rialtoServer      --> rialtoClient:     
rialtoClient      --> GStreamer_client: 

opt video_codec != None
GStreamer_client  ->  rialtoClient:     attachSource(pipeline_session, video_source)
rialtoClient      ->  rialtoServer:     attachSource(pipeline_session, video_source)
rialtoServer      ->  GStreamer_server: Add video sink to pipeline
GStreamer_server  --> rialtoServer:
rialtoServer      --> rialtoClient:
rialtoClient      --> GStreamer_client:
end

opt audio_codec != None
GStreamer_client  ->  rialtoClient:     attachSource(pipeline_session, audio_source)
rialtoClient      ->  rialtoServer:     attachSource(pipeline_session, audio_source)
rialtoServer      ->  GStreamer_server: Add audio sink to pipeline
GStreamer_server  --> rialtoServer:
rialtoServer      --> rialtoClient:
rialtoClient      --> GStreamer_client:
end

rialtoClient       -> rialtoServer:      allSourcesAttached(pipeline_session)
rialtoServer      ->  GStreamer_server:  Setup and add app source
GStreamer_server  --> rialtoServer:
rialtoServer      --> rialtoClient:

deactivate GStreamer_client

GStreamer_client  --> Starboard
Starboard         --> Cobalt:



== Notify that Pipeline & network session is currently IDLE ==


rialtoServer       -/  rialtoClient:     notifyNetworkState(NETWORK_STATE_IDLE)
note right
Note that notification may occur before createMediaPipeline() call returns
end note
rialtoClient       -/  GStreamer_client: notifyNetworkState(NETWORK_STATE_IDLE)

rialtoServer       -/  rialtoClient:     notifyPlaybackState(PLAYBACK_STATE_IDLE)
note right
Note that notification may occur before createMediaPipeline() call returns
end note
rialtoClient       -/  GStreamer_client: notifyPlaybackState(PLAYBACK_STATE_IDLE)

else Permission check failed

rialtoServer      --> rialtoClient:     ERROR_DENIED
rialtoClient      --> GStreamer_client: ERROR_DENIED

end

@enduml 


Destroy

PlantUML Macro
formatSVG
titleDestroy Player
@startuml

autonumber

box "Container" #LightGreen
participant Cobalt
participant Starboard
participant GStreamer_client
participant rialtoClient
end box

box "Platform" #LightBlue
participant rialtoServer
participant GStreamer_server
end box


Cobalt            ->  Starboard:        SbPlayerDestroy(player_session)
Starboard         ->  GStreamer_client: Destroy Rialto Client Gst pipeline
activate GStreamer_client
note right of GStreamer_client
As each rialto sink is freed it will decrement the
ref count to its media player (via the TBD unique
pipeline ID). When the ref count reaches zero the
destructor is triggered.
end note
GStreamer_client  ->  rialtoClient:     ~IMediaPipeline()
deactivate GStreamer_client
rialtoClient      ->  rialtoServer:     ~IMediaPipeline()
rialtoServer      ->  GStreamer_server: Destroy rialto server pipeline
GStreamer_server  --> rialtoServer:
rialtoServer      --> rialtoClient:     
rialtoClient      --> GStreamer_client: 
GStreamer_client  --> Starboard
Starboard         --> Cobalt:

@enduml

...