23
MTP & PTP William.L [email protected] 2011-10-13

MTP & PTP

Embed Size (px)

DESCRIPTION

Introduction to MTP (Media Transfer Protocol) and PTP (Picture Transfer Protocol)

Citation preview

Page 1: MTP & PTP

MTP & PTP

William.L

[email protected]

2011-10-13

Page 2: MTP & PTP

Outline� Overview

� Protocol Intro

� MTP & DRM

� MTP & UMS

� MTP/PTP in Android

Page 3: MTP & PTP

Overview

Page 4: MTP & PTP

PTP / MTP (1/2)� Picture Transfer Protocol

� Define a common protocol of controlling and transferring files (photographs) for digital still image devices (ex: cameras)

� PIMA / ISO 15740

� Commonly implemented over the USB and FireWire

� Media Transfer Protocol� An extension of PTP

� USB-IF MTP 1.0

� Target primarily at

� Digital Still Cameras

� Portable Media Players

� Cellular phones

� Support DRM

Page 5: MTP & PTP

PTP / MTP (2/2)

� PTP and MTP are application layer protocols

� The term ”media” in MTP

� Used to identify any binary data

� Not restricted to audio/video formats

� Non-audio/video objects include contacts, schedules and text files

Page 6: MTP & PTP

PTP/MTP Supported by OS (1/2)

� Microsoft Windows

� WIA (Windows Image Acquisition/Architecture)

� A driver model and API for Windows Me and later Windows operating systems

� Enables software to communicate with imaging device such as scanners, digital cameras and digital video equipments

� Still Image Connectivity for Windows

� http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx

� MTP is part of the "Windows Media" framework and thus

closely related to Windows Media Player

� Built-in support : Windows Visa and Win7

� WinXP with Windows-Media-Player 10 or higher

� PlayForSure certification for devices

Page 7: MTP & PTP

PTP/MTP Supported by OS (2/2)

� Linux

� mtpfs

� libptp2

� libgphoto2

� libmtps

� Tools : gMTP(GUI), mtptools(CLI), etc

Page 8: MTP & PTP

MTP v.s PTP� MTP permits transfer of large(>4GByte) items

� MTP allows the data to be broken into different USB packets

� This allows USB chips to process the packets more

efficiently

Page 9: MTP & PTP

MTP Enhanced� From Microsoft

� Based on MTP 1.0

� Contains additional operations, events and responses

to enable more advanced functionality specific to

particular device classes, media types and applicationscenarios

� Devices designed for Windows should implement MTP

Enhanced

� Specification

� http://www.microsoft.com/download/en/details.aspx?id=19678

Page 10: MTP & PTP

Protocol Intro

Page 11: MTP & PTP

Layered Protocol� Physical layer : USB protocol

� Transport layer is taken directly from PTP (USB Still Image Class, class ID is 6)

� Command layer� PTP/MTP treat most things on devices as Objects

� Most of PTP/MTP commands deal with Objects, ex:GetObjectInfo, GetNumObjects

Page 12: MTP & PTP

Device Roles in Protocol� Initiator - Responder� Initiator

� Send operations/requests

� Responder � Responds for requests

� Fires events

Connect, identifies as using MTPConnect, identifies as using MTP

Device capabilityDevice capability

Request device informationRequest device information

Request list of contentsRequest list of contents

Request metadata describing contentRequest metadata describing content

Array of handles to contentArray of handles to content

Send metadataSend metadata

Object exchangeObject exchange

Responder Initiator

Page 13: MTP & PTP

Other Transport Media (1/2)� Transport-Independent

� MTP/PTP were originally implemented for use

across USB but extended for use across TCP/IP and Bluetooth

� Over TCP/IP

� PTP-IP, "Picture Transfer Protocol" over TCP/IP networks

� CIPA DC-005-2005 standard

� Windows 7 and Windows Vista support

� Ideal for devices with WiFi that can be connected and

synchronized anywhere in the home

Page 14: MTP & PTP

Other Transport Media (2/2)� Over Bluetooth

� Over the L2CAP (Logical Link Control and Adaptation Protocol)

� The specification is available in the Windows Portable Device Enabling Kit

� Windows 7 and Windows Vista (with the Platform Update) support

� Requires Bluetooth 1.2 or higher with the Microsoft Bluetooth stack installed

� Great for low power, low speed scenarios like synchronizing PIM data or a quick file transfer

Page 15: MTP & PTP

MTP & DRM

Page 16: MTP & PTP

DRM� Digital Rights Management� The protection of licensed or purchased audio or

video content, is extemely important in the handheld consumer market

� DRM prevents a copyrighted file from being played in another player than the one it was originally downloaded to� But, if one place where has DRM-Unlock tools, it can

play file normally

� With uncontrolled ability to transport digital content, content provider will remain reluctant to release digital material such as movies

Page 17: MTP & PTP

DRM Support In MTP� MTP provide DRM specific properties

� DRM status

� Determine if an object has DRM protection

� To expose whether an object will be playable after being transferred to a different device

� URL

� To allow DRM to ask for money when the license rights expire (link to the payment site)

� Use count

� The number of times of an object has been played or viewed

Page 18: MTP & PTP

MTP & UMS

Page 19: MTP & PTP

USB Mass Storage (1/2)� USB Mass Storage

� Also called USB MSC(Mass Storage Class)

� An USB device that can store data

� Most portable media players and still image devices have adopted for their internal memory where users save their media files

� Lack DRM support

Page 20: MTP & PTP

USB Mass Storage (2/2)� Can not be accessed by the PC and device

itself at the same time

Device Storage

USB/ATAPI Bridge

Driver Framework

USBStor

Device Player CPU

AutomaticSwitch

MSC

PCPC

DeviceDevice

With MSC,

content

Storage is

managed

by the PC

“switch” means “mount/unmount”. When the device storage is used by

the PC, the storage will be unmounted from the device.

Otherwise, it is mounted to the device.

Page 21: MTP & PTP

MTP v.s UMS

YESNONeed specific driver to access device’s

storage on Microsoft Windows

7/Vista/XP

YESNOCan do common disk recovery

MoreLessAmount of Devices Ready to Support

YES

MTP

NODRM Support

UMS

Page 22: MTP & PTP

MTP/PTP in Android

Page 23: MTP & PTP

� Support MTP/PTP file transfer since Android

3.0(Honeycomb)

� MTP programming APIs are provided from

Android 3.1

� MtpObjectInfo::getProtectionStatus()

� To retrieve the DRM protection status