fuchsia.media.playback

PROTOCOLS

Player

Defined in fuchsia.media.playback/player.fidl

Plays media.

CreateHttpSource

Creates a source that reads from a URL.

Request

NameType
http_url string
headers vector<fuchsia.net.oldhttp/HttpHeader>?
source_request request<Source>

CreateFileSource

Creates a source that reads from a file.

Request

NameType
file_channel handle<channel>
source_request request<Source>

CreateReaderSource

Creates a source that reads from a SeekingReader.

Request

NameType
seeking_reader SeekingReader
source_request request<Source>

CreateElementarySource

Creates a source that allows the client to provide independent elementary streams to the player. duration_ns, can_pause, can_seek and metadata are all included in the SourceStatus and, when the ElementarySource is used by the player, in the PlayerStatus as well. can_pause and can_seek, when false, constrain the capabilities of the player.

Request

NameType
duration_ns int64
can_pause bool
can_seek bool
metadata fuchsia.media/Metadata?
source_request request<ElementarySource>

SetSource

Sets the source for this player to use. If source is null, the player becomes idle.

Request

NameType
source Source?

TransitionToSource

Transitions to the specified source when playback of the current source reaches transition_pts. The new source starts playback at start_pts. If a transition is already pending, it will be discarded in favor of the new transition.

Request

NameType
source Source
transition_pts int64
start_pts int64

CancelSourceTransition

Cancels a pending transition, returning the source. If no transition is pending, the request channel is closed.

Request

NameType
returned_source_request request<Source>

SetHttpSource

Sets an HTTP URL to read from. The provided headers are added to each HTTP request issued to the URL.

Request

NameType
http_url string
headers vector<fuchsia.net.oldhttp/HttpHeader>?

SetFileSource

Sets a file channel to read from.

Request

NameType
file_channel handle<channel>

Play

Starts playback.

Request

NameType

Pause

Pauses playback.

Request

NameType

OnStatusChanged

Provides current status immediately after binding and whenever status changes thereafter.

Response

NameType
player_status PlayerStatus

Seek

Seeks to the specified position, specified in nanoseconds.

Request

NameType
position int64

CreateView

Creates a video view.

Request

NameType
view_token fuchsia.ui.views/ViewToken

BindGainControl

Binds to the gain control for this player.

Request

NameType
gain_control_request request<fuchsia.media.audio/GainControl>

AddBinding

Adds a new binding to this player.

Request

NameType
player_request request<Player>

SeekingReader

Defined in fuchsia.media.playback/seeking_reader.fidl

Describe

Request

NameType

Response

NameType
status int32
size uint64
can_seek bool

ReadAt

Request

NameType
position uint64

Response

NameType
status int32
socket handle<socket>?

SourceManager

Defined in fuchsia.media.playback/source_manager.fidl

Manages sources on behalf of a Player.

CreateHttpSource

Creates a source that reads from a URL.

Request

NameType
http_url string
headers vector<fuchsia.net.oldhttp/HttpHeader>?
source_request request<Source>

CreateFileSource

Creates a source that reads from a file.

Request

NameType
file_channel handle<channel>
source_request request<Source>

CreateReaderSource

Creates a source that reads from a SeekingReader.

Request

NameType
seeking_reader SeekingReader
source_request request<Source>

CreateElementarySource

Creates a source that allows the client to provide independent elementary streams to the player. duration_ns, can_pause, can_seek and metadata are all included in the SourceStatus and, when the ElementarySource is used by the player, in the PlayerStatus as well. can_pause and can_seek, when false, constrain the capabilities of the player.

Request

NameType
duration_ns int64
can_pause bool
can_seek bool
metadata fuchsia.media/Metadata?
source_request request<ElementarySource>

SetSource

Sets the source for this player to use. If source is null, the player becomes idle.

Request

NameType
source Source?

TransitionToSource

Transitions to the specified source when playback of the current source reaches transition_pts. The new source starts playback at start_pts. If a transition is already pending, it will be discarded in favor of the new transition.

Request

NameType
source Source
transition_pts int64
start_pts int64

CancelSourceTransition

Cancels a pending transition, returning the source. If no transition is pending, the request channel is closed.

Request

NameType
returned_source_request request<Source>

Source

Defined in fuchsia.media.playback/source_manager.fidl

A source of content that may be used by a player.

OnStatusChanged

Response

NameType
source_status SourceStatus

ElementarySource

Defined in fuchsia.media.playback/source_manager.fidl

Source variant for providing elementary streams directly to the player.

OnStatusChanged

Response

NameType
source_status SourceStatus

AddStream

Adds an elementary stream. The elementary stream can be removed by closing the SimpleStreamSink. ticks_per_second_numerator and ticks_per_second_denominator indicate the units that will be used for Streampacket timestamp values. For nanoseconds units, for example, ticks_per_second_numerator should be 1000000000 and ticks_per_second_denominator should be 1. To use units of frames for 48k audio, ticks_per_second_numerator should be 48000 and ticks_per_second_denominator should be 1.

Request

NameType
type fuchsia.media/StreamType
ticks_per_second_numerator uint32
ticks_per_second_denominator uint32
sink_request request<fuchsia.media/SimpleStreamSink>

AddBinding

Adds a new binding to this ElementarySource. By using this method, the client can obtain an additional channel through which to communicate to this ElementarySource even after a channel is consumed by a call to SourceManager.SetSource.

Request

NameType
source_request request<ElementarySource>

STRUCTS

PlayerStatus

Defined in fuchsia.media.playback/player.fidl

Player status information.

NameTypeDescriptionDefault
duration int64 Duration of the content. No default
can_pause bool Whether the player can pause. No default
can_seek bool Whether the player can seek. No default
has_audio bool Whether the source has an audio stream. No default
has_video bool Whether the source has a video stream. No default
ready bool Indicates whether the player is ready to play. After `SetHttpSource`, `SetFileSource` or `SourceManager.SetSource` is called, this value is false until the player is fully prepared to play the content from the source. No default
metadata fuchsia.media/Metadata? No default
problem Problem? Indicates a problem preventing intended operation. No default
audio_connected bool Indicates whether an audio stream is currently connected for rendering. This value will be false if `has_audio` is false or if the audio stream type isn't supported. No default
video_connected bool Indicates whether a video stream is currently connected for rendering. This value will be false if `has_video` is false or if the video stream type isn't supported. No default
video_size fuchsia.math/Size? Size of the video currently being produced. This value will be null if the video size is currently unknown. No default
pixel_aspect_ratio fuchsia.math/Size? Relative dimensions of a video pixel. This value will be null if the pixel aspect ratio is currently unknown. No default
timeline_function fuchsia.media/TimelineFunction? Function translating local time to presentation time. This value will be null if the timeline function is currently undefined. No default
end_of_stream bool Indicates whether presentation for all streams has reached end-of-stream. No default

Problem

Defined in fuchsia.media.playback/problem.fidl

Models a problem preventing intended operation.

A Problem is generally surfaced as part of a component's status, probably as an optional field. Absence of a Problem means that nothing is preventing intended operation. When a problem is exposed, the client can take action automatically or present relevant UI. If a problem can be resolved by some action, the client may take that action automatically or enlist the user somehow in the resolution. In either case, the problem goes away when the issue that caused it to be exposed is resolved. By design, there is no general means of dismissing a problem.

NameTypeDescriptionDefault
type string The type of problem. This is a string for extensibility. No default
details string? Type-dependent details. No default

SourceStatus

Defined in fuchsia.media.playback/source_manager.fidl

Source status information.

NameTypeDescriptionDefault
duration int64 Duration of the content. No default
can_pause bool Whether the source can pause. No default
can_seek bool Whether the source can seek. No default
has_audio bool Whether the source has an audio stream. No default
has_video bool Whether the source has a video stream. No default
ready bool Indicates whether the source is ready. A true value signals that the content has been probed and there are no known problems with it. No default
metadata fuchsia.media/Metadata? Describes the media. No default
problem Problem? Indicates a problem preventing intended operation. A null value indicates that the source is functioning as intended. No default

CONSTANTS

NameValueType
PROBLEM_INTERNAL fuchsia.media.playback.Internal String
PROBLEM_ASSET_NOT_FOUND fuchsia.media.playback.AssetNotFound String
PROBLEM_CONTAINER_NOT_SUPPORTED fuchsia.media.playback.ContainerNotSupported String
PROBLEM_AUDIO_ENCODING_NOT_SUPPORTED fuchsia.media.playback.AudioEncodingNotSupported String
PROBLEM_VIDEO_ENCODING_NOT_SUPPORTED fuchsia.media.playback.VideoEncodingNotSupported String
PROBLEM_CONNECTION_FAILED fuchsia.media.playback.ConnectionFailed String
UNKNOWN_SIZE 18446744073709551615 uint64