Compare the j2-multimedia optional packages

Source: Internet
Author: User

In j2s, the mobile media API (mmapi) is an optional package. It provides a standard API that can be used to express and obtain time-based media. Such as sound tracks and video clips. Mmapi is developed in JSR-135 in Java Community processes and is designed to be flexible and platform-independent, without making any assumptions about media formats, protocols, or features supported by different devices in the future. Mmapi is already used on mobile devices. For example, nokia3650 contains an implementation. Other devices that support mmapi can be found in the "j2m‑based device.
This article will introduce the latest developments in mmapi: new security considerations proposed in mmapi1.1, differences between mmapi and midp2.0 media APIs, And the j2m's wireless Toolkit) support for mmapi and JSR-234, advanced multimedia supplement (advance multimedia Supplement ). If you are looking for a mmapi guide and sample code, for example, for an audio/video player, refer to "j2's mobile media API" and "taking photos using mmapi ".
Mmapi components Overview
Mmapi has four main components:
L player is used to play the content. It provides a method to manage the player lifecycle and different replay features.
L manager is the media master who creates a player.
L datasource represents the controller of a protocol, which is usually invisible to application developers. The Protocol manager reads the media and puts it in the player for playback.
L control controls different features of player and replay operations.
Control operations supported by mmapi
Mmapi contains 12 control operations in the javax. microedition. Control package:
L metadatacontrol is used to obtain metadata information from media data.
L midicontrol provides access to the player performance and transmission devices.
L guicontrol indicates a control operation with user interface components.
L pitchcontrol increases or reduces the replay position without changing the replay speed.
L ratecontrol controls the replay rate.
L tempocontrol controls the rhythm of MIDI songs.
L volumecontrol controls the volume.
L videocontrol controls the display of visual content.
L framepositioningcontrol can precisely locate a video frame.
L recordcontrol records the content played by the player.
L stoptimecontrol allows the application to specify a stop time for a player in advance.
L tonecontrol is an interface for playing User-Defined tone sequences.
You must understand that not all mmapi implementations support all control operation types. You can call system. getproperty (string key) to obtain the control type supported by the device. These attributes are defined as follows:
L microedition. Media. Version returns a string that represents the mmapi implementation version. If the current device supports mmapi, "1.0" or "1.1" is returned. Otherwise, "null" is returned ".
L supports. Mixing returns true If mixing is supported; otherwise, false.
L supports. Audio. Capture returns true if audio records are supported. Otherwise, false is returned.
L supports. Video. Capture returns true if video records are supported. Otherwise, false is returned.
L supports. Recording returns true if recording is supported. Otherwise, false is returned.
L audio. encodings returns a string that represents the supported audio format. If audio content is not supported, "null" is returned ".
L video. encodings returns a string that represents the supported video format. If the video content is not supported, "null" is returned ".
L video. snapshot. encodings returns a string that represents the supported image format. If video snapshots are not supported, "null" is returned ".
L streamable. Contents returns a string representing the supported streaming media content type, in mime syntax.
In addition to the attributes supported by system. getproperty (), the Manager class also provides several useful static methods:
L string [] getsupportedcontenttypes (string protocol) input a protocol such as "HTTP" as the parameter and return the content type supported by this Protocol.
L string [] getsupportedprotocols (string contenttype) is used to input a mime-formatted content type, for example, "Video/MPEG". The returned protocol can be used to pass this type.
Mmapi1.1
Mmapi1.1 is a continuation and update of mmapi1.0. It mainly modified document issues, added some new definitions, and revised the documents associated with the midp2.0 security framework. It does not make any changes to the class, interface, and method definition.
Mmapi does not define its own security framework, but the implementation of mmapi is a security framework provided by the potential profile and configuration. If the caller lacks appropriate security permissions, some mmapi methods are defined to throw a securityexception. Therefore, an mmapi must be implemented with the following guarantees:
L when the caller does not have proper permissions and executes methods in mmapi implementation, a securityexception is thrown.
L The methods may be used when appropriate permissions are granted.
Mmapi security issues involve recording, network access, and local data storage access. Recording is related to the user's private right. Applications may silently access the recording function to record and distribute private sessions. In addition, security practices must be able to access remote and local resources at appropriate locations. To gain access to the recording function, network, and local data storage, an mmapi must be granted with the appropriate permissions.
Mmapi and j2's wireless toolkit 2.2
The JSR-135 is implemented with the j2_wireless tool Version 2.2. Mediacontrolskin, a simulator skin released along with this toolbox, is mainly used for multimedia playback and control. The mmapi implementation of this simulator supports the following media types.
Mime Type
Description
Audio/MIDI
MIDI files
Audio/SP-Midi
Upgradeable multi-tone MIDI
Audio/X-Tone-seq
Midp2.0 tone sequence
Audio/X-WAV
Wav PCM sampling audio
Image/GIF
Fig89a (Active GIF)
Video/MPEG
MPEG Video
Video/vnd. Sun. rgb565
Video Record
Mmapi midlets
Some mmapi demos are released along with the toolbox. A special user's demo is pausing audio test, which is part of the mmademo project. It shows how a well-developed mmapi MIDlet works. For example, you must know that the midlets may be aborted by some events, such as a call, as shown in 1. When your midlets stops, they should release important device resources and re-allocate or start those resources when the MIDlet recovers. When a MIDlet is terminated, any player should be stopped. If William Tell Overture keeps playing through an important business phone, your users will not thank you.
  

Figure 1
Comparison between mmapi and midp2.0 media API
Midp2.0 media API is an immediate subset of mmapi and is intended to be provided to devices with limited resources running midp2.0, although the same subset may be used by other j2profile that require sound support. This API meets the requirements set by the MIDP expert group, including:
L simple audio playback
L independent from any specific protocol and content format
L supports custom tones
L Supports normal media stream control, such as start, stop, and search.
L supports media type-specific control, such as sound
L support capacity Query
Because of these requirements, the midp2.0 media API and mmapi have the following differences:
L if it is only a video, it does not include video or image-specific control operations.
L multiple players cannot use a normal time base for Synchronous playback at the same time.
L custom protocols are not supported through custom datasource, And the javax. microedition. Media. Protocol package is not included.
L use a simplified version of manager.
Comparison between mmapi and advanced multimedia supplements
The JSR-135 introduces the basic playing functions of audio and video. JSR-234, advanced multimedia supplement, will support recent hardware updates by defining an Optional package for advanced multimedia features. In the j2-cldc environment, new API dependencies and mmapi features are added. The main purpose of this Optional package is to better support cameras and radios, as well as for advanced audio processing. The following capabilities are described in the Specification:
L supports specific camera control, such as brightness comparison, flashing, lighting mode, and lens zoom.
L correct access to radio and other media sources based on channels and frequencies, including radio data systems.
L advanced audio processing capabilities, such as balancers and audio effects.
L specifies the media output mode, which is used to select whether the audio is played through the speaker or through the headset.
Summary
The mmapi Optional package provides some pleasant features for applications running on the MIDP device, which were previously unavailable. Its Scalable Architecture creates opportunities for providing more features on mobile devices in the future. This article describes the main components of mmapi, discusses changes in Version 1.1, and explains the relationships between mmapi, midp2.0 media API, and advanced multimedia supplements. If you want to apply the mmapi to the actual situation, please download the j2m's wireless toolkit 2.2 and study the mmademo and audiodemo projects.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.