<br />

A library of protocols for routing media between devices.

This library is based on "targets", which are devices or groups of devices
which can render media sessions. See `fuchsia.media.sessions2` for media
session details.

Through the `Discovery` protocol, clients can discover what media targets
are available on the network, and select them to render media sessions.
Added: 7

## **PROTOCOLS**

## Discovery

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=28)*

A protocol for discovering media targets.

<br />

### BindGroupTarget

Renders the media session specified by `session_id` on the set of
targets specified by `target_ids`.

This may create a new group target which contains all the specified
targets as members, if one does not exist. The group target may be
temporary, only existing for the lifetime of playback, and not
discoverable through `Discovery`.

#### Request

| Name | Type |
|---|---|
| `session_id` | `https://fuchsia.dev/reference/fuchsia.media.sessions2//https://fuchsia.dev/reference/fuchsia.media.sessions2#SessionId` |
| `target_ids` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id>:100` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindGroupTarget_Result` |

### BindTarget

Renders the media session specified by `session_id` on the target
specified by `target_id`.

#### Request

| Name | Type |
|---|---|
| `session_id` | `https://fuchsia.dev/reference/fuchsia.media.sessions2//https://fuchsia.dev/reference/fuchsia.media.sessions2#SessionId` |
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindTarget_Result` |

### ConnectToTarget

Connects to a target by id. Drops the given channel if no such
target exists.

#### Request

| Name | Type |
|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |
| `target_request` | `server_end:https://fuchsia.dev/reference/fidl/fuchsia.media.target#Target` |

### WatchSessionBindings

Watches for bindings of media sessions to targets.

A media session is rendered on the target to which it is bound.

Bindings are returned as deltas between the watch calls, leave a
request hanging to get the latest updates.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `event` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#SessionBindingsWatchEvent` |

### WatchTargets

Watches for changes to the set of registered targets. Leave a request
hanging to get replies when changes occur. New clients will be caught
up with the state of the world.

Targets are returned as deltas between the watch calls.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `targets_watch_event` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#TargetsWatchEvent` |

## Group

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=104)*

A protocol for watching the members of a group.

<br />

### WatchTargets

Watches for changes to the set of registered targets. Leave a request
hanging to get replies when changes occur. New clients will be caught
up with the state of the world.

Targets are returned as deltas between the watch calls.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `targets_watch_event` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#TargetsWatchEvent` |

## GroupEditor

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=80)*

A protocol for adding and removing members of a group target.

<br />

### AddTarget

Adds a target to this group target.

If the added target is a group of devices, all the devices in that group
are added to this group. A group itself cannot be a member of a group.

Returns the id of the new target if a new group was created to fulfill this
request.

#### Request

| Name | Type |
|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_AddTarget_Result` |

### RemoveTarget

Removes a target from this group. Returns the id of the new target
if a new group was created to fulfill this request.

#### Request

| Name | Type |
|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_RemoveTarget_Result` |

## Selector

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=173)*

A protocol for selecting a media target. Commands on this protocol can
change the target on which a media session is rendered.

<br />

### BindGroupTarget

Renders the media session specified by `session_id` on the set of
targets specified by `target_ids`.

This may create a new group target which contains all the specified
targets as members, if one does not exist. The group target may be
temporary, only existing for the lifetime of playback, and not
discoverable through `Discovery`.

#### Request

| Name | Type |
|---|---|
| `session_id` | `https://fuchsia.dev/reference/fuchsia.media.sessions2//https://fuchsia.dev/reference/fuchsia.media.sessions2#SessionId` |
| `target_ids` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id>:100` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindGroupTarget_Result` |

### BindTarget

Renders the media session specified by `session_id` on the target
specified by `target_id`.

#### Request

| Name | Type |
|---|---|
| `session_id` | `https://fuchsia.dev/reference/fuchsia.media.sessions2//https://fuchsia.dev/reference/fuchsia.media.sessions2#SessionId` |
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindTarget_Result` |

## Target

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=69)*

A target is a device or group of devices on which media can be rendered,
such as a speaker which renders audio.

<br />

### AddTarget

Adds a target to this group target.

If the added target is a group of devices, all the devices in that group
are added to this group. A group itself cannot be a member of a group.

Returns the id of the new target if a new group was created to fulfill this
request.

#### Request

| Name | Type |
|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_AddTarget_Result` |

### BindMemberVolumeControl

Binds to the target's volume control as a member of the given group.
The request channel is dropped if the target is not a member of the group.

This volume control influences the volume of this target only when it is
participating as a member of the group. This is used to adjust the balance
of volume among members of a group. These settings persist for the lifetime
of the target

#### Request

| Name | Type |
|---|---|
| `group` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |
| `volume_control_request` | `server_end:https://fuchsia.dev/reference/fuchsia.media.audio//https://fuchsia.dev/reference/fuchsia.media.audio#VolumeControl` |

### BindVolumeControl

Binds to the target's volume control. If this target is a group,
all member volumes are influenced. These settings persist
for the lifetime of the target.

#### Request

| Name | Type |
|---|---|
| `volume_control_request` | `server_end:https://fuchsia.dev/reference/fuchsia.media.audio//https://fuchsia.dev/reference/fuchsia.media.audio#VolumeControl` |

### RemoveTarget

Removes a target from this group. Returns the id of the new target
if a new group was created to fulfill this request.

#### Request

| Name | Type |
|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_RemoveTarget_Result` |

### WatchTargets

Watches for changes to the set of registered targets. Leave a request
hanging to get replies when changes occur. New clients will be caught
up with the state of the world.

Targets are returned as deltas between the watch calls.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `targets_watch_event` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#TargetsWatchEvent` |

## VolumeControl

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=124)*

A protocol to control the volume of target.

<br />

### BindMemberVolumeControl

Binds to the target's volume control as a member of the given group.
The request channel is dropped if the target is not a member of the group.

This volume control influences the volume of this target only when it is
participating as a member of the group. This is used to adjust the balance
of volume among members of a group. These settings persist for the lifetime
of the target

#### Request

| Name | Type |
|---|---|
| `group` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |
| `volume_control_request` | `server_end:https://fuchsia.dev/reference/fuchsia.media.audio//https://fuchsia.dev/reference/fuchsia.media.audio#VolumeControl` |

### BindVolumeControl

Binds to the target's volume control. If this target is a group,
all member volumes are influenced. These settings persist
for the lifetime of the target.

#### Request

| Name | Type |
|---|---|
| `volume_control_request` | `server_end:https://fuchsia.dev/reference/fuchsia.media.audio//https://fuchsia.dev/reference/fuchsia.media.audio#VolumeControl` |

## **STRUCTS**

### GroupEditor_AddTarget_Response

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=90)*

| Field | Type | Description | Default |
|---|---|---|---|
| `target_change` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#TargetChange?` |   | No default |

### GroupEditor_RemoveTarget_Response

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=98)*

| Field | Type | Description | Default |
|---|---|---|---|
| `target_change` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#TargetChange?` |   | No default |

### Selector_BindGroupTarget_Response

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=191)*

| Field | Type | Description | Default |
|---|---|---|---|
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |   | No default |

### Selector_BindTarget_Response

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=179)*

\<EMPTY\>

### SessionBinding

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=52)*

A binding between a session and a target, indicating the media session
is rendered on the target.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `session_id` | `https://fuchsia.dev/reference/fuchsia.media.sessions2//https://fuchsia.dev/reference/fuchsia.media.sessions2#SessionId` |   | No default |
| `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |   | No default |

### TargetChange

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=75)*

| Field | Type | Description | Default |
|---|---|---|---|
| `new_target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` |   | No default |

## **ENUMS**

### Error [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=197)*

| Name | Value | Description |
|---|---|---|
| ### NOT_A_GROUP | `0` |   |
| ### UNKNOWN_ON_DOMAIN | `1` |   |
| ### CANNOT_BE_GROUPED | `2` |   |
| ### NOT_MEMBER_OF_GROUP | `3` |   |
| ### TRANSFER_FROM_TARGET_UNSUPPORTED | `4` |   |
| ### TRANSFER_TO_TARGET_UNSUPPORTED | `5` |   |
| ### MULTI_TARGET_PLAYBACK_UNSUPPORTED | `6` |   |

## **TABLES**

### Description

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=146)*

A description of a target.

<br />

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `target_id` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id` | Identifies the target. |
| ### 2 | `capability_flags` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#CapabilityFlags` | Enumerates of the interoperability features the device supports. |
| ### 3 | `display_name` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#DisplayName` |   |
| ### 4 | `metadata` | `https://fuchsia.dev/reference/fuchsia.media//https://fuchsia.dev/reference/fuchsia.media#Metadata` |   |

### SessionBindingsWatchEvent

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=57)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `updated` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#SessionBinding>` | A list of active session bindings added or updated in the network at any point in time. |
| ### 2 | `removed` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#SessionBinding>` | A list of session bindings that are removed in the network since notified. |

### TargetsWatchEvent

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=115)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `updated` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#Description>` | Targets added or updated on the network at any point in time. |
| ### 2 | `removed` | `vector<https://fuchsia.dev/reference/fidl/fuchsia.media.target#Id>` | Targets that are removed since last notified. |

## **UNIONS**

### GroupEditor_AddTarget_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=90)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_AddTarget_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Error` |   |

<br />

### GroupEditor_RemoveTarget_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=98)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#GroupEditor_RemoveTarget_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Error` |   |

<br />

### Selector_BindGroupTarget_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=191)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindGroupTarget_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Error` |   |

<br />

### Selector_BindTarget_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=179)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Selector_BindTarget_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fidl/fuchsia.media.target#Error` |   |

<br />

## **BITS**

### CapabilityFlags [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint64`

*Defined in [fuchsia.media.target/target_discovery.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=157)*

Capabilities of the target.

<br />

| Name | Value | Description |
|---|---|---|
| ### TRANSFER_TO | 1 | Indicates the target can receive a transfer of a media session from another target. |
| ### TRANSFER_FROM | 2 | Indicates the target can transfer a media session to another target. |
| ### MULTI_TARGET_PLAYBACK | 4 | Indicates the target can participate in rendering media with other devices. |
| ### VIDEO | 8 | Indicates the target can render video. |

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [DisplayName](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=24) | `string`\[`200`\] | A user-visible name for a target to display in user interface or read in voice interfaces. |
| [Id](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.media.target/target_discovery.fidl;l=20) | `uint64` | A unique id for a target. |