Multimedia file decoding method, system and apparatus, and electronic device and storage medium
By intercepting and switching the decoding component when decoding errors occur, the problem of low playback efficiency of electronic devices when decoding errors occur is solved, and the playback of multimedia files can be quickly restored.
Patent Information
- Application Number
- PCT/CN2025/087565
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-12
- Filing Date
- 2025-04-07
- Publication Date
- 2025-10-16
AI Technical Summary
In existing technologies, electronic devices need to recreate the player when multimedia file decoding fails, resulting in low playback efficiency.
When a decoding error occurs, the error message transmitted from the decoding component to the application layer is intercepted, and the multimedia data is continued to be decoded by switching to a second decoding component, thus avoiding the creation of a new player.
It improves the playback efficiency of multimedia files on electronic devices in the event of decoding failure, and reduces the time required for replay.
Smart Images

Figure CN2025087565_16102025_PF_FP_ABST
Abstract
Description
Multimedia file decoding method, system, device, electronic equipment and storage medium
[0001] Cross-reference to related applications
[0002] The present application claims priority from the Chinese patent application No. 202410443271.8 filed on April 12, 2024, and entitled "Multimedia file decoding method, system, device, electronic equipment and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0003] The present application belongs to the electronic technical field, and particularly relates to a multimedia file decoding method, system, device, electronic equipment and storage medium. BACKGROUND
[0004] At present, before playing a multimedia file, an electronic device needs to create a player in a system runtime library layer, and decodes video data of a certain video through a platform decoding component in the player, so that the video can be played. The player includes a network download component, a local memory buffer, a player logic control component and a decoding component.
[0005] In the related art, if the decoding component in the player fails to successfully decode the cache data information in the local memory buffer, the player can send an exception message to a play state exception monitoring module in an application layer, so that when the play state exception monitoring module receives the exception message, the application layer can control a multimedia playing application program to exit this playing.
[0006] However, in the above method, after the application layer controls the multimedia playing application program to exit this playing, if the user needs to play the multimedia file again, the electronic device needs to create a new player, and the player needs to perform a playing process again. As a result, the electronic device needs a relatively long time to play the multimedia file again. Therefore, in the case of decoding exception of the electronic device, the efficiency of playing the multimedia file is poor. SUMMARY
[0007] The embodiments of the present application provide a multimedia file decoding method, system, device, electronic equipment and storage medium, which can improve the efficiency of playing the multimedia file in the case of decoding exception of the electronic device.
[0008] In a first aspect, an embodiment of the present application provides a multimedia file decoding method, which comprises: in the case that a first decoding component in a system runtime library layer of an electronic device decodes a first multimedia exception and transmits a first exception message to an application layer, intercepting the first decoding component from transmitting the first exception message to the application layer, and decoding the first multimedia data by a second decoding component.
[0009] In a second aspect, an embodiment of the present application provides a multimedia file decoding apparatus, which comprises: an intercepting module and a decoding module. The intercepting module is configured to, in the case that a first decoding component in a system runtime library layer of an electronic device decodes a first multimedia data decoding exception and transmits a first exception message to an application layer, intercept the first decoding component from transmitting the first exception message to the application layer. The decoding module is configured to decode the first multimedia data by a second decoding component.
[0010] In a third aspect, an embodiment of the present application provides an electronic device, which comprises a processor and a memory. The memory stores programs or instructions that can be run on the processor. When the programs or instructions are executed by the processor, the steps of the method according to the first aspect are implemented.
[0011] In a fourth aspect, an embodiment of the present application provides a readable storage medium, which stores programs or instructions. When the programs or instructions are executed by a processor, the steps of the method according to the first aspect are implemented.
[0012] In a fifth aspect, an embodiment of the present application provides a chip, which comprises a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions, and implement the method according to the first aspect.
[0013] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the method according to the first aspect.
[0014] In the case where the first decoding component in the system runtime library layer decodes the first multimedia data abnormally and transmits the first exception message to the application layer, the electronic device can intercept the first exception message transmitted by the first decoding component to the application layer, and decode the first multimedia data through the second decoding component. In the present scheme, in the case where the first decoding component in the system runtime library layer decodes abnormally, the transmission behavior of the first exception message transmitted by the first decoding component to the application layer is intercepted, so that the application layer does not need to instruct the system runtime library layer to create a new player. At the same time, the second decoding component in the player is switched to continue decoding the first multimedia data, so that the new player does not need to be created, and the playing process can also be continued, so that the multimedia file can be played again. In this way, compared with re-creating the player and re-executing the playing process, the electronic device only needs a short time to play the multimedia file again, and the efficiency of playing the multimedia file is improved in the case of decoding exception. BRIEF DESCRIPTION OF DRAWINGS
[0015] FIG. 1 is a system architecture diagram of an operating system in the related art;
[0016] FIG. 2 is a flowchart of a multimedia file decoding method according to an embodiment of the present application;
[0017] FIG. 3 is a flowchart of a multimedia file decoding method according to an embodiment of the present application;
[0018] FIG. 4 is a flowchart of a multimedia file decoding method according to an embodiment of the present application;
[0019] FIG. 5 is a system architecture diagram of an operating system according to an embodiment of the present application;
[0020] FIG. 6 is a structural schematic diagram of a multimedia file decoding apparatus according to an embodiment of the present application;
[0021] FIG. 7 is a hardware structural schematic diagram of an electronic device according to an embodiment of the present application;
[0022] FIG. 8 is a hardware structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the present application.
[0024] The terms "first", "second", and the like in the description and claims of the application are used for distinguishing between similar objects and are not necessarily used to describe a sequence or an order. It is understood that the terms so used can be interchanged under appropriate circumstances such that the embodiments of the application described herein are, therefore, capable of embodiments in any of the sequences or combinations of components recited herein. Moreover, the terms "and / or" and "or" as used herein are intended to represent both conjunctive and disjunctive alternatives, such that the term "and / or" or "or" will be understood to mean "at least one of A, but also B, or also C, or also D, or any combination thereof." The terms "comprises", "comprising", "includes", "including", "contains", "containing" or variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, includes or contains an element or a combination of elements can include additional elements not specified after the comma. The terms "first", "second", and the like in the description and claims of the application are used for distinguishing between similar objects and are not necessarily used to describe a sequence or an order. It is understood that the terms so used can be interchanged under appropriate circumstances such that the embodiments of the application described herein are, therefore, capable of embodiments in any of the sequences or combinations of components recited herein. Moreover, the terms "and / or" and "or" as used herein are intended to represent both conjunctive and disjunctive alternatives, such that the term "and / or" or "or" will be understood to mean "at least one of A, but also B, or also C, or also D, or any combination thereof." The terms "comprises", "comprising", "includes", "including", "contains", "containing" or variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises, includes or contains an element or a combination of elements can include additional elements not specified after the comma.
[0025] The terms "at least one", "one or more", and the like in the description and the claims of the application are intended to denote any one of the stated integers, or a combination of any two or more of the stated integers. For example, "at least one of a, b and c" can denote "a", "b", "c", "a and b", "a and c", "b and c", or "a, b and c". Similarly, "at least two" means two or more, and has a similar meaning to "at least one".
[0026] The multimedia file decoding method, device, electronic device and storage medium provided by the embodiments of the application will be described in detail below in combination with the accompanying drawings and specific embodiments and application scenarios.
[0027] FIG. 1 shows a structural schematic diagram of a conventional operating system architecture. As shown in FIG. 1, the operating system architecture can include an application layer, an application framework layer, a system runtime library layer, and a kernel layer (which can be a Linux kernel layer).
[0028] The application layer includes various application programs (including system application programs and third-party application programs) in the Android operating system.
[0029] The application layer includes a playing state monitoring module.
[0030] The application framework layer is a framework of the application program. Developers can develop some application programs based on the application framework layer under the condition of complying with the development principles of the framework of the application program.
[0031] The system runtime library layer includes a library (also referred to as a system library) and an Android operating system runtime environment. The library mainly provides various resources required by the Android operating system. The Android operating system runtime environment is used to provide a software environment for the Android operating system.
[0032] Exemplarily, the system runtime library layer includes a player, and the player includes a network downloading module, a local data caching module, a player logic control component, and a decoding component.
[0033] The network downloading module is configured to acquire multimedia data from a server, the local data caching module is configured to cache the multimedia data, the player logic control component is configured to render multimedia information corresponding to the multimedia data, and the decoding component is configured to decode the multimedia data to obtain the multimedia information.
[0034] The kernel layer is an operating system layer of the Android operating system and belongs to the lowest layer of the software hierarchy of the Android operating system. The kernel layer provides core system services and hardware-related drivers based on the Linux kernel for the Android operating system.
[0035] The multimedia file decoding method and device, the electronic device, and the storage medium provided by the embodiments of the present application can be applied in a video playing or audio playing scenario.
[0036] At present, with the development of electronic devices, the functions of the electronic devices are also increasing. For example, the electronic devices can play videos or audios. Generally, the electronic devices can play videos or audios through a player in a system runtime library layer.
[0037] Exemplarily, in combination with FIG. 1, after the application layer in the operating system receives input of a user on a certain video identifier, the application layer can call the player in the system runtime library layer and input the video identifier into a network downloading module in the player. The network downloading module can download video data from a server based on the video identifier and then input the downloaded video data into a local data caching module. Then, a player logic control component can acquire the video data cached by the local data caching module through an input / output (IO) port and then input the cached video data into a decoding component to decode the cached video data, so as to obtain video information. Then, the decoding component can transmit the video information to the player logic control component. After the player logic control kernel renders the video information, the rendered picture is transmitted to a display module of the application layer, so as to play the video.
[0038] If the decoding component in the player fails to successfully decode the cached data information in the local memory buffer, the player can send an exception message to a playing state exception monitoring module in the application layer, so that when the playing state exception monitoring module receives the exception message, the application layer can control the video playing application program to exit this playing and instruct the system runtime library layer to create a new player.
[0039] However, in the above method, after the system runtime library layer creates a new player, the player needs to re-execute the playing process. This causes the electronic device to take a long time to replay the video, and thus, in the case of decoding exception of the electronic device, the efficiency of playing the multimedia file is poor.
[0040] In the embodiment of the present application, in the case of decoding exception of the first decoding component in the player, the transmission behavior of the first exception message transmitted by the first decoding component to the application layer is intercepted, so that the application layer does not need to instruct the system runtime library layer to create a new player. At the same time, the second decoding component in the player is switched to continue decoding the first multimedia data, so that the playing process can continue to be executed without creating a new player, thereby replaying the multimedia file. Thus, compared with re-creating the player and re-executing the playing process, the electronic device only needs a short time to replay the multimedia file, and in the case of decoding exception of the electronic device, the efficiency of playing the multimedia file is improved.
[0041] The execution subject of the multimedia file decoding method provided in the embodiment of the present application can be a multimedia file decoding device, which can be an electronic device or a functional module in the electronic device. The technical solutions provided in the embodiments of the present application are described below with the electronic device as an example.
[0042] The embodiment of the present application provides a multimedia file decoding method, and FIG. 2 shows a flowchart of a multimedia file decoding method provided in the embodiment of the present application. As shown in FIG. 2, the multimedia file decoding method provided in the embodiment of the present application can include the following steps 201 and 202.
[0043] Step 201: In the case of decoding exception of the first decoding component in the system runtime library layer of the electronic device and transmitting a first exception message to the application layer, the electronic device intercepts the first decoding component from transmitting the first exception message to the application layer.
[0044] Optionally, in the embodiment of the present application, the system runtime library layer can include at least two decoding components, including the first decoding component.
[0045] Illustratively, the first decoding component is a hardware decoding component in the system runtime library layer.
[0046] Optionally, in the embodiment of the present application, the first multimedia data can include any of the following: video data or audio data.
[0047] Illustratively, the first exception message is used to indicate that the first decoding component has an exception when decoding the first multimedia data, i.e., the first multimedia data cannot be correctly decoded.
[0048] In the embodiment of the present application, when the first decoding component decodes the first multimedia data abnormally, the first decoding component can generate a first exception message.
[0049] In the embodiment of the present application, the electronic device can intercept, by the exception handling module, the transmission behavior of the first decoding component to the application layer for transmitting the first exception message.
[0050] In step 202, the electronic device decodes the first multimedia data by a second decoding component.
[0051] In the embodiment of the present application, the decoding manner of the second decoding component is different from the decoding manner of the first decoding component.
[0052] Exemplarily, after the first decoding component in the system runtime library layer generates the first exception message, the exception monitoring module in the system runtime library layer can transmit the first exception message generated by the first decoding component to the player logic control component, and then the player logic control component transmits the first exception message to the exception handling module. Then, after receiving the first exception message, the exception handling module can transmit the component identifier of the second decoding component to the player logic control component and discard the first exception message. Then, after the player logic control component receives the component identifier of the second decoding component, the player logic control component can determine the second decoding component from the system runtime library layer based on the component identifier of the second decoding component, switch the first decoding component to the second decoding component, and then send the first multimedia data to the second decoding component to decode the first multimedia data by the second decoding component.
[0053] Optionally, in the embodiment of the present application, after the exception handling module receives the first exception message, the exception handling module can decode and process the first exception message, so that the exception handling module can identify the first exception message.
[0054] Optionally, in the embodiment of the present application, after the electronic device switches from the first decoding component to the second decoding component, the player logic control component can control the pointer in the local data cache module to dial back to re-input the first multimedia data into the second decoding component.
[0055] In the multimedia file decoding method provided in the embodiments of the present application, in the case that the first decoding component in the system runtime library layer decodes the first multimedia data abnormally and transmits a first exception message to the application layer, the electronic device can intercept the first exception message transmitted by the first decoding component to the application layer, and decode the first multimedia data through the second decoding component. In this solution, in the case that the first decoding component in the player decodes abnormally, the transmission behavior of the first exception message transmitted by the first decoding component to the application layer is intercepted, so that the application layer does not need to instruct the system runtime library layer to create a new player. At the same time, the second decoding component in the player is switched to continue decoding the first multimedia data, so that the playing process can be continued without creating a new player, and the multimedia file can be played again without creating a new player. In this way, compared with re-creating a player and re-executing a playing process, the electronic device only needs a short time to play the multimedia file again, and the efficiency of playing the multimedia file is improved in the case of decoding exception.
[0056] Optionally, before the step 202, the multimedia file decoding method provided in the embodiments of the present application further includes the following step 301.
[0057] In step 301, the electronic device switches the first decoding component currently decoded by the player to the second decoding component through the player logic control component in the system runtime library layer.
[0058] In the embodiments of the present application, the player logic control component in the system runtime library layer can receive the component identifier of the second decoding component sent by the exception processing module, and then switch the first decoding component to the second decoding component through the component identifier of the second decoding component.
[0059] For example, the second decoding component can be any one of the following: a google software decoding component or a software decoding component customized by a manufacturer.
[0060] In the embodiments of the present application, the player logic control component switches other decoding components in the system runtime library layer to continue decoding the first multimedia data, so that the playing process can be continued without creating a new player, and the multimedia file can be played again.
[0061] Optionally, in the embodiments of the present application, the first exception message includes decoding exception state information; before the step 301, the multimedia file decoding method provided in the embodiments of the present application further includes the following steps 401 and 402.
[0062] In step 401, the electronic device reports a first exception message to an exception handling module in a system runtime library layer through a player logic control component.
[0063] Exemplarily, the decoding exception state information can be a decoding exception state value, such as 00 or 01.
[0064] In step 402, the electronic device determines a second decoding component based on the decoding exception state information through the exception handling module, and sends a component identifier of the second decoding component to the player logic control component.
[0065] In the embodiment of the present application, the exception handling module can analyze the decoding exception state information to determine the second decoding component, and send a component identifier of the second decoding component to the player logic control component.
[0066] In this way, the exception handling module can determine the second decoding component through the decoding exception state information, thereby improving the flexibility of the electronic device in determining the second decoding component.
[0067] Optionally, in the embodiment of the present application, the first exception message contains the decoding exception state information; before the step 202 of "decoding the first multimedia data through the second decoding component", the multimedia file decoding method provided by the embodiment of the present application further includes the following step 501 or step 502.
[0068] In step 501, the electronic device takes a decoding component in a system of the electronic device as the second decoding component in a case where the decoding exception state information indicates that system resources in the electronic device satisfy a first condition.
[0069] Exemplarily, the decoding component in the system can be a google software decoding component.
[0070] In the embodiment of the present application, in a case where the exception handling module determines that the decoding exception state information indicates that the system resources in the electronic device satisfy the first condition, the exception handling module can determine the second decoding component as a software decoding component in the system of the electronic device.
[0071] Optionally, in the embodiment of the present application, the system resources in the electronic device satisfying the first condition can be at least one of the following: the free memory in the electronic device is less than a preset threshold, the free storage control of the electronic device is less than a preset threshold, and the resource utilization rate of the central processing unit in the electronic device is greater than or equal to a preset threshold.
[0072] In step 502, the electronic device takes a third-party decoding component as the second decoding component in a case where the decoding exception state information indicates that the first decoding component does not have a decoding function for the first multimedia data information.
[0073] Exemplarily, the third-party decoding component is a custom decoding component defined by a vendor of the electronic device.
[0074] Exemplarily, the first decoding component does not have a decoding function for the first multimedia data information, i.e., a decoding mode of the first decoding component does not correspond to an encoding mode of the first multimedia data information, so that the first decoding component cannot decode the first multimedia data information.
[0075] In the embodiment of the present application, in the case where the exception handling module determines that the first decoding component does not have a decoding function for the first multimedia data information, the exception handling module can determine the second decoding component as a custom decoding component defined by a vendor of the electronic device.
[0076] In the embodiment of the present application, the electronic device can determine a decoding component corresponding to decoding exception state information according to the first exception message containing the decoding exception state information, so that the accuracy of decoding by the electronic device is improved.
[0077] Optionally, in the embodiment of the present application, as shown in FIG. 4, after the step 202, the multimedia file decoding method provided by the embodiment of the present application further includes the following steps 601 and 602.
[0078] In the case where the second decoding component decodes the first multimedia data abnormally, the electronic device obtains component information of a third decoding component from a server.
[0079] In the embodiment of the present application, the electronic device can obtain the component information of the third decoding component through the exception handling module.
[0080] Exemplarily, in the case where the second decoding component decodes the first multimedia data abnormally, the exception monitoring module in the system runtime library layer can transmit a second exception message generated by the second decoding component to the player logic control component; then, the player logic control component sends the second exception message to the exception handling module; further, after receiving the second exception message, the exception handling module can send a first request to the server, so that the server can send the component information of the third decoding component to the exception handling module; then, the exception handling module sends the component information of the third decoding component to the player logic control component.
[0081] In the case where the second decoding component decodes the first multimedia data abnormally, the electronic device obtains component information of a third decoding component from a server.
[0082] In the embodiment of the present application, after receiving the component information of the third decoding component, the player logic control component can create the third decoding component in the system runtime library layer based on the component information, then switch the second decoding component to the third decoding component, and send the first multimedia data to the third decoding component to decode the first multimedia data through the third decoding component.
[0083] In the embodiment of the present application, in the case that the second decoding component decodes the first multimedia data abnormally, the electronic device obtains the component information of the third decoding component from the server, creates the third decoding component in the system runtime library layer through the component information of the third decoding component, and decodes the first multimedia data through the third decoding component. In this way, the flexibility of the electronic device in decoding the first multimedia data is improved.
[0084] Optionally, the multimedia file decoding method provided by the embodiment of the present application further includes the following step 701.
[0085] In the case that any decoding component successfully decodes the first multimedia data, the electronic device sends a decoding success message to the application layer in the system runtime library layer.
[0086] In the embodiment of the present application, the decoding success message includes decoding information obtained after any decoding component successfully decodes the first multimedia data.
[0087] Optionally, in the embodiment of the present application, the decoding information includes at least one of a video resolution, a video color value and an audio quality.
[0088] In the embodiment of the present application, after any decoding component successfully decodes the first multimedia data, the decoding component can send a decoding success message to the player logic control component, and then the player logic control component sends the decoding success message to the exception processing module. Further, the exception processing module can send the decoding success message to the play state monitoring module in the application layer, so that the play state monitoring module can transmit the decoding information to the output unit.
[0089] Optionally, in the embodiment of the present application, after the play state monitoring module in the application layer receives the decoding success message, the application layer can freely choose whether to process the message. The application layer can decide whether to need to reset the display related parameters according to the message, and if the application layer does not process the message, the original display parameters are still used for picture rendering.
[0090] Optionally, the multimedia file decoding method provided by the embodiment of the present application further includes the following step 801.
[0091] Step 801, in the case that all decoding components in the player cannot successfully decode the first multimedia data, the electronic device sends a decoding failure message to the application layer at the system runtime library layer.
[0092] In the embodiment of the application, when the abnormality processing module implements all compatible modes, and the decoding abnormality still occurs, the abnormality value is thrown to the application layer according to the Android native process, and finally the application layer processes the abnormality.
[0093] The architecture of the operating system provided by the embodiment of the application is explained below.
[0094] As shown in FIG. 5, it is a possible architecture of the operating system provided by the embodiment of the application. In FIG. 2, the architecture of the operating system includes four layers, which are the application layer, the application framework layer, the system runtime library layer and the kernel layer (which can be the Linux kernel layer).
[0095] The application layer includes various application programs (including system application programs and third-party application programs) in the operating system.
[0096] Exemplarily, the application layer includes a playing state monitoring module and a display module.
[0097] The application framework layer is the framework of the application program. The developers can develop some application programs based on the application framework layer under the condition of complying with the development principles of the framework of the application program.
[0098] The system runtime library layer includes a library (also referred to as a system library) and an operating system runtime environment. The library mainly provides various resources required by the operating system. The operating system runtime environment is used to provide a software environment for the operating system.
[0099] Exemplarily, the system runtime library layer includes a network downloading module, a local data caching module, a player logic control component, at least one decoding component and an abnormality processing module.
[0100] The network downloading module is used to obtain multimedia data from a server, the local data caching module is used to cache the multimedia data, the player logic control component is used to render multimedia information corresponding to the multimedia data, and each decoding component in the at least one decoding component is used to decode the multimedia data to obtain the multimedia information.
[0101] The kernel layer is the operating system layer of the operating system, and belongs to the bottom layer of the software hierarchy of the operating system. The kernel layer provides core system services and hardware-related drivers for the operating system based on the Linux kernel.
[0102] With reference to FIG. 5, the embodiment of the present application provides a multimedia file decoding system, which comprises: a system runtime library layer, the system runtime library layer comprising a first decoding component, a second decoding component, an exception processing module, and a player logic control component.
[0103] The first decoding component reports a first exception message to the exception processing module through the player logic control component in the case of decoding exception of the first multimedia data; the exception processing module determines the second decoding component based on the first exception message, and sends a component identifier of the second decoding component to the player logic control component; the player logic control component switches the first decoding component to the second decoding component based on the component identifier of the second decoding component; and the second decoding component decodes the first multimedia data.
[0104] Optionally, in the embodiment of the present application, the first exception message comprises decoding exception state information; the exception processing module takes a decoding component in the system of the electronic device as the second decoding component in the case that the decoding exception state information indicates that the system resource in the electronic device meets the first condition; or takes a third-party decoding component as the second decoding component in the case that the decoding exception state information indicates that the first decoding component does not have the decoding function for the first multimedia data information.
[0105] Optionally, in the embodiment of the present application, in the case that the second decoding component decodes the first multimedia data abnormally, the exception processing module obtains component information of a third decoding component from a server, and sends the component information of the third decoding component to the player logic control component; the player logic control component creates the third decoding component based on the component information of the third decoding component, and decodes the first multimedia data through the third decoding component.
[0106] Optionally, in the embodiment of the present application, the multimedia file decoding system further comprises: an application layer, the application layer comprising: a playing state monitoring module.
[0107] In the case that any decoding component successfully decodes the first multimedia data, the exception processing module sends a decoding success message to the playing state monitoring module in the application layer, the decoding success message comprising: decoding information obtained after any decoding component successfully decodes the first multimedia data; and the playing state monitoring module determines display parameters based on the decoding information.
[0108] Optionally, in the embodiment of the present application, in the case that all decoding components in the system runtime library layer cannot successfully decode the first multimedia data, the exception processing module sends a decoding failure message to the playing state monitoring module.
[0109] Exemplarily, in combination with FIG. 5, the multimedia decoding method provided by the present application is specifically explained below through a specific example, and is specifically implemented through the following steps 20 to 25.
[0110] Step 20, the Error handle module informs the player logic control component to pause the video picture rendering first. The Error handle module is the above-mentioned exception handling module.
[0111] Step 21, the Error handle module will decide whether to use the google decoding component or the vendor customized decoding component for the newly created decoding component according to the obtained decoding exception state value. The exception state value is roughly divided into two kinds, the error caused by insufficient hardware resource memory in running and the error of data source code stream exception. For the former, the google decoding component is switched, and for the error of data source code stream exception, the vendor customized component is switched.
[0112] Step 22, the above-mentioned google decoding component and vendor customized decoding component are both software implemented video data decoding modules (different from the DSP hardware implemented decoding module of the chip itself), wherein the google decoding component is included in the android open source code, and the vendor customized decoding component is a component customized and implemented by the mobile phone manufacturer according to the code stream compatibility requirement of the mobile phone manufacturer. In addition, when the existing module in the Error handle cannot be compatible with the code stream, it will try to download the appropriate decoding component from the cloud, so as to ensure the maximum compatibility.
[0113] Step 23, the Error handle module will inform the local cache module to return the data reading pointer, and send the video data to the player logic control component from the decoding exception picture time point before
[0114] Step 24, the player logic control component will send the new video data to the newly created decoder component to perform the new decoding and playing action, and start playing and rendering the picture from the previous decoding exception time point
[0115] Step 25, when the Error handle module completes the decoder switching, it will throw an info message to inform the application layer of the change of the new decoding information, and the application layer can freely choose whether to process the message. The message usually includes the resolution and color information of the decoding picture after switching, and the application layer can decide whether to need to reset the display related parameters according to the info. If the application layer does not process the message, the picture rendering is still performed with the original display parameters
[0116] When the Error handle module implements all compatible modes, and decoding exception still occurs, the exception value is thrown to the application layer according to the original process of Android, and finally the application layer processes the exception.
[0117] The various method embodiments or various possible implementation manners in each method embodiment can be executed individually or, in the absence of contradiction, can also be executed in combination. The specific execution can be determined according to actual use requirements, and the application embodiments do not limit this.
[0118] It should be noted that the multimedia decoding method provided in the application embodiments can be executed by a multimedia decoding device or an electronic device, or a functional module or entity in the electronic device. In the application embodiments, the multimedia decoding device is taken as an example to execute the multimedia decoding method, and the multimedia decoding device provided in the application embodiments is described.
[0119] FIG. 6 shows a possible structural schematic diagram of a multimedia file decoding device involved in the application embodiments. As shown in FIG. 6, the multimedia file decoding device 70 can include an interception module 71 and a decoding module 72.
[0120] The interception module 71 is configured to intercept the first decoding component from transmitting the first exception message to the application layer when the first decoding component decodes the first multimedia data abnormally and transmits the first exception message to the application layer in the system runtime library layer of the electronic device. The decoding module 72 is configured to decode the first multimedia data by using the second decoding component.
[0121] In a possible implementation manner, the multimedia file decoding device further includes a switching module. The switching module is configured to switch the first decoding component to the second decoding component by using the player logic control component in the system runtime library layer before the decoding module 73 decodes the first multimedia data by using the second decoding component.
[0122] In a possible implementation manner, the first exception message includes decoding exception state information. The multimedia file decoding device further includes a sending module and a determining module. The sending module is configured to report the first exception message to the exception handling module on the system runtime library layer by using the player logic control component before the switching module switches the first decoding component to the second decoding component by using the player logic control component in the system runtime library layer. The determining module is configured to determine the second decoding component based on the decoding exception state information by using the exception handling module. The sending module is further configured to send the component identifier of the second decoding component to the player logic control component.
[0123] In a possible implementation, the first exception message comprises decoding exception state information; and the determining module is further configured to, before the decoding module 72 decodes the first multimedia data by the second decoding component, determine, according to the decoding exception state information, whether the system resources in the electronic device satisfy a first condition, and if so, determine the software decoding component in the system of the electronic device as the second decoding component; or if the first decoding component does not have the decoding function for the first multimedia data information, determine a third-party decoding component as the second decoding component.
[0124] In a possible implementation, the multimedia file decoding apparatus further comprises an obtaining module and a creating module. The obtaining module is configured to, after the decoding module 72 decodes the first multimedia data by the second decoding component, obtain component information of a third decoding component from a server if the second decoding component fails to decode the first multimedia data. The creating module is configured to create the third decoding component based on the component information, and decode the first multimedia data by the third decoding component.
[0125] In a possible implementation, the multimedia file decoding apparatus further comprises a sending module. The sending module is configured to, if any decoding component successfully decodes the first multimedia data, send a decoding success message to the application layer at the system runtime library layer, where the decoding success message comprises decoding information obtained after any decoding component successfully decodes the first multimedia data.
[0126] In a possible implementation, the multimedia file decoding apparatus further comprises a sending module.
[0127] The sending module is configured to, if all decoding components in the system runtime library layer fail to successfully decode the first multimedia data, send a decoding failure message to the application layer by an exception handling module in the system runtime library layer.
[0128] The embodiments of the present application provide a multimedia file decoding apparatus. In the case that a first decoding component in a system runtime library layer has a decoding exception, the transmission behavior of a first exception message transmitted by the first decoding component to an application layer is intercepted, so that the application layer does not need to instruct the system runtime library layer to create a new player. Meanwhile, a second decoding component in the player is switched to continue decoding the first multimedia data, so that the playing process can be continued without creating a new player, and the multimedia file can be played again. In this way, compared with re-creating a player and re-executing a playing process, the electronic device only needs a short time to play the multimedia file again, and the efficiency of playing the multimedia file is improved in the case of a decoding exception.
[0129] The multimedia file decoding apparatus in the embodiments of the present application can be an electronic device or a component in an electronic device, for example, an integrated circuit or a chip. The electronic device can be a terminal or other device than a terminal. For example, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile Internet Device (MID), an augmented reality (AR) / virtual reality (VR) device, a robot, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), and the like, and can also be a server, a Network Attached Storage (NAS), a personal computer (PC), a television (TV), a teller machine, a self-service machine, and the like. The embodiments of the present application are not limited in this regard.
[0130] The multimedia file decoding apparatus in the embodiments of the present application can be a device with an operating system. The operating system can be an Android operating system, an iOS operating system, or other possible operating system, and the embodiments of the present application are not limited in this regard.
[0131] The multimedia file decoding apparatus provided in the embodiments of the present application can implement the processes of the above embodiments, and thus repeated description is omitted here.
[0132] Optionally, as shown in FIG. 7, the embodiments of the present application further provide an electronic device 90, which includes a processor 91 and a memory 92. The memory 92 has a program or instruction stored thereon, which can be run on the processor 91. The program or instruction is executed by the processor 91 to implement each step of the above multimedia file decoding method embodiments and achieve the same technical effects. To avoid repetition, the same is not described here.
[0133] It should be noted that the electronic device in the embodiments of the present application includes the above-mentioned mobile electronic device and non-mobile electronic device.
[0134] FIG. 8 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
[0135] The electronic device 100 includes, but is not limited to, a radio frequency unit 101, a network module 102, an audio output unit 103, an input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, and a processor 110, etc.
[0136] Those skilled in the art can understand that the electronic device 100 can further include a power supply (such as a battery) for supplying power to each component, and the power supply can be logically connected to the processor 110 through a power management system, so that the power management system can realize functions such as management of charging, discharging, and power consumption management. The electronic device structure shown in FIG. 8 does not constitute a limitation on the electronic device, and the electronic device can include more or fewer components than shown, or combine certain components, or different component arrangements, which will not be described here.
[0137] The processor 110 is configured to, in a case where a first decoding component in a system runtime library layer of the electronic device decodes first multimedia data abnormally and transmits a first exception message to an application layer, intercept the transmission of the first exception message from the first decoding component to the application layer, and decode the first multimedia data through a second decoding component.
[0138] The electronic device provided in the embodiments of the present application, in a case where a first decoding component in a system runtime library layer decodes abnormally, intercepts the transmission of a first exception message transmitted from the first decoding component to an application layer, so that the application layer does not need to instruct the system runtime library layer to create a new player, and at the same time, continues to decode the first multimedia data through a second decoding component in the player, so that the new player does not need to be created, and the playing process can also be continued, thereby playing the multimedia file again; in this way, compared with re-creating the player and re-executing the playing process, the electronic device only needs a short time to play the multimedia file again, and the efficiency of playing the multimedia file is improved in a case where the electronic device decodes abnormally.
[0139] Optionally, in the embodiments of the present application, before the processor 110 decodes the first multimedia data through the second decoding component, the processor 110 is further configured to switch the first decoding component to the second decoding component through a player logic control component in the system runtime library layer.
[0140] Optionally, in the embodiments of the present application, the first exception message includes decoding exception state information; before the processor 110 switches the first decoding component to the second decoding component through the player logic control component in the system runtime library layer, the processor 110 is further configured to send the first exception message to an exception handling module in the system runtime library layer through the player logic control component; through the exception handling module, based on the decoding exception state information, the second decoding component is determined, and the component identifier of the second decoding component is sent to the player logic control component.
[0141] Optionally, in the embodiments of the present application, the first exception message contains decoding exception state information; the processor 110 is further configured to, before decoding the first multimedia data by the second decoding component, in a case where the decoding exception state information indicates that system resources in the electronic device meet the first condition, taking a software decoding component in the system in the electronic device as the second decoding component; or, in a case where the decoding exception state information indicates that the first decoding component does not have the decoding function for the first multimedia data information, taking a third-party decoding component as the second decoding component.
[0142] Optionally, in the embodiments of the present application, the processor 110 is further configured to, after decoding the first multimedia data by the second decoding component, in a case where the second decoding component fails to decode the first multimedia data, obtaining component information of a third decoding component from a server; creating the third decoding component based on the component information, and decoding the first multimedia data by the third decoding component.
[0143] Optionally, in the embodiments of the present application, the processor 110 is further configured to, in a case where any decoding component successfully decodes the first multimedia data, sending a decoding success message to an application layer at a system runtime library layer, the decoding success message including decoding information obtained after any decoding component successfully decodes the first multimedia data.
[0144] Optionally, in the embodiments of the present application, the processor 110 is further configured to, in a case where all decoding components in the system runtime library layer fail to successfully decode the first multimedia data, sending a decoding failure message to the application layer by an exception processing module in the system runtime library layer.
[0145] The electronic device provided in the embodiments of the present application can implement each process achieved by the method embodiments, and achieve the same technical effects. To avoid repetition, details are not described herein.
[0146] The beneficial effects of various implementation manners in the embodiments can refer to the beneficial effects of the corresponding implementation manners in the method embodiments, and details are not described herein to avoid repetition.
[0147] It should be understood that in the embodiments of the present application, the input unit 104 can include a graphics processor (GPU) 1041 and a microphone 1042. The graphics processor 1041 processes image data of a still picture or a video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 106 can include a display panel 1061, which can be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 107 includes at least one of a touch panel 1071 and other input devices 1072. The touch panel 1071 is also referred to as a touch screen. The touch panel 1071 can include two parts of a touch detection device and a touch controller. The other input devices 1072 can include, but are not limited to, a physical keyboard, function keys (such as volume control keys, on-off keys, and the like), a trackball, a mouse, a joystick, and the like, which will not be described here.
[0148] The memory 109 can be used to store software programs and various data. The memory 109 can mainly include a first storage area storing programs or instructions and a second storage area storing data, wherein the first storage area can store an operating system, application programs or instructions required by at least one function (such as a sound playing function, an image playing function, and the like), and the like. In addition, the memory 109 can include a volatile memory or a non-volatile memory, or the memory 109 can include both volatile and non-volatile memories. The non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), a static random access memory (SRAM), a dynamic random access memory (DRAM), a synchronous dynamic random access memory (SDRAM), a double data rate synchronous dynamic random access memory (DDR SDRAM), an enhanced synchronous dynamic random access memory (ESDRAM), a synch link dynamic random access memory (SLDRAM), and a direct memory bus random access memory (Direct Rambus RAM, DRRAM). The memory 109 in the embodiments of the present application includes but is not limited to these and any other suitable types of memory.
[0149] The processor 110 can include one or more processing units; optionally, the processor 110 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and an application program, and the modem processor mainly processes a wireless communication signal, such as a baseband processor. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 110.
[0150] The embodiment of the present application further provides a readable storage medium, and the readable storage medium stores a program or instructions, the program or instructions are executed by a processor to realize various processes of the above-mentioned method embodiment, and the same technical effects can be achieved, and details are not repeated here.
[0151] The processor is the processor in the electronic device in the above-mentioned embodiment. The readable storage medium includes a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like.
[0152] The embodiment of the present application further provides a chip, and the chip includes a processor and a communication interface, the communication interface is coupled with the processor, and the processor is used to run a program or instructions to realize various processes of the above-mentioned method embodiment, and the same technical effects can be achieved, and details are not repeated here.
[0153] It should be understood that the chip mentioned in the embodiment of the present application can also be referred to as a system level chip, a system chip, a chip system, or a system on chip, and the like.
[0154] The embodiment of the present application provides a computer program product, and the program product is stored in a storage medium, and the program product is executed by at least one processor to realize various processes of the above-mentioned multimedia file decoding method embodiment, and the same technical effects can be achieved, and details are not repeated here.
[0155] It should be noted that, in the present document, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element. Furthermore, it is to be understood that the method and apparatus of the present application can be carried out by more than one process, method, article, or apparatus either simultaneously, concurrently, or with intervening action that are carried out at the same time, either in a simultaneous fashion or in a fashion that is interleaved in time. For example, the described methods can be performed in a different order from that described, and / or various steps can be combined or omitted, and / or additional steps can be added, without departing from the scope of the present application. Also, features described with respect to certain examples can be combined in other examples.
[0156] From the above description of the embodiments, it is apparent that the above-mentioned method can be realized by means of software and necessary universal hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solution of the present application can be embodied in the form of computer software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a plurality of instructions for making a terminal (which can be a mobile phone, computer, server, or network equipment, etc.) execute the method described in various embodiments of the present application.
[0157] The embodiments of the present application are described above in conjunction with the drawings, but the present application is not limited to the above-described specific embodiments, and the above-described specific embodiments are merely illustrative, rather than limiting, and those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the scope protected by the claims.
Claims
1. A multimedia file decoding method, wherein: The method comprises: When a first decoding component in the runtime layer of the electronic device system decodes the first multimedia data abnormally and transmits a first abnormality message to the application layer, intercepting the first decoding component from transmitting the first abnormality message to the application layer; The first multimedia data is decoded by a second decoding component.
2. The method according to claim 1, before decoding the first multimedia data by the second decoding component, the method further comprises: The first decoding component is switched to the second decoding component through the player logic control component in the system runtime layer.
3. The method according to claim 2, wherein the first exception message includes decoding exception status information; Before switching the first decoding component to the second decoding component through the player logic control component in the system runtime layer, the method further includes: Reporting the first exception message to the exception handling module in the system runtime layer through the player logic control component; The exception handling module determines the second decoding component based on the decoding exception status information, and sends the component identifier of the second decoding component to the player logic control component.
4. The method according to any one of claims 1 to 3, wherein the first exception message includes decoding exception status information; Before decoding the first multimedia data by the second decoding component, the method further includes: In a case where the decoding abnormality status information indicates that the system resources in the electronic device meet the first condition, using the decoding component in the system of the electronic device as the second decoding component; or When the decoding abnormality status information indicates that the first decoding component does not have the decoding function of the first multimedia data information, a third-party decoding component is used as the second decoding component.
5. The method according to claim 1, after decoding the first multimedia data by the second decoding component, the method further comprises: When the second decoding component decodes the first multimedia data abnormally, obtaining component information of a third decoding component from a server; Based on the component information, the third decoding component is created, and the first multimedia data is decoded by the third decoding component.
6. The method according to claim 1 or 5, further comprising: When any decoding component successfully decodes the first multimedia data, the system runtime layer sends a decoding success message to the application layer. The decoding success message includes: decoding information obtained after any decoding component successfully decodes the first multimedia data.
7. The method according to claim 1, further comprising: In the case that all decoding components in the system runtime layer cannot successfully decode the first multimedia data, a decoding failure message is sent to the application layer through the exception handling module in the system runtime layer.
8. A multimedia file decoding system, wherein: The system comprises: a system runtime layer, wherein the system runtime layer comprises a first decoding component, a second decoding component, an exception handling module and a player logic control component; When the first decoding component decodes the first multimedia data abnormally, the first decoding component reports a first abnormality message to the abnormality handling module through the player logic control component; The exception handling module determines a second decoding component based on the first exception message, and sends a component identifier of the second decoding component to the player logic control component; The player logic control component switches the first decoding component to the second decoding component based on the component identifier of the second decoding component; The second decoding component decodes the first multimedia data.
9. The multimedia file decoding system according to claim 8, wherein the first exception message comprises decoding exception status information; The exception handling module uses the decoding component in the electronic device system as the second decoding component when the decoding exception status information indicates that the system resources in the electronic device meet the first condition; or When the decoding abnormality status information indicates that the first decoding component does not have the decoding function of the first multimedia data information, a third-party decoding component is used as the second decoding component.
10. The multimedia file decoding system according to claim 8 or 9, wherein when the second decoding component decodes the first multimedia data abnormally, the exception handling module obtains component information of the third decoding component from the server and sends the component information of the third decoding component to the player logic control component; The player logic control component creates the third decoding component based on the component information of the third decoding component, and decodes the first multimedia data through the third decoding component.
11. The multimedia file decoding system according to claim 8 or 10, further comprising: The application layer includes: a playback status monitoring module; When any decoding component successfully decodes the first multimedia data, the exception handling module sends a decoding success message to the playback status monitoring module in the application layer, where the decoding success message includes: decoding information obtained after any decoding component successfully decodes the first multimedia data; The playback status monitoring module determines display parameters based on the decoded information.
12. The multimedia file decoding system according to claim 11, wherein when all decoding components in the system runtime layer cannot successfully decode the first multimedia data, the exception handling module sends a decoding failure message to the playback status monitoring module.
13. A multimedia file decoding device, wherein: The device comprises: an interception module and a decoding module; The interception module is configured to intercept, when a first decoding component in a system runtime layer of the electronic device decodes the first multimedia data abnormally and transmits a first abnormality message to the application layer, the first decoding component transmitting the first abnormality message to the application layer; The decoding module is configured to decode the first multimedia data through a second decoding component.
14. An electronic device comprising a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the multimedia file decoding method according to any one of claims 1 to 7.
15. A readable storage medium storing a program or instruction, wherein the program or instruction, when executed by a processor, implements the steps of the multimedia file decoding method according to any one of claims 1 to 7.
16. A chip comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is configured to execute a program or instruction to implement the steps of the multimedia file decoding method according to any one of claims 1 to 7.
17. A computer program product, wherein the program product is executed by at least one processor to implement the steps of the multimedia file decoding method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Player decoding method and device
CN105898295A
Video processing method and device, and terminal
CN107172432A
Method and device for decoding video file
CN114339257A
Multimedia file decoding method, system and device, electronic equipment and storage medium
CN118354146A
Multimedia encoding / decoding method and device for multi-operating system, and electronic device
WO2018119711A1