Introduction to the Media Kit Matt Wronkiewicz Be Users Group at UIUC
Introduction n This presentation gives an overview of the structure and use of the new Media Kit, part of BeOS R4.
What is the BeOS? n Multimedia OS n Can run with Windows or MacOS on the same computer n Designed for video and audio professionals n Newer and more efficient than other operating systems n Easy to program
Topics of Discussion n Uses n Structure n Classes n Communicating with the Media Kit n A simple application
Uses n Allows you to write video and audio players and editors. n Reads audio from files and sound cards n Reads video from files (QuickTime, MPEG, AVI) n Simplifies development of applications. n Example: The Media Kit can be used to write a DVD disk player.
Structure n Media Kit provides translators and the foundation for writing players and editors n Translator add-ons read media files such as MPEG movies from disk n Allows you to create your own translators and filters n Applications can use translators and filters to play video and sound
Architecture Kernel Level Drivers Application Media Server Media Kit Library Add-Ons Media Add-Ons
Classes n Media Nodes: (Can mix these) u Media Producer (BBufferProducer) u Media Consumer (BBufferConsumer) u Time Source (BTimeSource) u Media File (BFileInterface) n Media Roster (BMediaRoster)
Media Producer n Sends audio or video data to other objects n Represents a file or piece of hardware like a sound card n Connects to Media Consumers n Example: Sound generator
Media Consumer n Receives A/V data from Media Producers n Can be paired with a Media Consumer to create a filter n Example: Audio mixer n Example: Video player
Time Source n Can be used to synchronize audio and video n Default time source is the computer’s clock n Example: Satellite transmission
Media File n Accesses data files to provide media n Writes sound and movie files
Media Roster n Keeps track of media translators and filters n Supplies media nodes for requested format n Supplies default audio and video sources and the audio mixer
Communicating with the Media Kit n Subclass media node classes to create new nodes n Link Producers with Consumers (BBufferProducer::Connect) n Ask the Media Roster to provide system and third-party nodes n Put a media node in a user- installable add-on (BMediaAddOn)
Using the Nodes Together Sound File (BBufferProducer, BFileInterface) High Frequency Filter (BBufferConsumer, BBufferProducer) Audio Mixer (BBufferConsumer)
Sample Audio Player void playsound(entry_ref* file) { BSound sound(&file); BSoundPlayer player; player.Start(); player.SetVolume(1.0); BSoundPlayer::play_id id; id = player.StartPlaying(sound); player.WaitForSound(id); }
Summary n Media Kit makes it easier to write multimedia applications n Pluggable architecture allows programs to work together n Pre-made add-ons reduce development time