Multimedia

Record video without audio

You can now specify "none" as a value for the audio_codec parameter when creating your video recording player (for example: createPlayer("capture://video?encoding=video/3gpp&audio_codec=none")). If "none" is specified, the video will record without audio.

Consequently, System.getProperty("audio.encodings") now returns "none" as an allowable value for the audio_codec parameter.

Query supported bitrates for various codecs

You can invoke System.getProperty("audio.encodings.bitrate.ranges") and System.getProperty("video.encoding.bitrate.ranges") to retrieve a list of bitrate ranges for each codec. The string returned has the following format: "codec:[min]-[max] codec:[min]-[max]... codec[min]-[max]" where codec is the name corresponding to the codec name that can be used in the locator string to start a recording (general example: capture://video?encoding=video/3gpp&audio_codec=codec&video_codec=<codec>&rate=<audiorate>&video_rate=<videorate> ).

Set audio and video bitrate in video recordings during initialization

You can now specify the bitrate for audio and video codecs when creating a Player instance using the Manager class by setting the rate parameter (general example: createPlayer("capture://video?encoding=video/3gpp&rate=<bitrate>&video_rate=<bitrate>")).

Bitrate ranges for various codecs can be obtained using System.getProperty("audio.encodings.bitrate.ranges") and System.getProperty("video.encoding.bitrate.ranges").

Change audio and video bitrate while recording is in progress

You can change the video bitrate of a video at any time while recording using the VideoFormatControl interface. Similarly, you can change or retrieve the audio bitrate while recording using the AudioFormatControl interface.

Both interfaces use methods and functionality inheirited from the FormatControl interface.

Optimized audio settings

You can enable VoIP functionality on CDMA-based devices by using the voipMode and rate parameters of the createPlayer(String locator) method located in the javax.microedition.media.Manager class.

Use camera input scene modes

You can use new constants and methods in the net.rim.device.api.amms.control.camera.FeatureControl class to set and retrieve the input scene mode (such as portrait, landscape, sport, snow, macro and so on) and to check if a scene mode are supported by the device. The functionality includes the following methods:

  • setSceneMode(): Sets the camera's mode to the scene mode specified in the parameter. The parameter must be one of the constants located in the FeatureControl class prefixed by SCENE_MODE_
  • getCurrentSceneMode(): Retrieves the currently set scene mode represented by one of the constants prefixed by SCENE_MODE_
  • isSceneModeSupported(): Determines if a specified scene mode, passed in as a parameter, is supported by the device

Advanced video control interface

You can use the new AdvancedVideoControl interface, located in the net.rim.device.api.media.control package, to define a new video display mode. This new mode allows you to render core UI components over video fields, for example playback controls. The interface has one constant, USE_GUI_ADVANCED, that is used as a parameter in the VideoControl.initDisplayMode(int mode, Object arg) method.

RTSP fast content switching

When you use the RTSP protocol to display video, you can now switch video feeds without disconnecting and reconnecting to the server (if supported) by using the new RtspContentControl interface located in the net.rim.device.api.media.control package. This results in faster and more efficient content switching.

Buffer configuration API

You can use the StreamingBufferControl interface, located in the net.rim.device.api.media.control package, to control the internal streaming buffers of the media player. The flush() method clears all data that is currently buffered (but not yet played) by the media player. The setBufferTime(int millis) method controls the amount of time to buffer before playback begins.

Use new focus control modes

You can use new constants in the net.rim.device.api.amms.control.camera.EnhancedFocusControl class to set the focus control type. The functionality includes the following constants and methods:

  • FOCUS_MODE_CONTINUOUS: Sets the camera's focus mode to continuously scan and always be ready for capture
  • FOCUS_MODE_FIXED: Sets the camera's focus mode to infinity
  • FOCUS_MODE_SINGLESHOT: Sets the camera's focus mode to lock immediately before capture
  • setFocusMode(String mode): Sets the camera's focus mode
  • getCurrentFocusMode(): Retrieves the current focus mode
  • isFocusModeSupported(String focusModeID): Returns true if the focus mode is supported, false otherwise. The string passed into this method can be any of the three constants above

In addition, the default focus control of the camera on a BlackBerry® device has changed from single-shot to the best available mode (typically continuous). If you rely on a specific focus mode for your application, you must call it explicitly using these new constants.


Was this information helpful? Send us your comments.