Message Constants

The Media Kit has a number of message formats. The following table lists the messages (by their 'what' constants) and describes their intents. The subsequent sections list the fields that are contained in the messages.


Notification Messages

Declared in: media/MediaDefs.h

Messages with these 'what' are sent by the media server to any application that's registered to receive notifications by calling BMediaRoster::StartWatching().

ConstantDescription

B_MEDIA_WILDCARD

Used to match any notification (used only in calls to StartWatching() and StopWatching()).

B_MEDIA_NODE_CREATED

A new node has been created

B_MEDIA_NODE_DELETED

A node has been deleted. (Not sent in R4.5.)

B_MEDIA_CONNECTION_MADE

Not sent in R4.5.

B_MEDIA_CONNECTION_BROKEN

Not sent in R4.5.

B_MEDIA_BUFFER_CREATED

Not sent in R4.5.

B_MEDIA_BUFFER_DELETED

Not sent in R4.5.

B_MEDIA_FORMAT_CHANGED

Not sent in R4.5.

B_MEDIA_PARAMETER_CHANGED

Indicates that a parameter in a BParameterWeb has changed.

B_MEDIA_NEW_PARAMETER_VALUE

Indicates that a parameter in a BParameterWeb has changed. Unlike the B_MEDIA_PARAMETER_CHANGED notification, this includes the new value.

B_MEDIA_WEB_CHANGED

Indicates that a node's BParameterWeb has changed.

B_MEDIA_NODE_STOPPED

Indicates that a node has stopped.

B_MEDIA_FLAVORS_CHANGED

Indicates that flavors have changed.

B_MEDIA_DEFAULT_CHANGED

Not sent in R4.5.

B_MEDIA_TRANSPORT_STATE

Not sent in R4.5.

B_MEDIA_WILDCARD

Purpose:Constant only.
Source:Your application.
Target:The media server.
Hook: 

When calling BMediaRoster::StartWatching() or BMediaRoster::StopWatching(), you can use this constant to match all media messages. This message has no actual format.

(No Be-defined fields)

B_MEDIA_NODE_CREATED, B_MEDIA_NODE_DELETED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook: 

Sent to indicate that a node has been created or deleted in the media system.

FieldType codeDescription
media_node_idB_INT32_TYPEThe ID of the media_node that was created or deleted.

B_MEDIA_CONNECTION_MADE, B_MEDIA_CONNECTION_BROKEN

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook:

Sent to indicate that a connection between media nodes has been made or broken.

The B_MEDIA_CONNECTION_MADE message has three data fields:

FieldType codeDescription
be:outputB_RAW_TYPEA media_output structure describing the connection's output.
be:inputB_RAW_TYPEA media_input structure describing the connection's input.
be:formatB_RAW_TYPEA media_format structure describing the format of the data that flows across the connection.

And B_MEDIA_CONNECTION_BROKEN has two.

FieldType codeDescription
destinationB_RAW_TYPEA media_destination structure describing the destination of the connection that's been broken.
sourceB_RAW_TYPEA media_source structure describing the source of the connection that's been broken.

B_MEDIA_BUFFER_CREATED, B_MEDIA_BUFFER_DELETED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook:

Sent to indicate that a media buffer has been created or deleted.

B_MEDIA_BUFFER_CREATED's message has the following fields:

FieldType codeDescription
clone_infoB_RAW_TYPEAn area_info structure describing the buffer's location in memory. This is an array, one entry per buffer created.

B_MEDIA_BUFFER_DELETED looks like this:

FieldType codeDescription
media_buffer_idB_INT32_TYPEThe buffer ID number of the buffer being deleted. This is an array, one entry per buffer deleted.

B_MEDIA_FORMAT_CHANGED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook: 

Sent by the media server to indicate that the format used on a particular connection has changed.

FieldType codeDescription
be:sourceB_RAW_TYPEA media_source structure describing the source of the connection whose format changed.
be:destinationB_RAW_TYPEA media_source structure describing the source of the connection whose format changed.
be:formatB_RAW_TYPEA media_format structure describing the new format.

B_MEDIA_PARAMETER_CHANGED, B_MEDIA_NEW_PARAMETER_VALUE

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook: 

Sent by the media server to indicate that the value of a parameter has changed. B_MEDIA_PARAMETER_CHANGED only tells you which parameter changed (media_node and parameter ID). B_MEDIA_NEW_PARAMETER_VALUE also tells you which parameter changed, and what the new value is.

The B_MEDIA_PARAMETER_CHANGED message looks like this:

FieldType codeDescription
be:nodeB_RAW_TYPEA media_node structure indicating which node's parameter web has changed.
be:parameterB_INT32_TYPEThe ID number of the parameter whose value has changed.

The B_MEDIA_NEW_PARAMETER_VALUE message is:

FieldType codeDescription
nodeB_RAW_TYPEA media_node structure indicating which node is reporting a changed parameter value.
parameterB_INT32_TYPEThe parameter ID of the changed parameter.
whenB_INT64_TYPEThe performance time at which the change took effect. value B_RAW_TYPE The parameter's new value.

B_MEDIA_WEB_CHANGED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook: 

Sent by the media server to indicate that a particular node's BParameterWeb has.

FieldType codeDescription
nodeB_RAW_TYPEA media_node structure indicating which node's parameter web has changed.

B_MEDIA_NODE_STOPPED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook: 

Indicates that a media node has stopped.

B_MEDIA_FLAVORS_CHANGED

Purpose:Deliverable
Source:The media server.
Target:Target specified to BMediaRoster::StartWatching().
Hook:

Sent by the media server to indicate that the flavors supported by a particular add-on have changed.

FieldType codeDescription
be:addon_idB_INT32_TYPEThe add-on ID of the add-on whose flavors have changed
be:new_countB_INT32_TYPEHow many new flavors have been added.
be:gone_countB_INT32_TYPEHow many flavors have been removed.
Creative Commons License
Legal Notice
This work is licensed under a Creative Commons Attribution-Non commercial-No Derivative Works 3.0 License.