mpvtools sdk tutorial october 13 th, 2003 osta optical storage symposium
TRANSCRIPT
MPVTools SDKTutorial
October 13th, 2003
OSTA Optical Storage Symposium
Tutorial Goals
• On completion of the tutorial, you will:– A better understanding of where the MPV
initiative is at.– A good understanding of what functionality is
available in the MPVTools distribution.– A good understanding of how to navigate
around the distribution materials such as the source code, online help and example programs.
Contents
• Overview of MPV• Overview of MPVTools• Overview of MPV C SDK• Reading MPV Files• Writing MPV Files• Processing in-memory representation• Worked Example (Concat)• Futures/Questions
Overview of MPV
• See alternate slidedecks
Overview of MPVTools
• MPVTools is an open source project hosted at Sourceforge (mpvtools.sourceforge.net)
• The project currently contains three sub-projects:– DHTML MPV browser– MPV C SDK– MPV C Incremental writer
Overview of MPV C SDK
• Ansi C library that provides reading, writing and processing of MPV files.
• Targeted at embedded applications.• Minimal ROM footprint.• Integrates with system services of platform
(file, memory, xml parsing).• Royalty free.• Implements MPV mechanisms and policies.
OS
Memory File Directory
XML Parser
Expat UnicoiMPV Infrastructure
MPV Reader MPV Writer
Convenience Interfaces
C SDK Block Diagram
C SDK Infrastructure
Pluggable System Services
• Pluggable system services:– Memory management– File processing– Directory processing
• Examples
String Management
• MpvBuffer
• MpvChar (unicode)
• MpvString
MD5 and JPEG
• MPV makes use of MD5 checksums as contentID• The toolkit includes a placeholder implementation
of MD5• The MPV Still asset can include JPEG2000
compliant metadata for the dimensions. This toolkit includes a placeholder implementation of the JPEG extraction code for dimensions.
• This code can be replaced by platform specific implementations where available.
Simple XML Objects
• MpvXml: representation of xml element
• MpvProperty: representation of xml attribute
• MpvXmlList: representation of xml childlist
MPV Reader
• Implements MPV Algorithm for directory search for manifest.– 3 levels of directory and specific naming
patterns– MpvFindMpvFileSpec
MPV Parsing
• MpvParse() is a wrapper around the actual XML parser. Supported parsers are:– Expat– Unicoi micro parser
• Returns an in-memory representation of the MPV file
Minimizing run-time memory usage
• Metadata can dramatically increase the size of the in-memory representation
• You can prune the metadata by specifying the RestrictMetadata flag to the parser.
• FUTURE: we will support an asset at a time interface that provides fine-grained control over run-time memory footprint
In-Memory Representation
FileManifest Structure
• Top-level data structure for in-memory representation.
Raw XML
• MPV supports “other” content at several levels in the data model:– Manifest element Level
• Arbitrary XML
• Arbitrary Metadata
• Structured Metadata
• Additional attributes
– Asset Level• Arbitrary Metadata
• Structured Metadata
• Additional attributes
• Attributes are maintained as moreAttributes
• Elements are maintained as moreXml
Processing In-Memory Representation
• Rulesets
• You can defined new rulesets
• SDK comes bundled with a large number of Rulesets
• Provide convenience interface to extracting subsets of in-memory representations.
Accessor Functions
• Accessors package up common filtering and transformation operations on the in-memory representation.
• There are a large number of accessors for filtering out a subset of the assets.
•MpvFindAssets()
•MpvFindAlbumAssets()
•MpvFindIndexedAlbumAssets()
•MpvFindMarkedAssets()
•MpvFindRootAssets()
•MpvFindSlideshowForeground()
•MpvFindSlideshowBackground()
•MpvFindAlbumSlideshowForeground()
•MpvFindAlbumSlideshowBackground()
•MpvFindIndexedAlbumSlideshowForeground()
MpvFindIndexedAlbumSlideshowBackground()
Rulesets
• Rulesets provide a convenient declarative approach to specifying rendition replacement policies.
• A number of “typical” Rulesets are available:– MpvRuleSetInitTyp()
– MpvRuleSetInitTypThumbnailStills()
– MpvRuleSetInitTypScreenStills()
– MpvRuleSetInitTypPrintStills()
Examples
minApp Walkthrough
showTest Walkthrough
musicPlayback Walkthrough
Futures
• Incremental processing– Manifest Start tag– Everything before AssetList– Asset at a time from AssetList
• Deterministic Writing– Depth first
• In-Memory construction of Manifest
Todo
• Flesh out Accessor functions section