Camera request processing method and related apparatus

By adopting the camera request processing method in the electronic device, rendering and sending image frames according to the VSync signal periodically, the preview lag caused by the electronic device to send multiple image frames continuously during the rendering cycle is solved, and a stable preview image display is achieved.

WO2025119288A1PCT designated stage expired Publication Date: 2025-06-12HUAWEI TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/137174
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-08
Filing Date
2024-12-05
Publication Date
2025-06-12

AI Technical Summary

Technical Problem

When multiple frames of image frames are sent continuously to the rendering process during the rendering cycle of an electronic device, the speed of sending frames exceeds the rendering capability of the rendering process, resulting in frame drops in the rendering module and preview stuttering.

Method used

By implementing a camera request processing method in an electronic device, the image frame corresponding to the camera request sent by the camera application is obtained, and when the time interval between the current time and the transmission time of the previous frame image frame is greater than or equal to K vertically synchronized VSync signal periods, the image frame is rendered and transmitted.

Benefits of technology

Ensure that the time interval of image frame transmission remains stable, reduce preview lag, and achieve stable display of camera applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024137174_12062025_PF_FP_ABST
    Figure CN2024137174_12062025_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the present application are a camera request processing method and a related apparatus. The method may comprise: before sending to a rendering process module an image frame which is acquired on the basis of a camera request for displaying the image frame, an electronic device temporarily storing the image frame in an application program framework layer; and only when an interval between a current time and the time when the previous image frame was sent for displaying is K VSync signal cycles, the electronic device sending the next image frame for displaying same. In this way, an electronic device may cache image frames which are sent on an HAL, and then send same to a rendering process module on the basis of VSync signal cycles, and by means of the VSync signal cycles, the electronic device may enable the image frames, which are sent on the HAL, to be uniformly sent to the rendering process module. Accordingly, the problem of a preview picture of a camera application lagging caused by sending multiple image frames to a rendering process module within one rendering cycle can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Camera request processing method and related device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 8, 2023, with application number 202311692945.X and application name “A Camera Request Processing Method and Related Devices”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic technology, and in particular to a camera request processing method and related devices. Background Art

[0003] Currently, electronic devices such as mobile phones and tablets all have camera applications. When the camera application is activated on an electronic device, users can view preview image frames within the device's capture interface. Typically, the electronic device's camera application issues a camera request to obtain preview image frames. Based on this camera request, the image frames captured by the electronic device's camera are typically processed and then sent to a rendering process for rendering and display. Only then can the user see the preview image frames. However, if the electronic device continuously sends multiple image frames to the rendering process within a rendering cycle, and the frame delivery rate exceeds the rendering process's rendering capacity, the electronic device's rendering module may drop frames. For example, if the electronic device's rendering process is still rendering the first image frame, the electronic device sends the second image frame captured by the camera to the rendering process. The rendering process may drop the second image frame. As a result, the electronic device cannot stably display the preview image, and the preview image may experience lags. This results in a poor user experience.

[0004] Therefore, how to enable electronic devices to reduce preview freezes and stably display preview image frames is an urgent problem to be solved. Summary of the Invention

[0005] The present application provides a camera request processing method and related devices. Through the camera request processing method provided in the embodiments of the present application, the electronic device can maintain a stable time interval for sending and displaying image frames, thereby reducing preview freezes and stably displaying preview image frames.

[0006] In a first aspect, the present application provides a camera request processing method, which may include: an electronic device obtaining a first image frame corresponding to a first camera request issued by a camera application; when the time interval between the current time and the display time of the previous image frame is greater than or equal to K vertical synchronization VSync signal cycles, the electronic device renders and displays the first image frame; and the electronic device displays the first image frame in the preview interface of the camera application.

[0007] Through the method provided in the first aspect, the electronic device can cache the acquired image frames, and then render and display them according to the VSync signal cycle. The electronic device can use the VSync signal cycle to ensure that the acquired image frames are rendered and displayed evenly. This can solve the problem of camera application preview screen freeze caused by rendering multiple image frames in the same rendering cycle.

[0008] In combination with the first aspect, in a possible implementation, the method may further include: when the time interval between the current time and the display time of the previous image frame is less than K VSync signal cycles, the electronic device stores the first image frame in a cache buffer queue of image frames to be displayed.

[0009] In this way, the electronic device can temporarily store the image frame and send the next image frame to be rendered after the electronic device has finished rendering the previous image frame, thereby preventing the speed of sending the image frame from exceeding the speed of the electronic device rendering the image frame.

[0010] In combination with the first aspect, in a possible implementation, the electronic device may further include a buffer manager, which is used to temporarily store image frames. After the electronic device obtains the first image frame corresponding to the first camera request issued by the camera application, the method may further include: when the number of image frames in the buffer manager is greater than or equal to a first threshold, the electronic device renders and displays the first image frame; when the number of image frames in the buffer manager is less than the first threshold, the buffer manager temporarily stores the first image frame in a buffer queue.

[0011] In this way, when the number of image frames temporarily stored in the buffer manager is relatively small, the buffer manager can continue to temporarily store the first image frame in the buffer queue. When the number of image frames temporarily stored in the buffer manager is large, the electronic device can directly render and display the first image frame. This can prevent queue congestion caused by too many temporarily stored image frames, which could affect the smoothness of the electronic device's display of image frames.

[0012] In conjunction with the first aspect, in one possible implementation, the electronic device may further include a display sending thread module. After the buffer manager temporarily stores the first image frame, the method may further include: the display sending thread module obtaining the first image frame from the buffer manager. In this way, the display sending process can obtain the first image frame from the buffer manager.

[0013] In conjunction with the first aspect, in one possible implementation, the electronic device may further include a VSync signal monitoring module and a rendering process module, wherein the VSync signal monitoring module is configured to monitor the VSync signal of the rendering process module. In this way, the VSync signal monitoring module can determine whether the rendering process module has completed rendering of the image frame by monitoring the rendering process module.

[0014] In combination with the first aspect, in a possible implementation, the method may further include: the VSync signal monitoring module sends the VSync signal to the display thread module; the display thread module determines, based on the VSync signal, that the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles.

[0015] In this way, the display thread module can determine whether the first image frame can be sent to the rendering process module according to the VSync signal.

[0016] In conjunction with the first aspect, in one possible implementation, when the time interval between the current time and the display time of the previous image frame is greater than or equal to K vertical synchronization VSync signal cycles, the electronic device rendering and displaying the first image frame may include:

[0017] When the display thread module determines that the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles, the display thread module sends the first image frame to the rendering process module; the rendering process module renders and displays the first image frame.

[0018] In this way, the display thread module can determine the timing of sending the first image frame to the rendering process module based on the VSync signal. The electronic device can process the rendering and display the first image frame through the rendering process module.

[0019] In conjunction with the first aspect, in a possible implementation, the value of K is determined by the frame rate of the electronic device and the periodic interval of the VSync signal. In this way, the value of K can be determined.

[0020] In conjunction with the first aspect, in a possible implementation, K is equal to the first value divided by the frame rate, and then divided by the VSync signal period interval. In this way, the value of K can be determined.

[0021] In combination with the first aspect, in a possible implementation, the electronic device may further include a timer module, and the method may further include: the timer module sets a first timestamp for the first image frame; when the display thread module determines that the time interval between the first timestamp and the timestamp of the previous image frame displayed by the display thread module is greater than a second threshold, the display module sends the first image frame to the rendering process module.

[0022] In this way, the display thread module can determine the timing of sending the image frame to the rendering process module based on the timestamp set by the timer, thereby keeping the time interval for sending the image frame to the rendering process module stable.

[0023] In a second aspect, an electronic device is provided, which may include one or more cameras, a display, one or more processors and one or more memories; wherein the one or more cameras, the display, the one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, and the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method involved in any possible implementation method of the first aspect.

[0024] According to a third aspect, an electronic device is provided. The electronic device may include one or more functional modules, and the one or more functional modules are used for the method involved in any possible implementation of the first aspect.

[0025] In a fourth aspect, a chip system is provided, which is applied to an electronic device, and the chip system includes one or more processors, and the processor is used to call computer instructions to enable the electronic device to execute the method involved in any possible implementation of the first aspect.

[0026] In a fifth aspect, a computer-readable storage medium is provided, comprising instructions, which, when executed on an electronic device, enable the electronic device to execute the method involved in any possible implementation of the first aspect.

[0027] In a sixth aspect, a computer program product is provided. When the program product is run on an electronic device, the electronic device executes the method involved in any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0029] FIG2 is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;

[0030] FIG3 is a schematic diagram of a scenario in which an image frame is sent to a rendering process and the rendering process discards the image frame, provided by an embodiment of the present application;

[0031] FIG4A is a schematic diagram of a user interface provided in an embodiment of the present application;

[0032] 4B-4D are schematic diagrams of scenes when a group of electronic devices, provided in an embodiment of the present application, photograph objects in a spatial coordinate system;

[0033] FIG5A is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;

[0034] FIG5B is a schematic diagram of the software and hardware architecture of an electronic device provided in an embodiment of the present application;

[0035] FIG6 is a schematic diagram of the interaction between software and hardware modules of a camera request processing method provided by an embodiment of the present application;

[0036] FIG7 is a flow chart of a camera request processing method provided in an embodiment of the present application;

[0037] FIG8 is a schematic diagram of a scenario in which an electronic device temporarily stores image frames before sending the image frames to a rendering process according to an embodiment of the present application;

[0038] FIG9 is a schematic diagram showing a comparison of time intervals for sending and displaying multiple image frames provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0040] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and appended claims of this application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless the context clearly indicates otherwise. The terms "first" and "second" are used for descriptive purposes only and are not to be understood as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "First" and "second" etc. are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first object and the second object are used to distinguish different objects, rather than to describe a specific order of objects.

[0041] In the description of the embodiments of this application, unless otherwise specified, "a plurality" means two or more. For example, a plurality of processing units refers to two or more processing units; a plurality of systems refers to two or more systems.

[0042] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0043] The term "and / or" in this application is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0044] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0045] To better understand the technical solutions provided by this application, before describing the technical solutions of this application, we first describe the electronic device 100 with a camera function to which this application is applicable, with reference to the accompanying drawings. In the embodiments of this application, the electronic device 100 may include, but is not limited to, devices with a camera function, such as mobile phones, tablet computers, and smart watches. This embodiment of the application does not limit the specific form or type of the electronic device 100.

[0046] An exemplary electronic device 100 provided in an embodiment of the present application is described below with reference to the accompanying drawings.

[0047] FIG1 is a schematic structural diagram of an electronic device 100 provided in an embodiment of the present application.

[0048] The following embodiments are described in detail using electronic device 100 as an example. It should be understood that electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have a different component configuration. The various components shown in the figure may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.

[0049] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0050] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0051] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0052] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0053] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0054] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0055] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0056] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0057] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0058] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0059] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0060] The SIM interface can be used to communicate with the SIM card interface 195 to implement the function of transmitting data to the SIM card or reading data in the SIM card.

[0061] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0062] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0063] The charging management module 140 is configured to receive charging input from a charger, which may be a wireless charger or a wired charger.

[0064] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to provide power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160.

[0065] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0066] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0067] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0068] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0069] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0070] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0071] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0072] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0073] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0074] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise, brightness, and color. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0075] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0076] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0077] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0078] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0079] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0080] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, applications required for at least one function (such as face recognition function, fingerprint recognition function, mobile payment function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as face information template data, fingerprint information template, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0081] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0082] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0083] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0084] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0085] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.

[0086] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0087] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.

[0088] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0089] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0090] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.

[0091] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0092] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.

[0093] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.

[0094] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.

[0095] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0096] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.

[0097] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.

[0098] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

[0099] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0100] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.

[0101] The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to and disconnected from the electronic device 100 by inserting it into or removing it from the SIM card interface 195. The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can also be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external memory cards. The electronic device 100 interacts with the network through the SIM card to implement functions such as calls and data communications.

[0102] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. The electronic device 100 shown in FIG1 is merely an example. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0103] In order to better understand the software structure of the electronic device 100 shown in Figure 1, the software structure of the electronic device 100 is described below. Before describing the software structure of the electronic device 100, the architecture that can be adopted by the software system of the electronic device 100 is first described.

[0104] Specifically, in actual applications, the software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture.

[0105] In addition, it is understandable that the software systems used by current mainstream electronic devices include but are not limited to Windows systems, Android systems, and iOS systems. For ease of explanation, the embodiment of the present application takes the layered architecture Android system as an example to exemplify the software structure of the electronic device 100.

[0106] In addition, the subsequent camera request processing method provided in the embodiment of the present application is also applicable to other systems in specific implementation.

[0107] FIG2 shows a schematic diagram of the software and hardware architecture of a camera service on an electronic device 100 provided in an embodiment of the present application.

[0108] As shown in Figure 2, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that implements related camera services (for example, preview, photo taking, video recording, etc.) together with the software structure. Among them, the layered architecture divides the software system of the electronic device 100 into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (application layer), the application framework layer (framework layer, FWK), the hardware abstraction layer (hardware abstraction layer, HAL), and the drive layer (drive layer).

[0109] The application layer may include a series of application packages. As shown in FIG2 , an application package may include a camera application.

[0110] Optionally, the application package may also include application programs (also referred to as applications) such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. This embodiment of the present application does not limit this.

[0111] The application framework layer provides an application programming interface (API) and programming framework for the application packages in the application layer. The application framework layer includes some predefined functions.

[0112] Optionally, in some embodiments, the application framework layer may include a camera interface. For example, the camera interface may include an image acquisition interface and an interface for continuously acquiring images.

[0113] In some embodiments, the application framework layer may also include a request queue processing module. The request queue processing module may include a WaitForRequest module, a SendRequestsBatch module, and a PrepareHardwareAbstractLayerRequest (PrepareHALRequest) module. The WaitForRequest module may be used to wait for pending camera requests in the request queue module when there are no empty buffers in the N buffers allocated to the camera application in the electronic device's buffer area. The PrepareHALRequest module may be used to construct the HAL layer's camera request and output buffers. When there are empty buffers in the N buffers allocated to the camera application, the PrepareHALRequest module may obtain a buffer from the AllocateBuffer interface for the camera request issued by the camera application. The SendRequestsBatch module may be used to send the HAL layer's Capture request constructed by the PrepareHALRequest module to the HAL layer.

[0114] For example, N can be 8, meaning that the number of buffers allocated by the electronic device to the camera application for camera requests can be 8. N can also be other values, such as 7 or 9, and the present application does not limit the value of N. The following description uses the example of N being 8 as an example.

[0115] In some embodiments, the application framework layer may also include an Allocate Buffer interface, which is used to allocate a buffer for camera requests issued by camera applications. For example, the Allocate Buffer interface can specify the address of a buffer for storing the camera request. The request queue processing module can receive camera requests issued by the camera application via the camera interface. The request queue processing module can then obtain the buffer allocated for the camera request from the Allocate Buffer Interface module. The request queue processing module can then send the camera request and the buffer address to the camera hardware abstraction layer. Specifically, the Wait Request module within the request queue processing module can receive camera requests issued by the camera application via the camera interface. The Wait Request module can then send the received camera request to the Prepare HAL Request module. The Prepare HAL Request module can then obtain the buffer for storing the camera request from the Allocate Buffer Interface module. The Prepare HAL Request module can then send the camera request and the buffer address of the camera request to the Send Batch Request module. The Send Batch Request module can then send the camera request and the buffer address of the camera request to the Camera Hardware Abstraction Layer. Optionally, when the buffer area for storing camera requests has an empty buffer, the HAL request preparation module can directly receive the camera request sent by the camera application through the camera interface.

[0116] In some embodiments, the application framework layer may further include a result processing module. The result processing module may be configured to receive an image frame sent by the hardware abstraction layer, or a buffer address storing an image frame. The result processing module may send the image frame or the buffer address of the image frame to the rendering process module.

[0117] Optionally, in a possible implementation, the result processing module may further send the image frame or the buffer address storing the image frame to the camera application.

[0118] In some embodiments, the application framework layer may further include a rendering process module that can be used to render the image frames sent by the rendering result processing module and send the rendering results to the display via a display driver.

[0119] Optionally, in a possible implementation, the rendering process module may also be used to render the image frame sent by the camera application, and send the rendering result (ie, the rendered image frame) to the camera application. The camera application may display the rendering result.

[0120] In some embodiments, the application framework layer may also be referred to as the application framework layer.

[0121] The hardware abstraction layer (HAL) is an interface layer between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system.

[0122] The HAL (Hardware Abstraction Layer) can include a camera hardware abstraction layer (HAL). The HAL receives camera requests from the application framework layer and transmits the camera parameters in the requests to the camera module via the driver layer. The HAL can also call a result-returning interface (e.g., ProcessCaptureResult) to send image frames captured by the camera module according to the camera parameters to the result processing module in the application framework layer.

[0123] Optionally, the camera hardware abstraction layer may store the image frames acquired by the camera module into a buffer address corresponding to the camera request, and send the buffer address to the result processing module in the application framework layer.

[0124] In this embodiment of the present application, a camera request corresponding to an image frame refers to a camera request that includes camera parameters for obtaining the image frame. That is, the camera can obtain the image frame according to the camera parameters in the camera request. For example, if the camera obtains image frame 1 according to the camera parameters in camera request 1, then camera request 1 can be referred to as the camera request corresponding to image frame 1.

[0125] Optionally, the camera hardware abstraction layer may include a request processing module and a result return module. The request processing module and the result return module are not shown in Figure 2. The request processing module can extract camera parameters from the camera request and send the camera parameters to the camera module through the driver layer. The request processing module can also send the buffer address of the camera request to the result return module. The result return module can receive the image frame obtained by the camera module according to the camera parameters. The result return module can store the image frame in the buffer address of the camera request. Then, the result return module can send the buffer address to the result processing module in the application framework layer. Alternatively, the result return module can send the image frame and the buffer address to the result processing module in the application framework layer.

[0126] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. These include camera drivers, image processor drivers, and display drivers. The camera driver drives the image sensors (e.g., image sensor 1, image sensor 2, etc.) of one or more cameras in the camera module to capture images and drives the image signal processor to pre-process the images. The image processor driver drives the graphics processor to process images. The display driver drives the display.

[0127] The hardware layer may include a camera module, an image signal processor (ISP), a display, and the like. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like. The ISP may be used to process image frames captured by the camera module. The display may be used to display image frames sent by the camera application.

[0128] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with the scene of displaying a preview image using a camera application.

[0129] ①. The electronic device 100 receives an operation from the user to start the camera application and issues a camera request for obtaining a preview image.

[0130] When the electronic device 100 receives the user's operation to start the camera application, the electronic device 100 starts the camera application. The camera application can send multiple camera requests for obtaining preview images.

[0131] It is understandable that after the camera application in the electronic device 100 is turned on, it can periodically send a camera request for obtaining a preview image.

[0132] After receiving the camera request sent by the camera application, the application framework layer of the electronic device 100 can obtain the buffer address for storing the camera request. The application framework layer can also store the camera request in the buffer corresponding to the buffer address. It is understandable that the number of buffers used to store camera requests in the electronic device 100 is limited. When the camera application sends multiple camera requests in sequence, the application framework layer can store the multiple camera requests in the buffer in sequence. When the buffers in the cache area are all filled with camera requests and there is no empty buffer, the camera requests sent by the subsequent camera application need to wait for the camera requests stored in the buffer to be processed and the empty buffer to be released before they can be stored in the empty buffer.

[0133] For example, the camera application of electronic device 100 may issue a camera request 1. The request queue processing module in the application framework layer of electronic device 100 may obtain camera request 1 through the setRepeatingRequest() or capture() interfaces in the camera interface. When there is an empty buffer in the N buffers reserved for camera requests in the cache area of ​​electronic device 100, electronic device 100 may issue the camera request from the waiting request module in the request queue processing module to the prepare HAL request module in the request queue processing module. After obtaining the buffer address allocated for the camera request using the Allocate Buffer interface, the prepare HAL request module may store the camera request in the buffer. The prepare HAL request module may construct the camera request into a Capture request at the HAL layer and issue it to the camera request waiting module in the HAL layer via the batch request issuing module. When the previous camera request processed by the camera hardware abstraction module has been completed, the camera request waiting module may send the camera request to the camera hardware abstraction processing module. The camera hardware abstraction processing module may then send the camera parameters and the buffer address of the new camera request to the camera module via the driver layer.

[0134] As can be understood, if camera requests are stored in multiple buffers in the buffer queue of the cache area and no buffer is empty, the request thread module needs to wait for the camera request in the first buffer in the buffer queue (for example, buffer 1) to be processed. Then, when the first buffer, buffer 1, is cleared, the request thread module can obtain the address of buffer 1 and store camera request 1 in buffer 1.

[0135] It is understood that after camera request 1 is stored in buffer 1, buffer 1 may be placed at the end of the buffer queue. The position of buffer 1 in the buffer queue is not fixed; the buffers in the buffer queue take turns storing camera requests. In the buffer queue, the buffer that stores camera requests first may be placed before the buffer that stores camera requests later, in the order in which the camera requests were stored. Electronic device 100 may first process the camera requests stored in the buffers at the beginning of the buffer queue, and then process the camera requests stored in the buffers at the end of the buffer queue.

[0136] ②. The electronic device 100 turns on the camera and obtains the image frame captured by the camera based on the camera request.

[0137] After receiving the camera parameters, the camera driver in the electronic device 100 can drive the electronic device 100 to turn on the camera module. The camera driver can send the camera parameters to the camera module. The camera module can obtain image frames according to the camera parameters.

[0138] In the embodiments of the present application, camera parameters may include camera intrinsic parameters and camera extrinsic parameters. Among them, camera intrinsic parameters may include parameters such as focal length (e.g., 1.0x), pixel focal length, etc. Camera extrinsic parameters may include the transformation relationship between different coordinate systems, for example, the transformation relationship between the world coordinate system and the camera coordinate system. The embodiments of the present application do not limit the specific camera parameters.

[0139] ③. The electronic device 100 sends the image frames captured by the camera to the application framework layer, and the application framework layer renders the image frames.

[0140] Electronic device 100 can upload the image frame captured by the camera module to the hardware abstraction layer through the camera driver. The hardware abstraction layer can store the image frame in the buffer of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame and the buffer address storing the image frame to the result processing module in the application framework layer.

[0141] Optionally, in some examples, the image frame captured by the camera module can be transmitted to an image signal processor. The image signal processor can pre-process the image frame and upload it to the hardware abstraction layer via a camera driver or an image processor driver. The hardware abstraction layer can store the image frame in buffer 1 of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame and the address of buffer 1 storing the image frame to the result processing module in the application framework layer.

[0142] The result processing module in the application framework layer can then upload the image frame and / or the address of buffer1 to the camera application. The camera application can then send the image frame to the rendering process module for rendering. After rendering, the rendering process module can send the rendering result to the camera application, which can then send the rendering result to the display via the display driver.

[0143] Optionally, in some feasible examples, after the hardware abstraction layer stores the image frames captured by the camera module in buffer 1, it uploads the address of buffer 1 to the result processing module in the application framework layer. The result processing module then uploads the address of buffer 1 to the camera application. After receiving the address of buffer 1, the camera application notifies the rendering process module in the application framework layer to perform rendering and informs the rendering process module of the address of buffer 1. The rendering process module can retrieve the image frames from buffer 1 and render them. The rendering process module can then send the rendering results to the camera application.

[0144] Alternatively, in some feasible examples, the rendering process module can directly render the image frame in buffer1. When rendering is complete, it can notify the camera application of the completion of rendering. The camera application can then notify the display driver to display the image frame and inform it of the address of buffer1. The display can then retrieve the rendered image frame from buffer1 and display it.

[0145] ④. The electronic device 100 displays the image frame.

[0146] After receiving the rendering result, that is, the rendered image frame, the display of the electronic device 100 can display the image frame.

[0147] Furthermore, in some examples, after the display successfully displays an image frame, the buffer storing the image frame and the camera request for the image frame in the buffer area of ​​the electronic device is cleared, so that the requesting process in the application framework layer can store another camera request in the buffer.

[0148] The visible screen and preview screen of the camera application. The preview screen can also be called the preview interface. A preview image can be displayed in the preview screen. After the camera application sends a preview request, the electronic device 100 will process the preview request sent by the camera application according to the above steps ① to ④. During the request sending stage, the camera application sends the preview request to the application framework layer. The application framework layer can process the preview request and send the meta information (also called meta information, for example, beauty, exposure, filter, etc.) and buffer address in the preview request to the HAL. During the preview request processing stage, after the HAL processes the preview request and obtains the image frame taken by the camera module according to the camera parameters in the camera request, the HAL can send the image frame to the rendering process module for rendering.

[0149] In the process from when the electronic device 100 sends a camera request from the camera application to when it obtains the image frame and sends the image frame to the rendering process module for rendering, the processing time for each camera request in the electronic device 100 may be different. Specifically, after the camera module obtains the image frame, the time it takes for the ISP to process each frame may be different. In addition, the metadata carried in the camera request is different, resulting in different times for the camera module to output the image frame. The time required for the application framework layer and the HAL to process different camera requests may also be different. This may result in different times required for image frame 1 and image frame 2 to be sent to the rendering process module. When the speed at which the electronic device 100 continuously sends image frames to the rendering process module exceeds the rendering capability of the electronic device 100, the rendering process module will discard the image frames. This will cause the preview screen in the electronic device to freeze, thereby affecting the user experience.

[0150] In the embodiment of the present application, the rendering cycle of the rendering process module is related to the processing power of the relevant underlying hardware (e.g., GPU) in the electronic device 100. The rendering cycle of the rendering process module may be different for different GPUs. The embodiment of the present application does not limit the specific value of the rendering cycle of the rendering process module.

[0151] Exemplarily, as shown in FIG3 , taking the rendering cycle of the rendering process module as 33.3 ms as an example, it shows a scenario in which the rendering process module discards image frames when the speed at which the electronic device 100 continuously sends image frames to the rendering process module exceeds the rendering capability of the electronic device 100 .

[0152] As shown in Figure 3, the first image frame is sent to the rendering process module. After the rendering process module renders the first image frame, the electronic device can display the first image frame. Then, when the rendering of the first image frame is complete, the second image frame can be sent to the rendering process module. After the rendering process module completes rendering the second image frame, the electronic device can display the second image frame. Then, when the rendering of the second image frame is complete, the third image frame can be sent to the rendering process module. After the rendering process module completes rendering the third image frame, the electronic device can display the third image frame. Then, when the rendering of the third image frame is complete, the fourth image frame can be sent to the rendering process module. After the rendering process module completes rendering the fourth image frame, the electronic device can display the fourth image frame. If the fifth image frame is already sent to the rendering process module while the rendering process module is still rendering the fourth image frame, the rendering process module can discard the fifth image frame. After the fourth image frame is successfully displayed, the electronic device 100 can wait for the sixth image frame. After the sixth image frame is sent to the rendering process module, the rendering process module can render the sixth image frame and send the sixth image frame for display.

[0153] After the fourth image frame is displayed, because the fifth image frame is discarded, electronic device 100 may experience a freeze while waiting for the sixth image frame to be displayed. For example, the fourth image frame may be preview image 415 shown in FIG. 4B , and the fifth image frame may be image frame 416 shown in FIG. 4C . Image frame 416 is not displayed on electronic device 100. The sixth image frame may be preview image 417 in FIG. 4D . For details, please refer to the description of FIG. 4A-4D below, which will not be repeated here.

[0154] In some scenarios, when the rendering process module of the electronic device 100 discards image frames, causing the electronic device 100 to freeze, the user may perceive the freeze in the preview screen of the electronic device 100. Figures 4A to 4D exemplarily illustrate user interface diagrams related to freezes in the preview screen of the electronic device 100.

[0155] Exemplarily, as shown in Figure 4A, the electronic device 100 can display a desktop 401, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator 404 is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area 402 is displayed below the page indicator 404. Among them, the tray area 402 includes multiple tray icons, for example, a camera application icon 403, an address book application icon, a phone application icon, and a message application icon. The tray area 402 remains displayed when the page is switched. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator 404. The page indicator 404 may not be part of the page and may exist independently. The above-mentioned tray icon is also optional, and the embodiments of the present application are not limited to this.

[0156] The electronic device 100 may receive an input operation (eg, a single click) from the user on the camera application icon 403 . In response to the input operation, the electronic device 100 may display a shooting interface 410 as shown in FIG. 4B .

[0157] As shown in Figure 4B, the shooting interface 410 may include an echo control 413A, a shooting control 413B, a camera conversion control 413C, a preview box 411, a zoom ratio control 412, and controls for one or more shooting modes (for example, controls 414A for large aperture shooting mode, controls 414B for night scene shooting mode, controls 414C for portrait shooting mode, controls 414D for shooting mode, controls 414E for video recording mode, controls 414F for multi-lens video recording mode, and controls 414G for more modes).

[0158] As shown in FIG. 4B , a desk lamp 200 and a basketball 300 exist in the spatial coordinate system XYZ where the electronic device 100 is located.

[0159] As shown in FIG4B , the control 414D for the photo mode is selected, and the electronic device 100 is in photo mode. The desk lamp 200 is within the shooting range of the camera of the electronic device 100. A preview image 415 captured by the camera of the electronic device 100 in photo mode is displayed in the preview box 411. The echo control 413A can be used to trigger the display of the captured image or video. The capture control 413B is used to trigger the saving of the image captured by the camera. The camera switch control 413C can be used to switch the camera used by the electronic device 100 to capture images (e.g., from the front camera to the rear camera, or vice versa). The zoom ratio control 412 can be used to set the zoom factor for the electronic device 100 to capture photos or videos. The zoom ratio control 412 can display the currently used zoom factor (e.g., 1.0x), a commonly used zoom factor 1 (e.g., 0.6x) that is smaller than the currently used zoom factor, and a commonly used zoom factor 2 (e.g., 2x) that is larger than the currently used zoom factor.

[0160] The controls for the shooting mode can be used to trigger the image processing process corresponding to the shooting mode. For example, the control 414A for the large aperture shooting mode can be used to trigger the camera to shoot images using large aperture parameters. The control 414B for the night scene shooting mode can be used to trigger increasing the brightness and color richness in the captured image, etc. The control 414C for the portrait shooting mode can be used to trigger the electronic device 100 to beautify the portrait in the captured image. The control 414D for the shooting mode can be used to trigger the electronic device 100 to shoot images using default parameters and use the default image processing process to process the images captured by the camera. The control 414E for the video recording mode can be used to trigger the electronic device 100 to record a video through a single camera. The control 414F for the multi-lens recording mode can be used to trigger the electronic device 100 to record a video simultaneously through multiple cameras. The more mode control 414G can be used to trigger the electronic device 100 to display controls for more shooting modes.

[0161] At this time, the table lamp 200 is within the shooting range of the camera of the electronic device 100. The preview image 415 displayed by the electronic device 100 is the image of the table lamp 200 captured by the electronic device 100. In some examples, the preview frame 411 can be called a preview screen.

[0162] The user can quickly move the electronic device 100 to the right (ie, the positive direction of the X-axis in the spatial coordinate system XYZ) so that the object within the shooting range of the camera of the electronic device 100 gradually changes from the desk lamp 200 to the basketball 300.

[0163] As shown in Figure 4C, during the rapid movement of electronic device 100, a portion of lamp 200 and a portion of basketball 300 (e.g., image frame 416) briefly appear within the camera's range. However, because electronic device 100 discards image frame 416 during rendering, electronic device 100 experiences a freeze and fails to display image frame 416. Preview frame 411 of electronic device 100 still displays preview image 415 of lamp 200.

[0164] As shown in FIG. 4D , when the electronic device 100 continues to move, only the basketball is within the shooting range of the camera of the electronic device 100 , and a preview image 417 of the basketball 300 may be displayed in the preview frame 411 of the electronic device 100 .

[0165] In this way, since the speed at which the electronic device 100 continuously sends image frames to the rendering process module exceeds the rendering capability of the electronic device 100, the rendering process module discards the image frames, causing the electronic device 100 to freeze.

[0166] In order to keep the speed at which the electronic device 100 sends image frames to the rendering process module stable and not to continuously send multiple image frames within the rendering cycle of the rendering process module, an embodiment of the present application provides a camera processing method, which may include: the camera application of the electronic device 100 sends a camera request to the HAL through the application framework layer. The HAL then sends the camera parameters in the camera request to the camera module, and obtains the image frames uploaded by the camera module according to the camera parameters. The HAL adds a timestamp to the image frame and uploads it to the application framework layer. The application framework layer can determine the image frame display time based on the timestamp of the image frame and the display time of the previous image frame of the image frame, that is, the time to send it to the rendering process module for rendering. The application framework layer sends the image frame to the rendering process module for rendering at the display time of the image frame, and then the electronic device displays the image frame.

[0167] However, in this camera request processing method, the electronic device 100 needs to rely on the HAL to add timestamps to the image frames. When the HAL software clock and the hardware used to process camera requests in the electronic device, such as the GPU clock, are different, the added timestamps will be incorrect, which will cause the electronic device 100 to send image frames to the rendering process module at an unstable speed. In other words, the time intervals between sending and displaying image frames will be inconsistent, which may cause the electronic device 100 to continuously send image frames to the rendering process module at a speed that exceeds the rendering capacity of the electronic device 100. In this case, the rendering process module will discard image frames, causing the electronic device 100 to send frames at a lag.

[0168] In order to solve the above problems, an embodiment of the present application provides a software framework diagram of another camera service on an electronic device.

[0169] As shown in Figure 5A, the software and hardware architecture of the electronic device 100 includes a software system and a hardware layer that implements related camera services (for example, preview, photo taking, video recording, etc.) together with the software structure. Among them, the layered architecture divides the software system of the electronic device 100 into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (application layer), the application framework layer (framework layer, FWK), the hardware abstraction layer (hardware abstraction layer, HAL), and the drive layer (drive layer).

[0170] In the electronic device 100, in addition to processing camera services through an uploaded software framework, the electronic device 100 can also process camera services through a hardware layer. In some examples, the software framework and hardware layer for processing camera services can be collectively referred to as a hardware-software architecture.

[0171] The application layer may include a series of application packages. As shown in FIG5A , an application package may include a camera application.

[0172] Optionally, the application package may also include application programs (also referred to as applications) such as gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc. This embodiment of the present application does not limit this.

[0173] The application framework layer provides an application programming interface (API) and programming framework for the application packages in the application layer. The application framework layer includes some predefined functions.

[0174] In some embodiments, the application framework layer may include a camera interface. For example, the camera interface may include an image acquisition interface and an interface for continuously acquiring images.

[0175] As shown in Figure 5A, the application framework layer also includes a shooting parameter generation module, a request queue processing module, an allocation buffer interface, a result processing module, an image cropping module, a vsync signal monitoring module, a display thread, a timer, a buffer manager, and a rendering process surface flinger.

[0176] The shooting parameter generation module is configured to generate a smooth adjustment curve based on the initial shooting parameters and the target shooting parameters sent by the camera application when detecting that the user has adjusted the shooting parameters. The module also determines one or more transition shooting parameters based on the image frame return time and the smooth adjustment curve.

[0177] The shooting parameter generation module is also used to send a transition shooting parameter to the HAL layer when it detects that the HAL layer uploads an image frame to the result processing module. The HAL layer then sends the transition shooting parameter to the camera module, so that the camera module can obtain the image frame based on the transition shooting parameter.

[0178] In some embodiments, the shooting parameter generation module may also be located in the HAL layer. This application does not limit the location of the shooting parameter generation module.

[0179] For the request queue processing module, allocation buffer interface and result processing module, please refer to the description in the embodiment of Figure 2, and this application will not go into details here.

[0180] The image cropping module is used to crop or scale the acquired image frame based on the camera parameters requested by the current camera and the camera parameters of the acquired image frame.

[0181] For modules such as the buffer manager, timer, display sending thread, and vertical synchronization (VSync) monitoring, please refer to the description in FIG5B , which will not be repeated here.

[0182] The hardware abstraction layer, driver layer and hardware layer can refer to the description in Figure 2 above and will not be repeated here.

[0183] In combination with the software and hardware framework of the electronic device 100 provided in Figure 5A above, Figure 5B shows the interaction of relevant modules involved in the embodiment of the present application and the specific flow of data processed by the electronic device when processing camera requests at a stable image frame display time interval.

[0184] As shown in FIG5B , the application framework layer may further include a request queue processing module, a result processing module, a buffer manager, a timer, a display sending thread, and a VSync monitor.

[0185] The client request queue processing module can receive camera requests sent by the camera application through the camera interface. The request queue processing module can then obtain the buffer allocated for the camera request from the buffer allocation interface module. The request queue processing module can then send the camera request and buffer address to the camera hardware abstraction layer. Camera requests received by the camera client can be stored in the request queue module. The request queue module can store one or more camera requests. The request thread module can obtain camera requests from the request queue module and also obtain a buffer for storing camera requests from the buffer. The request thread module can receive camera requests sent by the request queue module and the buffer address received from the buffer. Specifically, the waiting request module within the request queue processing module can receive camera requests sent by the camera application through the camera interface. The waiting request module can then send the received camera request to the preparation HAL request module. The preparation HAL request module can obtain a buffer for storing the camera request from the buffer allocation interface module. The preparation HAL request module can then send the camera request and the buffer address of the camera request to the batch request issuing module. The batch request issuing module can send the camera request and the buffer address of the camera request to the camera hardware abstraction layer. Optionally, when the buffer area used to store camera requests has an empty buffer, the HAL request preparation module can directly receive the camera request issued by the camera application through the camera interface. In the present embodiment, the camera request can include a preview request, a photo request, a video recording request, etc., and the present embodiment does not limit the specific type of camera request.

[0186] The result processing module can be used to receive the image frame sent by the hardware abstraction layer, or the buffer address storing the image frame.

[0187] The result processing module may further store the image frame or the buffer address storing the image frame in the buffer manager first.

[0188] Alternatively, in one possible implementation, the result processing module may first determine the number of buffers in the buffer manager. If the number of buffers in the buffer manager is greater than or equal to a threshold of 1, the result processing module may send the image frame or the address of the buffer storing the image frame to the camera application. If the number of buffers in the buffer manager is less than the threshold of 1, the result processing module may send the image frame or the address of the buffer storing the image frame to the buffer manager.

[0189] The buffer manager can be used to store buffers to be sent for display. In some examples, the buffer manager can store image frames sent by the result processing module or the addresses of buffers storing such frames. Furthermore, the buffer manager can also send the stored image frames or the addresses of buffers storing such frames to the display sending thread when the display sending thread obtains the buffer.

[0190] The display sending thread may determine the timing of obtaining the next image frame to be sent for display from the buffer manager based on the VSync signal period or the timer period.

[0191] Specifically, in one possible implementation, the display thread can be configured to obtain the next image frame to be displayed from the buffer manager after a delay of K VSync signal cycles from the time the previous image frame was displayed, and send the obtained image frame to the camera application. The camera application can then send the obtained image frame to the rendering process module.

[0192] Optionally, in one possible implementation, the display thread may also obtain the next image frame to be displayed from the buffer manager after a timer display period has elapsed since the previous image frame was displayed, and send the obtained image frame to the camera application. The camera application may send the obtained image frame to the rendering process module.

[0193] VSync can be used to monitor the VSync signal cycle in the rendering process and send the VSync signal cycle to the display process.

[0194] The timer can be used to send a timer period signal to the display thread, wherein the period of the timer can be determined by the frame rate of the electronic device.

[0195] In some embodiments, the application framework layer may further include a rendering process module. The rendering process module may be used to render the image frames sent by the camera application and send the rendering results (i.e., the rendered image frames) to the camera application. The camera application may display the rendering results.

[0196] In some embodiments, the application framework layer may also be referred to as the application framework layer.

[0197] The hardware abstraction layer (HAL) is an interface layer between the application framework layer and the driver layer, providing a virtual hardware platform for the operating system.

[0198] The HAL (Hardware Abstraction Layer) can include a camera hardware abstraction layer (HAL). The HAL receives camera requests from the application framework layer and transmits the camera parameters in the requests to the camera module via the driver layer. The HAL can also call a result-returning interface (e.g., ProcessCaptureResult) to send image frames captured by the camera module according to the camera parameters to the result processing module in the application framework layer.

[0199] Optionally, the camera hardware abstraction layer may store the image frames acquired by the camera module into a buffer address corresponding to the camera request, and send the buffer address to the result processing module in the application framework layer.

[0200] In this embodiment of the present application, a camera request corresponding to an image frame refers to a camera request that includes camera parameters for obtaining the image frame. That is, the camera can obtain the image frame according to the camera parameters in the camera request. For example, if the camera obtains image frame 1 according to the camera parameters in camera request 1, then camera request 1 can be referred to as the camera request corresponding to image frame 1.

[0201] Optionally, the camera hardware abstraction layer may include a request processing module and a result return module. The request processing module and the result return module are not shown in Figure 5B. The request processing module can extract camera parameters from the camera request and send the camera parameters to the camera module through the driver layer. The request processing module can also send the buffer address of the camera request to the result return module. The result return module can receive the image frame obtained by the camera module according to the camera parameters. The result return module can store the image frame in the buffer address of the camera request. Then, the result return module can send the buffer address to the result processing module in the application framework layer. Alternatively, the result return module can send the image frame and the buffer address to the result processing module in the application framework layer.

[0202] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. These include camera drivers, image processor drivers, and display drivers. The camera driver drives the image sensors (e.g., image sensor 1, image sensor 2, etc.) of one or more cameras in the camera module to capture images and drives the image signal processor to pre-process the images. The image processor driver drives the graphics processor to process images. The display driver drives the display.

[0203] The hardware layer may include a camera module, an image signal processor (ISP), a display, and the like. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like. The ISP may be used to process image frames captured by the camera module. The display may be used to display image frames sent by the camera application.

[0204] The following describes the workflow of the software and hardware of the electronic device 100 in conjunction with the scene of displaying a preview image using a camera application.

[0205] ①. The electronic device 100 receives an operation from the user to start the camera application and issues a camera request for obtaining a preview image.

[0206] When the electronic device 100 receives the user's operation to start the camera application, the electronic device 100 starts the camera application. The camera application can send multiple camera requests for obtaining preview images.

[0207] It is understandable that after the camera application in the electronic device 100 is turned on, it can periodically send a camera request for obtaining a preview image.

[0208] After receiving the camera request sent by the camera application, the application framework layer of the electronic device 100 can obtain the buffer address for storing the camera request. The application framework layer can also store the camera request in the buffer corresponding to the buffer address. It is understandable that the number of buffers used to store camera requests in the electronic device 100 is limited. When the camera application sends multiple camera requests in sequence, the application framework layer can store the multiple camera requests in the buffer in sequence. When the buffers in the cache area are all filled with camera requests and there is no empty buffer, the camera requests sent by the subsequent camera application need to wait for the camera requests stored in the buffer to be processed and the empty buffer to be released before they can be stored in the empty buffer.

[0209] For example, the camera application of electronic device 100 may issue a camera request 1. The request queue processing module in the application framework layer of electronic device 100 may obtain camera request 1 through the setRepeatingRequest() or capture() interfaces in the camera interface. When there is an empty buffer in the N buffers reserved for camera requests in the cache area of ​​electronic device 100, electronic device 100 may issue the camera request from the waiting request module in the request queue processing module to the prepare HAL request module in the request queue processing module. After obtaining the buffer address allocated for the camera request using the Allocate Buffer interface, the prepare HAL request module may store the camera request in the buffer. The prepare HAL request module may construct the camera request into a Capture request at the HAL layer and issue it to the camera request waiting module in the HAL layer through the batch request issuing module. When the previous camera request processed by the camera hardware abstraction module has been processed, the camera request waiting module may send the camera request to the camera hardware abstraction processing module. The camera hardware abstraction processing module may then send the camera parameters and the buffer address of the new camera request to the camera driver. As can be understood, if camera requests are stored in multiple buffers in the buffer queue of the cache area and no buffer is empty, the request thread module needs to wait for the camera request in the first buffer in the buffer queue (for example, buffer 1) to be processed. Then, when the first buffer, buffer 1, is cleared, the request thread module can obtain the address of buffer 1 and store camera request 1 in buffer 1.

[0210] It is understood that after camera request 1 is stored in buffer 1, buffer 1 may be placed at the end of the buffer queue. The position of buffer 1 in the buffer queue is not fixed; the buffers in the buffer queue take turns storing camera requests. In the buffer queue, the buffer that stores camera requests first may be placed before the buffer that stores camera requests later, in the order in which the camera requests were stored. Electronic device 100 may first process the camera requests stored in the buffers at the beginning of the buffer queue, and then process the camera requests stored in the buffers at the end of the buffer queue.

[0211] ②. The electronic device 100 turns on the camera and obtains the image frame captured by the camera based on the camera request.

[0212] After receiving the camera parameters, the camera driver in the electronic device 100 can drive the electronic device 100 to turn on the camera module. The camera driver can send the camera parameters to the camera module. The camera module can obtain image frames according to the camera parameters.

[0213] In the embodiments of the present application, camera parameters may include camera intrinsic parameters and camera extrinsic parameters. Among them, camera intrinsic parameters may include parameters such as focal length (e.g., 1.0x), pixel focal length, etc. Camera extrinsic parameters may include the transformation relationship between different coordinate systems, for example, the transformation relationship between the world coordinate system and the camera coordinate system. The embodiments of the present application do not limit the specific camera parameters.

[0214] ③. The electronic device 100 sends the image frame captured by the camera to the application framework layer, and the application framework layer renders the image frame at a first moment determined based on the VSync signal period or the timer signal period.

[0215] Electronic device 100 can upload the image frame captured by the camera module to the hardware abstraction layer through the camera driver. The hardware abstraction layer can store the image frame in the buffer of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame and the buffer address storing the image frame to the result processing module in the application framework layer.

[0216] Optionally, in some examples, the image frame captured by the camera module can be transmitted to an image signal processor. The image signal processor can pre-process the image frame and upload it to the hardware abstraction layer via a camera driver or an image processor driver. The hardware abstraction layer can store the image frame in buffer 1 of camera request 1. The camera hardware abstraction layer in the hardware abstraction layer can upload the image frame and the address of buffer 1 storing the image frame to the result processing module in the application framework layer.

[0217] After receiving the image frame uploaded by the camera hardware abstraction layer and the address of buffer 1, the result processing module can temporarily store the image frame in the buffer manager at the address of buffer address 1.

[0218] If the number of buffers in the buffer manager is greater than or equal to a threshold of 1, the buffer manager can directly send the image frame in the first queued buffer to the display process for display. If the number of buffers in the buffer manager is less than the threshold of 1, the buffer manager can send the previous image frame to the display thread. After the display thread completes displaying the image frame, the buffer manager can check the current buffer queue to see if the timestamp interval between the buffers is greater than a preset time interval. If so, the buffer manager can send the image frame in the first queued buffer in the buffer queue to the display thread.

[0219] In an embodiment of the present application, threshold 1 can be 2. For example, when buffer0 has been temporarily stored in the buffer manager, when the result processing module sends the address of buffer0 or the image frame to the buffer manager, there are 2 buffers in the buffer manager. Then the buffer manager can directly send buffer0 to the display process without waiting for the display thread to obtain the image frame.

[0220] It is understandable that the embodiment of the present application does not limit the specific value of threshold 1.

[0221] In the embodiment of the present application, the preset time interval may be 45 ms, and the embodiment of the present application does not limit the specific value of the preset time interval.

[0222] In one possible implementation, the display process can obtain the VSync signal cycle sent by the VSync monitoring module. After displaying the image frame in buffer0, the display process can obtain the next image frame to be displayed from the buffer manager after K VSync signal cycles have passed. For example, the image in buffer1 can be sent to the camera application.

[0223] In the embodiment of the present application, the number of VSync signal cycles between intervals, that is, the value of K, is determined by the VSync signal cycle interval and the frame rate.

[0224] In a possible implementation, the specific relationship between the value of K, the VSync signal period interval, and the frame rate is shown in the following formula 1.

[0225] K = 1000ms / frame rate / VSync signal cycle interval (Formula 1)

[0226] For example, when the frame rate is 30 fps (fps is a frame rate unit, indicating the number of frames transmitted per second) and the VSync signal cycle interval is 16.67 ms (ms indicates “milliseconds”), K is approximately equal to 2.

[0227] In this embodiment of the present application, the first value may be 1000.

[0228] Optionally, in another possible implementation, when the display process does not receive K VSync signal cycles sent by the VSync monitoring module after displaying the image frame in buffer0, the display process can determine the time of displaying the image frame in buffer1 based on the timestamp sent by the timer.

[0229] Furthermore, in one possible implementation, the display process can determine the time to display an image frame in buffer 1 based on a timestamp sent by a timer. This can include: when the time interval between the timestamp of the previously displayed image frame and the timestamp of the next image frame to be displayed is greater than a preset time interval, the display process can send the next image frame to be displayed to the camera application for display. For example, the timestamp of the image frame in buffer 0 is time 1, and the timestamp of the image frame in buffer 1 is time 2. After the display process displays the image frame in buffer 0, if the display process determines that the time interval between time 2 and time 1 is greater than the preset time interval, the display process can send the image frame in buffer 1 to the camera application for display.

[0230] Optionally, in some feasible examples, the address of buffer1 is uploaded to the camera application. After receiving the address of buffer1, the camera application notifies the rendering process module in the application framework layer to perform rendering and informs the rendering process module of the address of buffer1. The rendering process module can retrieve the image frame from buffer1 and render it. The rendering process module can then send the rendered result to the camera application.

[0231] Alternatively, in some feasible examples, the rendering process module can directly render the image frame in buffer1. When rendering is complete, it can notify the camera application of the completion of rendering. The camera application can then notify the display driver to display the image frame and inform it of the address of buffer1. The display can then retrieve the rendered image frame from buffer1 and display it.

[0232] ④. The electronic device 100 displays the image frame.

[0233] After receiving the rendering result, that is, the rendered image frame, the display of the electronic device 100 can display the image frame.

[0234] Furthermore, in some examples, after the display successfully displays an image frame, the buffer storing the image frame and the camera request for the image frame in the buffer area of ​​the electronic device is cleared, so that the requesting process in the application framework layer can store another camera request in the buffer.

[0235] When a user opens the camera application on the electronic device 100, the camera application may issue a camera request (e.g., a photo request) or periodically issue a camera request (e.g., a preview request) based on a user action (e.g., a user clicking a capture control for taking a photo). Below, we use the camera application sending a preview request as an example. When the camera application continuously issues preview requests, if the camera parameters in the preview request are different, the application framework layer and the HAL may take different amounts of time to process each camera request. Consequently, the time required for the HAL layer to obtain the image frame corresponding to the preview request varies. Thus, the time required for image frames corresponding to different preview requests to be sent to the rendering process module varies. If the next image frame is sent to the rendering process module while the previous image frame is being sent to the rendering process, or before the previous image frame has been rendered, the rendering process module cannot render the next frame because it is currently rendering the previous frame and may discard the next frame. Thus, if the next image frame or the captured content in the next image frame is different, the user may perceive a freeze in the preview screen of the electronic device 100, thereby affecting the user experience.

[0236] In implementing a camera request processing method provided by an embodiment of the present application, the electronic device 100 temporarily stores the image frame in the application framework layer (for example, the buffer manager shown in FIG3 ) before sending the image frame obtained based on the camera request to the rendering process module for display. Then, when the interval between the current time and the time when the previous image frame was sent to the rendering process module is K VSync signal cycles, the electronic device 100 sends the next image frame to the rendering process module for rendering, and then displays the rendered image frame. In this way, the electronic device can cache the image frame sent by the HAL, and then send it to the rendering process module according to the VSync signal cycle. The electronic device 100 can process the time interval of the image frame that was originally unevenly sent through the VSync signal cycle, so that the image frame sent by the HAL can be sent to the rendering process module evenly. This can solve the problem of the preview screen of the camera application being stuck due to sending multiple image frames to the rendering process module within the same rendering cycle.

[0237] 5A and 5B , a camera request processing method provided in an embodiment of the present application will be described in detail, taking the continuous issuance of preview requests after the camera application is started as an example.

[0238] FIG6 exemplarily shows a schematic diagram of software module interaction of a camera request processing method provided in an embodiment of the present application.

[0239] As shown in Figure 6, electronic device 100 may include a camera application, an application framework layer, and a hardware abstraction layer. The application framework layer may include a request queue processing module 610, a buffer manager 620, a display thread module 630, a VSync monitoring module 640, and a rendering process module 650. The hardware abstraction layer may include a camera hardware abstraction layer 660.

[0240] Among them, in a camera request processing method provided in an embodiment of the present application, the interaction process between the software modules of the electronic device 100 may include the following steps:

[0241] S601: The camera application detects an operation to start the camera and starts the camera application.

[0242] The camera application can detect the operation of starting the camera, for example, the user can click the camera application icon 403 as shown in Figure 4A. In response to the user operation, the camera application is started and the shooting interface of the camera application is displayed, such as the shooting interface 410 shown in Figure 4B.

[0243] S602 : The camera application sends multiple camera requests (camera request R11 , camera request R12 , . . . , camera request R1m ) to the request queue processing module 610 .

[0244] After the camera application is started, it may send multiple camera requests (camera request R11, camera request R12, ..., camera request R1m) to the request queue processing module 610. For example, camera request R11 may be a preview request for obtaining a preview image 415 as shown in FIG4B.

[0245] S603 , the request queue processing module 610 sends multiple camera requests (camera request R11 , camera request R12 , . . . , camera request R1m ) to the camera hardware abstraction layer 660 .

[0246] The request queue processing module 610 can receive multiple camera requests issued by the camera application through a camera interface. The camera interface may include a capture() interface and a setRepeatingRequest() interface. When the multiple camera requests issued by the camera application are requests for continuously obtaining preview data streams (e.g., multiple preview images), the request queue processing module 610 can obtain the multiple camera requests issued by the camera application through the setRepeatingRequest() interface.

[0247] The request queue processing module 610 may send multiple camera requests (camera request R11 , camera request R12 , . . . , camera request R1m) issued by the camera application to the camera hardware abstraction layer 660 .

[0248] Specifically, in one possible implementation, referring to FIG5B , the waiting request module in the request queue processing module 610 may first sequentially send multiple camera requests (camera request R11, camera request R12, ..., camera request R1m) to the preparing HAL request module in the request queue processing module 610. The preparing HAL request module then sequentially obtains buffers for the multiple camera requests and sends them to the sending batch request module in the request queue processing module 610. Finally, the sending batch request module in the request queue processing module 610 sends the multiple camera requests (camera request R11, camera request R12, ..., camera request R1m) to the camera hardware abstraction layer 660.

[0249] S604 . The camera hardware abstraction layer 660 obtains, through the camera, an image frame 1 corresponding to the camera request R11 among the multiple camera requests.

[0250] The camera hardware abstraction layer 660 can process multiple camera requests one by one. First, the camera hardware abstraction layer 660 can send the camera parameters in camera request R11 to the camera module via the camera driver. The camera module can obtain image frame 1 according to the camera parameters in camera request R11. The camera module can send image frame 1 to the camera hardware abstraction layer 660 via the camera driver. Alternatively, the camera module can first send image frame 1 to the image signal processor. The image signal processor processes image frame 1 and sends the processed image frame 1 to the camera hardware abstraction layer 660 via the camera driver.

[0251] S605 : The camera hardware abstraction layer 660 returns image frame 1 to the buffer manager 620 .

[0252] After acquiring the image frame 1, the camera hardware abstraction layer 660 may send the image frame 1 to the result processing module in the application framework layer. Then, the result processing module may send the image frame 1 to the buffer manager 620.

[0253] In one possible implementation, if the number of image frames in the buffer manager 620 (also referred to as the number of buffers storing image frames) is greater than or equal to a threshold value of 1, the buffer manager 620 may directly send the image frame (e.g., image frame 0) stored in the buffer manager 620 before image frame 1 to the display thread module 630. If the number of image frames in the buffer manager 620 (also referred to as the number of buffers storing image frames) is less than the threshold value of 1, the buffer manager 620 may continue to store image frames returned by the camera hardware abstraction layer 660 and wait for the display thread module 630 to obtain image frames.

[0254] S606 , the VSync monitoring module 640 monitors the VSync signal in the rendering process module 650 .

[0255] The VSync monitoring module 640 can monitor the VSync signal in the rendering process module 650.

[0256] It is understood that after the camera application is launched, the VSync monitoring module 640 can begin to continuously monitor the VSync signal in the rendering process module 650. That is, step S605 is continuously executed throughout the entire process of the electronic device 100 processing the camera request. For example, step S605 can be executed after step S601 and end after the camera application is closed.

[0257] S607 : The rendering process module 650 sends a VSync signal cycle to the VSync monitoring module 640 .

[0258] The rendering process module 650 may issue a VSync signal when rendering an image frame. The VSync monitoring module 640 may monitor the rising and falling edges of the VSync signal. The VSync signal may change periodically. The time interval between the previous VSync signal and the next VSync signal may be the VSync signal period.

[0259] In an embodiment of the present application, the rendering process module 650 may send a VSync signal period or a VSync signal to the VSync monitoring module 640 .

[0260] S608 : The VSync monitoring module 640 sends a VSync signal cycle to the display sending thread module 630 .

[0261] The VSync monitoring module 640 may send a VSync signal cycle or a VSync signal to the display thread module 630 when detecting a change in the rising edge or falling edge of the VSync signal.

[0262] Optionally, the VSync monitoring module 640 may notify the display thread module 630 once every VSync signal cycle. Alternatively, the VSync monitoring module 640 may notify the display thread module 630 once every VSync signal is monitored.

[0263] S609 , the display sending thread module 630 obtains image frames from the buffer manager 620 every K VSync signal cycles.

[0264] The display thread module 630 may obtain an image frame from the buffer manager 620 every K VSync signal cycles.

[0265] Optionally, in one possible implementation, the VSync monitoring module 640 may not perform step S608. When the VSync monitoring module 640 detects the Kth VSync signal from the rendering process module 650, the VSync monitoring module 640 may notify the display thread module 630 to acquire an image frame. Subsequently, when the VSync monitoring module 640 detects the 2Kth VSync signal from the rendering process module 650, the VSync monitoring module 640 may notify the display thread module 630 to acquire an image frame. In this manner, the VSync monitoring module 640 notifies the display thread module 630 to acquire an image frame every K VSync signal cycles.

[0266] Optionally, in another possible implementation, the display sending thread module 630 may also receive a timestamp sent by a timer. When the time interval between the current time and the timestamp of the previous image frame obtained by the display sending thread module 630 is greater than or equal to a preset time interval, the display sending thread module 630 may obtain the image frame from the buffer manager 620.

[0267] S610 , when the display sending thread module 630 obtains an image frame, the buffer manager 620 sends image frame 1 to the display sending thread module 630 .

[0268] After receiving the instruction from the display sending thread module 630 to obtain the image frame, the buffer manager 620 may send the image frame 1 to the display sending thread module 630 .

[0269] S611 , the display thread module 630 sends the image frame 1 to the camera application.

[0270] The display thread module 630 may send the image frame 1 and / or the buffer address storing the image frame 1 to the camera application.

[0271] S612 , the camera application sends the image frame 1 to the rendering process module 650 .

[0272] The camera application may send the image frame 1 and / or the buffer address storing the image frame 1 to the rendering process module 650 .

[0273] S613 , the rendering process module 650 renders the image frame 1 to obtain the rendered image frame 1 .

[0274] The rendering process module 650 can render image frame 1 and obtain the rendered image frame. In some examples, if the rendering process module 650 obtains the buffer address storing image frame 1, the rendering process module 650 can render image frame 1 in the buffer corresponding to the buffer address. Alternatively, if the rendering process module 650 obtains the buffer address storing image frame 1, the rendering process module 650 can retrieve image frame 1 from the buffer corresponding to the buffer address and render the image frame.

[0275] S614 , the rendering process module 650 sends the rendered image frame 1 to the camera application.

[0276] The rendering process module 650 may send the rendered image frame 1 or the buffer address storing the image frame 1 to the camera application.

[0277] S615: The camera application displays the rendered image frame 1 in the user interface.

[0278] The camera application may display the rendered image frame 1 in a user interface. Specifically, the camera application may send the rendered image frame 1 to a display, and the display may display the rendered image frame 1 in the user interface of the camera application.

[0279] In this way, the electronic device can cache the image frames sent by the HAL in the buffer manager 620. The display thread module 630 then sends them to the rendering process module according to the VSync signal cycle. The electronic device 100 can use the VSync signal cycle to process the uneven time intervals between image frames sent for display, ensuring that the image frames sent by the HAL are evenly sent to the rendering process module. This can solve the problem of camera application preview screen freezes caused by sending multiple image frames to the rendering process module within the same rendering cycle.

[0280] FIG7 exemplarily shows a flow chart of a camera request processing method provided by an embodiment of the present application. As shown in FIG7 , a camera request processing method provided by an embodiment of the present application may include the following steps:

[0281] S701 : The electronic device 100 obtains the image frame 1 corresponding to the camera request R11 .

[0282] After the camera application of electronic device 100 is activated, it can issue a camera request R11. Then, electronic device 100 can issue this camera request R11 layer by layer to the HAL. The HAL can extract the camera parameters in the camera request R11 and send them to the camera. The HAL can also obtain the image frame 1 captured by the camera according to the camera parameters.

[0283] Regarding how the electronic device 100 specifically obtains the image frame 1 corresponding to the camera request R11 in step S701 , reference may be made to the description in steps S601 to S604 above, which will not be repeated here.

[0284] S702: The electronic device 100 stores the image frame 1 in a buffer queue.

[0285] The electronic device 100 may store the image frame 1 in the buffer queue of the buffer manager.

[0286] S703 , the electronic device 100 determines whether the number of image frames in the buffer queue is greater than a threshold value 1; if so, execute step S705 a ; if not, execute step S704 .

[0287] The electronic device 100 can determine whether the number of buffers in the buffer queue of the buffer manager is greater than the threshold value 1. If the number of buffers in the buffer queue is greater than or equal to the threshold value 1, the electronic device 100 can render the image frame that is first queued in the buffer queue, for example, image frame 0. That is, if the number of buffers in the buffer queue is greater than or equal to the threshold value 1, the electronic device 100 can execute step S705a and step S706a. If the number of buffers in the buffer queue is less than the threshold value 1, the electronic device 100 can wait for the time interval between the current time and the display time of the previous image frame to be greater than or equal to K VSync signal cycles. That is, if the number of buffers in the buffer queue is less than the threshold value 1, the electronic device 100 can execute step S704.

[0288] For example, let's assume that threshold 1 is 2. If image frame 0 is already queued in the buffer queue, after image frame 1 is stored in the buffer queue, the number of buffers in the buffer queue is 2. Therefore, electronic device 100 can display image frame 0 first. If no image frame is queued in the buffer queue, after image frame 1 is stored in the buffer queue, the number of buffers in the buffer queue is 1. Therefore, electronic device 100 can wait until the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles before displaying image frame 1.

[0289] In the embodiment of the present application, a buffer stores an image frame and a camera request corresponding to the image frame. When describing the number of buffers in the buffer queue, it also describes the number of image frames in the buffer queue.

[0290] In the embodiment of the present application, the first threshold may be threshold 1.

[0291] S704. The electronic device 100 determines whether the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles; if so, execute step S705b; if not, execute step S703 again.

[0292] The electronic device 100 can obtain the VSync signal and determine whether the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles. If the time interval between the current time and the display time of the previous image frame is greater than or equal to K VSync signal cycles, the electronic device 100 can execute steps S705b and S706b. If the time interval between the current time and the display time of the previous image frame is less than K VSync signal cycles, the electronic device 100 can execute step S703 again.

[0293] For details of step S704 , please refer to the description of steps S606 to S609 above.

[0294] S705a: The electronic device 100 renders image frame 0 to obtain rendered image frame 0, and stores image frame 0 in the buffer queue before image frame 1.

[0295] S706a: The electronic device 100 displays the rendered image frame 0.

[0296] The electronic device 100 can render image frame 0 and display the rendered image frame 0. Here, for details, reference can be made to the description of the electronic device 100 rendering the image frame in FIG. 2 or FIG. 5B . In the embodiment of the present application, the electronic device 100 displays the rendered image frame 0, which can also be referred to as the electronic device 100 displaying image frame 0.

[0297] S705b: The electronic device 100 renders the image frame 1 to obtain the rendered image frame 1.

[0298] S706b: The electronic device 100 displays the rendered image frame 1.

[0299] The electronic device 100 can render the image frame 1 and display the rendered image frame 1. For details, reference can be made to the description of the electronic device 100 rendering the image frame in FIG. 2 or FIG. 5B . In the embodiment of the present application, the electronic device 100 displays the rendered image frame 1, which can also be referred to as the electronic device 100 displaying the image frame 1.

[0300] Optionally, in one possible implementation, when the electronic device 100 does not receive the VSync signal, the electronic device 100 may determine, based on the timer's timestamp, when to display image frame 1. Specifically, when only image frame 1 is stored in the buffer queue of the electronic device 100, the electronic device 100 may display image frame 1 when the time interval between the current time and the display time of the previous image frame is greater than or equal to a preset time interval.

[0301] Embodiments of the present application provide a camera request processing method in which the electronic device 100 can cache image frames sent by the HAL and then send them to the rendering process module based on the VSync signal cycle. The electronic device 100 can use the VSync signal cycle to ensure that the image frames sent by the HAL are evenly sent to the rendering process module. This can solve the problem of camera application preview screen lag caused by sending multiple image frames to the rendering process module within the same rendering cycle.

[0302] Exemplarily, as shown in FIG8 , taking the rendering cycle of the rendering process module as 33.3 ms as an example, it shows a scenario in which the electronic device 100 sends rendered image frames according to the VSync signal cycle when the speed at which the electronic device 100 continuously sends image frames to the rendering process module exceeds the rendering capability of the electronic device 100 .

[0303] As shown in Figure 8, when VSync signal 1 arrives, the electronic device 100 sends the first image frame to the rendering process module. After the rendering process module renders the first image frame, the electronic device 100 can display the first image frame. When VSync signal 3 arrives, the electronic device 100 sends the second image frame to the rendering process module. After the rendering process module renders the second image frame, the electronic device 100 can display the second image frame. When VSync signal 5 arrives, the electronic device 100 sends the third image frame to the rendering process module. After the rendering process module renders the third image frame, the electronic device 100 can display the third image frame. When VSync signal 7 arrives, the electronic device 100 sends the fourth image frame to the rendering process module. After the rendering process module renders the fourth image frame, the electronic device 100 can display the fourth image frame. Before the fourth image frame is rendered, the HAL layer has already returned the fifth image frame to the application framework layer. The electronic device 100 may temporarily store the fifth image frame according to the camera request processing method shown in steps S701 to S706b above. Then, after two VSync signal cycles, the fifth image frame may be sent to the rendering process module. After the rendering process module renders the fifth image frame, the electronic device 100 may display the fifth image frame. Upon the arrival of the VSync signal 12, the electronic device 100 may send the sixth image frame to the rendering process module. After the rendering process module renders the sixth image frame, the electronic device 100 may display the sixth image frame.

[0304] In this way, when the time it takes for the HAL to continuously upload image frames (for example, the 4th and 5th image frames) is less than the rendering cycle of the rendering process, the next image frame (for example, the 5th image frame) will be temporarily stored. The electronic device 100 then uploads it to the rendering process module according to the VSync signal cycle. The electronic device 100 can use the VSync signal cycle to ensure that the image frames uploaded by the HAL are evenly sent to the rendering process module. In this way, the electronic device 100 does not discard the 5th image frame.

[0305] The camera processing request method provided by an embodiment of the present application can stabilize the time interval for sending image frames to the rendering process. For example, as shown in Figure 9, Figure 9 (a) shows the time interval between sending and displaying each frame of image and the previous frame of image when the electronic device 100 processes the camera request before the camera processing request method provided by an embodiment of the present application is adopted. Figure 9 (b) shows the time interval between sending and displaying each frame of image and the previous frame of image when the electronic device 100 processes the camera request after the camera processing request method provided by an embodiment of the present application is adopted.

[0306] As shown in Figure 9 (b), after adopting the camera processing request method provided in the embodiment of the present application, the time interval for sending image frames into the rendering process is more stable, and the time interval between sending and displaying more image frames and the previous frame is stable at 33 milliseconds.

[0307] As shown in FIG. 9 ( a ), before the camera processing request method provided in the embodiment of the present application is adopted, the display time between a large number of image frames and the previous image frame is less than 33 milliseconds.

[0308] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

[0309] As used in the above embodiments, the term “when…” may be interpreted to mean “if…” or “after…” or “in response to determining…” or “in response to detecting…”, depending on the context. Similarly, the phrases “upon determining…” or “if (stated condition or event) is detected” may be interpreted to mean “if determining…” or “in response to determining…” or “upon detecting (stated condition or event)” or “in response to detecting (stated condition or event)”, depending on the context.

[0310] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk).

[0311] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A camera request processing method, characterized in that: The method comprises: The electronic device obtains a first image frame corresponding to a first camera request sent by a camera application; When the time interval between the current time and the display time of the previous image frame is greater than or equal to K vertical synchronization VSync signal cycles, the electronic device renders and displays the first image frame; The electronic device displays the first image frame in a preview interface of the camera application.

2. The method according to claim 1, characterized in that The method further comprises: When the time interval between the current time and the display time of the previous image frame is less than the K VSync signal cycles, the electronic device stores the first image frame in a buffer queue of image frames to be displayed.

3. The method according to claim 2, characterized in that The electronic device further includes a buffer manager, and the buffer manager is used to temporarily store image frames. After the electronic device obtains a first image frame corresponding to a first camera request sent by a camera application, the method further includes: When the number of image frames in the buffer manager is greater than or equal to a first threshold, the electronic device renders and displays the first image frame; When the image frame in the buffer manager is smaller than the first threshold, the buffer manager temporarily stores the first image frame in the buffer queue.

4. The method according to any one of claims 1 to 3, characterized in that: The electronic device further includes a display transmission thread module. After the buffer manager temporarily stores the first image frame, the method further includes: The display sending thread module obtains the first image frame from the buffer manager.

5. The method according to claim 4, characterized in that The electronic device further comprises a VSync signal monitoring module and a rendering process module, wherein the VSync signal monitoring module is used to monitor the VSync signal of the rendering process module.

6. The method according to claim 5, characterized in that The method further comprises: The VSync signal monitoring module sends the VSync signal to the display transmission thread module; The display thread module determines, based on the VSync signal, that a time interval between a current time and a display time of a previous image frame is greater than or equal to the K VSync signal cycles.

7. The method according to claim 6, characterized in that In the case where the time interval between the current time and the display time of the previous image frame is greater than or equal to K vertical synchronization VSync signal cycles, the electronic device renders and displays the first image frame, including: When the display sending thread module determines that the time interval between the current time and the display sending time of the previous image frame is greater than or equal to the K VSync signal cycles, the display sending thread module sends the first image frame to the rendering process module; The rendering process module renders and displays the first image frame.

8. The method according to any one of claims 5 to 7, characterized in that: The value of K is determined by the frame rate of the electronic device and the VSync signal cycle interval.

9. The method according to claim 8, characterized in that The K is equal to the first value divided by the frame rate, and then divided by the VSync signal period interval.

10. The method according to claim 9, characterized in that The electronic device further includes a timer module, and the method further includes: The timer module sets a first timestamp for the first image frame; When the display sending thread module determines that the time interval between the first timestamp and the timestamp of the last image frame sent for display by the display sending thread module is greater than a second threshold, the display sending module sends the first image frame to the rendering process module.

11. An electronic device, characterized in that: It comprises a camera, one or more processors and one or more memories; wherein the camera, the one or more memories are coupled to the one or more processors, the one or more memories are used to store computer program codes, and the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the method as described in any one of claims 1-10 is executed.

12. A chip system, the chip system is applied to electronic equipment, the chip system comprises one or more processors, characterized in that: The processor is configured to call computer instructions so as to execute the method according to any one of claims 1 to 10.

13. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the method according to any one of claims 1 to 10 is executed.

Citation Information

Patent Citations

  • Video uniform display method, terminal device, and machine readable storage medium

    CN110771160A

  • Data processing method and related device

    CN116627301A

  • Determination method and device for preview lag reason and storage medium

    CN116708753A

  • Thread acceleration processing method and device

    CN117130774A

  • Frame control device and method, display system, electronic equipment and storage medium

    CN117153076A