advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
Average Rating: 3/5 | Rate this item | 2 users have rated this item.
Email this articleEmail this article
 
Playing Multimedia Using BREW's IMedia API
BREW has supported multimedia presentation from the start. Now, its new IMedia interface makes taking advantage of BREW's rich support for audio and video playback easier than ever. 

 
advertisement
rom the earliest days of the BREW platform, its designers at Qualcomm have paid close attention to the demands of multimedia presentation. Early versions of BREW supported animated image display through the proprietary BREW Compressed Image (BCI) format as well as sound playback through the ISound, ISoundPlayer, and IRinger interfaces. With the advent of BREW 2.0 a few years ago, multimedia presentation in C and C++ has been streamlined through a single interface—the IMedia interface—which provides a single interface to audio and visual (still and video) multimedia. Imedia consists of an abstract interface (IMedia) and subclasses implementing codecs for popular standards including MIDI, MP3, AAC, 3GPP video, and JPEG, along with a helper class responsible for selecting the appropriate subclass. This makes IMedia the media presentation interface of choice for both existing and new BREW applications.

Understanding BREW's Multimedia Architecture
At first blush, especially if you're new to BREW, the IMedia interface and media playback architecture can seem overwhelming. However, it's really quite simple, being comprised of only three key parts:

  • The abstract BREW IMedia interface is responsible for managing media playback. It treats playback as an asynchronous activity, in which the controlling application sets various properties for playback (such as volume and display rectangle), invokes key operations to control playback (such as starting and stopping media presentation), and receives messages from the IMedia interface periodically through a callback function.
  • Subclasses of the IMedia interface implement specific codecs for playing back a single media data type, such as MP3, AAC, and MIDI audio, 3GPP video, or BMP or JPEG images. These interfaces can be created in the usual way via ISHELL_CreateInstance with the class id of a specific media player, such as AEECLSID_MEDIAMP3.
  • The BREW IMediaUtil interface implements a factory for obtaining a specific IMedia subclass given the data to present.
Using the IMedia interface is far simpler than you might think in just reading the documentation:
  1. Given the source data to play, create an appropriate subclass of IMedia to present the data.
  2. Set the IMedia instance's callback so that the instance can pass information about the media back to your application using IMEDIA_RegisterNotify.
  3. Configure any playback options (such as default volume or screen rectangle for drawing).
  4. Begin and control media playback, using handset or programmatic events (key presses, game actions, or so forth) to trigger IMedia methods such as IMEDIA_Play, IMEDIA_Pause, IMEDIA_Resume, and IMEDIA_Stop.
  5. Monitor the values sent to your application callback for information such as errors or the termination of playback and handle those notifications appropriately (for example, restarting playback if your application is looping audio or video).
  6. When playback is complete, release the IMedia instance and any other resources you've consumed.
While straightforward, it's instructive to actually see the IMedia methods in sample code to help fit the pieces of the puzzle together.

  Next Page: Creating and Configuring the IMedia Interface
Page 1: IntroductionPage 3: Controlling the IMedia Interface
Page 2: Creating and Configuring the IMedia Interface 
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES