Camera control methods, devices, electronic equipment, storage media and products

By acquiring the time interval between two adjacent frames in the viewfinder of the electronic device, the camera frame rate is increased and resource configuration is adjusted, which solves the display stuttering problem caused by low hardware configuration and achieves more accurate stuttering detection and mitigation.

CN122372832APending Publication Date: 2026-07-10BEIJING XIAOMI MOBILE SOFTWARE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING XIAOMI MOBILE SOFTWARE CO LTD
Filing Date
2025-01-10
Publication Date
2026-07-10

Smart Images

  • Figure CN122372832A_ABST
    Figure CN122372832A_ABST
Patent Text Reader

Abstract

This disclosure relates to a camera control method, apparatus, electronic device, storage medium, and product. The method includes: when displaying an application interface of a first application, and the application interface has a viewfinder window, acquiring the time interval between two adjacent frames displayed in the viewfinder window, wherein the two adjacent frames are obtained based on image acquisition of the viewfinder area by a camera invoked by the first application; and when the time interval exceeds a duration threshold, increasing the camera's frame rate to shorten the time interval. This method can promptly detect and alleviate image display stuttering.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of electronic technology, and in particular to a camera control method, apparatus, electronic device, storage medium, and product. Background Technology

[0002] Image acquisition is a crucial function in electronic devices. However, the process of acquiring and displaying images using a camera typically requires significant computing and storage resources. Consequently, with devices featuring lower hardware specifications, image display stuttering can easily occur during camera-based image acquisition, negatively impacting the user experience.

[0003] Currently, to address this issue, electronic devices can detect the frame rate of the camera's output images and determine whether frame drops have occurred during the image output process based on this frame rate. If the electronic device determines that frame drops have occurred during image output, it then determines that the image displayed on the screen is experiencing display stuttering. However, because the image display process is also affected by other factors, the accuracy of determining whether display stuttering occurs based on the camera's frame rate is relatively low. Summary of the Invention

[0004] To overcome the problems existing in the related technologies, this disclosure provides a camera control method, device, electronic device storage medium and product, which can promptly detect and alleviate image display stuttering.

[0005] According to a first aspect of the present disclosure, a camera control method is provided, the method comprising: when displaying an application interface of a first application and the application interface having a viewfinder window, acquiring a time interval between two adjacent frames of images displayed in the viewfinder window, the two adjacent frames being obtained by the camera invoked by the first application to acquire images of the viewfinder range; and increasing the frame rate of the camera when the time interval is greater than a duration threshold; wherein the frame rate of the camera is used to indicate the number of images acquired and processed by the camera per unit time.

[0006] In some embodiments, obtaining the time interval between two adjacent frames of images displayed in the viewfinder includes: determining a first layer for drawing images captured by the camera from various layers associated with the display compositing module, the first layer being used to form the viewfinder; and determining the time interval between two adjacent frames of images displayed in the viewfinder based on the time interval between drawing two adjacent frames of images on the first layer.

[0007] In some embodiments, determining a first layer for drawing an image acquired by a camera from the layers associated with the display compositing module includes: determining the first layer from the layers associated with the display compositing module based on layer information of the first layer.

[0008] In some embodiments, increasing the camera's frame rate when the time interval is greater than a duration threshold includes: increasing the hardware resources configured for the camera when the time interval is greater than the duration threshold, the hardware resources including computing resources and / or storage resources; and / or reducing the quality of the images output by the camera when the time interval is greater than the duration threshold.

[0009] In some embodiments, when the time interval is greater than a duration threshold, the quality of the image output by the camera is reduced, including at least one of the following: when the time interval is greater than a duration threshold, the image processing algorithm of the camera is simplified; when the time interval is greater than a duration threshold, the number of cameras acquiring images is adjusted from a first number to a second number, wherein the second number is less than the first number.

[0010] When the time interval exceeds a duration threshold, the resolution of the image output by the camera is reduced.

[0011] In some embodiments, when the time interval is greater than a duration threshold, the hardware resources configured for the camera are increased, including: when the time interval is greater than the duration threshold, determining the camera's shooting mode; determining the target hardware resources corresponding to the shooting mode; and adjusting the hardware resources configured for the camera to the target hardware resources.

[0012] In some embodiments, the method further includes: after increasing the frame rate of the camera, acquiring the time interval between two adjacent frames displayed in the viewfinder again; and terminating the camera process when the latest acquired time interval is greater than a duration threshold.

[0013] According to a second aspect of the present disclosure, a camera control device is provided, the device comprising: a first acquisition module configured to acquire, when displaying an application interface of a first application and the application interface has a viewfinder window, a time interval between two adjacent frames of images displayed in the viewfinder window, wherein the two adjacent frames of images are obtained by the camera invoked by the first application to acquire images of the viewfinder area; and an enhancement module configured to increase the frame rate of the camera when the time interval is greater than a duration threshold; wherein the frame rate of the camera is used to indicate the number of images acquired and processed by the camera per unit time.

[0014] In some embodiments, the first acquisition module is configured to: determine a first layer for drawing images acquired by the camera from the various layers associated with the display composition module, the first layer being used to form a viewfinder window; and determine a time interval for displaying two adjacent frames of images in the viewfinder window based on the time interval for drawing two adjacent frames of images on the first layer.

[0015] In some embodiments, the first acquisition module is configured to: determine the first layer from the various layers associated with the display composition module based on the layer information of the first layer.

[0016] In some embodiments, the enhancement module is configured to: increase the hardware resources configured for the camera when the time interval is greater than a duration threshold, the hardware resources including computing resources and / or storage resources; and / or, reduce the quality of the image output by the camera when the time interval is greater than the duration threshold.

[0017] In some embodiments, the enhancement module is configured to: simplify the image processing algorithm of the camera when the time interval is greater than the duration threshold; adjust the number of cameras acquiring images from a first number to a second number when the time interval is greater than the duration threshold, wherein the second number is less than the first number; and reduce the resolution of the image output by the camera when the time interval is greater than the duration threshold.

[0018] In some embodiments, the enhancement module is configured to: determine the camera's shooting mode when the time interval is greater than a duration threshold; determine the target hardware resources corresponding to the shooting mode; and adjust the hardware resources configured for the camera to the target hardware resources.

[0019] In some embodiments, the device further includes: a second acquisition module configured to acquire the time interval between two adjacent frames displayed in the viewfinder after increasing the frame rate of the camera; and an termination module configured to terminate the camera process when the latest acquired time interval is greater than a duration threshold.

[0020] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing computer programs or instructions; wherein the processor executes the computer programs or instructions to implement the steps of the method described above.

[0021] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium is provided, which stores executable instructions or a computer program that, when executed by a processor, implements the steps of the method described above.

[0022] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program or instructions that, when executed by a processor, implement the steps of the method described above.

[0023] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:

[0024] In this disclosure, a decrease in the frame rate of the camera output image or a decrease in the update frame rate of the application interface will lead to an increase in the time interval between two adjacent frames of the image captured by the camera displayed in the viewfinder window of the application interface, resulting in image display stuttering. Therefore, by determining the time interval between two adjacent frames displayed in the viewfinder window, it is possible to more accurately determine whether the image captured by the camera is experiencing display stuttering, thereby alleviating the image display stuttering phenomenon more promptly.

[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

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

[0027] Figure 1 This is a schematic diagram illustrating a process related to an image captured by a display camera, according to an exemplary embodiment.

[0028] Figure 2 This is a flowchart illustrating a camera control method according to an exemplary embodiment.

[0029] Figure 3 This is a flowchart illustrating a camera control method according to another exemplary embodiment.

[0030] Figure 4 This is a schematic diagram illustrating the frame rate of a camera output image according to an exemplary embodiment.

[0031] Figure 5 This is a schematic diagram of the frame rate of an output image from a camera according to another exemplary embodiment.

[0032] Figure 6 This is a schematic diagram illustrating a preset mapping relationship according to an exemplary embodiment.

[0033] Figure 7 This is a flowchart illustrating a camera control method according to yet another exemplary embodiment.

[0034] Figure 8 This is a schematic diagram illustrating the interaction between the surfaceflinger process and the camera process according to an exemplary embodiment.

[0035] Figure 9 This is a schematic diagram illustrating the interaction between a surfaceflinger and a camera process according to another exemplary embodiment.

[0036] Figure 10 This is a schematic diagram illustrating an application scenario of a camera control method according to an exemplary embodiment.

[0037] Figure 11 This is a block diagram illustrating a camera control device according to an exemplary embodiment.

[0038] Figure 12 This is a structural block diagram of an electronic device according to an exemplary embodiment. Detailed Implementation

[0039] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this disclosure. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this disclosure as detailed in the appended claims.

[0040] Image acquisition is a crucial function in electronic devices. However, the process of acquiring and displaying images using a camera typically requires significant computing and storage resources. Consequently, with devices featuring lower hardware specifications, image display stuttering can easily occur during camera-based image acquisition, negatively impacting the user experience.

[0041] Currently, to address this issue, electronic devices can detect the frame rate of the camera's output images and determine whether frame drops have occurred during the image output process based on this frame rate. If the electronic device determines that frame drops have occurred during image output, it then determines that image display stuttering has occurred. However, image display stuttering is not only related to the frame rate of the camera's output images but is also affected by other processes related to image display. Therefore, the accuracy of determining whether image display stuttering occurs solely by monitoring the frame rate of the camera's output images is relatively low.

[0042] For example, refer to Figure 1 , Figure 1 This is a schematic diagram illustrating a process related to an image captured by a display camera, according to an exemplary embodiment. Figure 1As shown, when the first application installed on the electronic device invokes the camera, the electronic device can create a camera process 101. Then, the camera process 101 in the electronic device can control the camera to acquire images and process the acquired images. Afterwards, the camera process 101 can transmit the processed image to the surfaceflinger process 102. After receiving the image transmitted by the camera process, the surfaceflinger process 102 can draw the application interface of the first application based on the obtained image and display the image transmitted from the camera process 101 to the surfaceflinger process 102 in the viewfinder window of the application interface. Thus, when the application interface of the first application is displayed on the screen, the viewfinder window of the application interface displays the image acquired by the camera. It can be seen that the process of displaying the image acquired by the camera through the viewfinder window of the application interface involves not only the camera process but also the surfaceflinger process 102. If the frame rate of the image output by the camera process 102 is normal, but there is a delay in the process of the surfaceflinger process drawing the application interface based on the image acquired by the camera, it will also cause a delay in the update of the image displayed in the viewfinder window, thus extending the time interval between the display of two adjacent frames in the viewfinder window. It is clear that monitoring whether frames are dropped when the camera outputs images cannot accurately determine whether the image display is choppy.

[0043] To address the aforementioned problems, this disclosure provides a camera control method. This method can be executed by an electronic device. Exemplarily, the electronic device executing the camera control method provided in this disclosure can be a mobile terminal with a camera or a fixed terminal. The mobile terminal can include smartphones, tablets, laptops, digital cameras, and wearable electronic devices, etc. The fixed terminal can include desktop computers, all-in-one computers, etc.

[0044] refer to Figure 2 , Figure 2 This is a schematic flowchart illustrating a camera control method according to an exemplary embodiment. In the following text, an electronic device will be used as the execution subject, with reference to... Figure 2 The steps shown illustrate a camera control method provided in this disclosure embodiment. The camera control method mainly includes the following steps:

[0045] In step 201, when the application interface of the first application is displayed and the application interface has a viewfinder window, the time interval between two adjacent frames of images displayed in the viewfinder window is obtained.

[0046] In some embodiments, two adjacent frames are obtained by capturing images of the field of view using a camera invoked by a first application.

[0047] Understandably, when the first application installed on an electronic device invokes the camera, the device can capture images of the frame using the camera and display these images in the application's viewfinder. During this process, the electronic device redraws the application interface at preset time intervals (the reciprocal of the screen refresh rate), incorporating the latest image captured by the camera into the newly drawn interface so that the user can view it through the viewfinder. However, if the camera hasn't yet captured a new image while the device is drawing the first application interface, it will reuse the previously captured image to generate and display a new interface. In this case, the image displayed in the viewfinder of the new interface is the same frame as the image displayed in the viewfinder of the previous application interface, resulting in a perceived stuttering or lag in the viewfinder from the user's perspective.

[0048] Furthermore, if an electronic device experiences a delay in rendering a new application interface, causing the rendering time to exceed the preset time interval, the update interval of the application interface will be prolonged. This will visually manifest as a lag in the entire application interface for the user, and the viewfinder will also appear to lag. Therefore, both delays in camera image output and delays in application interface rendering can cause lag in the viewfinder. Thus, when an electronic device displays an image captured by the camera in its viewfinder, the time interval between two adjacent frames displayed in the viewfinder can be used to determine whether lag is occurring in the viewfinder.

[0049] For example, when the application interface of a first application is displayed on the screen, the electronic device can obtain the time interval between the display of the first image and the second image in the viewfinder window of the application interface. The first image and the second image are two adjacent frames captured by the camera.

[0050] In some embodiments, the electronic device may determine the time interval between the start display times of two adjacent frames as the time interval for the viewfinder to display the two adjacent frames. Alternatively, the electronic device may determine the time interval between the end display times of two adjacent frames as the time interval for the viewfinder to display the two adjacent frames; this disclosure does not limit the scope of the embodiments.

[0051] In some embodiments, the size of the viewfinder window may be smaller than or equal to the size of the application interface of the first application, and this disclosure does not limit this.

[0052] In some embodiments, the first application may be a system camera application, a third-party camera application, an instant messaging application, a social application, a live streaming application, etc., and this disclosure does not limit this.

[0053] For example, third-party camera applications include, but are not limited to: camera applications with beautification functions. Instant messaging applications can be any application with video communication capabilities, such as WeChat. Live streaming applications can be any application with live streaming capabilities.

[0054] In some embodiments, when the first application is a system camera application or a third-party camera application, the size of the viewfinder can be equal to the size of the application interface of the first application. Based on this, when the first application is a system camera application or a third-party camera application, the image captured by the camera can be displayed through the entire application interface.

[0055] In some embodiments, when the first application is a video communication application or a live streaming application, the size of the viewfinder window can be smaller than the size of the application interface of the first application. Based on this, the electronic device can display images captured by the camera through the viewfinder window and display other content in the area of ​​the application interface other than the viewfinder window. For example, in a video communication scenario, images sent by the other device can be displayed in the area of ​​the application interface other than the viewfinder window.

[0056] In some embodiments, the electronic device can obtain the time interval between two adjacent frames of images displayed in the viewflinger process.

[0057] In some embodiments, the two adjacent frames displayed in the viewfinder can be two adjacent frames captured by the camera, or two non-adjacent frames captured by the camera. This disclosure does not limit the scope of the embodiments.

[0058] In some embodiments of this disclosure, the camera can be understood as: a camera function implemented in an electronic device by hardware such as a camera module, a lens (camera), and camera services in the operating system.

[0059] In step 202, when the time interval is greater than the duration threshold, the camera's frame rate is increased to shorten the time interval.

[0060] Understandably, after obtaining the time interval between two adjacent frames displayed in the viewfinder through step 201, the electronic device can compare the obtained time interval with a duration threshold. If the time interval between two adjacent frames displayed in the viewfinder is greater than the duration threshold, the electronic device can determine that there is display stuttering in the image on the viewfinder. At this time, the electronic device can increase the frame rate of the camera output image to shorten the time interval between two adjacent frames displayed in the viewfinder, thereby alleviating the display stuttering phenomenon in the viewfinder.

[0061] In some embodiments, the duration threshold can be determined based on the screen refresh rate. For example, the duration threshold can be the sum of a preset number of screen frame intervals, where the screen frame interval is the reciprocal of the screen refresh rate. For example, when the screen refresh rate is 120Hz, the screen frame interval is (1 / 120) seconds, and when the screen refresh rate is 60Hz, the screen frame interval is (1 / 60) seconds.

[0062] In some embodiments, when the update frame rate of the first application's interface is normal, the electronic device will draw a new application interface based on the latest image captured by the camera at each screen frame interval to update the application interface displayed on the screen. If the camera has not captured a new image while updating the application interface, the electronic device will generate a new application interface based on the previously captured image. In this case, although the application interface of the first application displayed on the screen has been updated, the image in the viewfinder window remains the same and has not been updated, causing display stuttering in the viewfinder window. This stuttering is due to a decrease in the frame rate of the camera's image capture. Therefore, when the electronic device determines that the time interval between two adjacent frames displayed in the viewfinder area is greater than a preset number of screen frame intervals, it indicates that the electronic device is using the same frame image captured by the camera in multiple updates of the application interface. In this case, the electronic device can increase the camera's frame rate to alleviate the display stuttering in the viewfinder window.

[0063] It should be noted that the above is only an example of how to determine the duration threshold. The size of the duration threshold can also be determined as needed, and this disclosure does not limit it.

[0064] In some embodiments, the preset quantity can be any value greater than 2, for example, the preset quantity can be 5 or the preset quantity can be 8.

[0065] It should be noted that the above are just examples of several preset quantities, and the specific values ​​of the preset quantities can be determined as needed. This disclosure does not limit this.

[0066] In some embodiments, the electronic device can determine the camera's current shooting mode and, based on a first mapping relationship, determine a first frame rate corresponding to the camera's current operating module. Then, the electronic device can determine whether the camera's current frame rate is less than the first frame rate. When the electronic device determines that the camera's frame rate is less than the first frame rate, it can increase the camera's frame rate to a value greater than or equal to the first frame rate.

[0067] In this disclosed embodiment, a decrease in the frame rate of the camera output image or a decrease in the update frame rate of the application interface will lead to an extension of the time interval between two adjacent frames of images captured by the camera displayed in the viewfinder window of the application interface, resulting in image display stuttering. Therefore, by determining the time interval between two adjacent frames displayed in the viewfinder window, it is possible to more accurately determine whether the image captured by the camera is experiencing display stuttering, thereby alleviating the image display stuttering phenomenon more promptly.

[0068] In some embodiments, step 201 includes: determining a first layer for drawing images captured by the camera from the various layers associated with the display compositing module; and determining a time interval for displaying two adjacent frames in the viewfinder window based on the time interval for drawing two adjacent frames on the first layer.

[0069] Understandably, the application interface displayed on an electronic device is composed of layers, and the content in the layers used to form an application interface can come from the same application or service, or from different applications and / or services. For example, in a video call scenario, the video call interface includes at least a first layer for drawing images captured by the camera, a second layer for drawing images received from other electronic devices during the video call, and a third layer for drawing controls and icons in the video call interface. Furthermore, the process of obtaining images from different applications and / or services, and drawing these images in their corresponding layers to form the application interface, is performed by the display composition module. Therefore, the display composition module can be associated with layers from multiple applications and / or services. Based on the above analysis, it is clear that before displaying the application interface of a first application, the electronic device needs to first draw the various layers that form the application interface of the first application. The layers forming the application interface of the first application include at least the first layer. Based on this, when the electronic device displays the image captured by the camera through the viewfinder window in the application interface of the first application, it can determine the first layer of the image captured by the camera drawn by the user from the various layers associated with the display compositing module, and determine the time interval between the display window displaying the image of two adjacent frames based on the time interval between the display compositing module drawing the image of two adjacent frames on the first layer.

[0070] In some embodiments, the electronic device may determine the time interval between drawing two adjacent frames of images on the first layer as the time interval between displaying the two adjacent frames of images in the viewfinder.

[0071] In some embodiments, the display synthesis module may be the SurfaceFlinger process in an electronic device.

[0072] In some embodiments, since the execution entity for drawing each layer is the surfaceflinger process, the electronic device can determine the time interval between two adjacent frames of images drawn by the surfaceflinger process on the first layer as the time interval between two adjacent frames of images displayed in the viewfinder.

[0073] In some embodiments, the electronic device may determine the time interval between the start times of the SurfaceFlinger process drawing two adjacent frames on the first layer as the time interval for the viewfinder to display two adjacent frames. The electronic device may also determine the time interval between the midpoint times of the SurfaceFlinger process drawing two adjacent frames on the first layer as the time interval for the viewfinder to display two adjacent frames. Furthermore, the electronic device may determine the time interval between the end times of the SurfaceFlinger process drawing two adjacent frames on the first layer as the time interval for the viewfinder to display two adjacent frames.

[0074] In some embodiments, the application interface of the first application is composed of multiple layers. Therefore, the first layer can be understood as the layer that forms the viewfinder in the application interface.

[0075] In this embodiment of the disclosure, since the time when the image captured by the camera can be displayed in the viewfinder is determined by when the surfaceflinger process draws the image on the first layer, determining the time interval for displaying two adjacent frames in the viewfinder based on the time interval between drawing two adjacent frames on the first layer can make the determined time interval more accurate.

[0076] In some embodiments, determining a first layer for drawing an image acquired by a camera from the layers associated with the display compositing module includes: determining the first layer from the layers associated with the display compositing module based on layer information of the first layer.

[0077] Understandably, since the display composition module is associated with multiple application and / or service layers, and the layer information of different application and / or service layers is different, the electronic device can determine the first layer from the multiple layers associated with the display composition module based on the layer information of the first layer.

[0078] In some embodiments, the layer information of each layer associated with the compositing module includes, but is not limited to: layer size, layer identifier, and / or the frame rate range of the layer.

[0079] For example, the size of the first layer can be a preset size. For instance, the size of the first layer can be 1440×1080.

[0080] For example, the layer identifier of the first layer can be a preset field in the layer, such as the "camera" field in the layer name.

[0081] For example, the frame rate range of the first layer can be any range less than the camera's frame rate. For instance, when the camera's frame rate is 60fps, the frame rate range of the first layer can be from 10fps to 60fps.

[0082] In some embodiments, step 202 includes at least one of the following: increasing the hardware resources configured for the camera when the time interval is greater than a duration threshold, wherein the hardware resources include computing resources and / or storage resources; and / or reducing the quality of the image output by the camera when the time interval is greater than a duration threshold.

[0083] Understandably, when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold, electronic devices can increase the computing and storage resources allocated to the camera to improve the processing speed of a single frame, thereby increasing the frame rate of the camera's output images. Since reducing image quality decreases the computational and storage resource consumption during image processing, electronic devices can also reduce the quality of the camera's output images when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold, thus increasing the frame rate of the camera's output images.

[0084] In some embodiments, when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold, the electronic device may first increase the storage and / or computing resources configured for the camera. Subsequently, the electronic device may continue to acquire the time interval between two adjacent frames displayed in the viewfinder, and if the latest acquired time interval still exceeds the duration threshold, the quality of the image output by the camera is reduced. If, after the electronic device increases the storage and / or computing resources configured for the camera, the frame rate of the camera output image has recovered to a preset frame rate, the quality of the camera output image remains unchanged.

[0085] In this embodiment of the present disclosure, when the time interval between two adjacent frames of images displayed in the viewfinder is greater than a duration threshold, the electronic device first increases the storage resources and / or computing resources configured for the camera. After increasing the storage resources and computing resources configured for the camera, if the time interval between two adjacent frames of images displayed in the viewfinder is still greater than the duration threshold, the quality of the image output by the camera is reduced. Compared with directly reducing the quality of the image output by the camera, this can reduce the probability that the image quality of the image displayed in the viewfinder is frequently reduced.

[0086] In some embodiments, when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold, the electronic device may first reduce the quality of the image output by the camera, and then, after reducing the quality of the image output by the camera, re-acquire the time interval between the two adjacent frames displayed in the viewfinder. If the latest acquired time interval is still greater than the duration threshold, the electronic device may increase the storage and / or computing resources configured for the camera.

[0087] In some embodiments, when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, the electronic device may add computing resources configured for the camera, including at least one of the following: the electronic device may add central processing unit (CPU) resources configured for the camera; the electronic device may add graphics processing unit (GPU) resources configured for the camera; the electronic device may add image signal processor (ISP) resources configured for the camera.

[0088] For example, when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, the storage resources added by the electronic device for the camera may include, but are not limited to: the electronic device may add storage space for the camera, for example, the electronic device may add storage space provided by Double Data Rate (DDR) for the camera.

[0089] In some embodiments, reference Figure 3 , Figure 3 This is a schematic flowchart illustrating a camera control method according to another exemplary embodiment. Hereinafter, reference will be made to... Figure 3 The steps shown in the figure further illustrate the camera control method provided in the embodiments of this disclosure.

[0090] In step 301, the electronic device acquires the frame rate (time interval) of the image displayed in the viewfinder.

[0091] In step 302, the electronic device determines whether there is continuous frame dropping or stuttering during the display of the image in the viewfinder window based on the obtained frame rate. If yes, step 303 is executed; otherwise, the process returns to step 301.

[0092] In step 303, the electronic device acquires parameters of at least one of the chips such as CPU, GPU, and DDR.

[0093] In step 304, the electronic device adjusts the parameters in the CPU, GPU, and DDR that are identified as abnormal, so that the parameters of the CPU, GPU, and DDR are restored to normal.

[0094] In step 305, the electronic device determines whether the image displayed in the viewfinder has returned to smoothness. If yes, it proceeds to step 306; otherwise, it returns to step 301.

[0095] In step 306, the parameters of the CPU, GPU, and DDR are adjusted to their initial values.

[0096] refer to Figure 4 and Figure 5 , Figure 4 This is a schematic diagram illustrating the frame rate of a camera output image according to an exemplary embodiment; Figure 5 This is a schematic diagram illustrating the frame rate of a camera output image according to another exemplary embodiment. For example... Figure 4 and Figure 5 As shown, from Figure 4 and Figure 5 The ImageReader in the diagram illustrates the display frame rate of the image shown in the viewfinder window. Figure 4 and Figure 5 In this context, Cpu7 Min FreqLimit is the minimum operating frequency of CPU7. Figure 4 and Figure 5 The `Cpu7FreqLimit` in the figure represents the CPU's maximum operating frequency. Based on this, as shown in Figure 4, when the camera's preset frame rate is 30fps, if the CPU ( Figure 4 The clock frequency of CPU7 in the image output was low, resulting in frame drops (5 frames dropped) during the camera's image output in time period T1, and continued frame drops (8 frames dropped) in time period T2. This demonstrates that if the camera's hardware resources are not adjusted during image output, multiple frame drops will occur.

[0097] refer to Figure 5 When the electronic device determines that the camera has dropped 4 frames at time T3, it will increase the CPU resources allocated to the camera to 2.9GHz and continue to monitor the camera's frame rate. It can then be found that the camera has recovered to the normal output frequency (30pfs) in the subsequent image output process and no more frame drops have occurred.

[0098] In some embodiments, the electronic device reduces the size of the image output by the camera when it determines that the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold.

[0099] In some embodiments, when the time interval is greater than a duration threshold, the quality of the image output by the camera is reduced, including at least one of the following: when the time interval is greater than the duration threshold, simplifying the image processing algorithm of the camera; when the time interval is greater than the duration threshold, adjusting the number of cameras acquiring the image from a first number to a second number, wherein the second number is less than the first number; when the time interval is greater than the duration threshold, reducing the resolution of the image output by the camera.

[0100] Understandably, the more and / or more complex the processing algorithms used to process a single frame of an image, the longer the processing time and the more hardware resources are required. Therefore, when the time interval between two adjacent frames displayed in the viewfinder exceeds a certain threshold, electronic devices can simplify the camera's processing algorithm for a single frame to shorten the processing time and thus increase the frame rate of the output image. Furthermore, the less data a single frame contains, the shorter the processing time for the electronic device. Therefore, when the time interval between two adjacent frames displayed in the viewfinder exceeds a certain threshold, the electronic device can reduce the number of cameras used to capture images from a first number to a second number to reduce the amount of data in each frame output by the camera, thereby increasing the frame rate. The electronic device can also reduce the amount of data in a single frame by lowering the resolution of the images captured by the cameras, thus reducing the amount of data processed by the camera and similarly increasing the frame rate of the output image.

[0101] In some embodiments, the electronic device may first execute one of the following three steps: simplifying the image processing algorithm of the camera, adjusting the number of cameras acquiring images from a first number to a second number, and reducing the resolution of the images acquired by the cameras. Then, the electronic device may continue to acquire the time interval between two adjacent frames displayed in the viewfinder, and if the latest acquired time interval is greater than a duration threshold, execute any one of the two steps that were not executed in the above three steps. If the latest acquired time interval is less than or equal to the duration threshold, the remaining steps are not executed.

[0102] In some embodiments, when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, the electronic device may adjust the first processing algorithm used to process each frame of image to a second processing algorithm, wherein the computational complexity of the second processing algorithm is less than that of the first processing algorithm.

[0103] In some embodiments, when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold, the electronic device can determine the camera's current shooting mode and identify a second processing algorithm corresponding to the current shooting mode. The electronic device can then adjust the first processing algorithm currently used by the camera to the second processing algorithm corresponding to the current shooting mode.

[0104] In some embodiments, when the camera's shooting mode includes High Dynamic Range (HDR) mode and Beauty Mode, the electronic device may store a first processing algorithm and a second processing algorithm corresponding to HDR mode, as well as a first processing algorithm and a second processing algorithm corresponding to Beauty Mode. The first processing algorithm corresponding to HDR mode includes an HDR algorithm, while the second processing algorithm does not; the first processing algorithm corresponding to Beauty Mode includes a Beauty algorithm, while the second processing algorithm does not. Based on this, when the time interval between two adjacent frames displayed in the first area viewfinder window is greater than a duration threshold, and the camera's current shooting mode is HDR mode, the electronic device may adjust the processing algorithm currently used by the camera for image processing (the first processing algorithm corresponding to HDR mode) to the second processing algorithm corresponding to HDR mode. Similarly, when the time interval between two adjacent frames displayed in the viewfinder window is greater than a duration threshold, and the camera's current shooting mode is Beauty Mode, the electronic device may adjust the processing algorithm currently used by the camera for image processing (the first processing algorithm corresponding to Beauty Mode) to the second processing algorithm corresponding to Beauty Mode.

[0105] In some embodiments, the camera's shooting mode also includes a portrait mode. Based on this, the electronic device can also reduce the number of cameras used to capture images from two to one when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, and the camera's current shooting mode is portrait mode. That is, the dual-camera mode for image capture is changed to a single-camera mode.

[0106] In some embodiments, when the electronic device determines that the time interval between two adjacent frames of images displayed in the viewfinder is greater than a duration threshold, it may also reduce the resolution of the images captured by at least one camera that is in operation.

[0107] In some embodiments, when the time interval is greater than a duration threshold, the hardware resources configured for the camera are increased, including: when the time interval is greater than or equal to the duration threshold, determining the current shooting mode of the camera; determining the target hardware resources corresponding to the current shooting mode; and adjusting the hardware resources currently configured for the camera to the target hardware resources.

[0108] Understandably, considering that cameras have different storage and / or computing resource requirements in different shooting modes, the electronic device can determine the camera's current shooting mode and the hardware resources (target hardware resources) required by the camera in the current shooting mode when the time interval between two adjacent frames displayed in the viewfinder exceeds a duration threshold. The electronic device can then adjust the hardware resources currently configured for the camera to match the target hardware resources.

[0109] In some embodiments, the electronic device may store a preset mapping relationship, which can be a mapping relationship between a camera's shooting mode and its corresponding configuration parameters. The configuration parameters are used to configure the corresponding hardware resources for the camera, enabling the camera to output images at a preset frame rate. Based on this, when the electronic device determines that the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, it can determine the camera's current shooting mode, identify the target configuration parameters corresponding to the current shooting mode from the preset mapping relationship, and adjust the parameters of the hardware related to running the camera to the target configuration parameters, thereby adjusting the hardware resources configured for the camera to the target hardware resources.

[0110] In some embodiments, the hardware parameters stored in the preset mapping relationship include, but are not limited to: CPU parameters, GPU parameters, DDR parameters, ISP parameters, etc.

[0111] In some embodiments, reference Figure 6 , Figure 6 This is a schematic diagram illustrating a preset mapping relationship according to an exemplary embodiment. For example... Figure 6 As shown, the preset mapping relationships stored in the electronic device can include configuration parameters corresponding to the normal preview mode. Figure 6 Configuration 1) Configuration parameters corresponding to normal shooting mode ( Figure 6 Configuration 2) Configuration parameters corresponding to portrait mode ( Figure 6 The configuration N in the document. Based on this, the electronic device can perform the following steps:

[0112] In step 601, when the electronic device determines that the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, it can determine the current shooting mode of the camera.

[0113] In step 602, the electronic device acquires the target configuration parameters corresponding to the current shooting mode.

[0114] In step 603, the electronic device adjusts the parameters of the hardware related to camera operation to the target configuration parameters.

[0115] For example, refer to Figure 6When the electronic device determines that the camera's current shooting mode is normal preview mode, it can obtain configuration 1 corresponding to normal preview mode and adjust the parameters of the hardware related to operating the camera to the parameters indicated by configuration 1. When the electronic device determines that the camera's current shooting mode is normal photo mode, it can obtain configuration 2 corresponding to normal photo mode and adjust the parameters of the hardware related to operating the camera to the parameters indicated by configuration 2. When the electronic device determines that the camera's current shooting mode is portrait mode, it can obtain configuration N corresponding to portrait mode and adjust the parameters of the hardware related to operating the camera to the parameters indicated by configuration N.

[0116] In some embodiments, when the time interval between two adjacent frames of images displayed in the viewfinder is greater than a duration threshold, the electronic device can obtain the hardware resources currently configured for the camera. If the hardware resources currently configured for the camera are lower than the target hardware resources corresponding to the current shooting mode of the camera, the hardware resources currently configured for the camera will be adjusted to the target hardware resources.

[0117] For example, when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, the electronic device can obtain the current operating frequency of the CPU. If the current operating frequency of the CPU is lower than the target frequency corresponding to the current shooting mode of the camera, the operating frequency of the CPU can be increased to the target frequency.

[0118] In some embodiments, the electronic device may further improve the hardware resources configured for the camera when the time interval between two adjacent frames displayed in the viewfinder is greater than a duration threshold, and the hardware resources currently configured for the camera are the target hardware resources corresponding to the current shooting mode. Afterwards, the electronic device may again obtain a time interval between two adjacent frames displayed in the viewfinder that is greater than a certain duration. If the electronic device determines that the latest obtained time interval is less than or equal to a preset duration, it may readjust the hardware resources configured for the camera to the target hardware resources.

[0119] In some embodiments, the method further includes: after increasing the camera's frame rate, re-acquiring the time interval between adjacent images displayed in the viewfinder; and terminating the camera's process when the latest acquired time interval is greater than a duration threshold.

[0120] Understandably, after increasing the output frequency of the camera's images, the electronic device can again acquire the time interval between two adjacent frames displayed in the viewfinder and compare the latest acquired time interval with a duration threshold. If the latest acquired time interval is greater than the duration threshold, the electronic device can terminate the camera's process.

[0121] In some embodiments, the electronic device can, after increasing camera hardware resources and reducing the quality of the camera output images, re-acquire the time interval between two adjacent frames displayed in the viewfinder and compare the latest acquired time interval with a duration threshold. If the latest acquired time interval is greater than the duration threshold, the electronic device can terminate the camera process.

[0122] In some embodiments, the electronic device maintains the camera's current output frequency when the latest acquisition time interval is less than or equal to a duration threshold.

[0123] In some embodiments, ending the camera process can be understood as stopping the camera from running in the foreground or background.

[0124] In this embodiment of the disclosure, after increasing the camera's hardware resources and reducing the quality of the images output by the camera, if the time interval between two adjacent frames displayed in the viewfinder is still greater than the duration threshold, it indicates that increasing the output frequency of the camera's output images cannot alleviate the image stuttering problem in the viewfinder. At this time, the electronic device can terminate the camera's process to reduce the probability of long-term stuttering in the viewfinder.

[0125] The following text will refer to Figure 7 The camera control method provided in the above embodiments will be further described with a specific example. Figure 7 This is a flowchart illustrating a camera control method according to yet another exemplary embodiment.

[0126] In step 701, the electronic device obtains the rendering frame rate of the first layer based on the surfaceflinger process.

[0127] In step 702, the electronic device determines whether there is any lag in the display of the image in the viewfinder based on the drawing frame rate of the first layer. If yes, it proceeds to step 703; otherwise, it returns to step 701.

[0128] In step 703, the electronic device adjusts the configuration parameters of the CPU, GPU, DDR, etc., and reduces the quality of the image output by the camera.

[0129] In step 704, the electronic device determines whether the viewfinder window is displaying stuttering based on the latest drawing frame rate of the first layer. If yes, it proceeds to step 705; otherwise, it returns to step 701.

[0130] In step 705, the electronic device executes an exception handling procedure.

[0131] In step 706, the camera process is terminated.

[0132] In some embodiments, the steps related to step 201 performed by the aforementioned electronic device, as well as the steps related to determining the first layer from the various layers associated with the display compositing module surfaceflinger, can be performed by surfaceflinger. The steps related to step 202 performed by the aforementioned electronic device can be performed by the camera process.

[0133] In some embodiments, reference Figure 8 and Figure 9 , Figure 8 This is a schematic diagram illustrating the interaction between the surfaceflinger process and the camera process according to an exemplary embodiment. Figure 9 This is a schematic diagram illustrating the interaction between the surfaceflinger process and the camera process according to another exemplary embodiment. Figure 8 and Figure 9 As shown, the SurfaceFlinger process 102 registers the Binder service through the serverManager 104; the camera process 101 obtains the Binder service registered by the SurfaceFlinger process 102 through the Binder driver 103. Based on this, after processing a frame of image, the camera process 101 can transmit the obtained image to the SurfaceFlinger process 102 so that the SurfaceFlinger process 102 can draw the application interface including the image. Then, the SurfaceFlinger process 102 transmits the application interface to the display process 105 for display. Additionally, the SurfaceFlinger process 102 can also obtain the display frame rate of the image displayed by the camera (the drawing frame rate of the first layer). Then, the SurfaceFlinger process 102 can transmit the obtained drawing frame rate to the camera process based on the Binder driver 103. Correspondingly, the camera process can obtain the drawing frame rate transmitted by the SurfaceFlinger process 102 and determine whether the time interval between displaying two adjacent frames in the viewfinder window is greater than a duration threshold based on the obtained drawing frame rate. If the camera process determines that the time interval between two adjacent frames displayed in the viewfinder is greater than the duration threshold, it determines that the image displayed in the viewfinder has stuttered. At this time, the camera can increase the frame rate of its output image.

[0134] In some embodiments, the camera can increase the frame rate of its output image by means of the above-mentioned electronic device controlling the camera to increase the frame rate, which will not be described again in the embodiments of this application.

[0135] For example, reducing the quality of the camera's output image includes: reducing system load. This mainly refers to proactively reducing the system load by lowering image quality and / or reducing the camera's image processing algorithms when stuttering is detected at the camera's upper layer (viewfinder), thereby optimizing the smoothness of the camera's output image. For example, if the camera originally uses HDR and / or beauty algorithms by default, these algorithms will not be used when image stuttering occurs in the viewfinder. In portrait mode, if no image stuttering is detected in the viewfinder, the camera uses dual cameras to capture an image set; if image stuttering occurs in the viewfinder, it uses a single camera to capture an image.

[0136] In some embodiments, the electronic device adjusts the configuration parameters of the hardware related to running the camera process, including updating the parameters of the chip related to running the camera process. For example, when image stuttering occurs in the viewfinder, the default parameters set when the camera process was created are updated based on real-time system feedback. For instance, if stuttering occurs at frame 100 due to CPU resource constraints, and the CPU7 clock speed is low at this time, the CPU7 clock speed can be increased to its maximum. After the camera's frame rate returns to normal, the CPU7 configuration is restored to its original default value. Similarly, if the electronic device determines that the GPU and / or DDR modules in the chip are causing stuttering when the camera outputs images, the parameters of the GPU and / or DDR can be adjusted.

[0137] refer to Figure 10 , Figure 10 This is a schematic diagram illustrating an application scenario of a camera control method according to an exemplary embodiment. For example... Figure 10 As shown, after adopting the camera control method provided in the embodiments of this disclosure, the fluctuation of the frame rate of the camera output image can be reduced (fluctuating around 15fps), thus demonstrating that the camera control method provided in the embodiments of this disclosure can reduce the probability of stuttering during the camera display process.

[0138] refer to Figure 11 , Figure 11 This is a block diagram illustrating a camera control device according to an exemplary embodiment. Figure 11 As shown, the camera control device 1100 includes: a first acquisition module 1101, configured to acquire the time interval between two adjacent frames of images displayed in the viewfinder window when the application interface of the first application is displayed and the application interface has a viewfinder window, wherein the two adjacent frames of images are obtained by the camera called by the first application to acquire images of the viewfinder area; and an enhancement module 1102, configured to increase the frame rate of the camera to shorten the time interval when the time interval is greater than a duration threshold; wherein the frame rate of the camera is used to indicate the number of images acquired and processed by the camera per unit time.

[0139] In some embodiments, the first acquisition module 1101 is configured to: determine a first layer for drawing images acquired by the camera from the various layers associated with the display composition module, the first layer being used to form a viewfinder window; and determine the time interval for displaying two adjacent frames of images in the viewfinder window based on the time interval for drawing two adjacent frames of images on the first layer.

[0140] In some embodiments, the first acquisition module 1101 is configured to: determine the first layer from the layers associated with the display composition module based on the layer information of the first layer.

[0141] In some embodiments, the enhancement module 1102 is configured to: increase the hardware resources configured for the camera when the time interval is greater than the duration threshold, the hardware resources including computing resources and / or storage resources; and / or, reduce the quality of the image output by the camera when the time interval is greater than the duration threshold.

[0142] In some embodiments, the enhancement module 1102 is configured to at least one of the following: simplify the image processing algorithm of the camera when the time interval is greater than the duration threshold; adjust the number of cameras acquiring images from a first number to a second number when the time interval is greater than the duration threshold, wherein the second number is less than the first number; and reduce the resolution of the image output by the camera when the time interval is greater than the duration threshold.

[0143] In some embodiments, the enhancement module 1102 is configured to: determine the camera's shooting mode when the time interval is greater than a duration threshold; determine the target hardware resources corresponding to the shooting mode; and adjust the hardware resources configured for the camera to the target hardware resources.

[0144] In some embodiments, the device further includes: a second acquisition module configured to acquire the time interval between two adjacent frames displayed in the viewfinder after increasing the frame rate of the camera; and an termination module configured to terminate the camera process when the latest acquired time interval is greater than a duration threshold.

[0145] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0146] Figure 12 This is a structural block diagram illustrating an electronic device 1200 according to an exemplary embodiment. For example, the electronic device 1200 may be a mobile phone, tablet computer, smartwatch, vehicle-mounted device, or other communication device.

[0147] Reference Figure 12The electronic device 1200 may include one or more of the following components: processing component 1202, memory 1204, power supply component 1206, multimedia component 1208, audio component 1210, input / output (I / O) interface 1212, sensor component 1214, and communication component 1216.

[0148] Processing component 1202 typically controls the overall operation of electronic device 1200, such as operations associated with at least one of display, telephone call, data communication, camera operation, and recording operation. Processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the methods described above. Furthermore, processing component 1202 may include one or more modules to facilitate interaction between processing component 1202 and other components. For example, processing component 1202 may include a multimedia module to facilitate interaction between multimedia component 1208 and processing component 1202.

[0149] Memory 1204 is configured to store various types of data to support operation on electronic device 1200. Examples of such data include at least one of the following: instructions for any application or method operating on electronic device 1200, contact data, phonebook data, messages, pictures, and videos. Memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0150] Power supply component 1206 provides power to various components of electronic device 1200. Power supply component 1206 may include at least one of the following: a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1200.

[0151] Multimedia component 1208 includes a screen that provides an output interface between electronic device 1200 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a Touch Panel, the screen may be implemented as a touchscreen to receive input signals from the user. The Touch Panel includes one or more touch sensors to sense touches, swipes, and gestures on the Touch Panel. The touch sensors may sense not only the boundaries of touch or swipe actions but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 1208 includes a front-facing camera and / or a rear-facing camera. When electronic device 1200 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.

[0152] Audio component 1210 is configured to output and / or input audio signals. For example, audio component 1210 includes a microphone (MIC) configured to receive external audio signals when electronic device 1200 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 1204 or transmitted via communication component 1216. In some embodiments, audio component 1210 also includes a speaker for outputting audio signals.

[0153] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, and buttons. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.

[0154] Sensor assembly 1214 includes one or more sensors for providing state assessments of various aspects of electronic device 1200. For example, sensor assembly 1214 may detect the on / off state of electronic device 1200, the relative positioning of components such as the display and keypad of electronic device 1200, changes in position of electronic device 1200 or one of its components, the presence or absence of user contact with electronic device 1200, orientation or acceleration / deceleration of electronic device 1200, and temperature changes of electronic device 1200. Sensor assembly 1214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 1214 may also include an optical sensor, such as a complementary metal-oxide-semiconductor (CMOS) or charge-coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, sensor assembly 1214 may also include, but is not limited to, at least one of the following: an accelerometer, a gyroscope, a magnetometer, a pressure sensor, and a temperature sensor.

[0155] Communication component 1216 is configured to facilitate wired or wireless communication between electronic device 1200 and other devices. Electronic device 1200 can access wireless networks based on communication standards, such as Wi-Fi, 4G, 5G, or combinations thereof. In one exemplary embodiment, communication component 1216 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 1216 also includes a Near Field Communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wide Band (UWB), Bluetooth (BT), and other technologies.

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

[0157] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including executable instructions or a computer program, which can be executed by a processor 1220 of an electronic device 1200 to perform the above-described method. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.

[0158] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform any of the camera control methods described in the embodiments of this disclosure. For example, the method includes:

[0159] When the application interface of the first application is displayed, and the application interface has a viewfinder window, the time interval between two adjacent frames of images displayed in the viewfinder window is obtained. The two adjacent frames of images are obtained by the camera called by the first application to capture images of the viewfinder range. When the time interval is greater than the duration threshold, the frame rate of the camera is increased to shorten the time interval. The frame rate of the camera is used to indicate the number of images captured and processed by the camera per unit time.

[0160] This disclosure provides a computer program product comprising a computer program or executable instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer program or executable instructions from the computer-readable storage medium and executes the computer program or executable instructions, causing the computer device to perform any of the camera control methods described in this disclosure.

[0161] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.

[0162] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A method for controlling a camera, characterized in that, The method includes: When the application interface of the first application is displayed, and the application interface has a viewfinder window, the time interval between two adjacent frames of images displayed in the viewfinder window is obtained. The two adjacent frames of images are obtained by the camera called by the first application to capture images of the viewfinder area. When the time interval is greater than the duration threshold, the frame rate of the camera is increased; The frame rate of the camera is used to indicate the number of images that the camera acquires and processes per unit time.

2. The method according to claim 1, characterized in that, The step of obtaining the time interval between two adjacent frames displayed in the viewfinder includes: From the layers associated with the display compositing module, a first layer is determined for drawing the image captured by the camera, and the first layer is used to form the viewfinder window; The time interval for displaying the two adjacent frames in the viewfinder is determined based on the time interval between drawing the two adjacent frames on the first layer.

3. The method according to claim 2, characterized in that, Determining the first layer for drawing the image acquired by the camera from the layers associated with the display compositing module includes: Based on the layer information of the first layer, the first layer is determined from the various layers associated with the display composition module.

4. The method according to claim 1, characterized in that, The step of increasing the frame rate of the camera when the time interval is greater than a duration threshold includes: When the time interval is greater than the duration threshold, the hardware resources configured for the camera are increased, including computing resources and / or storage resources; And / or, When the time interval exceeds a duration threshold, the quality of the image output by the camera is reduced.

5. The method according to claim 4, characterized in that, When the time interval is greater than a duration threshold, reducing the quality of the image output by the camera includes at least one of the following: When the time interval is greater than the duration threshold, the image processing algorithm of the camera is simplified. When the time interval is greater than the duration threshold, the number of cameras capturing the images is adjusted from a first number to a second number, wherein the second number is less than the first number; When the time interval is greater than the duration threshold, the resolution of the image output by the camera is reduced.

6. The method according to claim 4, characterized in that, The step of increasing the hardware resources configured for the camera when the time interval is greater than the duration threshold includes: When the time interval is greater than a duration threshold, the shooting mode of the camera is determined; Determine the target hardware resources corresponding to the shooting mode; Adjust the hardware resources configured for the camera to the target hardware resources.

7. The method according to claim 1, characterized in that, The method further includes: After increasing the frame rate of the camera, the time interval between two adjacent frames displayed in the viewfinder is obtained again. The camera process terminates when the latest acquisition time interval exceeds the duration threshold.

8. A camera control device, characterized in that, The device includes: The first acquisition module is configured to acquire the time interval between two adjacent frames of images displayed in the viewfinder window when the application interface of the first application is displayed and the application interface has a viewfinder window, wherein the two adjacent frames of images are obtained by the camera called by the first application to acquire images of the viewfinder area. The enhancement module is configured to increase the frame rate of the camera when the time interval is greater than a duration threshold, so as to shorten the time interval; The frame rate of the camera is used to indicate the number of images that the camera acquires and processes per unit time.

9. An electronic device, characterized in that, include: processor; Memory used to store computer programs or instructions; The processor executes the computer program or instructions to implement the steps of the method according to any one of claims 1 to 7.

10. A non-transitory computer-readable storage medium storing a computer program or instructions, characterized in that, When the computer program or instructions in the storage medium are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.