Smart phone audio system (three media playback backend)

Source: Internet
Author: User

To facilitate the management of audio resources and reduce the complexity of audio control by applications, the media playing background is used.
To manage audio playback and access to audio resources. Media Playback backend requires the following features:

1. priority-based preemption and restoration.
2. Supports simultaneous access to audio resources and mixed and alternative playback for multiple applications.
3. Support for pronunciation Device Control.
4. Has a message reporting mechanism. End of playing, stop playing, pause playing, current position, etc.
5. The application can actively query the current status.

The media playback background consists of the playback Object Manager and the playback service interface. The playback object corresponds to different playback requirements,
It contains the priority, Response Processing Mechanism, and device requirements of the current playback request. The playback service interface is based on the media playback library.
To provide the playback function for the playback object. Separated the connection between the media playing background and the actual playing database.

The media playback backend uses the seek service to provide a playback interface for applications. The application uses the seek interface to play back the background to the media.
Apply for your own playback object. When a playback request has a lower priority than the current playback object, the playback fails. Otherwise, it will be preemptible.

The current playback object, and restore it to the preemptible playback object after the end. This method is implemented by using the linked list of playback objects.
Function. Each playback object will have a pointer to its preemptible playback object to prepare for restoration.

Only playback objects of the same priority can be mixed or alternate. Here is a complicated example.
For multiple calls, each call must have an independent background call and call recording. Each call here will be its own
Creates a background audio playback object and a recording object. When switching the channel, the playback object will also be switched, and the original
Paused.

Connection monitoring for headphones and Bluetooth headsets is also implemented in the background of media playback. The headset is implemented through monitoring Io, And the Bluetooth headset passes through
BLUEZ-AUIDO Butler reporting signal implementation. You need to re-query each time a device is updated or the playing object is updated.
You can configure and update the device status according to the device requirements and current device status of the current playback object.

After the media is played, messages in the Post-state inherit the implementation of the gobject signal mechanism. The procedure is as follows:
The app registers a callback function with the player API.
The player API registers a callback function with dbusproxy.
When an event occurs:
The player background reports the event to the dbusproxy of the client.
Dbusproxy reports the event to the player API.
Player API reports events to applications

Some applications that deal with the background of media playback are implemented through the media playback client.

 

Related Article

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.