You are on page 1of 9

Media Transfer Protocol: Transport Controls

Note: This documentation is an early release of the final product documentation. It is


meant to accompany software that is still in development. Some of the information in this
documentation may be inaccurate or may not be an accurate representation of the
functionality of the final retail product. Microsoft Corporation assumes no responsibility
for any damages that might occur either directly or indirectly from these inaccuracies.

Legal Notice
This is a preliminary document and may be changed substantially prior to final commercial release of the
software described herein.
The information contained in this document represents the current view of Microsoft Corporation on the
issues discussed as of the date of publication. Because Microsoft must respond to changing market
conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot
guarantee the accuracy of any information presented after the date of publication.
This White Paper is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR
IMPLIED, AS TO THE INFORMATION IN THIS DOCUMENT.
Complying with all applicable copyright laws is the responsibility of the user. Without limiting the rights
under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval
system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or
otherwise), or for any purpose, without the express written permission of Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these patents,
trademarks, copyrights, or other intellectual property.
2005 Microsoft Corporation. All rights reserved.
Microsoft, MS-DOS, Windows, Windows Media, Windows NT, Windows Server, Windows Vista, Active
Directory, ActiveSync, ActiveX, Direct3D, DirectDraw, DirectInput, DirectMusic, DirectPlay, DirectShow,
DirectSound, DirectX, FrontPage, HighMAT, JScript, Microsoft Press, MSN, NetShow, Outlook, PlaysForSure
logo, PowerPoint, Visual Basic, Visual C++, Visual InterDev, Visual J++, Visual Studio, WebTV, Win32,
and Win32s are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or
other countries.
All other trademarks are property of their respective owners.
Some of the links in this document might let you leave Microsoft's site. The linked sites are not under the
control of Microsoft and Microsoft is not responsible for the contents of any linked site or any link
contained in a linked site, or any changes or updates to such sites. Microsoft is not responsible for
webcasting or any other form of transmission received from any linked site. Microsoft is providing these
links to you only as a convenience, and the inclusion of any link does not imply endorsement by Microsoft
of the site.
Table of Contents
Table of Contents..................................................................................................1
Playback control scenarios.................................................................................1
Suggested playback control implementation....................................................2
Overview.........................................................................................................................2
Playback control device properties............................................................................3
A.1.1. Volume.............................................................................................................3
A.1.2. Playback Rate.................................................................................................3
A.1.3. Playback Object.............................................................................................3
A.1.4. Playback Container Index.............................................................................4
A.1.5. Playback Position...........................................................................................4
Playback Control Operations......................................................................................5
A.1.6. Skip...................................................................................................................5
Mapping of scenarios onto MTP Playback Controls.........................................6
Scenarios not addressed at this time.................................................................7

Playback control scenarios


Scenarios currently implemented by automotive audio control units:
Play Play selected track can be invoked from paused state or from selected
state
Pause Pause playing selected track,
Stop Stop playing selected track
Mute Mute audio for track that is playing, keep playing; if paused or in select
state, mute audio; User must hit Play to un-mute
Next track Skip to next track in playlist or album; if at last track in an
album/playlist, skip to the first track; if already playing, start playing the next
track; if selected but not playing, select track and await further commands; if
paused, pause at new selection
Previous track - Skip to previous track in playlist or album; if at first track in an
album/playlist, skip to the last track; if already playing, start playing the previous
track; if selected but not playing, select track and await further commands; if
paused, pause at new selection
Next album - Skip to first track of next album; if at last album, skip to the first
track of the first album; if already playing, start playing the next album; if selected
but not playing, select track from next album and await further commands; if
paused, pause at new selection; if playing/selecting a track on a playlist, behavior
is same as Next Playlist
Previous album - Skip to first track of previous album; if at first album, skip to
the first track of the last album; if already playing, start playing the previous
album; if selected but not playing, select track from next album and await further
commands; if paused, pause at new selection; if playing/selecting a track on a
playlist, behavior is same as Previous Playlist
Go to album # - Go to first track of selected album # (album order is left to
device); if already playing, start playing the album; if selected but not playing,
select track from album and await further commands; if paused, pause at new
selection;
Next playlist - Skip to first track of next playlist; if at last playlist, skip to the first
track of the first playlist; if already playing, start playing the next playlist; if
selected but not playing, select track from next playlist and await further
commands; if paused, pause at new selection; if playing/selecting a track on an
album, behavior is same as Next Album
Previous playlist - Skip to first track of previous playlist; if at first playlist, skip to
the first track of the last playlist; if already playing, start playing the previous
playlist; if selected but not playing, select track from previous playlist and await
further commands; if paused, pause at new selection; if playing/selecting a track
on an album, behavior is same as Previous Album
Go to playlist # - Go to first track of selected playlist # (playlist order is left to
device); if already playing, start playing the playlist; if selected but not playing,
select track from playlist and await further commands; if paused, pause at new
selection;
Go to album name Go to first track of selected album; if already playing, start
playing the album; if selected but not playing, select track from album and await
further commands; if paused, pause at new selection;
Go to playlist name Go to first track of selected playlist; if already playing,
start playing the playlist; if selected but not playing, select track from playlist and
await further commands; if paused, pause at new selection;
FF Play at an increased rate in the forward direction
REW Reverse playback (largely obsolete with Random Access playback)

Additional scenarios suggested by known usage patterns:


Connect & know status When a device is connected to an automotive audio
control unit, it should be able to remotely display the media file currently being
played on the device on the dash display without needing to reset the unit.
Time elapsed/time remaining It should be clear at what time position in a
media file playback is currently at.
Skip to position the control unit should be able to begin playback of a media
file at a given offset.

Suggested playback control implementation


Overview

Playback control, unlike object exchange, is a stateful process. When controlling


playback the current situation of the device is required to determine what the next state
should be. In order to keep playback control stateless and allow multiple sessions to co-
exist with this functionality (such as an audio control unit splicing in with device UI), it will
be implemented in 5 different device properties:
Volume
Playback Rate
Playback Object
Playback Container Index
Playback Position

In addition, there is one set of operations (forward & backward skip) which relies on
information which may not be practical to expose to a controlling initiator. This will be
implemented using an operation, which provides multi-parameter control.
Skip

A description of each follows:

Playback control device properties


A.1.1. Volume

This identifies (and is used to set) the current volume of the device, and is an unsigned
32-bit integer. The allowed values of this property device should be identified by a range
form defined in the DevicePropDesc dataset defining this property. Values for this
property are always based at 0, and a value of 0 indicates that the device is muted.

DevicePropCode = 0xD403
Datatype: INT32
DescForms: Range
Get/Set: Get/Set

A.1.2. Playback Rate

This identifies the current speed of playback, identified linearly. It is a signed 32-bit
integer, which identifies the speed in thousandths. Thus, a value of 1000 indicates that
the playback should proceed at full speed. A value of 500 indicates that playback should
be at half-speed. A value of -1000 indicates that playback should be in reverse at full
speed. A value of 0 indicates that the device is paused.

A complete list of allowed playback rates for an object should be contained in an


enumeration of allowed values defined in the DevicePropDesc dataset defining this
property, but should always include the values 1000 and 0.

DevicePropCode = 0xD410
Datatype: INT32
DescForms: Enum
Get/Set: Get/Set

A.1.3. Playback Object

This identifies the object currently being played back on the device, identified by Object
Handle. This property has two special values. A value of 0x00000000 indicates that the
device is currently stopped, and no media file is being consumed.
Devices which support playlist or album objects should allow this property to contain a
handle of an album or playlist. If a device supports these object types, as well as
playback control, it must also support the Playback Container Index Device Property. If
this property contains an album or playlist object, it indicates that the device is currently
playing back the contents of that album or playlist.

Whenever the object being played back is updated on the device (due to the previous
object finishing playback, user input on the device, or active control on another active
session) the device should indicate this by initiating a DevicePropChanged event for this
property.

DevicePropCode = 0xD411
Datatype: UINT32
DescForms: None
Get/Set: Get/Set

A.1.4. Playback Container Index

When playing content, the Playback Object device property may contain a container
object (album, playlist, etc.) rather than the actual object being consumed. In this case,
it is important to expose the specific object in that playback container which is being
consumed. The object being played should be identified by its index within Object
References array of that playback container, and that index is contained in this property.
Recall that arrays in MTP are zero-based (so a value of 0x00000000 in this property
indicates that the first ObjectHandle in the Object References array is being consumed).

If the Playback Object does not represent a container object, or the object being played
back is not an object referenced by the object whose object handle is in the Playback
Object device property, then this property must contain a value of 0xFFFFFFFF.

DevicePropCode = 0xD412
Datatype: UINT32
DescForms: None
Get/Set: Get/Set

A.1.5. Playback Position

This identifies the current time offset of the object currently being played back in
milliseconds. During playback, this property will change frequently, and those changes
should not result in DevicePropChanged events unless they are caused by actions
external to both the current session and the regular playback of the object.
DevicePropCode = 0xD413
Datatype: UINT32
DescForms: None
Get/Set: Get/Set

Playback Control Operations


A.1.6. Skip

This operation updates the current object being played back by skipping either ahead or
behind in a device-specific ordering of objects (the ordering is defined by the device for
its own independent playback of objects). This operation requires one parameter,
containing a signed INT32 value, which indicates the depth and direction into the
playback queue to which the current playback object should skip.

A value of 1 indicates that the device should skip ahead one media object to the object
immediately following the object currently identified by the Playback Object (and
optionally Playback Container Object if the Playback Object is a container). A value of -1
indicates that the previous object in the device playback queue should be loaded as the
current playback object. If a device supports this operation, it must at least support
values of [-1,1]. If a value not supported by device is passed in this parameter, and the
device is incapable of interpreting it, a response code of Invalid_Parameter should be
returned. If a value of 0 is passed in this parameter, the responder should fail this
operation with a response code of Invalid_Parameter.

Table B- Skip Definition


Operation Code 0x9820
Operation Parameter 1 INT32
Operation Parameter 2 None
Operation Parameter 3 None
Operation Parameter 4 None
Operation Parameter 5 None
Data None
Data Direction N/A
ResponseCode Options OK, Operation_Not_Supported,
Session_Not_Open, Invalid_TransactionID,
Access_Denied, Store_Not_Available,
Invalid_Parameter
Response Parameter 1 None
Response Parameter 2 None
Response Parameter 3 None
Response Parameter 4 None
Response Parameter 5 None
Mapping of scenarios onto MTP Playback Controls
The scenarios map to these playback controls as follows:
Play
o (optional) Set the current Playback Object
(optional) If the current playback object a container, select the
index to be played.
o Set the Playback Rate to 1000.
Pause
o Set the Playback Rate to 0.
Stop
o Set the Playback Object to 0x00000000.
Next track (device interpreted)
o Skip (1)
Previous track
o Skip (-1)
Next album
o Retrieve a list of albums from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the current album in that list,
identify the next album in that list (determined by the initiator), and set the
Playback Object to that object.
Previous album
o Retrieve a list of albums from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the current album in that list,
identify the previous album in that list, then set the Playback Object to
that object.
Go to album #n
o Retrieve a list of albums from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the nth album in that list,
identify then set the Playback Object to that object.
Next playlist
o Retrieve a list of playlists from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the current playlist in that list,
identify the next playlist in that list, then set the Playback Object to that
object.
Previous playlist
o Retrieve a list of playlists from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the current playlist in that list,
identify the previous playlist in that list, then set the Playback Object to
that object.
Go to playlist #n
o Retrieve a list of playlists from the device using the GetObjectHandles
operation restricted by ObjectFormat. Find the nth current playlist in that
list, identify the next playlist in that list, then set the Playback Object to
that object.
Go to album name
o If the control unit has the name of an album on the device, it should also
have that albums object handle. Set the Playback Object to that object.
Go to playlist name
o If the control unit has the name of a playlist on the device, it should also
have that playlists object handle. Set the Playback Object to that object.
Fast Forward
o Retrieve the current value and an enumeration of valid values for the
Playback Rate device property description dataset using the
GetObjectPropDesc operation.
o Find the current value of the Playback Rate property in the allowed
values enumeration.
o Set the Playback Rate property to the desired rate of playback, or the
first value greater than 1000.
Rewind
o Retrieve the current value and an enumeration of valid values for the
Playback Rate device property description dataset using the
GetObjectPropDesc operation.
o Find the current value of the Playback Rate property in the allowed
values enumeration.
o Set the Playback Rate property to the next smallest value, or the largest
value smaller than 0.
Connect & know status
o Retrieve the Playback Object property.
o Find details about that object using the GetObjectInfo or
GetObjectPropList restricted by the Object Handle in the Playback
Object.
o (optional) If the Playback Object represents an album or playlist object,
then:
Retrieve the Playback Container Index property.
Retrieve the Object References for the Playback Container
Identify the current object being played back
o Find details about that object using the GetObjectInfo or
GetObjectPropList.
o Retrieve the Playback Position (if desired)
Time elapsed
o Retrieve the Playback Position property
Time remaining
o Retrieve the Playback Position property
o Retrieve the total duration of the object using the GetObjectPropValue
operation
o Subtract
Skip to position
o Set the Playback Position property to the desired offset.

Scenarios not addressed at this time


This document does not attempt to address the following scenarios:
Output selection
o For devices which support multiple outputs or displays, the ability to
toggle between them is recognized as important, but not included in this
document.
Synchronized Multimedia Playback
o Synchronized playback of multiple media types (audio soundtrack with an
image slideshow, for instance) is beyond the scope of this
implementation.

You might also like