Camera control method and device and storage medium

By monitoring the status of the folded screen and camera, and accurately controlling the camera turn-on, the problem of data transmission conflicts between multiple cameras in the prior art is solved, and the adaptive switching and visual experience improvement of the folded screen terminal are achieved.

CN119182841APending Publication Date: 2024-12-24BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310746062.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

The camera application of existing folding screen terminals fails to effectively respond to changes in folding or expanding states, resulting in conflicts in data transmission of multiple cameras and affecting the user experience.

Method used

By monitoring the status of the folded screen and the status of the camera, accurately control the opening and closing of the target camera, ensure that the camera matches the status of the folded screen, realize adaptive switching, and blurring during the switching process to optimize the visual experience.

Benefits of technology

The data transmission conflict problem of multiple cameras has been solved, which improves the user's visual experience and user experience, and ensures that the camera always matches the folded screen status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182841A_ABST
    Figure CN119182841A_ABST
Patent Text Reader

Abstract

The invention relates to a camera control method and device and a storage medium. The camera control method comprises the steps that in response to the fact that a camera application in a terminal with a folding screen is triggered to be opened, the state of the folding screen and the state of cameras are determined, the terminal comprises a plurality of cameras, the state of the folding screen comprises an unfolding state or a folding state, and the state of the cameras comprises an opening state or a closing state; based on the state of the folding screen and the state of the camera, a target camera is controlled to be started, the target camera is the camera, corresponding to the state of the folding screen, in the multiple cameras, and different states of the folding screen correspond to different cameras in the multiple cameras. Through the method provided by the invention, the camera matched with the state of the folding screen can be controlled to be opened, so that the adaptive switching of the camera is realized, and the visual experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of terminal technology, and in particular to a camera control method, device and storage medium. Background Art

[0002] With the development of a new round of science and technology, terminals with foldable screens are constantly entering people's lives.

[0003] Currently, terminals with foldable screens generally have multiple cameras, which can be triggered to open by starting a camera application. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present disclosure provides a camera control method, device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a camera control method is provided, comprising: in response to a camera application in a terminal with a folding screen being triggered to open, determining the state of the folding screen and the state of the camera, the terminal comprising a plurality of the cameras, the state of the folding screen comprising an unfolded state or a folded state, and the state of the camera comprising an on state or a closed state; based on the state of the folding screen and the state of the camera, controlling a target camera to open, the target camera being a camera among the plurality of cameras corresponding to the state of the folding screen, wherein different states of the folding screen correspond to different cameras among the plurality of cameras.

[0006] In one embodiment, controlling the target camera to turn on based on the state of the folding screen and the state of the camera includes: if the state of the camera is off, determining the current state of the folding screen, and controlling the camera corresponding to the current state of the folding screen to turn on.

[0007] In one embodiment, controlling the target camera to turn on based on the state of the folding screen and the state of the camera includes: if the state of the camera is on, determining the state change of the folding screen; determining the target camera according to the state change of the folding screen, and controlling the target camera to turn on.

[0008] In one embodiment, determining a target camera based on a state change of the folding screen and controlling the target camera to turn on includes: if the state of the folding screen has not changed, determining a camera that is currently in an on state as the target camera, and keeping the on state of the camera that is currently in an on state.

[0009] In one embodiment, the target camera is determined according to the state change of the folding screen, and the target camera is controlled to be turned on, including: if the state of the folding screen changes, the camera corresponding to the state after the folding screen changes is used as the target camera; the configuration resources of the camera corresponding to the state before the folding screen changes are cleared, and the configuration resources of the target camera are initialized to turn off the camera that is currently on, and control the target camera to be turned on.

[0010] In one embodiment, the method further includes: blurring the blurred image displayed in the camera application while closing the currently turned-on camera and controlling the target camera to turn on; the blurred image is a residual preview image captured by the closed camera.

[0011] According to a second aspect of an embodiment of the present disclosure, a camera control device is provided, comprising: a determination unit, for determining the state of the folding screen and the state of the camera in response to a camera application in a terminal with a folding screen being triggered to open, wherein the terminal comprises a plurality of the cameras, the state of the folding screen comprises an unfolded state or a folded state, and the state of the camera comprises an on state or a off state; and a processing unit, for controlling a target camera to open based on the state of the folding screen and the state of the camera, wherein the target camera is a camera among the plurality of cameras corresponding to the state of the folding screen, wherein different states of the folding screen correspond to different cameras among the plurality of cameras.

[0012] In one embodiment, the processing unit controls the target camera to turn on based on the state of the folding screen and the state of the camera in the following manner: if the state of the camera is off, the current state of the folding screen is determined, and the camera corresponding to the current state of the folding screen is controlled to turn on.

[0013] In one embodiment, the processing unit controls the target camera to turn on based on the state of the folding screen and the state of the camera in the following manner: if the state of the camera is on, the state change of the folding screen is determined; according to the state change of the folding screen, the target camera is determined, and the target camera is controlled to turn on.

[0014] In one embodiment, the processing unit determines the target camera and controls the target camera to turn on according to the state change of the folding screen in the following manner: if the state of the folding screen has not changed, the camera that is currently in the turned-on state is determined as the target camera, and the turned-on state of the camera that is currently in the turned-on state is maintained.

[0015] In one embodiment, the processing unit determines the target camera and controls the target camera to turn on according to the state change of the folding screen in the following manner: if the state of the folding screen changes, the camera corresponding to the state after the folding screen state changes is used as the target camera; the configuration resources of the camera corresponding to the state before the folding screen state changes are cleared, and the configuration resources of the target camera are initialized to turn off the camera that is currently on, and control the target camera to turn on.

[0016] In one embodiment, the processing unit is also used to: blur the blurred image displayed in the camera application when closing the camera that is currently turned on and controlling the target camera to turn on; the blurred image is a residual preview image captured by the closed camera.

[0017] According to a third aspect of an embodiment of the present disclosure, a camera control device is provided, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the camera control method described in the first aspect or any one implementation of the first aspect.

[0018] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, in which instructions are stored. When the instructions in the storage medium are executed by a processor of a terminal, the terminal is enabled to execute the camera control method described in the first aspect or any one of the implementations of the first aspect.

[0019] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects: through the embodiments of the present disclosure, based on the state of the folding screen and the state of the camera, the target camera corresponding to the current state of the folding screen is controlled to be turned on. This solution can control the opening of the camera that matches the state of the folding screen, thereby realizing adaptive switching of the camera and improving the user's visual experience.

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

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

[0022] Figure 1 The figure is a flow chart of a camera control method according to an exemplary embodiment.

[0023] Figure 2 The figure is a flow chart of another camera control method according to an exemplary embodiment.

[0024] Figure 3 is a flow chart of yet another camera control method according to an exemplary embodiment.

[0025] Figure 4 The figure is a flow chart of another camera control method according to an exemplary embodiment.

[0026] Figure 5 is a flow chart of yet another camera control method according to an exemplary embodiment.

[0027] Figure 6 The figure is a flow chart of a method for optimizing camera control according to an exemplary embodiment.

[0028] Figure 7 The figure is a flow chart of another camera control method according to an exemplary embodiment.

[0029] Figure 8 is an exemplary diagram showing a terminal with a foldable screen in an unfolded state according to an exemplary embodiment.

[0030] Fig. 9 is an exemplary diagram showing a terminal with a folding screen in a folded state according to an exemplary embodiment.

[0031] Fig.10 The figure is a flow chart of a camera configuration method according to an exemplary embodiment.

[0032] Fig.11 The invention is a block diagram of a camera control device according to an exemplary embodiment.

[0033] Fig.12 The invention is a block diagram showing a device for a camera control method according to an exemplary embodiment.

[0034] Fig.13 The invention is a block diagram showing a device for a camera control method according to an exemplary embodiment. DETAILED DESCRIPTION

[0035] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present disclosure.

[0036] In this embodiment, the terminal with a foldable screen can adapt to the current folded state or unfolded state according to the user's operation. For example, when the terminal with a foldable screen is in the unfolded state and the main screen is open, if the user folds the terminal with a foldable screen, the display content of the main screen will be transmitted and displayed on the folded screen. The terminal with a foldable screen can be a mobile phone, tablet computer, etc. with a foldable screen.

[0037] However, the current camera application is basically not adapted to the folding screen switching, and will not respond to the folding or unfolding events of the folding screen. It always uses the camera tag CameraID=1 to open the front camera. For example, if multiple front cameras are connected to the same CSI, CameraID=1 is still used to open the front camera. It is impossible to identify which camera is opened, and the data transmission of multiple cameras will conflict.

[0038] In view of this, the present disclosure provides a camera control method. When the camera application of a terminal with a folding screen is triggered to open, the target camera that matches the current state of the folding screen can be controlled to open. The problem of data transmission conflicts between multiple cameras is solved, and adaptive switching of multiple cameras is achieved, thereby improving the user's visual experience.

[0039] Figure 1 is a flow chart of a camera control method according to an exemplary embodiment, the camera control method is applied to a terminal with a folding screen, such as Figure 1 As shown, the method includes the following steps.

[0040] In step S11 , in response to a camera application in a terminal with a folding screen being triggered to open, a state of the folding screen and a state of the camera are determined.

[0041] In step S12, based on the state of the folding screen and the state of the camera, the target camera is controlled to turn on.

[0042] In the embodiment of the present disclosure, the camera application in the terminal with a foldable screen corresponds to multiple cameras, and the multiple cameras can use different CSI interfaces respectively, or share the same CSI interface. Among them, the CSI interface is used to transmit camera data.

[0043] In the disclosed embodiment, the state of the folding screen includes an unfolded state and a folded state, and the state of the camera includes an on state and a off state. The target camera is a camera corresponding to the state of the folding screen among the multiple cameras. It should be noted that different states of the folding screen correspond to different cameras among the multiple cameras.

[0044] According to the disclosed embodiment, when the camera application in the terminal with a folding screen is triggered to open, the matching target camera is controlled to open based on the current state of the folding screen and the state of the camera. This solution accurately determines the target camera of the camera application under different folding screen states, avoids data transmission conflicts between multiple cameras, realizes adaptive switching of multiple cameras, and improves the user experience.

[0045] In the present disclosure, based on the state of the folding screen and the state of the camera, the target camera is controlled to be turned on, including two situations, one of which is described below.

[0046] Figure 2 is a flow chart of another camera control method according to an exemplary embodiment. Figure 2 As shown, the method includes the following steps.

[0047] In step S21 , in response to determining that a camera application in a terminal with a folding screen is triggered to open, a state of the folding screen and a state of the camera are determined.

[0048] In step S22, if the state of the camera is off, the state of the current folding screen is determined, and the camera corresponding to the state of the current folding screen is controlled to turn on.

[0049] Taking the front camera of a terminal with a folding screen as an example, the label of the front inner screen camera can be set to 1, and the label of the front outer screen camera can be set to 2. When the camera application of the terminal with a folding screen opens the camera_ID=1 front camera instruction, the labels of the two physical cameras of the front camera with camera_ID=1 are obtained. Among them, the unfolded state of the folding screen corresponds to the camera with label 1, and the folded state of the folding screen corresponds to the camera with label 2. If there is no camera that has been opened when the front camera instruction to open camera_ID=1 is received and the folding screen of the current terminal is in the unfolded state, the physical camera with label 1 is opened. If there is no camera that has been opened when the front camera instruction to open camera_ID=1 is received and the folding screen of the current terminal is in the unfolded state, the physical camera with label 2 is opened.

[0050] In the embodiment of the present disclosure, the state of the camera is closed, which means that any camera is not turned on. If the current state of the folding screen is the unfolded state, the camera of the inner screen of the folding screen is controlled to be turned on. If the current state of the folding screen is the folded state, the camera of the outer screen of the folding screen is controlled to be turned on. It can be understood that when the folding screen is in the unfolded state, the camera of the inner screen of the folding screen is corresponding, and when the folding screen is in the folded state, the camera of the outer screen of the folding screen is corresponding.

[0051] According to the embodiment of the present disclosure, if any camera is in the off state, the corresponding target camera is controlled to be turned on based on the determined state of the folding screen. This method can directly and accurately identify the target camera that the user needs to turn on based on the state of the folding screen, so that the target camera matches the current state of the folding screen.

[0052] In the present disclosure, for controlling the target camera to turn on based on the state of the folding screen and the state of the camera, one scenario of the process has been described above, and another scenario will be described below.

[0053] Figure 3 is a flowchart of another camera control method according to an exemplary embodiment. Figure 3 As shown, the method includes the following steps.

[0054] In step S31 , in response to a camera application in a terminal with a folding screen being triggered to open, a state of the folding screen and a state of the camera are determined.

[0055] In step S32, if the state of the camera is on, the state change of the folding screen is determined.

[0056] In step S33, the target camera is determined according to the state change of the folding screen, and the target camera is controlled to be turned on.

[0057] Similarly, taking the front camera of a terminal with a folding screen as an example, the label of the front inner screen camera is set to 1, and the label of the front outer screen camera is set to 2. When the camera application of the terminal with a folding screen opens the camera_ID=1 front camera instruction, the labels of the two physical cameras of the front camera with camera_ID=1 are obtained. Among them, the unfolded state of the folding screen corresponds to the camera with label 1, and the folded state of the folding screen corresponds to the camera with label 2. If the camera currently exists and is turned on when the front camera instruction to open camera_ID=1 is received and matches the state of the folding screen of the current terminal, no processing is performed. If the camera currently exists and is turned on when the front camera instruction to open camera_ID=1 is received but does not match the state of the folding screen of the current terminal, the camera corresponding to the current label is cleared, and the camera with the label corresponding to the state of the current folding screen is configured and turned on.

[0058] In the embodiment of the present disclosure, the state of the camera is the on state, which means that at least one camera is in the on state. The state change of the folding screen includes: the state of the folding screen has not changed, or the state of the folding screen has changed.

[0059] According to the embodiment of the present disclosure, if at least one camera is turned on, a corresponding operation is performed according to whether the state of the folding screen has changed. This method can make the current camera still match the current state of the folding screen when the user has not changed the state of the folding screen, and make the current camera match the changed state of the folding screen when the user has changed the state of the folding screen. This realizes the adaptive switching of the camera and improves the user experience.

[0060] In the present disclosure, operations corresponding to different folding screen state changes are performed according to different folding screen state changes. If the folding screen state does not change, the target camera does not change.

[0061] Figure 4 is a flow chart of another camera control method according to an exemplary embodiment. Figure 4 As shown, the method includes the following steps.

[0062] In step S41 , in response to a camera application in a terminal with a folding screen being triggered to open, a state of the folding screen and a state of the camera are determined.

[0063] In step S42, if the camera is in the on state, the state change of the folding screen is determined.

[0064] In step S43, if the state of the folding screen has not changed, the camera that is currently in the turned-on state is determined as the target camera, and the turned-on state of the camera that is currently in the turned-on state is maintained.

[0065] For ease of understanding, the following examples are given. If the internal screen camera of the front camera in the terminal with a folding screen is currently turned on, and the folding screen of the current terminal remains in the unfolded state, no processing is performed. That is, it is equivalent to keeping the internal screen camera turned on. If the external screen camera of the front camera in the terminal with a folding screen is currently turned on, and the folding screen of the current terminal remains in the folded state, no processing is performed. That is, it is equivalent to keeping the external screen camera turned on.

[0066] According to the disclosed embodiment, through further real-time judgment, when the state of the folding screen has not changed, the current camera remains turned on. This method can reduce multiple judgments and multiple switching operations of the system, while keeping the current camera matching the state of the current folding screen in real time, saving system resources.

[0067] In the present disclosure, operations corresponding to different folding screen state changes are performed according to different folding screen state changes. If the state of the folding screen changes, the target camera is changed accordingly.

[0068] Figure 5is a flowchart of another camera control method according to an exemplary embodiment. Figure 5 As shown, the method includes the following steps.

[0069] In step S51 , in response to a camera application in a terminal with a folding screen being triggered to open, a state of the folding screen and a state of the camera are determined.

[0070] In step S52, if the camera is in the on state, the state change of the folding screen is determined.

[0071] In step S53, if the state of the folding screen changes, the camera corresponding to the state after the folding screen state changes is used as the target camera.

[0072] In step S54, the configuration resources of the camera corresponding to the state before the folding screen state changes are cleared, and the configuration resources of the target camera are initialized to turn off the camera that is currently on and control the target camera to turn on.

[0073] For ease of understanding, the following examples are given. If the internal screen camera of the front camera in the terminal with a folding screen has been turned on, and the state of the folding screen of the current terminal changes to a folded state, the internal screen camera is turned off, and the external screen camera is turned on. This is equivalent to switching from the internal screen camera to the external screen camera. If the external screen camera of the front camera in the terminal with a folding screen has been turned on, and the state of the folding screen of the current terminal changes to an unfolded state, the external screen camera is turned off, and the internal screen camera is turned on. This is equivalent to switching from the external screen camera to the internal screen camera.

[0074] In the disclosed embodiment, since multiple cameras may be connected to the same CSI interface, and one CSI interface cannot transmit data from multiple cameras at the same time. Therefore, when the state of the folding screen changes, the camera resources need to be reconfigured. Specifically: clear the configuration resources of the camera corresponding to the state before the folding screen state changes, and initialize the configuration resources of the target camera. Reconfiguration can transmit the data of the target camera, and then control the target camera to turn on.

[0075] According to the embodiment of the present disclosure, the currently turned on camera is turned off and the target camera is turned on by reconfiguring when the state of the folding screen changes. This process can realize resource configuration for the camera that is turned on, and can accurately turn on and configure the target camera based on the mapping relationship between the state of the folding screen and the camera, avoiding conflicts in data transmission between multiple cameras.

[0076] In the present disclosure, since there may be a phenomenon of residual preview images during the camera switching process, in order to optimize the user's visual experience, blur processing is further used to process the residual images during the switching process.

[0077] Figure 6 is a flow chart of a method for optimizing camera control according to an exemplary embodiment. Figure 6 As shown, the method includes the following steps.

[0078] In step S61, the camera that is currently turned on is turned off.

[0079] In step S62, blur processing is performed on the blurred image displayed in the camera application.

[0080] In step S63, the target camera is controlled to be turned on.

[0081] In the embodiment of the present disclosure, the blurred image displayed in the camera application is a residual preview image captured by the closed camera. The blurring process adopts Gaussian blurring process.

[0082] According to the disclosed embodiment, the camera switching process in the disclosed camera control method is optimized. Gaussian blur processing is performed during the camera switching process, so that the image can be switched smoothly, avoiding the influence of the residual image on the new image, and improving the user's visual experience.

[0083] In the present disclosure, the above-mentioned camera control method is generally described by taking the front camera application as an example.

[0084] Figure 7 is a flow chart of another camera control method according to an exemplary embodiment. Figure 7 As shown, the method includes the following steps.

[0085] In step S101, the front camera is turned on. It should be noted that the front camera is turned on for the first time, that is, the current state of the camera is turned off.

[0086] In step S102, the current state of the folding screen is determined. If the current state of the folding screen is in the unfolded state, step S103 is executed. If the current state of the folding screen is in the folded state, step S104 is executed.

[0087] In step S103, a first camera is turned on. The first camera is a camera corresponding to the inner screen of the terminal with a foldable screen.

[0088] In step S104, the second camera is turned on. The second camera is a camera corresponding to the external screen of the terminal with a foldable screen.

[0089] In step S105, the current camera is in the open state, and it is further determined whether the state of the folding screen has changed. If the state of the folding screen has not changed, step S106 is executed. If the state of the folding screen has changed, step S107 is further executed.

[0090] In step S106, if the state of the folding screen has not changed, no processing is performed.

[0091] In step S107, when the state of the folding screen changes, it is further determined how the state of the folding screen changes. If the folding state of the folding screen changes from the unfolded state to the folded state, step S108 is executed. If the folding state of the folding screen changes from the folded state to the unfolded state, step S109 is executed.

[0092] In step S108, the first camera is turned off and the second camera is turned on.

[0093] In step S109, the second camera is turned off and the first camera is turned on.

[0094] In step S110, the front camera operates normally.

[0095] In the embodiment of the present disclosure, there is a preset mapping relationship between the state of the folding screen and the physical camera. The mapping relationship includes: the folded state of the folding screen corresponds to the camera corresponding to the inner screen of the terminal with the folding screen, and the unfolded state of the folding screen corresponds to the camera corresponding to the outer screen of the terminal with the folding screen. That is, in the embodiment of the present disclosure, the folded state of the folding screen corresponds to the first camera, and the unfolded state of the folding screen corresponds to the second camera.

[0096] For ease of understanding, the following provides examples with reference to diagrams. Figure 8 is an exemplary diagram of a terminal with a folding screen in an unfolded state according to an exemplary embodiment. Figure 8 As shown, the unfolded state corresponds to camera 1, and camera 1 represents the front camera of the terminal inner screen. Fig. 9 is an exemplary diagram of a terminal with a folding screen in a folded state according to an exemplary embodiment. Fig. 9As shown, the folded state corresponds to camera 2, and camera 2 represents the front camera of the terminal's external screen. In the following examples, camera 1 is represented by front1, camera 2 is represented by front2, fold indicates that the folding screen of the folding screen terminal is in the folded state, and unfold indicates that the folding screen of the terminal is in the unfolded state. When we open the front camera while using a terminal with a folding screen, the system will obtain the state of the folding screen of the current terminal. If the state of the folding screen is unfolded, perform the initial configuration of front1, and after the configuration is completed, front1 can be opened, which is equivalent to opening the corresponding front1 in the unfolded state when the folding screen is in the unfolded state. If the state of the folding screen is folded, perform the configuration of front2, and after the configuration is completed, front2 can be opened, which is equivalent to opening the corresponding front2 in the folded state when the folding screen is in the folded state.

[0097] Further, based on the fact that the current camera is already in the open state, if the state of the folding screen has not changed, no processing is performed, and the current camera remains in the open state. Specifically, if the current state of the folding screen is the unfolded state, the open state of front1 is maintained. If the state of the folding screen is the folded state, the open state of front2 is maintained. If the state of the folding screen changes, reconfiguration is required to achieve camera switching. Specifically, if the state of the folding screen changes from the unfolded state to the folded state, the configuration information of the corresponding front1 in the current unfolded state is cleared, and the corresponding front2 configuration in the folded state is re-performed, thereby achieving the closing of front1 and the opening of front2, which is equivalent to the switching from front1 to front2. If the folding state of the folding screen changes from the folded state to the unfolded state, the configuration information of the corresponding front2 in the current folded state is cleared, and the corresponding front1 configuration in the unfolded state is re-performed, thereby achieving the closing of front2 and the opening of front1, which is equivalent to the switching from front2 to front1. The above process enables the opened front camera to operate normally.

[0098] In the disclosed embodiment, through the mapping relationship between the folding screen state and the physical camera, the current camera is turned off in time and the target camera is turned on, thereby realizing the adaptive switching of the front multi-camera. This solution can be applied to the scene where multiple front cameras share the same CSI interface, and the scene where multiple front cameras use different CSI interfaces, and has good versatility.

[0099] In the present disclosure, the camera needs to be configured whether it is turned off or on. The overall configuration method in the above solution is specifically described below.

[0100] Fig.10 is a flowchart of a camera configuration method according to an exemplary embodiment. Fig.10 As shown, the method includes the following steps.

[0101] In step S201, the front camera is turned on.

[0102] In step S202, the HAL layer is initially configured.

[0103] It should be noted that the HAL (HardwareAbstractionLayer) layer is the hardware abstraction layer. The role of HAL is to represent the rest of the operating system as an abstract hardware device. The initial configuration process executes the configure_streams(...) method, where the configure_streams process refers to configuring the camera's data stream output. Specifically, the configure_streams process includes determining the type of data to be output, setting parameters such as the resolution and frame rate of the data stream, configuring the format and encoding method of the data stream, determining the transmission method of the data stream, and testing the stability and quality of the data stream to ensure the accuracy and reliability of the output data. In general, when performing the configure_streams configuration process, a single physical camera needs to correspond to one CSI interface.

[0104] In step S203, it is determined whether the state of the folding screen has changed. If the state of the folding screen has not changed, step S204 is executed. If the state of the folding screen has changed, step S205 is executed.

[0105] In step S204, the HAL layer does not perform any processing.

[0106] In step S205, the HAL layer is reconfigured.

[0107] It should be noted that the reconfiguration of the HAL layer includes: flushing the front camera that is currently in the open state, releasing the physical camera and its CSIPHY and other resources in the process. init the physical front camera and its CSIPHY resources corresponding to the folded state of the folding screen of the terminal with a folding screen. Among them, flush is the refresh method, and init is the initialization method. CSIPHY and other resources are the resources configured by the configure_streams(...) method executed by the above-mentioned HAL layer. This process control realizes the reasonable allocation of the CSI interface during the camera configuration process.

[0108] In step S206, the front camera operates normally.

[0109] According to the disclosed embodiment, it is possible to determine whether reconfiguration is required based on the state of the folding screen. The method can configure the corresponding camera when the state of the folding screen changes, implement the configuration switching of the two physical cameras at the bottom layer, and then enable the camera application to control the opening of the target camera. The adaptive switching of the business layer camera is achieved through the configuration of the bottom layer logic, which improves the user experience.

[0110] Based on the same concept, an embodiment of the present disclosure also provides a camera control device.

[0111] It is understandable that the camera control device provided in the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function in order to realize the above functions. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.

[0112] Fig.11 1 is a block diagram of a camera control device 1100 according to an exemplary embodiment. Fig.11 The device 1100 includes a determining unit 1101 and a processing unit 1102.

[0113] The determining unit 1101 is used to determine the state of the folding screen and the state of the camera in response to the camera application in the terminal with a folding screen being triggered to open, the terminal includes multiple cameras, the state of the folding screen includes an unfolded state or a folded state, and the state of the camera includes an open state or a closed state;

[0114] The processing unit 1102 is used to control the target camera to turn on based on the state of the folding screen and the state of the camera, where the target camera is a camera among multiple cameras corresponding to the state of the folding screen, wherein different states of the folding screen correspond to different cameras among the multiple cameras.

[0115] In some embodiments, the processing unit 1102 controls the target camera to turn on based on the state of the folding screen and the state of the camera in the following manner: if the camera state is off, the state of the current folding screen is determined, and the camera corresponding to the state of the current folding screen is controlled to turn on.

[0116] In some embodiments, the processing unit 1102 controls the target camera to turn on based on the state of the folding screen and the state of the camera in the following manner: if the camera is in the on state, the state change of the folding screen is determined; according to the state change of the folding screen, the target camera is determined, and the target camera is controlled to turn on.

[0117] In some embodiments, the processing unit 1102 determines the target camera and controls the target camera to turn on according to the state change of the folding screen in the following manner: if the state of the folding screen has not changed, the camera that is currently in the turned-on state is determined as the target camera, and the turned-on state of the camera that is currently in the turned-on state is maintained.

[0118] In some embodiments, the processing unit 1102 determines the target camera and controls the target camera to turn on according to the state change of the folding screen in the following manner: if the state of the folding screen changes, the camera corresponding to the state after the folding screen state changes is used as the target camera; the configuration resources of the camera corresponding to the state before the folding screen state changes are cleared, and the configuration resources of the target camera are initialized to turn off the camera that is currently on, and control the target camera to turn on.

[0119] In some embodiments, the processing unit 1102 is also used to: blur the blurred image displayed in the camera application when turning off the currently turned-on camera and controlling the target camera to turn on; the blurred image is the residual preview image captured by the turned-off camera.

[0120] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0121] Fig.12 1 is a block diagram of an apparatus 1200 for a camera control method according to an exemplary embodiment. For example, the apparatus 1200 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

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

[0123] The processing component 1202 generally controls the overall operation of the device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to perform all or part of the steps of the above-described method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.

[0124] The memory 1204 is configured to store various types of data to support the operation of the device 1200. Examples of such data include instructions for any application or method operating on the device 1200, contact data, phone book data, messages, pictures, videos, etc. The 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 memory, flash memory, magnetic disk or optical disk.

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

[0126] The multimedia component 1208 includes a screen that provides an output interface between the 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 touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0127] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the device 1200 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 1204 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.

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

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

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

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

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

[0133] Fig.13 1 is a block diagram of a device 1300 for a camera control method according to an exemplary embodiment. For example, the device 1300 may be provided as a server. Fig.13 The apparatus 1300 includes a processing component 1322, which further includes one or more processors, and a memory resource represented by a memory 1332 for storing instructions, such as an application, that can be executed by the processing component 1322. The application stored in the memory 1332 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1322 is configured to execute instructions to perform the above method.

[0134] The device 1300 may also include a power supply component 1326 configured to perform power management of the device 1300, a wired or wireless network interface 1350 configured to connect the device 1300 to a network, and an input / output (I / O) interface 1358. The device 1300 may operate based on an operating system stored in the memory 1332, such as Windows Server TM, Mac OS X TM, Unix TM, Linux TM, FreeBSD TM or the like.

[0135] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.

[0136] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.

[0137] It will be further understood that the terms “center”, “longitudinal”, “lateral”, “front”, “back”, “up”, “down”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present embodiment and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation.

[0138] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.

[0139] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.

[0140] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure.

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

Claims

1. A camera control method, characterized in that: include: In response to a camera application in a terminal with a foldable screen being triggered to open, determining a state of the foldable screen and a state of a camera, wherein the terminal includes a plurality of the cameras, the state of the foldable screen includes an unfolded state or a folded state, and the state of the camera includes an on state or a off state; Based on the state of the folding screen and the state of the camera, the target camera is controlled to turn on, and the target camera is a camera among the multiple cameras corresponding to the state of the folding screen, wherein different states of the folding screen correspond to different cameras among the multiple cameras.

2. The method according to claim 1, characterized in that The controlling the target camera to be turned on based on the state of the folding screen and the state of the camera includes: If the state of the camera is off, the current state of the folding screen is determined, and the camera corresponding to the current state of the folding screen is controlled to turn on.

3. The method according to claim 1, characterized in that The controlling the target camera to be turned on based on the state of the folding screen and the state of the camera includes: If the camera is in an on state, determining a state change of the folding screen; According to the state change of the folding screen, the target camera is determined, and the target camera is controlled to be turned on.

4. The method according to claim 3, characterized in that: The determining a target camera according to a state change of the folding screen, and controlling the target camera to turn on, includes: If the state of the folding screen has not changed, the camera that is currently in the turned-on state is determined as the target camera, and the turned-on state of the camera that is currently in the turned-on state is maintained.

5. The method according to claim 3, characterized in that: The determining a target camera according to a state change of the folding screen, and controlling the target camera to turn on, includes: If the state of the folding screen changes, the camera corresponding to the state after the folding screen changes is used as the target camera; Clear the configuration resources of the camera corresponding to the state before the folding screen changes, and initialize the configuration resources of the target camera to turn off the camera that is currently on, and control the target camera to turn on.

6. The method according to claim 5, characterized in that The method further comprises: In the process of closing the camera that is currently turned on and controlling the target camera to turn on, blurring the blurred image displayed in the camera application; The blurred image is a residual preview image captured by the closed camera.

7. A camera control device, characterized in that: include: a determining unit, configured to determine, in response to a camera application in a terminal with a foldable screen being triggered to open, a state of the foldable screen and a state of a camera, wherein the terminal includes a plurality of the cameras, the state of the foldable screen includes an unfolded state or a folded state, and the state of the camera includes an on state or a off state; A processing unit is used to control the target camera to turn on based on the state of the folding screen and the state of the camera, wherein the target camera is a camera among the multiple cameras corresponding to the state of the folding screen, wherein different states of the folding screen correspond to different cameras among the multiple cameras.

8. The device according to claim 7, characterized in that The processing unit controls the target camera to be turned on based on the state of the folding screen and the state of the camera in the following manner: If the state of the camera is off, the current state of the folding screen is determined, and the camera corresponding to the current state of the folding screen is controlled to turn on.

9. The device according to claim 7, characterized in that The processing unit controls the target camera to be turned on based on the state of the folding screen and the state of the camera in the following manner: If the camera is in an on state, determining a state change of the folding screen; According to the state change of the folding screen, the target camera is determined, and the target camera is controlled to be turned on.

10. The device according to claim 9, characterized in that The processing unit determines the target camera according to the state change of the folding screen and controls the target camera to be turned on in the following manner: If the state of the folding screen has not changed, the camera that is currently in the turned-on state is determined as the target camera, and the turned-on state of the camera that is currently in the turned-on state is maintained.

11. The device according to claim 9, characterized in that The processing unit determines the target camera according to the state change of the folding screen and controls the target camera to be turned on in the following manner: If the state of the folding screen changes, the camera corresponding to the state after the folding screen state changes is used as the target camera; Clear the configuration resources of the camera corresponding to the state before the folding screen state changes, and initialize the configuration resources of the target camera to turn off the camera that is currently on, and control the target camera to turn on.

12. The device according to claim 11, characterized in that The processing unit is also used for: In the process of closing the camera that is currently turned on and controlling the target camera to turn on, blurring the blurred image displayed in the camera application; The blurred image is a residual preview image captured by the closed camera.

13. A camera control device, characterized in that: include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the camera control method described in any one of claims 1 to 6.

14. A storage medium, characterized in that: The storage medium stores instructions, and when the instructions in the storage medium are executed by the processor of the terminal, the terminal is enabled to execute the camera control method described in any one of claims 1 to 6.