Video data processing method, electronic device and storage medium

By introducing video processing policy module and a second hardware abstraction layer into the operating system of electronic devices, the problem that third-party applications cannot access the video function of native cameras is solved, and the use of video processing strategies for native camera applications is realized, and video is improved. Flexibility and effectiveness of processing.

CN116366914BActive Publication Date: 2025-02-18BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111631008.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-28
Publication Date
2025-02-18
Estimated Expiration
2041-12-28

AI Technical Summary

Technical Problem

The system architecture of existing electronic devices restricts third-party applications from accessing and using the video functions of native cameras, resulting in third-party applications not being able to obtain better video effects.

Method used

By introducing a video processing policy module and a second hardware abstraction layer into the operating system of an electronic device, a third-party application can send a video processing request to the first hardware abstraction layer, and then pass it to the second hardware abstraction layer after parsing and encapsulation, so as to achieve the Use of video processing strategies for native camera applications.

Benefits of technology

It realizes the use of video processing strategies of third-party applications for native camera applications, opens up the video functions of native cameras to third-party applications, and improves the flexibility and effect of video processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116366914B_ABST
    Figure CN116366914B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a video data processing method, an electronic device and a storage medium. The operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer and an application layer provided with a third-party application. The method includes: the third-party application sends a first video processing request to a video processing strategy module in the first hardware abstraction layer; the video processing strategy module generates a second video processing request according to a parsing result of the first video processing request, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; the second hardware abstraction layer processes video data according to a target video processing strategy that matches the second video processing request, and sends the processed data to the third-party application, where the target video processing strategy is a video processing strategy provided for a native camera application, thereby realizing the use of the video processing strategy of the native camera application by the third-party application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of electronic information technology, and in particular to a video data processing method, an electronic device and a storage medium. Background Art

[0002] At present, the video processing technology of electronic devices has been very mature. In most electronic devices, multiple cameras are integrated for video recording and configured with corresponding video functions. However, under the existing system architecture of electronic devices, the configured video functions can only be accessed by the native camera of the electronic device, and third-party applications cannot access and use the video functions of the native camera of the electronic device, which results in the inability of third-party applications to obtain good video effects. Summary of the invention

[0003] In order to overcome the problems existing in the related art, the present disclosure provides a video data processing method, an electronic device and a storage medium.

[0004] According to a first aspect of an embodiment of the present disclosure, a video data processing method is provided, which is applied to an electronic device, wherein an operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer, and an application layer provided with a third-party application, and the video data processing method includes:

[0005] The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer;

[0006] The video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer;

[0007] The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, wherein the target video processing strategy is a video processing strategy provided for a native camera application.

[0008] Optionally, the first video processing request carries stream configuration information, the stream configuration information includes video function parameters, metadata, and usage parameters of a video buffer, the metadata includes video data, and the video processing strategy module receives the first video processing request, parses the first video processing request, and generates a second video processing request based on the parsing result, including:

[0009] The video processing strategy module receives the first video processing request, parses the first video processing request to obtain the video function parameters, the metadata and the usage parameters of the video buffer, converts the video function parameters to obtain target video function parameters, adds preset information corresponding to the video function parameters to the metadata to obtain target metadata, sets the attribute value of the video buffer according to the usage parameters, and generates a second video processing request according to the target video function parameters, the target metadata and the attribute value of the video buffer.

[0010] Optionally, the target video processing strategy includes a hardware processing algorithm, a software processing algorithm, and a software and hardware algorithm execution order, the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes video data according to the target video processing strategy, and sends the processed data to the third-party application, including:

[0011] The second hardware abstraction layer parses the second video processing request to obtain the target video function parameters, the target metadata, and the attribute values ​​of the video buffer, determines the target output port according to the target video function parameters and the attribute values ​​of the video buffer, processes the video data in the target metadata according to the target video processing strategy corresponding to the target output port, and sends the processed data to the third-party application.

[0012] Optionally, the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, including:

[0013] The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, and processes the video data according to the target video processing strategy to obtain intermediate video data;

[0014] The second hardware abstraction layer stores the intermediate video data in a video buffer, and sends the video buffer storing the intermediate video data to the third-party application.

[0015] Optionally, the operating system of the electronic device further includes a framework layer, the application layer includes a camera software development kit, and the third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer, including:

[0016] The third-party application sends a first video processing request to the framework layer through an interface provided by the camera software development kit;

[0017] The framework layer receives the first video processing request and sends the first video processing request to a video processing policy module in the first hardware abstraction layer.

[0018] Optionally, the third-party application sends a first video processing request to the framework layer through an interface provided by the camera software development kit, including:

[0019] The third-party application generates the first video processing request in response to the touch operation, and sends the first video processing request to the framework layer through an interface provided by the camera software development kit.

[0020] Optionally, the video function parameter includes at least one of an HDR video function parameter, a night scene video function parameter and an anti-shake video function parameter.

[0021] According to a second aspect of an embodiment of the present disclosure, an electronic device is provided, wherein an operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer, and an application layer provided with a third-party application, and the electronic device includes:

[0022] a memory having a computer program stored thereon;

[0023] A processor; configured to execute the computer program in the memory to implement the following steps through the first hardware abstraction layer, the second hardware abstraction layer and an application layer provided with a third-party application:

[0024] The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer;

[0025] The video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer;

[0026] The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, wherein the target video processing strategy is a video processing strategy provided for a native camera application.

[0027] Optionally, the first video processing request carries stream configuration information, the stream configuration information includes video function parameters, metadata, and usage parameters of a video buffer, the metadata includes video data, and the processor is further configured to execute the computer program in the memory to implement the following steps through the first hardware abstraction layer, the second hardware abstraction layer, and an application layer provided with a third-party application:

[0028] The video processing strategy module receives the first video processing request, parses the first video processing request to obtain the video function parameters, the metadata and the usage parameters of the video buffer, converts the video function parameters to obtain target video function parameters, adds preset information corresponding to the video function parameters to the metadata to obtain target metadata, sets the attribute value of the video buffer according to the usage parameters, and generates a second video processing request according to the target video function parameters, the target metadata and the attribute value of the video buffer.

[0029] According to a third aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the video data processing method provided in the first aspect of the present disclosure are implemented.

[0030] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: a third-party application sends a first video processing request to a video processing policy module in a first hardware abstraction layer; the video processing policy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to a second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; the second hardware abstraction layer determines a target video processing policy that matches the second video processing request, processes video data according to the target video processing policy, and sends the processed data to the third-party application, where the target video processing policy is for a native camera The video processing strategy provided by the application enables the third-party application to use the video processing strategy of the native camera application; in addition, from the design structure of the operating system, the configuration process of the second video processing request is implemented through the first hardware abstraction layer, so as to avoid the upgrade or replacement of the second hardware abstraction layer affecting the configuration of the second video processing request, so as to support more types of second hardware abstraction layers, and considering the characteristics of the application layer itself, the video processing strategy module and the second hardware abstraction layer are set under the framework layer, and the first video processing request sent by the third-party application is automatically and efficiently processed through the video processing strategy module, so that the corresponding system functions can be opened to the third-party application in fewer operation steps and a shorter time. A lightweight interface is provided for third-party applications through the video processing strategy module and the second hardware abstraction layer.

[0031] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0033] Figure 1 The diagram is a schematic diagram of the architecture of an operating system of an electronic device according to an exemplary embodiment.

[0034] Figure 2 The figure is a flowchart of a method for processing video data according to an exemplary embodiment.

[0035] Figure 3 The figure is a schematic diagram of a display interface of a third-party application according to an exemplary embodiment.

[0036] Figure 4 is another flowchart of a video data processing method according to an exemplary embodiment.

[0037] Figure 5 is another flowchart of a video data processing method according to an exemplary embodiment.

[0038] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0039] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0040] As mentioned in the background technology, based on the architecture of the operating system of existing electronic devices, third-party applications cannot access the video function of the native camera of the electronic device (the implementation of this video function requires the underlying hardware and software capabilities). If the third-party application itself has many video functions for adding special effects to recorded videos, such as stickers, video plus puppet special effects, etc., and the video function of the third-party application can only take effect when the user uses the third-party application to shoot and record, it cannot be integrated with the video function supported by the native camera application. This leads to an urgent need for third-party applications to open the video function of the native camera application.

[0041] In view of this, an embodiment of the present disclosure provides a video data processing method, which is explained below in conjunction with the accompanying drawings.

[0042] Figure 1 FIG. 1 is a schematic diagram of an architecture of an operating system of an electronic device according to an exemplary embodiment. Figure 1 , the operating system of the electronic device may include an application layer, a framework layer, a first hardware abstraction layer, a second hardware abstraction layer, a kernel layer and a hardware layer. Among them, the application layer may be provided with a third-party application, a native camera application and a camera software development kit, and the camera software development kit may provide an interface for third-party applications to access the framework layer. The framework layer includes a camera capability expansion module, a camera application interface, a camera application service and a framework layer interface. The first hardware abstraction layer includes a first hardware abstraction layer interface 1 (e.g., HAL3.0), a video processing strategy module, an image processing engine and a first hardware abstraction layer interface 2 (e.g., HAL3.0), and the image processing engine maintains a variety of algorithms (algorithm 1, algorithm 2, etc.), including algorithms that can realize the video function of the native camera application. The second hardware abstraction layer includes a second hardware abstraction layer interface (e.g., HAL3.0), and the kernel layer includes a driver (e.g., driver 1, driver 2, etc.), each driver is used to drive the hardware included in the hardware layer, for example, the camera driver is used to drive the camera in the hardware layer. It should be noted that the above-mentioned layers communicate with each other by the provided interfaces.

[0043] Based on the above architecture, Figure 1 The communication link indicated by the middle arrow enables the third-party application to use the video processing strategy of the native camera application.

[0044] Figure 2 is a flow chart of a video data processing method according to an exemplary embodiment. The video data processing method can be applied to Figure 1 The operating system of the electronic device shown, referring to Figure 2 , the implementation process of the video data processing method can be as follows:

[0045] The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer; the video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application. Among them, the target video processing strategy is a video processing strategy provided for the native camera application.

[0046] It should be noted that the third-party application is an application program installed on the electronic device. The third-party application may be a third-party camera software that needs to call the camera, for example, a camera software that only has a shooting function, or a third-party social software that can call the camera.

[0047] The first video processing request is a request that indicates that the third-party application wants to use the video function of the native camera application to record a video, and the video function may be, for example, an HDR (High Dynamic Range Imaging) function, a night scene function, and an anti-shake function, etc. Correspondingly, to implement the video function of the native camera application, the corresponding target video processing strategy is an HDR video processing strategy (corresponding to the HDR function), a night scene video processing strategy (corresponding to the night scene function), or an anti-shake video processing strategy (corresponding to the anti-shake function).

[0048] Figure 3 is a schematic diagram of a display interface of a third-party application according to an exemplary embodiment. Figure 3 In the example, video function 1, video function 2, and video function 3 (which can be understood as controls) are video functions of the native camera application that are pre-opened to third-party applications. The user can click on these controls to indicate that he wants to use video function 1, video function 2, or video function 3 to record a video. The user can generate a touch operation on the electronic device by clicking on the corresponding control, and the third-party application can then respond to the touch operation and generate a first video processing request.

[0049] Among them, the above-mentioned video function 1, video function 2 and video function 3 can be opened to third-party applications in advance in the following ways: the third-party application sends a query request to the framework layer through the interface provided by the camera software development kit, and the framework layer verifies the permissions of the third-party application based on the query request. After determining that the third-party application has passed the verification, it sends a permission confirmation message to the third-party application, and the permission confirmation information includes the video function that the third-party application can use; the third-party application sends a permission opening request to the framework layer of the operating system to open the video function that the third-party application can use; the framework layer opens the permission of the video function that the third-party application can use to the third-party application based on the permission opening request. After developing the permissions for the corresponding video functions, the third-party application can successfully access the algorithm strategy corresponding to the corresponding video function.

[0050] The specific process described above can be implemented by the camera capability expansion module in the framework layer. When querying, the camera capability expansion module can query from a pre-stored whitelist. If there is a third-party application in the whitelist, it indicates that the third-party application has passed the verification. In some embodiments, the above whitelist can be maintained by a server, and the camera capability expansion module can receive the whitelist issued by the server. The camera capability expansion module updates and stores the whitelist according to the received whitelist.

[0051] For the first hardware abstraction layer that receives the first video processing request, it is necessary to parse it first, and then generate the corresponding second data processing request according to the parsing result. Among them, the first video processing request carries stream configuration information, and the stream configuration information includes video function parameters, metadata, and purpose parameters of the video buffer. Therefore, the video processing strategy module can generate the second video processing request according to the first video processing request in the following manner: the video processing strategy module receives the first video processing request, parses the first video processing request to obtain the video function parameters, metadata, and purpose parameters of the video buffer, converts the video function parameters to obtain the target video function parameters, adds preset information corresponding to the video function parameters to the metadata to obtain the target metadata, and sets the attribute value of the video buffer according to the purpose parameter, and generates the second video processing request according to the target video function parameters, the target metadata, and the attribute value of the video buffer.

[0052] Among them, the video function parameters may be, for example, HDR video function parameters, night scene video function parameters, and anti-shake video function parameters, etc. In the second hardware abstraction layer, the video function parameters have specific values, and the video function parameters initiated by the third-party application need to be modified to the corresponding parameters that can be recognized by the second hardware abstraction layer in order to implement the call of the software and hardware algorithms of the native camera. For example, when the video function is the HDR function, the HDR video function parameters may include HDR brightness parameters, HDR color parameters, etc.

[0053] The metadata includes video data, and the video data includes at least one frame of video data. The video processing strategy module stores preset information corresponding to the video function parameters, and the preset information can be used by the second hardware abstraction layer to parse and identify the metadata. In some embodiments, the application layer responds to the shooting operation request, and the shooting operation request can be forwarded to the same software architecture layer through the application layer to drive the camera to perform shooting and obtain video data. In this embodiment, various drivers are provided in the kernel layer, such as a camera driver. The kernel layer can request the corresponding camera driver to drive the camera in the hardware layer to collect video data according to the shooting operation request to obtain video data.

[0054] For example, the usage parameter of the video buffer may be the storage byte size of one video frame data (eg, 8 bits or 10 bits).

[0055] In some embodiments, the target video processing strategy includes a hardware processing algorithm, a software processing algorithm, and a hardware and software algorithm execution order. Therefore, the second hardware abstraction layer can process the video data according to the target video processing strategy in the following manner: the second hardware abstraction layer parses the second video processing request, obtains the target video function parameters, the target metadata, and the attribute values ​​of the video buffer, determines the target output port according to the target video function parameters and the attribute values ​​of the video buffer, processes the video data in the target metadata according to the target video processing strategy corresponding to the target output port, and sends the processed data to the third-party application.

[0056] It should be noted that the target output port has certain properties, and it can output format data corresponding to the target output port. In this embodiment, the target output port corresponds to a software and hardware algorithm that processes the format data corresponding to the port, that is, the target video processing strategy, including a hardware processing algorithm, a software processing algorithm, and a software and hardware algorithm execution sequence. Among them, the software and hardware algorithm execution sequence is used to characterize the execution sequence of each software algorithm and each hardware algorithm. Since the realization of the video function depends on both the software algorithm and the hardware algorithm, it is necessary to alternately process the hardware processing algorithm and the software processing algorithm to obtain the final video data.

[0057] It should be noted that the hardware processing algorithm can be implemented in the hardware layer, and the software processing algorithm can be implemented in the second hardware abstraction layer.

[0058] In the above manner, the first video processing request initiated by the third-party application is parsed and encapsulated into a request that can be recognized by the second hardware abstraction layer. Therefore, after receiving the recognizable second video processing request, the second hardware abstraction layer matches the corresponding target video processing strategy according to the parameters carried in the second video processing request and processes the video data according to the target video processing strategy. Since the target video processing strategy is a video processing strategy provided for the native camera application, the use of the video processing strategy of the native camera application by the third-party application is realized. In addition, in this embodiment, the video processing strategy module and the second hardware abstraction layer are arranged under the framework layer, and the first video processing request sent by the third-party application is automatically and efficiently processed by the video processing strategy module in the first hardware abstraction layer. The video processing strategy module can automatically obtain the second video processing request according to the first video processing request without the need for the third-party application to perform cumbersome settings. It can be seen that a lightweight interface is provided for the third-party application through the video processing strategy module, so that the corresponding system functions can be opened to the third-party application in fewer operation steps and a shorter time. In the related technology, there is a method of directly calling system functions through the application layer. However, this method is limited by the application layer itself and cannot quickly obtain the second video processing request based on the first video processing request. Instead, a series of cumbersome operations are required to realize the conversion from the first video processing request to the second video processing request, which is time-consuming.

[0059] In addition, considering that the hardware abstraction layer (i.e., the second hardware abstraction layer) of the chip of each platform is different, and the second hardware abstraction layer may be updated or upgraded, in order to adapt to the impact of the upgrade or replacement of the second hardware abstraction layer on the use of the native camera application by third-party applications, the configuration process of the second video processing request is implemented through the video processing strategy module in the first hardware abstraction layer, which is convenient for later maintenance. And considering the characteristics of the application layer itself, it is not considered to set the video processing strategy module in the application layer, so that the time for the application layer to convert the first video processing request can be shortened and the operation of the application layer to convert the first video processing request can be reduced, so as to provide a lightweight integration solution.

[0060] Figure 4 is another flow chart of a video data processing method according to an exemplary embodiment. Figure 4 , the implementation process of the video data processing method can be as follows:

[0061] The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer; the video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy to obtain intermediate data, stores the intermediate video data in a video buffer, and sends the video buffer storing the intermediate video data to the third-party application.

[0062] in, Figure 4 The middle part of the process and Figure 2 Some of the steps shown are similar, so Figure 4 The implementation method of this part of the step process can refer to Figure 2 The corresponding implementation process is described in detail in this embodiment.

[0063] It should be noted that the video buffer is a memory buffer used to buffer video playback data. Considering that the third-party application itself has many video functions for adding special effects to the recorded video, returning the video buffer to the third-party application can enable the third-party application to use its own video functions to add special effects to the video data, thereby realizing self-processing of the video data and enriching the special effects of the video.

[0064] Figure 5 is another flow chart of a video data processing method according to an exemplary embodiment. Figure 5 , the implementation process of the video data processing method can be as follows:

[0065] The third-party application sends a first video processing request to the framework layer, and the framework layer sends the first video processing request to the video processing strategy module in the first hardware abstraction layer; the video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, and the second video processing request is a request that can be recognized by the second hardware abstraction layer; the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request; generates a hardware data processing request according to the hardware processing algorithm in the target video processing strategy and sends the hardware data processing request to the hardware layer, the hardware layer executes the hardware processing algorithm to obtain intermediate video data, and sends the intermediate video data to the second hardware abstraction layer, the second hardware abstraction layer stores the intermediate video data in a video buffer, and the second hardware abstraction layer sends the video buffer storing the intermediate video data to the third-party application.

[0066] In some embodiments, the step of the third-party application sending the first video processing request to the video processing policy module in the first hardware abstraction layer may include: the third-party application sending the first video processing request to the framework layer through an interface provided by the camera software development kit.

[0067] In some embodiments, the step of the third-party application sending the first video processing request to the framework layer through the interface provided by the camera software development kit may include: the third-party application responds to the touch operation, generates the first video processing request, and sends the first video processing request to the framework layer through the interface provided by the camera software development kit. In this embodiment, the generation of the touch operation can refer to Figure 3 The relevant description will not be repeated in this embodiment.

[0068] exist Figure 5 In the embodiment, the target video processing strategy matched with the second video processing request determined by the second hardware abstraction layer includes a hardware processing algorithm. Since the hardware processing algorithm needs to be executed by the hardware end, the second hardware abstraction layer is configured according to the hardware processing algorithm executed by the hardware layer, generates a hardware data processing request, and then sends the hardware data processing request to the hardware layer. The hardware layer executes the hardware processing algorithm to obtain intermediate video data, and the hardware layer sends the intermediate video data to the second hardware abstraction layer. In some embodiments, the hardware data processing request and the intermediate video data can be transmitted between the second hardware abstraction layer and the hardware layer via the kernel layer.

[0069] It is worth mentioning that Figure 5 In the above, only the process of generating intermediate video data is exemplified by taking the case where the target video processing strategy includes a hardware processing algorithm as an example. In other embodiments, the target video processing strategy also includes a software processing algorithm, and the software processing algorithm is processed by the second hardware abstraction layer. The order in which each software processing algorithm and hardware processing algorithm processes the video data is determined by the execution order of the software and hardware algorithms in the target video processing strategy. The second hardware abstraction layer can configure the corresponding request according to the execution order of the software and hardware algorithms, and then the second hardware abstraction layer executes the software algorithm strategy and the hardware layer executes the hardware algorithm strategy to obtain the intermediate video data.

[0070] The embodiment of the present disclosure further provides a computer-readable storage medium on which computer program instructions are stored. When the program instructions are executed by a processor, the steps of the video data processing method provided by the present disclosure are implemented.

[0071] The present disclosure also provides an electronic device, wherein an operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer, and an application layer provided with a third-party application, and the electronic device includes:

[0072] a memory having a computer program stored thereon;

[0073] A processor; used to execute the computer program in the memory to implement the steps of the above-mentioned video data processing method through the first hardware abstraction layer and the second hardware abstraction layer and the application layer provided with a third-party application.

[0074] Figure 6 is a block diagram of an electronic device 600 according to an exemplary embodiment. For example, the electronic device 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0075] Reference Figure 6 , the electronic device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0076] The processing component 602 generally controls the overall operation of the electronic device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned video data processing method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0077] The memory 604 is configured to store various types of data to support operations on the electronic device 600. Examples of such data include instructions for any application or method operating on the electronic device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0078] The power component 606 provides power to the various components of the electronic device 600. The power component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 600.

[0079] The multimedia component 608 includes a screen that provides an output interface between the electronic device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the electronic device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0080] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the electronic device 600 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0081] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0082] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the electronic device 600. For example, the sensor assembly 614 can detect the open / closed state of the electronic device 600, the relative positioning of the components, such as the display and keypad of the electronic device 600, and the sensor assembly 614 can also detect the position change of the electronic device 600 or a component of the electronic device 600, the presence or absence of contact between the user and the electronic device 600, the orientation or acceleration / deceleration of the electronic device 600, and the temperature change of the electronic device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0083] The communication component 616 is configured to facilitate wired or wireless communication between the electronic device 600 and other devices. The electronic device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0084] In an exemplary embodiment, the electronic device 600 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned video data processing method.

[0085] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of an electronic device 600 to complete the above-mentioned video data processing method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0086] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0087] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A video data processing method, characterized in that: Applied to an electronic device, the operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer, and an application layer provided with a third-party application, and the video data processing method includes: The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer; The video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, wherein the target video processing strategy is a video processing strategy provided for a native camera application.

2. The video data processing method according to claim 1, characterized in that: The first video processing request carries stream configuration information, the stream configuration information includes video function parameters, metadata, and usage parameters of a video buffer, the metadata includes video data, the video processing strategy module receives the first video processing request, parses the first video processing request, and generates a second video processing request based on the parsing result, including: The video processing strategy module receives the first video processing request, parses the first video processing request to obtain the video function parameters, the metadata and the usage parameters of the video buffer, converts the video function parameters to obtain target video function parameters, adds preset information corresponding to the video function parameters to the metadata to obtain target metadata, sets the attribute value of the video buffer according to the usage parameters, and generates a second video processing request according to the target video function parameters, the target metadata and the attribute value of the video buffer.

3. The video data processing method according to claim 2, characterized in that: The target video processing strategy includes a hardware processing algorithm, a software processing algorithm, and a hardware and software algorithm execution order, the second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes video data according to the target video processing strategy, and sends the processed data to the third-party application, including: The second hardware abstraction layer parses the second video processing request to obtain the target video function parameters, the target metadata, and the attribute values ​​of the video buffer, determines the target output port according to the target video function parameters and the attribute values ​​of the video buffer, processes the video data in the target metadata according to the target video processing strategy corresponding to the target output port, and sends the processed data to the third-party application.

4. The video data processing method according to claim 1, characterized in that: The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, including: The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, and processes the video data according to the target video processing strategy to obtain intermediate video data; The second hardware abstraction layer stores the intermediate video data in a video buffer and sends the intermediate video data to the third-party application.

5. The video data processing method according to claim 1, characterized in that: The operating system of the electronic device further includes a framework layer, the application layer includes a camera software development kit, and the third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer, including: The third-party application sends a first video processing request to the framework layer through an interface provided by the camera software development kit; The framework layer receives the first video processing request and sends the first video processing request to a video processing policy module in the first hardware abstraction layer.

6. The video data processing method according to claim 5, characterized in that: The third-party application sends a first video processing request to the framework layer through an interface provided by the camera software development kit, including: The third-party application generates the first video processing request in response to the touch operation, and sends the first video processing request to the framework layer through an interface provided by the camera software development kit.

7. The video data processing method according to claim 2, characterized in that: The video function parameter includes at least one of an HDR video function parameter, a night scene video function parameter, and an anti-shake video function parameter.

8. An electronic device, characterized in that: The operating system of the electronic device includes a first hardware abstraction layer, a second hardware abstraction layer, and an application layer provided with a third-party application, and the electronic device includes: a memory having a computer program stored thereon; A processor; configured to execute the computer program in the memory to implement the following steps through the first hardware abstraction layer, the second hardware abstraction layer and an application layer provided with a third-party application: The third-party application sends a first video processing request to the video processing strategy module in the first hardware abstraction layer; The video processing strategy module receives the first video processing request, parses the first video processing request and generates a second video processing request based on the parsing result, and sends the second video processing request to the second hardware abstraction layer, where the second video processing request is a request that can be recognized by the second hardware abstraction layer; The second hardware abstraction layer determines a target video processing strategy that matches the second video processing request, processes the video data according to the target video processing strategy, and sends the processed data to the third-party application, wherein the target video processing strategy is a video processing strategy provided for a native camera application.

9. The electronic device according to claim 8, characterized in that: The first video processing request carries stream configuration information, the stream configuration information includes video function parameters, metadata, and usage parameters of a video buffer, the metadata includes video data, and the processor is further configured to execute the computer program in the memory to implement the following steps through the first hardware abstraction layer, the second hardware abstraction layer, and an application layer provided with a third-party application: The video processing strategy module receives the first video processing request, parses the first video processing request to obtain the video function parameters, the metadata and the usage parameters of the video buffer, converts the video function parameters to obtain target video function parameters, adds preset information corresponding to the video function parameters to the metadata to obtain target metadata, sets the attribute value of the video buffer according to the usage parameters, and generates a second video processing request according to the target video function parameters, the target metadata and the attribute value of the video buffer.

10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the steps of the video data processing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Data processing method and related product

    CN110955541A

  • Image shooting method and related device

    CN110995994A