A multimedia aggregation playing control method, system, device and medium
By using the MediaSession framework and AIDL communication, unified encapsulation and aggregation control of multimedia data are achieved, solving the problems of cumbersome control and focus control caused by the decentralized management of playback sources in in-vehicle multimedia systems, and improving the control efficiency and flexibility of multimedia data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2026-04-07
AI Technical Summary
In existing technologies, the decentralized management of playback sources in in-vehicle multimedia systems leads to cumbersome control and is prone to focus control problems, especially in intelligent voice control systems or quick launch menus, where the need to create JAR packages for access is cumbersome and prone to focus control issues.
A multimedia aggregation playback control method is adopted, which realizes the unified encapsulation and aggregation of multimedia data through the MediaSession multimedia framework, defines callback interfaces and service interfaces, creates MultiMediaService for aggregation, and configures playback attributes through bean classes. The client and server communicate through AIDL, and the Manager class listens for control requests to realize unified control of multimedia services.
It enables unified control of different types of multimedia data, avoids the problem of multiple playback sources playing at the same time, and improves the efficiency and flexibility of focus control.
Smart Images

Figure CN118450171B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of multimedia playback, specifically a multimedia aggregation playback control method, system, device, and medium. Background Technology
[0002] With the rapid development of internet technology, the in-vehicle multimedia market will become a new economic growth point for my country's automotive electronics industry, gradually forming a unique industrial sector. In-vehicle multimedia systems will inevitably move towards industrialization, thereby forming an information industry cluster.
[0003] Multimedia players on the market typically handle various playback sources separately, such as FM radio, Bluetooth audio, and local audio. These sources are often managed and operated independently. While this decentralized approach offers flexibility to some extent, it also presents a series of challenges. Especially when other applications, such as intelligent voice control systems or quick launch menus, control these playback sources, it requires creating JAR files, which is cumbersome and prone to focus control issues. Summary of the Invention
[0004] The purpose of this invention is to provide a multimedia aggregation playback control method, system, device, and medium to unify the playback source, realize the function of playing different multimedia data, and at the same time control the application and release of multimedia data focus to avoid the problem of multiple playback sources playing simultaneously.
[0005] To achieve the above objectives, the present invention employs the following technical methods:
[0006] A multimedia aggregation playback control method includes the following steps performed sequentially:
[0007] S1, Receives control commands for multimedia playback;
[0008] S2. Determine the type of multimedia data to be played, start the control service for the corresponding type of multimedia data and initialize the relevant configuration, and return a unified receipt;
[0009] This step is based on the MediaSession multimedia framework, which includes the client, Framework layer and server.
[0010] On the server side, define the callback interface and service interface for multimedia data, create a MultiMediaService, and connect to all callback interfaces and service interfaces. In the MultiMediaService, create a multimedia interface to aggregate all callback interfaces and service interfaces, encapsulate them into a serializable bean class, and configure the playback attributes of different types of multimedia data through the bean class.
[0011] In the client, a control interface for multimedia data is defined. The control interface is used to define the control operations for all multimedia data and communicates with the callback interface and service interface of the corresponding multimedia data in the server through the Framework layer.
[0012] In the Framework layer, a Manager class is created. The Manager class is used to encapsulate and run the remote service MultiMediaService, listen for and wait for control requests from clients, and control the multimedia service according to the control requests.
[0013] The client sends a control command, the server receives the control command and performs the corresponding operation. After the operation is completed, it sends a receipt to the client. Each receipt is put into MultiMediaService to uniformly encapsulate the type of multimedia data and playback information, and then a MediaSessionCallback class is opened to unify the receipt.
[0014] S3: Call the corresponding multimedia playback engine to play the multimedia data to be played.
[0015] As a limitation: MultiMediaService inherits from MediaBrowserService.
[0016] As a further limitation: In the Framework layer, a LiveData class is created. The LiveData class is used to expose multimedia aggregation playback control methods, so that the multimedia aggregation playback control methods can be called in a background thread and updated via postValue().
[0017] As a further clarification: the callback interface, service interface, and control interface are all defined using AIDL.
[0018] As a further clarification: the types of multimedia data include local audio, online audio, FM radio audio, and Bluetooth audio.
[0019] The present invention also provides a multimedia aggregation playback control system, comprising:
[0020] The control command acquisition module is used to receive control commands for multimedia playback;
[0021] The service configuration module determines the type of multimedia data requested for playback, starts the control service for the corresponding type of multimedia data, initializes relevant configurations, and returns a unified receipt. It is implemented based on the MediaSession multimedia framework, which includes a client, a Framework layer, and a server. On the server side, callback interfaces and service interfaces for multimedia data are defined. A MultiMediaService is created, which connects to all callback and service interfaces. Within the MultiMediaService, a multimedia interface is created to aggregate all callback and service interfaces, encapsulating them into a serializable bean class. Playback attributes for different types of multimedia data are configured through this bean class. On the client side… Define a control interface for multimedia data. This interface defines all control operations for multimedia data and communicates with the corresponding callback and service interfaces of the multimedia data on the server side through the Framework layer. In the Framework layer, create a Manager class. The Manager class encapsulates and runs the remote service MultiMediaService, listens for and waits for control requests from clients, and controls the multimedia service according to the control requests. When a client sends a control command, the server receives the control command, executes the corresponding operation, and sends an acknowledgment to the client after the operation is completed. Each acknowledgment is entered into MultiMediaService to uniformly encapsulate the multimedia data type and playback information, and a MediaSessionCallback class is then exposed to unify the acknowledgments.
[0022] The execution module is used to call the corresponding multimedia playback engine to play the multimedia data to be played.
[0023] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor calls the computer program in the memory to execute the above-described multimedia aggregation playback control method.
[0024] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, is used to implement the above-described multimedia aggregation playback control method.
[0025] The beneficial effects achieved by this invention, due to the adoption of the above-described solution, compared with the prior art, are as follows:
[0026] This invention provides a multimedia aggregation playback control method, system, device, and medium. By encapsulating playback sources of different types of multimedia data into a serializable bean class and configuring playback attributes through the bean class, the function of playing different types of multimedia data can be realized. By aggregating the service interfaces of different types of multimedia data, the application and release of focus can be better controlled, thereby avoiding the problem of multiple playback sources playing simultaneously.
[0027] This invention is applicable to multimedia playback. Attached Figure Description
[0028] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0029] Figure 1 This is a flowchart of a multimedia aggregation playback control method according to Embodiment 1 of the present invention;
[0030] Figure 2 This is a structural block diagram of a multimedia aggregation playback control system according to Embodiment 2 of the present invention;
[0031] Figure 3 This is a schematic diagram of the structure of the electronic device in Embodiment 3 of the present invention. Detailed Implementation
[0032] The present invention will be further described below with reference to the embodiments. However, those skilled in the art should understand that the present invention is not limited to the following embodiments. Any improvements and equivalent changes made based on the specific embodiments of the present invention are within the scope of protection of the claims of the present invention.
[0033] Example 1: A Multimedia Aggregation Playback Control Method
[0034] A multimedia aggregation playback control method, such as Figure 1 As shown, the steps are performed sequentially:
[0035] S1: Receives control commands for multimedia playback.
[0036] S2. Determine the type of multimedia data to be played, start the control service for the corresponding type of multimedia data and initialize the relevant configuration, and return a unified receipt.
[0037] This step is based on the MediaSession multimedia framework, which includes a client, a Framework layer, and a server. On the server side, callback and service interfaces for online audio, local audio, FM radio audio, and Bluetooth audio are defined using AIDL. A MultiMediaService is created, which inherits from MediaBrowserService. MultiMediaService connects to all callback and service interfaces. Within MultiMediaService, a multimedia interface is created to aggregate all callback and service interfaces, encapsulating them into a serializable bean class. Playback properties for different audio types are configured through this bean class. On the client side, multimedia control interfaces for online audio, local audio, FM radio audio, and Bluetooth audio are defined using AIDL. These multimedia control interfaces are used to define all multimedia... The control operations are implemented and communicate with the corresponding audio callback interface and service interface on the server through the Framework layer. In the Framework layer, Manager and LiveData classes are created. The Manager class is used to encapsulate and run the remote service MultiMediaService, listen for and wait for control requests from clients, and control the multimedia service according to the control requests. The LiveData class is used to expose the multimedia aggregation playback control methods, so that the multimedia aggregation playback control methods can be called in the background thread, and the LiveData is updated through postValue(). When the client sends a control command, the server receives the control command, executes the corresponding operation, and sends an acknowledgment to the client after the operation is completed. Each acknowledgment is put into MultiMediaService to uniformly encapsulate the audio type, playback progress, playlist, and playback details information, and then a MediaSessionCallback class is exposed to unify the acknowledgment.
[0038] S3. The client connects to the MultiMediaService in the Framework layer, calls the corresponding multimedia playback engine to play the multimedia data to be played, and synchronously updates the audio progress and lyrics-related data information.
[0039] In step S2 of this embodiment, the callback interface and service interface for online audio, local audio, FM radio audio, and Bluetooth audio are defined as follows: the callback interface ILocalCallback.aidl and the service interface IlocalService.aidl are defined for online audio and local audio. The callback interface ILocalCallback.aidl is called by the server when playback is complete, when an error occurs, or when the playback position changes; the service interface IlocalService.aidl is called by the client to control the local audio or online audio service, including playing audio, stopping audio playback, and playback progress. This document defines the callback interfaces `IRadioAppCallback.aidl` and `ITuneCallback.aidl` for FM radio audio, and the service interface `IRadioAppService.aidl`. The callback interface `IRadioAppCallback.aidl` is used by the FM radio service to provide callback notifications to clients when there are frequency changes, signal quality changes, or when a specific station is received. The callback interface `ITuneCallback.aidl` is related to adjusting radio frequencies and search functions, allowing clients to receive callbacks for tuning status updates and search results. The service interface `IRadioAppService.aidl` defines interactions with the FM radio service, including turning the FM radio station on or off, switching frequencies, adjusting volume, and searching channels. It also defines the callback interfaces `INfCallbackAvrcp.aidl` and `INfCallbackA2dp.aidl` for Bluetooth audio. These interfaces define the Bluetooth audio remote control service and the Bluetooth audio transmission service, allowing remote reception of Bluetooth service status updates and control. In addition to communicating with the client through the defined callback interface, Bluetooth audio can also use a delegate method to listen to BluetoothProfile.ServiceListener and obtain BluetoothA2dpSink in its onServiceConnected callback method. The Bluetooth audio remote control service is implemented by obtaining com.android.bluetooth.avrcpcontroller.BluetoothMediaBrowserService.
[0040] Example 2: A multimedia aggregation playback control system
[0041] A multimedia aggregation playback control system, the structural block diagram of which is as follows: Figure 2 As shown, it includes:
[0042] The control command acquisition module is used to receive control commands for multimedia playback.
[0043] The service configuration module is used to determine the type of multimedia data requested for playback, start the control service for the corresponding type of multimedia data and initialize the relevant configuration, and return a unified receipt.
[0044] This module is based on the MediaSession multimedia framework, which includes a client, a Framework layer, and a server. On the server side, callback and service interfaces for online audio, local audio, FM radio audio, and Bluetooth audio are defined using AIDL. A MultiMediaService is created, which inherits from MediaBrowserService. MultiMediaService connects to all callback and service interfaces. Within MultiMediaService, a multimedia interface is created to aggregate all callback and service interfaces, encapsulating them into a serializable bean class. Playback properties for different audio types are configured through this bean class. On the client side, multimedia control interfaces for online audio, local audio, FM radio audio, and Bluetooth audio are defined using AIDL. These multimedia control interfaces are used to define all multimedia... The control operations are implemented and communicate with the corresponding audio callback interface and service interface on the server through the Framework layer. In the Framework layer, Manager and LiveData classes are created. The Manager class is used to encapsulate and run the remote service MultiMediaService, listen for and wait for control requests from clients, and control the multimedia service according to the control requests. The LiveData class is used to expose the multimedia aggregation playback control methods, so that the multimedia aggregation playback control methods can be called in the background thread, and the LiveData is updated through postValue(). When the client sends a control command, the server receives the control command, executes the corresponding operation, and sends an acknowledgment to the client after the operation is completed. Each acknowledgment is put into MultiMediaService to uniformly encapsulate the audio type, playback progress, playlist, and playback details information, and then a MediaSessionCallback class is exposed to unify the acknowledgment.
[0045] The execution module is used to call the corresponding multimedia playback engine to play the multimedia data to be played, and to update the audio progress and lyrics-related data information synchronously.
[0046] The callback and service interfaces for online audio, local audio, FM radio audio, and Bluetooth audio are defined as follows: The callback interface ILocalCallback.aidl and the service interface IlocalService.aidl are defined for online and local audio. The callback interface ILocalCallback.aidl is called by the server when playback is complete, when an error occurs, or when the playback position changes. The service interface IlocalService.aidl is called by the client to control the local or online audio service, including playing audio, stopping audio playback, and controlling playback progress. This document defines the callback interfaces `IRadioAppCallback.aidl` and `ITuneCallback.aidl` for FM radio audio, and the service interface `IRadioAppService.aidl`. The callback interface `IRadioAppCallback.aidl` is used by the FM radio service to provide callback notifications to clients when there are frequency changes, signal quality changes, or when a specific station is received. The callback interface `ITuneCallback.aidl` is related to adjusting radio frequencies and search functions, allowing clients to receive callbacks for tuning status updates and search results. The service interface `IRadioAppService.aidl` defines interactions with the FM radio service, including turning the FM radio station on or off, switching frequencies, adjusting volume, and searching channels. It also defines the callback interfaces `INfCallbackAvrcp.aidl` and `INfCallbackA2dp.aidl` for Bluetooth audio. These interfaces define the Bluetooth audio remote control service and the Bluetooth audio transmission service, allowing remote reception of Bluetooth service status updates and control. In addition to communicating with the client through the defined callback interface, Bluetooth audio can also use a delegate method to listen to BluetoothProfile.ServiceListener and obtain BluetoothA2dpSink in its onServiceConnected callback method. The Bluetooth audio remote control service is implemented by obtaining com.android.bluetooth.avrcpcontroller.BluetoothMediaBrowserService.
[0047] Example 3 An electronic device
[0048] The electronic device of this embodiment includes a memory and a processor. The memory stores a computer program, and the processor calls the computer program in the memory to execute a multimedia aggregation playback control method of Embodiment 1. Figure 3This is a schematic diagram of the structure of the electronic device provided in this embodiment. The electronic device can be a terminal device or a server. The terminal device can include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, personal digital assistants (PDAs), portable Android devices (PADs), portable media players (PMPs), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of this embodiment.
[0049] like Figure 3 As shown, electronic devices may include processing units, such as central processing units (CPUs) and graphics processors (GPUs), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or loaded from storage devices into random access memory (RAM). RAM also stores various programs and data required for the operation of the electronic device. The processing unit, ROM, and RAM are interconnected via a bus. Input devices, output devices, communication devices, and storage devices are also connected to the bus via I / O interfaces.
[0050] Typically, the following devices can be connected to the I / O interface: input devices such as touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices such as liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices such as magnetic tapes, hard drives, etc.; and communication devices. Communication devices allow electronic devices to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 3 Electronic devices with various devices are shown, but it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0051] Example 4: A computer-readable medium
[0052] The computer-readable storage medium of this embodiment stores a computer program, which, when executed by a processor, is used to implement a multimedia aggregation playback control method of Embodiment 1. The computer-readable storage medium of this embodiment may be included in an electronic device; alternatively, it may exist independently and not be assembled into an electronic device.
[0053] The computer-readable storage medium of this embodiment may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0054] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this disclosure, and are not intended to limit them. Although this disclosure has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this disclosure.
Claims
1. A multimedia aggregation playback control method, characterized in that, This includes the following steps performed sequentially: S1, Receives control commands for multimedia playback; S2. Determine the type of multimedia data to be played, start the control service for the corresponding type of multimedia data and initialize the relevant configuration, and return a unified receipt; This step is based on the MediaSession multimedia framework, which includes the client, Framework layer and server. On the server side, define the callback interface and service interface for multimedia data, create a MultiMediaService, and connect to all callback interfaces and service interfaces. In the MultiMediaService, create a multimedia interface to aggregate all callback interfaces and service interfaces, encapsulate them into a serializable bean class, and configure the playback attributes of different types of multimedia data through the bean class. In the client, a control interface for multimedia data is defined. The control interface is used to define the control operations for all multimedia data and communicates with the callback interface and service interface of the corresponding multimedia data in the server through the Framework layer. In the Framework layer, a Manager class is created. The Manager class is used to encapsulate and run the remote service MultiMediaService, listen for and wait for control requests from clients, and control the multimedia service according to the control requests. The client sends a control command, the server receives the control command and performs the corresponding operation. After the operation is completed, it sends a receipt to the client. Each receipt is put into MultiMediaService to uniformly encapsulate the type of multimedia data and playback information, and then a MediaSessionCallback class is opened to unify the receipt. S3: Call the corresponding multimedia playback engine to play the multimedia data to be played.
2. The multimedia aggregation playback control method according to claim 1, characterized in that, MultiMediaService inherits from MediaBrowserService.
3. A multimedia aggregation playback control method according to claim 1 or 2, characterized in that, In the Framework layer, a LiveData class is created. The LiveData class is used to expose multimedia aggregation playback control methods, so that the multimedia aggregation playback control methods can be called in a background thread and updated via postValue().
4. A multimedia aggregation playback control method according to claim 1 or 2, characterized in that, The callback interface, service interface, and control interface are all defined using AIDL.
5. A multimedia aggregation playback control method according to claim 1 or 2, characterized in that, Multimedia data types include local audio, online audio, FM radio audio, and Bluetooth audio.
6. A multimedia aggregation playback control system, characterized in that, include: The control command acquisition module is used to receive control commands for multimedia playback; The service configuration module determines the type of multimedia data requested for playback, starts the control service for the corresponding type of multimedia data, initializes relevant configurations, and returns a unified receipt. It is implemented based on the MediaSession multimedia framework, which includes a client, a Framework layer, and a server. On the server side, callback interfaces and service interfaces for multimedia data are defined. A MultiMediaService is created, which connects to all callback and service interfaces. Within the MultiMediaService, a multimedia interface is created to aggregate all callback and service interfaces, encapsulating them into a serializable bean class. Playback attributes for different types of multimedia data are configured through this bean class. On the client side… Define a control interface for multimedia data. This interface defines all control operations for multimedia data and communicates with the corresponding callback and service interfaces of the multimedia data on the server side through the Framework layer. In the Framework layer, create a Manager class. The Manager class encapsulates and runs the remote service MultiMediaService, listens for and waits for control requests from clients, and controls the multimedia service according to the control requests. When a client sends a control command, the server receives the control command, executes the corresponding operation, and sends an acknowledgment to the client after the operation is completed. Each acknowledgment is entered into MultiMediaService to uniformly encapsulate the multimedia data type and playback information, and a MediaSessionCallback class is then exposed to unify the acknowledgments. The execution module is used to call the corresponding multimedia playback engine to play the multimedia data to be played.
7. An electronic device, characterized in that, It includes a memory and a processor. The memory stores a computer program, and the processor calls the computer program in the memory to execute the multimedia aggregation playback control method according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores a computer program, which, when executed by a processor, is used to implement the multimedia aggregation playback control method according to any one of claims 1-5.
Citation Information
Patent Citations
Embedded multimedia playing frame
CN109522006A
Media information playing method and device based on vehicle-mounted multimedia and vehicle
CN115148229A