Picture resolution configuration method, electronic device and storage medium
By storing the corresponding relationship between shooting parameters and resolution in the running memory of the camera application, the problem of complex configuration resolution process and large time overhead in the prior art is solved, and more efficient resolution configuration and update are achieved.
Patent Information
- Application Number
- PCT/CN2024/135397
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-30
- Filing Date
- 2024-11-28
- Publication Date
- 2025-06-05
AI Technical Summary
When configuring resolution for camera applications, existing electronic devices need to obtain and configure across processes, which is expensive and complicated, which affects the user experience.
By storing a configuration file in the running memory of the camera application, the file records the correspondence between multiple shooting parameters and picture resolutions, the electronic device directly obtains and updates the resolutions from the file when the camera application is running, simplifying the configuration process.
It greatly simplifies the process of obtaining and updating image resolutions for camera applications, improves configuration efficiency, reduces user waiting time, and improves user experience.
Smart Images

Figure CN2024135397_05062025_PF_FP_ABST
Abstract
Description
Image resolution configuration method, electronic device, and storage medium
[0001] This application claims priority to the Chinese patent application with application number 202311641422.2 filed with the State Intellectual Property Office of China on November 30, 2023, and priority to the Chinese patent application with the invention name “A method for configuring image resolution, an electronic device and a storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of terminal technology, and in particular to a method for configuring image resolution, an electronic device, and a storage medium. Background Art
[0003] With the development of science and technology, the shooting effects of electronic devices (such as digital cameras, or mobile phones and tablet computers with cameras, etc.) are getting better and better, and using electronic devices to shoot has become a common choice for people.
[0004] When users use electronic devices to take photos, they can adjust the camera resolution to improve image clarity, resulting in high-quality images. However, currently, configuring the resolution for camera applications on electronic devices requires retrieving and configuring the resolution from underlying processes, which is time-consuming. Further research is needed to simplify the resolution configuration process and reduce time. Summary of the Invention
[0005] The present application provides a method for configuring image resolution, an electronic device, and a storage medium, which simplifies the process of configuring resolution for camera applications by an electronic device and improves the efficiency of resolution configuration.
[0006] In a first aspect, the present application provides a method for configuring image resolution, the method comprising: when an electronic device runs a camera application, storing a first configuration file in the running memory of the camera application, the first configuration file recording the correspondence between multiple different shooting parameters and image resolutions; the electronic device receives and responds to a first operation of the user on the camera application, and obtains a first shooting parameter; the electronic device obtains the first configuration file from the running memory of the camera application; the electronic device obtains a first image resolution from the first configuration file based on the first shooting parameter; the electronic device captures a first image at the first image resolution through the camera application; and the electronic device displays the first image in the camera application.
[0007] Optionally, the electronic device may display the first image in a preview window of a camera application.
[0008] In some embodiments, after the camera application is closed, the first configuration file stored in the running memory of the camera application is cleared. When the camera application is started again, the camera application loads the first configuration file into the running memory of the camera application.
[0009] Through this method, the electronic device 100 can store the resolution information supported by the camera application in a first configuration file. After the camera application is running, the electronic device 100 stores the first configuration file in the camera application's runtime memory. When the camera application needs to reconfigure the image resolution, the camera application only needs to obtain the updated image resolution from the first configuration file, which simplifies the process of the camera application obtaining the updated image resolution and speeds up the camera application's acquisition of the updated image resolution.
[0010] In combination with the first aspect, in a possible implementation, after the electronic device runs the camera application and before storing the first configuration file in the running memory of the camera application, the method further includes: the electronic device obtaining the first configuration file from the file system of the camera application.
[0011] The first configuration file is stored in the file system of the camera application. When the camera application is running, the camera application can obtain the first configuration file from the file system of the camera application and store it in the running memory of the camera application.
[0012] In combination with the first aspect, in a possible implementation method, the first shooting parameter includes the shooting parameter of the camera application in the preview state corresponding to the first shooting mode. After the electronic device obtains the first configuration file, the method further includes: the electronic device obtains the second shooting parameter, the second shooting parameter includes the shooting parameter of the camera application in the shooting state corresponding to the first shooting mode; the electronic device obtains the first configuration file from the running memory of the camera application; the electronic device obtains the second image resolution from the first configuration file based on the second shooting parameter.
[0013] In other possible implementations, the camera application may not obtain the second image resolution first, and may obtain the second image resolution after detecting the user's operation on the shutter key. This application does not limit this.
[0014] In this way, the camera application can obtain the second image resolution in advance before detecting the user's operation on the shutter key, so as to speed up the camera application's response to the user's operation on the shutter key and improve the user experience.
[0015] In combination with the first aspect, in one possible implementation, the method also includes: the electronic device receives a second operation of the user on the shutter key in the camera application; in response to the second operation, the electronic device captures a second image or a second video at a second picture resolution; and the electronic device saves the second image or the second video.
[0016] In this way, the camera application can obtain the second image resolution in advance before detecting the user's shutter key operation. When the camera application detects the user's shutter key operation, the second image or second video is captured at the pre-acquired second image resolution, thereby speeding up the camera application's response to the user's shutter key operation and improving the user experience.
[0017] In combination with the first aspect, in a possible implementation, the second image resolution is greater than the first image resolution.
[0018] Generally speaking, users don't have high requirements for the clarity of preview images. Camera apps can capture preview images at a lower resolution to save power and not exceed the screen resolution of the device.
[0019] In combination with the first aspect, in a possible implementation, the first operation includes any one or more of the following: changing a shooting mode of a camera application, changing a display screen state of an electronic device, changing a camera type, and changing a picture ratio.
[0020] In combination with the first aspect, in a possible implementation, before the electronic device receives and responds to the user's first operation on the camera application, the method also includes: the electronic device obtains a first configuration file from the running memory of the camera application; the electronic device obtains a third shooting parameter and obtains a third picture resolution from the first configuration file based on the third shooting parameter; the electronic device captures a third image at the third picture resolution through the camera application; and the electronic device displays the third image within the camera application.
[0021] In one possible implementation, the third shooting parameter includes the shooting parameter of the camera application in the preview state corresponding to the default shooting mode; the method also includes: the electronic device obtains a fourth shooting parameter, the fourth shooting parameter includes the shooting parameter of the camera application in the shooting state corresponding to the default shooting mode; the electronic device obtains a first configuration file from the running memory of the camera application; the electronic device obtains a fourth image resolution from the first configuration file based on the fourth shooting parameter.
[0022] In some embodiments, the third image resolution may be referred to as an initial preview resolution, and the fourth image resolution may be referred to as an initial capture resolution.
[0023] In this way, when the camera application is first opened, before the user changes the shooting parameters, the camera application can obtain the initial preview resolution and the initial shooting resolution, and capture the preview image at the initial preview resolution.
[0024] Optionally, the camera application may also only obtain the initial preview resolution without obtaining the initial shooting resolution. When detecting the user's operation on the shutter key, the camera application then obtains the initial shooting resolution.
[0025] Optionally, after obtaining the first configuration file, the camera application may also obtain an initial shooting resolution from the first configuration file based on the initial shooting parameters.
[0026] In combination with the first aspect, in a possible implementation, the electronic device periodically / irregularly obtains a second configuration file from the server, where the second configuration file is partially different from or completely different from the first configuration file.
[0027] In this way, the first configuration file of the camera application stored on the electronic device can be updated periodically / irregularly.
[0028] In some embodiments, the content of the configuration file is related to the device model. The content of the configuration file corresponding to different device models may be different. In other embodiments, the content of the configuration file corresponding to different device models may also be the same, and this application does not limit this.
[0029] In combination with the first aspect, in a possible implementation, the shooting parameters include any one or more of the following: shooting status, shooting mode, device display status, camera type, and image ratio.
[0030] In a second aspect, the present application provides an electronic device, which includes a camera, a memory, and a processor; wherein the camera, the memory, and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes a picture resolution configuration method provided in any possible implementation method in the first aspect.
[0031] In a third aspect, the present application provides a computer-readable storage medium comprising instructions, which, when executed on an electronic device, enables the electronic device to execute a method for configuring image resolution provided in any possible implementation of the first aspect.
[0032] In a fourth aspect, the present application provides a computer program product comprising instructions. When the computer program product is run on an electronic device, the electronic device executes a method for configuring image resolution provided in any possible implementation of the first aspect.
[0033] In a fifth aspect, the present application provides a chip system, which includes one or more processors, and the processors are used to call computer instructions to enable an electronic device to execute a picture resolution configuration method provided in any possible implementation of the first aspect above.
[0034] For the description of the beneficial effects of the second to fifth aspects, reference may be made to the description of the beneficial effects in the first aspect, and this application will not repeat them here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] 1A-1D are schematic diagrams showing various shooting ratios;
[0036] Figures 2A-2C and 3A-3C show schematic diagrams of display forms of a folding screen;
[0037] Figures 3D-3F show schematic diagrams of the display configuration of the upper and lower folding screens;
[0038] FIG4 shows a schematic diagram of the display form of the extended screen;
[0039] FIG5 shows a schematic diagram of an electronic device 100 configuring picture resolution for a camera application;
[0040] FIG6 shows a schematic structural diagram of the electronic device 100;
[0041] FIG7 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention;
[0042] 8A-8B are schematic diagrams showing the electronic device 100 opening a camera application;
[0043] FIG9 is a schematic diagram showing a method flow of configuring image resolution for a camera application by the electronic device 100 after the camera application is started;
[0044] Figures 10 to 13 show schematic diagrams of several image resolution configuration files;
[0045] FIG14 is a flowchart of a method for updating the image resolution of a camera application based on a user operation in an electronic device 100 provided in the present application;
[0046] FIG15 is a flow chart of a method for configuring image resolution provided in this application. DETAILED DESCRIPTION
[0047] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0048] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
[0049] The term "user interface (UI)" in the following embodiments of this application refers to the media interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The commonly used form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of a wearable device.
[0050] First, let’s explain the technical terms involved in this application.
[0051] 1. Image ratio and image resolution.
[0052] The image resolution can be obtained by the number of pixels in the horizontal direction and the number of pixels in the vertical direction. For example, a 1920x1080 image can be composed of 1920 pixels in the horizontal direction and 1080 pixels in the vertical direction.
[0053] The image ratio can be obtained by the ratio of the number of pixels in the vertical direction to the number of pixels in the horizontal direction. For example, the ratio of a 1920x1080 image can be 16:9.
[0054] One image ratio can correspond to one or more different image resolutions, and one image resolution corresponds to only one image ratio.
[0055] The camera application can support multiple image ratios, including but not limited to 1:1, 4:3, 16:9, and full screen. The full screen image ratio can be 21:9, and different types of electronic devices can have different full screen image ratios. This application uses the full screen image ratio of 21:9 as an example for illustration.
[0056] The 1:1 image ratio may correspond to one or more different image resolutions, such as 1080×1080, 960×960, etc.
[0057] The 4:3 image ratio can correspond to one or more different image resolutions, such as 1440x1920, 1200×1600, 960×1280, and 480×640.
[0058] The 16:9 image ratio can correspond to one or more different image resolutions, such as 1080×1920, 900×1600, 720×1280, 540×960, and 360×640.
[0059] The full-screen image ratio can correspond to one or more different image resolutions, such as 823×1920, 463×1080, 412×960, etc.
[0060] 1A-1D are schematic diagrams showing various shooting ratios.
[0061] FIG1A shows a user selecting a 4:3 aspect ratio for taking a photo in photo mode. As shown in FIG1A , the length of the viewfinder is b and the width is a, where b:a=4:3. The width of the display screen of the electronic device can be a.
[0062] 1B shows that in the photo mode, the user selects a 1:1 image ratio to take a photo. As shown in FIG1B , the length of the viewfinder is c, and the width is a, and c:a=1:1 is selected.
[0063] 1C shows that in the photo mode, the user selects a 16:9 image ratio to take a photo. As shown in FIG1C , the length of the viewfinder is d, the width is a, and d:a=16:9.
[0064] FIG1D shows a user selecting a full-screen image ratio to take a photo in photo mode. As shown in FIG1D , the length of the viewfinder is e and the width is a, where e:a = 21:9. The length of the display screen of the electronic device may be e.
[0065] 2. Shooting Mode
[0066] The shooting mode may include a photo mode and a video mode.
[0067] The photo taking mode may include but is not limited to any one or more of the following: normal photo taking mode, portrait photo taking mode, high definition photo taking mode, night scene photo taking mode, panoramic photo taking mode, etc.
[0068] Optionally, when the camera application is opened for the first time, the default shooting mode of the camera application is the normal photo mode.
[0069] Optionally, the same photo mode can be divided into different shooting states. For example, the normal photo mode can be divided into a preview state and a non-preview state. The portrait photo mode can also be divided into a preview state and a non-preview state. The high-definition photo mode can also be divided into a preview state and a non-preview state. The night scene photo mode can also be divided into a preview state and a non-preview state. The panoramic photo mode can also be divided into a preview state and a non-preview state. Optionally, some photo modes may not distinguish between a non-preview state and a preview state, and this application does not limit this.
[0070] The recording mode may include but is not limited to any one or more of the following: normal recording mode, delayed recording mode, slow motion recording mode, etc.
[0071] Optionally, the same recording mode can be divided into different shooting states. For example, the normal recording mode can be divided into a preview state and a non-preview state. The delayed recording mode can also be divided into a preview state and a non-preview state. The slow-motion recording mode can also be divided into a preview state and a non-preview state. Optionally, the recording mode can also not distinguish between a non-preview state and a preview state, and this application does not limit this.
[0072] Different shooting modes can correspond to one image ratio or multiple image ratios. When a shooting mode supports multiple image ratios, the user can choose to switch between different image ratios.
[0073] For example, in the normal photo mode, the user can select a 1:1 image ratio, or a 4:3 image ratio.
[0074] 3. The shape of electronic device displays
[0075] In this application, the display screens of electronic devices may include: straight screens, foldable screens, and expandable screens. Foldable screens can be further categorized as inward-folding screens, outward-folding screens, and vertical-folding screens. In some embodiments, foldable screens can also be bifold screens.
[0076] The display area of a bar display screen is fixed. The device shown in FIG1A to FIG1D is a bar phone.
[0077] In some embodiments, the bar display screen may also be referred to as a vertical display screen. As shown in FIG1A to FIG1D , the shape of the bar display screen is fixed and cannot be extended or folded.
[0078] 2A-2C and 3A-3C show schematic diagrams of the display form of the folding screen.
[0079] Foldable screens can be divided into inner-folding screens and outer-folding screens. The display states of inner-folding screens and outer-folding screens can be divided into folded state and unfolded state. Among them, the folding states of inner-folding screens and outer-folding screens can be divided into intermediate folding state and fully folded state.
[0080] 2A-2C show schematic diagrams of the inward folding screen display form.
[0081] FIG2A is a schematic diagram showing the display state of the inner folding screen when it is in the unfolded state.
[0082] (a) in Figure 2A exemplarily shows a front view of the inner folding screen when it is in the unfolded state. Among them, when the inner folding screen is in the unfolded state, the displayable screens of the folding screen include screen A, screen B and screen C. Screen A and screen B can be a complete display screen or two independent display screens. Among them, in the fully folded state, the display area where screens A and B are located can also be called a large screen, and the display area where screens A and B are located can also be called an inner screen. Exemplarily, when the inner folding screen is in the unfolded state, the angle α between screens A and B is greater than angle one and less than or equal to 180 degrees. Exemplarily, the value of angle one can be between 170 degrees and 180. For example, when the inner folding screen is in the unfolded and folded state, the angle α between screens A and B can be 180 degrees.
[0083] Figure 2A(b) illustrates a rear view of the inner folding screen in its unfolded and folded state. When the inner folding screen is unfolded, the folding screen also includes a C-screen, which is a completely independent display from the A and B screens.
[0084] 2B-2C are schematic diagrams showing the display form when the inner folding screen is in a folded state.
[0085] Among them, the folding state of the folding screen shown in Figure 2B can also be called the intermediate folding state.
[0086] The inner folding screen can be bent in the direction where screen A and screen B face each other to form a folding form with a certain angle. When the inner folding screen is in the middle folding state, the screens that can be displayed by the folding screen include screen A, screen B and screen C. Among them, in the middle folding state, the display area where screen A and screen B are located can also be called the large screen, and the display area where screen A and screen B are located can also be called the inner screen. The angle α between screen A and screen B is greater than or equal to angle 2 and less than angle 1. For example, the value of angle 2 can be between 10 degrees and 170 degrees. For example, when the inner folding screen is in the middle folding state, the angle α between screen A and screen B can be 120 degrees.
[0087] Among them, the folded state of the folding screen shown in Figure 2C can also be called a fully folded state.
[0088] The inner folding screen can continue to bend in the direction where screen A and screen B face each other until the inner folding screen is in a fully folded state.
[0089] As shown in Figure 2C, when the inner folding screen is in a fully folded state, the displayable screen of the inner folding screen only includes screen C. Among them, in the fully folded state, the display area where screen C is located can also be called a small screen, and the display area where screen C is located can also be called an outer screen. Screen A and screen B are hidden and invisible. Among them, in the middle folding state, the display area where screen A and screen B are located can also be called a large screen, and the display area where screen A and screen B are located can also be called an inner screen. The angle α between screen A and screen B is greater than or equal to 0 degrees and less than angle 2. For example, when the inner folding screen is in a fully folded state, the angle α between screen A and screen B can be 0 degrees.
[0090] 3A-3C are schematic diagrams showing the display form of the external folding screen.
[0091] FIG3A is a schematic diagram showing the display state of the outer folding screen when it is in the unfolded state.
[0092] (a) in Figure 3A exemplarily shows a front view of the outer folding screen when it is in the unfolded state. Among them, when the outer folding screen is in the unfolded state, the displayable screens of the folding screen include screen A and screen B. Screen A and screen B can be a complete display screen or two independent display screens. Exemplarily, when the inner folding screen is in the unfolded state, the angle α between screen A and screen B is greater than angle three and less than or equal to 180 degrees. Exemplarily, the value of angle three can be between 170 degrees and 180 degrees. Exemplarily, if the value of angle three is 180 degrees, when the outer folding screen is in the unfolded state, the angle α between screen A and screen B can be 180 degrees.
[0093] Figure 3A(b) shows an exemplary rear view of the outer folding screen in the unfolded state. When the outer folding screen is in the unfolded state, compared with the inner folding screen in the unfolded state, the display screen of the outer folding screen does not include the C screen.
[0094] 3B-3C are schematic diagrams showing the display form when the outer folding screen is in a folded state.
[0095] Among them, the folding state of the folding screen shown in Figure 3B can also be called the intermediate folding state.
[0096] The outer folding screen can be bent in a direction opposite to screen A and screen B to form a folding form with a certain angle. That is, the folding directions of the outer folding screen and the inner folding screen are opposite. When the outer folding screen is in the middle state, the screens that can be displayed by the folding screen include screen A and screen B, and the angle α between screen A and screen B is greater than or equal to angle four and less than or equal to angle three. Exemplarily, the value of angle four can be between 10 degrees and 170. For example, when the outer folding screen is in the middle folding state, the angle α between screen A and screen B can be 120 degrees.
[0097] Among them, the folded state of the folding screen shown in Figure 3C can also be called a fully folded state.
[0098] As shown in Figure 3C, the outer folding screen can continue to bend in a direction opposite to screen A and screen B. When the outer folding screen is in the folded state, the display screen of the folding screen can be screen B (or the display screen can also be screen A). Exemplarily, when the inner folding screen is in the fully folded state, screen A is in the off state (or screen B is in the off state), and the angle α between screens A and B is greater than or equal to 0 degrees and less than angle 4. Exemplarily, the value of angle 4 can be between 0 degrees and 10 degrees. Exemplarily, when the outer folding screen is in the fully folded state, the angle α between screens A and B can be 0 degrees.
[0099] 3D-3F show schematic diagrams of the display form of the upper and lower folding screen.
[0100] Figure 3D shows a schematic diagram of the display form when the upper and lower folding screens are in the unfolded state. Among them, when the upper and lower folding screens are in the unfolded state, the displayable screens of the folding screen include screen A and screen B. Screen A and screen B can be a complete display screen or two independent display screens. Exemplarily, when the inner folding screen is in the unfolded state, the angle α between screen A and screen B is greater than angle three and less than or equal to 180 degrees. Exemplarily, the value of angle three can be between 170 degrees and 180 degrees. Exemplarily, if the value of angle three is 180 degrees, when the outer folding screen is in the unfolded state, the angle α between screen A and screen B can be 180 degrees.
[0101] 3E-3F are schematic diagrams showing the display forms when the upper and lower folding screens are in the folded state.
[0102] Among them, the folded state of the upper and lower folding screens shown in Figure 3E can also be called the middle folding state.
[0103] The upper and lower folding screens can be bent toward each other, toward screens A and B, to form a folded configuration with a predetermined angle. When the upper and lower folding screens are in an intermediate position, the displayable screens on the upper and lower folding screens include screens A and B, and the angle α between screens A and B is greater than or equal to angle 4 and less than or equal to angle 3. For example, angle 4 can be between 10 degrees and 170 degrees. For example, when the upper and lower folding screens are in the intermediate folding position, the angle α between screens A and B can be 120 degrees.
[0104] Among them, the folded state of the upper and lower folding screens shown in Figure 3F can also be called a fully folded state.
[0105] As shown in Figure 3F, the upper and lower folding screens can continue to bend outward in a direction toward where screens A and B face each other. When the folding screens are in the folded state, screens A and B of the upper and lower folding screens are hidden and invisible. Exemplarily, when the upper and lower folding screens are in the fully folded state, screens A and B are both off, and the angle α between screens A and B is greater than or equal to 0 degrees and less than angle 4. Exemplarily, angle 4 can be between 0 and 10 degrees. Exemplarily, when the upper and lower folding screens are in the fully folded state, the angle α between screens A and B can be 0 degrees.
[0106] For example, in some embodiments, the upper and lower folding screens may further include a C-screen. The C-screen is located behind the A-screen or the B-screen. When the upper and lower folding screens are in the unfolded state, the C-screen is in the off state. When the upper and lower folding screens are in the folded state, the C-screen is in the on state.
[0107] FIG4 is a schematic diagram showing the display form of the extended screen.
[0108] In some cases, the extended screen may also be referred to as a scroll screen. The scroll screen of an electronic device can be pulled out or rolled back in a direction perpendicular to the scroll axis, changing the screen length perpendicular to the scroll axis.
[0109] The form of the scroll screen can be divided into an unrolled state, a semi-rolled state, and a fully-rolled state. Among them, (a) in Figure 4 is a schematic diagram of the unrolled state of the scroll screen. When the scroll screen is in the unrolled state, part of the scroll screen is hidden inside the body of the electronic device, and the electronic device can display the interface of the application on the other part of the unfolded screen. At this time, the length of the screen is length one. The part of the screen hidden inside the body of the scroll screen can be extended in a specified direction (for example, the direction of the arrow shown in the figure). When the screen of the scroll screen has not been fully unfolded, the scroll screen is in a semi-rolled state, as shown in (b) in Figure 4. When the scroll screen is in a semi-rolled state, the part of the screen hidden inside the body of the scroll screen decreases, and the part of the screen exposed on the surface of the body increases, until the entire scroll screen is exposed on the surface of the body. When the entire scroll screen is exposed on the surface of the body, the scroll screen is in a fully unfolded state, as shown in (c) in Figure 4, and the length of the screen is length two. Among them, length two is greater than length one. It can be understood that when the length of the screen is greater than length one and less than length two, the scroll screen is in a semi-unfolded state.
[0110] It should be noted that in the embodiment of the present application, the scroll screen can be unfolded along a first direction perpendicular to the scroll axis, from an unfolded state, through a semi-folded state, to a fully unfolded state. Similarly, the scroll screen can also be retracted along a second direction perpendicular to the scroll axis, from a fully unfolded state, through a semi-folded state, to an unfolded state. The first direction and the second direction are opposite.
[0111] Optionally, the scroll screen of the electronic device is not limited to being pulled out horizontally to the right perpendicular to the scroll axis. In some embodiments, the scroll screen of the electronic device can also be pulled out horizontally to the left perpendicular to the scroll axis.
[0112] Optionally, in some embodiments, the scroll of the electronic device may also be located in a horizontal direction, and the electronic device may also pull out the scroll screen perpendicularly to the scroll upward or downward, which is not limited in this embodiment of the present application.
[0113] The electronic device displays described above may include: bar displays, foldable displays, and expandable displays. The display areas of these displays may vary in size, and the image ratios supported by camera applications may be the same or different.
[0114] For example, when the display screen of the electronic device is a bar screen, the bar screen only includes one display state. Therefore, for the bar screen, the image ratio supported by the camera application can be fixed, for example, it can include multiple image ratios such as 1:1, 4:3 and 16:9.
[0115] For another example, when the electronic device display screen is a foldable screen, when the foldable screen is in the folded state shown in Figure 2C or Figure 3C, the image ratios supported by the camera application may include 1:1, 4:3, and 16:9. When the foldable screen is in the unfolded state shown in Figure 2A or Figure 3A, the display area of the electronic device display screen becomes larger, and the image ratios supported by the camera application may include 1:1, 8:7, and other image ratios.
[0116] For another example, when the electronic device display screen is an extended screen, when the extended screen is in the folded state shown in Figure 4 (a), the camera application may support multiple image ratios including 1:1, 4:3, and 16:9. When the extended screen is in the unfolded state shown in Figure 4 (c), the display area of the electronic device display screen becomes larger, and the camera application may support multiple image ratios including 1:1, 8:7, and other image ratios.
[0117] FIG5 shows a schematic diagram of configuring image resolution for a camera application on the electronic device 100 .
[0118] S5001. In response to a user operation of starting a camera application, the camera application sends a picture resolution configuration request to the HAL layer.
[0119] Exemplarily, the user operation of starting the camera application may be a user operation on the camera application icon on the desktop, such as a single-click operation.
[0120] In response to a user operation to start the camera application, the camera application sends an image resolution configuration request to the HAL layer. This request is used to obtain a list of image resolutions supported by the camera application.
[0121] S5002: In response to the image resolution configuration request, the HAL layer obtains a list of image resolutions supported by the camera application.
[0122] In response to the image resolution configuration request, the HAL layer can obtain a list of image resolutions supported by the camera application.
[0123] Table 1
[0124] Table 1 illustrates a list of image resolutions supported by the camera application obtained by the HAL layer. As shown in Table 1, when the image ratio is 1:1, the image resolutions may include 1080×1080 and 960×960. When the image ratio is 4:9, the image resolutions may include 1440x1920, 1200×1600, 960×1280, and 480×640. When the image ratio is 16:9, the image resolutions may include 1080×1920, 900×1600, 720×1280, 540×960, and 360×640. When the image ratio is 21:9, the image resolutions may include 823×1920, 463×1080, and 412×960.
[0125] After obtaining the list of image resolutions supported by the camera application, the HAL layer sends the list of image resolutions supported by the camera application to the camera application.
[0126] S5003. The HAL layer sends the image resolution list to the camera application.
[0127] The shooting parameters may include but are not limited to information such as the icon ratio. For example, the image ratio may be 4:3.
[0128] S5004: The camera application obtains a picture resolution from the picture resolution list based on the shooting parameters.
[0129] The camera application can obtain an image resolution that matches the 4:3 aspect ratio of the image from the obtained image resolution list. For example, the camera application generally uses the first image resolution that matches as the image resolution configured for the camera application, and does not traverse other image resolutions. For example, if the camera application first matches an image resolution of 1440x1920 based on the image ratio of 4:3, the camera application can determine that 1440x1920 is the final selected image resolution.
[0130] S5005. The camera application sends the matched image resolution to the HAL layer.
[0131] S5006. The HAL layer sends the image resolution to the camera module driver, so that the camera module can capture images according to the image resolution.
[0132] After determining the image resolution, the camera application sends the matched image resolution to the HAL layer. The HAL layer then sends the image resolution to the camera module driver, so that the camera module driver can control the camera module to capture images according to the image resolution.
[0133] In some embodiments, when the user changes the shooting parameters of the camera application, for example, switching the image ratio from 4:3 to 16:9, the camera application needs to re-acquire the image resolution list uploaded by the HAL layer and re-match the image resolution in the manner shown in Figure 5.
[0134] As can be seen from the embodiment of Figure 5, the camera application confirms the image resolution and relies on the list of image resolutions supported by the camera application reported by the HAL layer. The interaction between the camera application and the HAL layer requires cross-process, resulting in a long time for the camera application to obtain the image resolution, and the camera application cannot obtain the image resolution in time. In terms of interface display, for example, after the electronic device 100 turns on the camera application based on user operation, the camera application needs to wait for a period of time before it can display the camera preview screen. For another example, after the electronic device 100 changes the shooting parameters of the camera application based on user operation, the camera application also needs to wait for a period of time before it can display the preview screen based on the updated shooting parameters, which results in a poor user experience.
[0135] Based on the above analysis, this application provides a method for configuring image resolution, an electronic device, and a storage medium. The method may include the following steps:
[0136] Step 1: The electronic device 100 receives a user operation to open a camera application. In response to the user operation, the electronic device 100 obtains a first configuration file and saves the first configuration file in the running memory of the camera application, wherein the first configuration file records the correspondence between multiple image resolutions and shooting parameters supported by the camera application.
[0137] The first configuration file may store the shooting parameters and image resolution in a key-value format, wherein the key may refer to the shooting parameters of the camera application, and the value may refer to the image resolution of the camera application.
[0138] The shooting parameters may include but are not limited to any one or more of the shooting status, shooting mode, device display status, camera, image ratio, etc.
[0139] For an introduction to the first configuration file, please refer to the description of the embodiments in FIG. 10 to FIG. 13 , which will not be repeated in this application.
[0140] Optionally, before the camera application is started, the first configuration file may be stored in a disk. For example, the first configuration file may be stored in a file system corresponding to the camera application in the disk.
[0141] Optionally, the first configuration file may be associated with the device model. The content of the first configuration file stored in different device models may be different. In other embodiments, the content of the first configuration file stored in different device models may also be the same, which is not limited in this application.
[0142] Step 2: The electronic device 100 obtains initial shooting parameters, and obtains an initial resolution from the first configuration file based on the initial shooting parameters. The camera application captures and displays an image at the initial resolution.
[0143] In other embodiments, the electronic device 100 may change the shooting parameters based on user operations. The camera application may obtain the updated shooting parameters and match the updated resolution from the first configuration file based on the updated shooting parameters. The electronic device 100 may capture and display an image based on the updated resolution.
[0144] Through this method, the electronic device 100 can store the resolution information supported by the camera application in a first configuration file. After the camera application is running, the electronic device 100 stores the first configuration file in the camera application's runtime memory. When the camera application needs to reconfigure the image resolution, the camera application only needs to obtain the updated image resolution from the first configuration file, which simplifies the process of the camera application obtaining the updated image resolution and speeds up the camera application's acquisition of the updated image resolution.
[0145] The following describes the hardware structure of an electronic device 100 provided in an embodiment of the present application.
[0146] FIG6 shows a schematic structural diagram of the electronic device 100 .
[0147] The following embodiments are described in detail using electronic device 100 as an example. It should be understood that the electronic device 100 shown in FIG6 is merely an example, and that electronic device 100 may have more or fewer components than those shown in FIG6 , may combine two or more components, or may have a different component configuration. The various components shown in FIG6 may be implemented in hardware, including one or more signal processing and / or application-specific integrated circuits, software, or a combination of hardware and software.
[0148] The electronic device 100 may include: a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0149] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0150] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0151] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0152] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0153] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.
[0154] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby enabling the touch function of the electronic device 100.
[0155] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.
[0156] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.
[0157] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.
[0158] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.
[0159] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0160] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0161] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0162] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0163] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0164] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0165] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0166] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0167] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0168] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0169] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0170] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0171] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD). The display screen panel can also be made of an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a miniLED, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0172] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
[0173] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.
[0174] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.
[0175] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
[0176] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.
[0177] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.
[0178] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0179] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0180] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0181] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.
[0182] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.
[0183] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.
[0184] Microphone 170C, also known as "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak by putting their mouth close to the microphone 170C to input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In other embodiments, the electronic device 100 can be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C to collect sound signals, reduce noise, identify the source of sound, realize directional recording function, etc.
[0185] The headphone jack 170D is used to connect a wired headphone and can be the USB interface 130 or a 3.5mm open mobile terminal platform (OMTP) standard interface or a cellular telecommunications industry association of the USA (CTIA) standard interface.
[0186] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force acts on pressure sensor 180A, the capacitance between the electrodes changes. Electronic device 100 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, electronic device 100 detects the touch intensity based on pressure sensor 180A. Electronic device 100 can also calculate the touch location based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, a command to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, a command to create a new short message is executed.
[0187] The gyroscope sensor 180B can be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the electronic device 100 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device 100 through reverse movement to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.
[0188] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude using the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
[0189] The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can use the magnetic sensor 180D to detect the opening and closing of the flip case. In some embodiments, when the electronic device 100 is a flip phone, the electronic device 100 can detect the opening and closing of the flip cover based on the magnetic sensor 180D. Based on the detected opening and closing status of the case or flip cover, features such as automatic unlocking of the flip cover can be configured.
[0190] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.
[0191] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance using infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure distance to achieve fast focusing.
[0192] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector, such as a photodiode. The light emitting diode may be an infrared light emitting diode. The electronic device 100 emits infrared light outward through the light emitting diode. The electronic device 100 uses a photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100. When insufficient reflected light is detected, the electronic device 100 can determine that there is no object near the electronic device 100. The electronic device 100 can use the proximity light sensor 180G to detect that the user is holding the electronic device 100 close to the ear to talk, so as to automatically turn off the screen to save power. The proximity light sensor 180G can also be used in leather case mode and pocket mode to automatically unlock and lock the screen.
[0193] Ambient light sensor 180L is used to sense ambient light brightness. Electronic device 100 can adaptively adjust the brightness of display screen 194 based on the perceived ambient light. Ambient light sensor 180L can also be used to automatically adjust white balance when taking photos. Ambient light sensor 180L can also work with proximity light sensor 180G to detect whether electronic device 100 is in a pocket to prevent accidental touches.
[0194] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.
[0195] The temperature sensor 180J is used to detect temperature. In some embodiments, the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to prevent the electronic device 100 from shutting down abnormally due to low temperature. In other embodiments, when the temperature is lower than another threshold, the electronic device 100 boosts the output voltage of the battery 142 to prevent abnormal shutdown due to low temperature.
[0196] The touch sensor 180K is also called a "touch panel." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, in a location different from that of the display screen 194.
[0197] The bone conduction sensor 180M can obtain vibration signals. In some embodiments, the bone conduction sensor 180M can obtain vibration signals from the vibrating bones of the human body. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure pulse signals. In some embodiments, the bone conduction sensor 180M can also be set in headphones to form bone conduction headphones. The audio module 170 can parse out voice signals based on the vibration signals of the vibrating bones of the human body obtained by the bone conduction sensor 180M to implement voice functions. The application processor can parse heart rate information based on the blood pressure pulse signals obtained by the bone conduction sensor 180M to implement heart rate detection functions.
[0198] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0199] Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 194, motor 191 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
[0200] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0201] The SIM card interface 195 is used to connect a SIM card.
[0202] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0203] FIG7 is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.
[0204] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other via software interfaces. In some embodiments, these layers, from top to bottom, are the application layer, the hardware abstraction layer (HAL), the driver layer, and the hardware layer.
[0205] The application layer can include a series of application packages.
[0206] As shown in FIG7 , the application package may include a camera application, and the camera application includes a running memory. After the camera application is running, the electronic device 100 may allocate a running memory for the camera application. After the camera application is closed, the running memory of the camera application is also cleared.
[0207] In some embodiments, after the camera application is running, the running memory of the camera application can be used to store the first configuration file. After the camera application is closed, the first configuration file stored in the running memory of the camera application will also be cleared.
[0208] In some embodiments, an application framework layer may be included between the application layer and the HAL layer. The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. For example, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. The window manager manages window programs. It can obtain the display screen size, determine whether a status bar is present, lock the screen, and take screenshots. The content provider stores and retrieves data and makes it accessible to applications. This data may include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and a phone book. The view system includes visual controls, such as controls for displaying text and images. The view system can be used to build applications. A display interface may consist of one or more views. For example, a display interface including a text notification icon may include a view for displaying text and a view for displaying images. The telephony manager provides communication functions for electronic device 100, such as managing call status (including connected and ended calls). The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the status bar at the top of the system in the form of an icon or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, it can prompt a text message in the status bar, emit a prompt sound, vibrate the electronic device, flash the indicator light, etc.
[0209] In some embodiments, a system runtime layer may be included between the application framework layer and the HAL layer. The system runtime layer may include multiple functional modules. For example: a surface manager, a media library, a three-dimensional graphics processing library (for example: OpenGL ES), a 2D graphics engine (for example: SGL), etc. The surface manager is used to manage the display subsystem and provides fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.
[0210] The hardware abstraction HAL layer is an interface layer located between the application framework layer and the kernel layer, providing a virtual hardware platform for the operating system.
[0211] The hardware abstraction layer (HAL) can be used to receive a configuration file acquisition request from the camera application and send the configuration file acquisition request to the disk driver, so that the disk driver can control the disk to obtain the first configuration file and send the first configuration file to the camera application through the HAL layer. The camera application stores the first configuration file in the camera application's running memory. The camera application can determine the initial preview resolution and initial shooting resolution from the first configuration file based on the initial shooting parameters and send them to the camera driver through the HAL layer. The camera driver can then control the camera module to capture preview images at the initial preview resolution and, upon detecting user shutter operation, capture and record images or videos at the initial shooting resolution.
[0212] The driver layer is the layer between hardware and software. It includes drivers for various hardware components. The driver layer can include camera drivers, disk drivers, and more. The camera driver is used to drive the image sensors (e.g., image sensor 1, image sensor 2, etc.) of one or more cameras in the camera module to capture images and to drive the image signal processor to pre-process the images. The disk driver is used to drive the disk to retrieve the first configuration file, the initial preview resolution, and the initial capture resolution.
[0213] The hardware layer may include a camera module, a disk, and the like. The camera module may include one or more camera image sensors (e.g., image sensor 1, image sensor 2, etc.). Optionally, the camera module may also include a time of flight (TOF) sensor, a multispectral sensor, and the like. The disk may include a file system of a camera application, wherein the file system of the camera application stores a first configuration file.
[0214] Next, in combination with the interactions between the above layers, how the electronic device 100 configures the image resolution for the camera application is described.
[0215] First, let's introduce how to configure the initial preview resolution and initial shooting resolution for the camera app when it is first opened.
[0216] 1. The camera application obtains a first configuration file acquisition request and sends the first configuration file acquisition request to the HAL layer.
[0217] In some embodiments, the camera application may also send a first configuration file acquisition request to the HAL layer through the application architecture layer and the system runtime library layer.
[0218] 2. The HAL layer sends a first configuration file acquisition request to the disk driver.
[0219] 3. The disk driver sends a first configuration file acquisition request to the disk.
[0220] After receiving the first configuration file acquisition request from the camera application, the HAL layer sends the first configuration file acquisition request to the disk driver, which then sends the first configuration file acquisition request to the disk. In response to receiving the first configuration file acquisition request from the disk driver, the disk can obtain the first configuration file from the camera application's file system.
[0221] 4. The disk sends the first configuration file to the disk drive.
[0222] 5. The disk driver sends the first configuration file to the HAL layer.
[0223] 6. The HAL layer sends the first configuration file to the camera application.
[0224] After the disk obtains the first configuration file, the disk may send the first configuration file to the disk driver. The disk driver then sends the first configuration file to the HAL layer. The HAL layer then sends the first configuration file to the camera application.
[0225] 7. The camera application saves the first configuration file in the running memory.
[0226] After receiving the first configuration file sent by the HAL layer, the camera application may store the first configuration file in the running memory of the camera application.
[0227] 8. The camera application obtains the initial preview resolution and the initial shooting resolution from the first configuration file based on the initial shooting parameters.
[0228] The initial shooting parameters are obtained when the camera application is first launched. For example, the user operation for launching the camera application can be an input operation on the camera application icon shown in FIG8A , such as a single click. In response to the input operation on the camera application icon, the camera application can obtain the initial shooting parameters and initial shooting resolution.
[0229] 9. The camera application sends the initial preview resolution to the HAL layer.
[0230] 10. The HAL layer sends the initial preview resolution to the camera driver.
[0231] 11. The camera driver sends the initial preview resolution to the camera module.
[0232] After obtaining the initial shooting parameters and initial shooting resolution, the camera application can send the initial preview resolution to the HAL layer. The HAL layer then sends the initial preview resolution to the camera driver, and the camera driver sends the initial preview resolution to the camera module.
[0233] After receiving the initial preview resolution, the camera module can capture images based on the initial preview resolution and display the images captured by the camera module at the initial preview resolution in the preview window of the camera application.
[0234] In some embodiments, the camera application can receive a user's shutter button operation and save an image or video. In response to the user's shutter button operation, the camera application can send the initial shooting resolution acquired in advance to the HAL layer. The HAL layer then sends the initial shooting resolution to the camera driver, which then sends the initial shooting resolution to the camera module. After receiving the initial shooting resolution, the camera module can capture an image or video based on the initial shooting resolution and save the image or video captured by the camera module at the initial shooting resolution in the gallery.
[0235] In some embodiments, the camera application may receive a user change in a shooting parameter of the camera application. In response to obtaining the updated shooting parameter, the camera application needs to obtain an updated preview resolution and an updated shooting resolution.
[0236] Next, we'll describe how to configure the camera app to update the preview resolution and capture resolution when the user changes the camera app's capture parameters.
[0237] 12. The camera application receives the user's first operation to change the shooting parameters and obtains the updated shooting parameters.
[0238] 13. The camera application obtains the first configuration file from the running memory of the camera application.
[0239] 14. The camera application obtains the updated preview resolution and updated shooting resolution from the running memory based on the updated shooting parameters.
[0240] In response to obtaining the updated shooting parameters, the camera application can obtain the first configuration file from the camera application's running memory. Since the camera application is already running, the first configuration file is stored in the camera application's running memory. There is no need to obtain the first configuration file from the camera application's file system. The camera application can directly obtain the first configuration file from the camera application's running memory, saving the camera application time in obtaining the first configuration file.
[0241] After acquiring the updated shooting parameters, the camera application may determine an updated preview resolution and an updated shooting resolution from the first configuration file based on the updated shooting parameters.
[0242] 15. The camera application sends the updated preview resolution to the HAL layer.
[0243] 16. The HAL layer sends the updated preview resolution to the camera driver.
[0244] 17. The camera driver sends the updated preview resolution to the camera module.
[0245] After the camera application determines the updated preview resolution, the camera application can send the updated preview resolution to the HAL layer, and the HAL layer sends the updated preview resolution to the camera driver, and the camera driver sends the updated preview resolution to the camera module.
[0246] After receiving the updated preview resolution, the camera module can capture an image based on the updated preview resolution and display the image captured by the camera module at the updated preview resolution in the preview window of the camera application.
[0247] In some embodiments, the electronic device can receive a user operation on the shutter key to save an image or video. In response to the user operation on the shutter key, the camera application can send the updated shooting resolution obtained in advance to the HAL layer, which in turn sends the updated shooting resolution to the camera driver, which in turn sends the updated shooting resolution to the camera module.
[0248] After receiving the updated shooting resolution, the camera module can capture images or videos based on the updated shooting resolution and save the images or videos captured by the camera module at the updated shooting resolution in the gallery. This can speed up the camera application's response to the user's shooting action.
[0249] First, a resolution configuration scenario provided by this application is introduced.
[0250] 1. Start the camera application, and the electronic device 100 configures the image resolution for the camera application based on the initial shooting parameters.
[0251] In some embodiments, after the electronic device 100 starts the camera application based on a user operation, the camera application enters the photo taking mode by default.
[0252] 8A-8B are schematic diagrams showing the electronic device 100 opening a camera application.
[0253] As shown in Figure 8A, the electronic device 100 can display a desktop, in which a page with application icons is displayed, and the page includes multiple application icons (for example, a settings application icon, an application market application icon, a gallery application icon, a browser application icon, etc.). A page indicator is also displayed below the multiple application icons to indicate the positional relationship between the currently displayed page and other pages. A tray area is displayed below the page indicator. Among them, the tray area includes multiple tray icons, for example, a camera application icon, an address book application icon, a phone application icon, and a message application icon. The tray area remains displayed when the page switches. In some embodiments, the above-mentioned page may also include multiple application icons and a page indicator. The page indicator may not be part of the page and may exist separately. The above-mentioned tray icon is also optional, and the embodiments of the present application are not limited to this.
[0254] The electronic device 100 may receive user input (e.g., a single click) on the camera application icon. In response to the input operation, the electronic device 100 may display a user interface as shown in FIG8B . FIG8B is a user interface for a capture and display service provided by the electronic device 100 according to an embodiment of the present application, which may also be referred to as a preview interface.
[0255] As shown in FIG. 8B , the preview interface may include a mode bar 501 , a shooting control 502 , a preview window 503 , a review control 504 , a quick function area 505 , and a focus adjustment option 506 .
[0256] The mode bar 501 may include multiple shooting mode options, such as "slow motion", "delayed photography", "portrait", "photo", "video", "night scene", "panorama", etc. Different shooting modes can provide users with shooting services with different effects. Users can select any shooting mode from multiple shooting modes to shoot according to different needs. For example, "photo" may be the default shooting mode for taking photos. "Video" is used to record videos. The "night scene" mode is suitable for shooting scenes with dim light, such as at night. The "portrait" mode is suitable for shooting scenes where the subject is a person. The electronic device 100 can also provide more shooting modes, such as "large aperture", "movie", "professional", etc., which are not listed here one by one.
[0257] The electronic device 100 can detect user operations on the shooting mode options in the mode bar 501 and change the currently used shooting mode according to the above user operations. The above user operations are, for example, left / right swipe operations. For example, when it is detected that the mode bar 5011 is dragged and slid to the left (left swipe operation) and the float stops at the "Portrait" option, the electronic device 100 can switch to the "Portrait" mode. By default, the electronic device 100 first uses the "Photograph" mode.
[0258] The capture control 502 is used to trigger a photo. The electronic device 100 can detect whether a user action, such as a click, is applied to the capture control 502. Upon detecting a user action on the capture control 502, the electronic device 100 can generate a capture instruction. Based on the capture instruction, the electronic device 100 can retrieve the image reported by the camera at the corresponding timestamp and save it as a photo.
[0259] The preview window 503 can be used to display the image reported by the camera in real time. In different shooting modes, the electronic device 100 can process the image reported by the camera to improve the image display effect. For example, in "Portrait" mode, the electronic device 100 can blur the background of the image reported by the camera to highlight the portrait. Here, the preview window 503 can display the image processed by the image processing algorithm corresponding to each shooting mode in real time, so that the user can perceive the shooting effect corresponding to each shooting mode in real time.
[0260] The review control 504 can be used to browse thumbnails of photos / videos that have been taken. When a user operation acting on the review control 504 is detected, the electronic device 100 can also display the best photo corresponding to the thumbnail.
[0261] The quick function area 505 may include a control 505A for the protagonist recording mode, an AI scene recognition control 505B, a flash control 505C, a color mode control 505D, a setting control 505E, and the like. The control 505A for the protagonist recording mode can be used to trigger the electronic device 100 to identify the protagonist among multiple characters in the preview screen when it is turned on. The AI scene recognition control 505B can be used to trigger the electronic device 100 to identify the shooting scene in the preview screen when it is turned on. The current AI scene recognition control 505B is in the off state. The flash control 505C can be used to trigger the electronic device 100 to turn on or off the flash. The color mode control 505D can be used to trigger the electronic device 100 to use a color filter to process the image captured by the camera. The setting control 505E can be used to set the shooting parameters of the electronic device 100 (for example, image size, image storage format, etc.), etc.
[0262] Focus adjustment options 506 show multiple zoom ratio options, such as a 0.5x zoom ratio option, a 1x zoom ratio option, a 2.5x zoom ratio option, and a 10x zoom ratio option. The current zoom ratio is 1x. Preview window 503 displays an image frame captured by electronic device 100 at a zoom ratio of 1x.
[0263] Exemplarily, the resolution of the image shown in FIG8B is 4:3.
[0264] In some implementations, after the electronic device 100 responds to the user's input to the camera application icon, before the electronic device 100 displays the preview interface shown in Figure 8B, the electronic device 100 can obtain the preview resolution in the preview mode, and the image displayed in the preview window 503 in Figure 8B is the image captured by the electronic device 100 at the preview resolution.
[0265] In some embodiments, after the electronic device 100 responds to the user's input to the camera application icon, the electronic device 100 can obtain shooting parameters and, based on the shooting parameters, obtain the shooting resolution in normal shooting mode. In this way, when a user operation acting on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the shooting resolution obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0266] Optionally, the preview resolution is lower than the shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0267] Optionally, the preview resolution may be the same as the shooting resolution, which is not limited in this application.
[0268] In some embodiments, after the electronic device 100 detects a user operation (such as a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can capture an image at a pre-configured shooting resolution and save the image in a gallery.
[0269] FIG9 is a schematic flow chart showing a method for the electronic device 100 to configure the image resolution for the camera application after the camera application is started.
[0270] This method can be implemented through the interaction and collaboration between the application layer (such as the camera application), the hardware abstraction layer (HAL), the driver layer, and the hardware layer within the electronic device. The application layer primarily involves the camera application. The driver layer primarily involves the camera driver and disk driver. The hardware layer primarily involves the camera module and disk.
[0271] S901: The camera application receives a user operation to start the camera application.
[0272] Exemplarily, the user operation of opening the camera application may be an input acting on the camera application icon as shown in FIG8A , such as a single click.
[0273] S902: In response to a user operation of starting a camera application, the camera application sends a first configuration file acquisition request to the HAL layer.
[0274] S903: The HAL layer sends a first configuration file acquisition request to the disk driver.
[0275] S904: The disk driver sends a first configuration file acquisition request to the disk.
[0276] In response to a user operation of starting a camera application, the electronic device 100 may obtain a first configuration file obtaining request.
[0277] In response to receiving the first profile acquisition request, the camera application may send the first profile acquisition request to the HAL layer, which then sends the first profile acquisition request to the disk driver, which then sends the first profile acquisition request to the disk.
[0278] S905: The disk obtains the first configuration file based on the first configuration file obtaining request.
[0279] In response to receiving the first configuration file sent by the disk drive, the disk may obtain the first configuration file from the file system of the camera application.
[0280] S906: The disk sends the first configuration file to the disk drive.
[0281] S907: The disk driver sends the first configuration file to the HAL layer.
[0282] S908 : The HAL layer sends the first configuration file to the camera application.
[0283] After the disk obtains the first configuration file, the disk may send the first configuration file to the disk driver, the disk driver then sends the first configuration file to the HAL layer, and the HAL layer then sends the first configuration file to the camera application.
[0284] Next, the composition of the first configuration file is introduced.
[0285] The first configuration file records the correspondence between multiple different shooting parameters and image resolutions.
[0286] In some embodiments, the file format of the first configuration file may be a JSON file format, and the first configuration file may store shooting parameters and image resolution in a key-value format, where the key may refer to the shooting parameters of the camera application, and the value may refer to the image resolution of the camera application.
[0287] The shooting parameters may include but are not limited to any one or more of the following: shooting status, shooting mode, device display status, camera type, image ratio, etc.
[0288] The shooting state may include but is not limited to a preview state and a non-preview state. The preview state may refer to the state described by the camera application before the electronic device 100 receives the user's click on the shooting control 502, that is, before the electronic device 100 has taken a picture or a video, or the preview state may also refer to the state described by the camera application after the electronic device 100 receives the user's click on the shooting control 502 and the electronic device 100 has acquired the picture or video. The non-preview state is the opposite of the preview state, and the non-preview state may refer to the state described by the camera application when the electronic device 100 receives the user's click on the shooting control 502, that is, when the electronic device 100 starts taking a picture or starts shooting a video.
[0289] The shooting mode is a shooting mode that can be provided by the camera application, and the shooting mode can include a photo mode and a video recording mode.
[0290] The photo taking mode may include but is not limited to any one or more of the following: normal photo taking mode, portrait photo taking mode, high definition photo taking mode, night scene photo taking mode, panoramic photo taking mode, etc.
[0291] Optionally, when the camera application is opened for the first time, the default shooting mode of the camera application is the normal shooting mode, and the shooting mode shown in FIG8B is the normal shooting mode.
[0292] Optionally, the same photo mode can be divided into different shooting states. For example, the normal photo mode can be divided into a preview state and a non-preview state. The portrait photo mode can also be divided into a preview state and a non-preview state. The high-definition photo mode can also be divided into a preview state and a non-preview state. The night scene photo mode can also be divided into a preview state and a non-preview state. The panoramic photo mode can also be divided into a preview state and a non-preview state. Optionally, some photo modes may not distinguish between a non-preview state and a preview state, and this application does not limit this.
[0293] The recording mode may include but is not limited to any one or more of the following: normal recording mode, delayed recording mode, slow motion recording mode, etc.
[0294] Optionally, the same recording mode can be divided into different shooting states. For example, the normal recording mode can be divided into a preview state and a non-preview state. The delayed recording mode can also be divided into a preview state and a non-preview state. The slow-motion recording mode can also be divided into a preview state and a non-preview state. Optionally, the recording mode can also not distinguish between a non-preview state and a preview state, and this application does not limit this.
[0295] The device display screen state may be for a folding screen or an extended screen, and the device display screen state may include a folded state or an unfolded state. In some embodiments, if the display screen of the electronic device 100 is a straight screen, the shooting parameters may not include the device display screen state.
[0296] The camera type may include a front camera and a rear camera. The front camera or the rear camera may also include one or more cameras. For example, the rear camera may include three cameras, such as a main camera, a wide-angle camera, and a telephoto camera. The front camera may include one main camera. In other embodiments, the front camera may also include multiple cameras, such as a front camera may also include a wide-angle camera, etc., which is not limited in this application.
[0297] In some embodiments, the camera application can determine the camera type from multiple rear cameras or from multiple front cameras based on the current zoom factor.
[0298] For example, when the rear cameras include a main camera, a wide-angle camera, and a telephoto camera, the three rear cameras support different zoom ratios. For example, the main camera supports a zoom ratio between Ax and Bx, the telephoto camera supports a zoom ratio greater than Bx, and the wide-angle camera supports a zoom ratio less than Ax. Bx is greater than Ax. The camera currently being used by the camera application can be determined based on the current zoom ratio of the camera application.
[0299] For example, A can be 1 and B can be 5. The main camera supports a zoom ratio between 1x and 5x, the telephoto camera supports a zoom ratio greater than 5x, and the wide-angle camera supports a zoom ratio less than 1x. When the camera application currently selects a zoom ratio of 1x, it can be determined that the camera application is using the main camera. When the camera application currently selects a zoom ratio of 10x, it can be determined that the camera application is using the telephoto camera.
[0300] The camera application is not limited to determining the camera type based on the zoom ratio. The camera application can also determine the camera type based on other information, which is not limited in this application.
[0301] The image ratio can be associated with the shooting mode, and different shooting modes can support different image ratios. For example, the normal photo mode can provide a 1:1 image ratio, a 4:3 image ratio, and a 16:9 image ratio. The normal video recording mode may only provide a 16:9 image ratio. The image ratios supported by different shooting modes may be related to the device manufacturer and may be preset before the device leaves the factory. This application only uses the above numerical values as an example to illustrate this application.
[0302] In some embodiments, the shooting parameters may also include other information, which is not limited in this application.
[0303] In order to facilitate understanding of the composition structure of the configuration file, this application takes the normal photo mode and the normal video mode as examples to illustrate the composition structure of the configuration file.
[0304] FIG10 is a schematic diagram showing a configuration file corresponding to the normal photographing mode.
[0305] As shown in FIG10 , the normal photo taking mode can be divided into two major branches, namely a preview state and a non-preview state.
[0306] Optionally, the image resolution in the preview mode and the non-preview mode of the normal camera mode may be different.
[0307] For example, when the camera application is in normal shooting mode, before starting to shoot a picture, the normal shooting mode is in preview mode, and the camera application can obtain the preview resolution in the preview state. The image displayed in the preview window 503 in Figure 8B is the image captured by the electronic device 100 at the preview resolution. After starting to shoot a picture, the electronic device 100 can obtain the shooting resolution in non-preview mode.
[0308] In some embodiments, the preview resolution in the preview state may be lower than the shooting resolution in the non-preview mode. The electronic device 100 may capture images and display preview images at a lower resolution to save power consumption of the electronic device 100.
[0309] As shown in Figure 10, the normal photo mode can be divided into two major branches: preview state and non-preview state. In the camera application preview state or non-preview state, the image resolution can be determined based on the device display state, camera type and currently selected image ratio.
[0310] It should be noted that when the display screen of the electronic device 100 is a straight screen rather than a folding screen or an extended screen, the configuration file corresponding to the normal photo mode shown in Figure 10 may not be divided into unfolded and folded states.
[0311] In some embodiments, when the camera application is in normal photo taking mode and in a non-preview state, the electronic device 100 may determine the preview resolution based on the device display screen state, camera type, and image ratio.
[0312] For example, after the electronic device 100 responds to the user input on the camera application icon, before the electronic device 100 receives the user operation on the shooting control 502, the camera application is in the normal shooting mode and in the non-preview state. The electronic device 100 can obtain the current shooting parameters.
[0313] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear main camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1920x1920.
[0314] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear main camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 1440x1920.
[0315] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear main camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 1080×1920.
[0316] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear telephoto camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1660×1660.
[0317] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear telephoto camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 1200×1600.
[0318] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear telephoto camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 900×1600.
[0319] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear wide-angle camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1200×1200.
[0320] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear wide-angle camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 960×1280.
[0321] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, rear wide-angle camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 720×1280.
[0322] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, front camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1280×1280.
[0323] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, front camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 960×1280.
[0324] For example, when the shooting parameters include normal shooting mode, non-preview state, folded state, front camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 900:1600.
[0325] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear main camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1920x1920.
[0326] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear main camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1920x1680.
[0327] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear telephoto camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1660×1660.
[0328] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear telephoto camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1660×1453.
[0329] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear wide-angle camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1200×1200.
[0330] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, rear wide-angle camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1920x1050.
[0331] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, front camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1280×1280.
[0332] For example, when the shooting parameters include normal shooting mode, non-preview state, unfolded state, front camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1920x1120.
[0333] In other embodiments, when the camera application is in normal photo taking mode and in preview state, the electronic device 100 may also determine the shooting resolution based on the device display screen state, camera type and picture ratio.
[0334] For example, after the electronic device 100 responds to the user input on the camera application icon, before the electronic device 100 receives the user operation on the shooting control 502, the camera application is in the normal shooting mode and in the preview state. The electronic device 100 can obtain the current shooting parameters.
[0335] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear main camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1280x1280.
[0336] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear main camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 960x1280.
[0337] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear main camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 720×1280.
[0338] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear telephoto camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1107×1107.
[0339] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear telephoto camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 800×1067.
[0340] For example, when the shooting parameters include normal photo mode, preview state, folded state, rear telephoto camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 600×1067.
[0341] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear wide-angle camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 800×800.
[0342] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear wide-angle camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 640×853.
[0343] For example, when the shooting parameters include normal shooting mode, preview state, folded state, rear wide-angle camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 480×853.
[0344] For example, when the shooting parameters include normal shooting mode, preview state, folded state, front camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 853×853.
[0345] For example, when the shooting parameters include normal shooting mode, preview state, folded state, front camera, and image ratio of 4:3, the electronic device 100 can determine that the image resolution is 640×853.
[0346] For example, when the shooting parameters include normal shooting mode, preview state, folded state, front camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 600x1067.
[0347] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear main camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1280x1280.
[0348] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear main camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1280x1120.
[0349] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear telephoto camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 1107×1107.
[0350] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear telephoto camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1107×969.
[0351] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear wide-angle camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 800×800.
[0352] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, rear wide-angle camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1280x700.
[0353] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, front camera, and image ratio of 1:1, the electronic device 100 can determine that the image resolution is 853×853.
[0354] For example, when the shooting parameters include normal shooting mode, preview state, unfolded state, front camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1280x747.
[0355] It should be noted that the image resolution shown in Figure 10 is only used to explain this application and can also be other values, which are not limited in this application.
[0356] In some embodiments, the configuration files corresponding to other photographing modes may be the same as the configuration file corresponding to the normal photographing mode. In this case, only the configuration file corresponding to the normal photographing mode is retained in the first configuration file, and other photographing modes and the normal photographing mode can share the configuration file corresponding to the normal photographing mode.
[0357] For example, the other photo mode may be a portrait photo mode, as shown in FIG11 , where the root nodes are the portrait photo mode and the normal photo mode, and the portrait photo mode and the normal photo mode may share a configuration file. This can reduce the data volume of the first configuration file.
[0358] For the introduction of the configuration file shown in FIG11 , please refer to the introduction in the embodiment of FIG10 , and this application will not go into details here.
[0359] FIG12 is a schematic diagram showing a configuration file corresponding to the normal recording mode.
[0360] Optionally, in video recording mode, if the image clarity is high, the video recording mode may only support the rear main camera for recording. In other embodiments, the video recording mode may also support other cameras, such as a wide-angle camera and a telephoto camera, etc., and this application does not limit this.
[0361] As shown in FIG12 , the normal recording mode can be divided into two major branches, namely a preview state and a non-preview state.
[0362] Optionally, the image resolutions of the normal recording mode in the preview mode and the non-preview mode may be different.
[0363] For example, when the camera application is in normal recording mode, before starting recording, the normal recording mode is in preview state, and the camera application can obtain the preview resolution in the preview state. After starting recording, the electronic device 100 can obtain the shooting resolution in non-preview mode.
[0364] In some embodiments, the preview resolution in the preview state may be lower than the shooting resolution in the non-preview mode. The electronic device 100 may capture images and display preview images at a lower resolution to save power consumption of the electronic device 100.
[0365] As shown in Figure 12, the normal recording mode can be divided into two branches: preview state and non-preview state. In the camera application preview state or non-preview state, the image resolution can be determined based on the device display state, camera type and currently selected image ratio.
[0366] It should be noted that when the display screen of the electronic device 100 is a straight screen rather than a folding screen or an extended screen, the configuration file corresponding to the normal recording mode shown in Figure 11 may not be divided into unfolded and folded states.
[0367] In some embodiments, when the camera application is in normal recording mode and in a non-preview state, the electronic device 100 can determine the preview resolution based on the device display screen state, camera type, and image ratio.
[0368] For example, after the electronic device 100 responds to the user's single-click operation on the "Record" option in the mode bar 501, the camera application is in the normal recording mode and in the non-preview state. The electronic device 100 can obtain the current shooting parameters.
[0369] For example, when the shooting parameters include normal video recording mode, non-preview state, folded state, rear main camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 1215x2160.
[0370] For example, when the shooting parameters include normal video recording mode, non-preview state, folded state, rear main camera, and image ratio of 21:9, the electronic device 100 can determine that the image resolution is 857x2000.
[0371] For example, when the shooting parameters include normal video recording mode, non-preview state, folded state, front camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 1114x1980.
[0372] For example, when the shooting parameters include normal video recording mode, non-preview state, folded state, front camera, and image ratio of 21:9, the electronic device 100 can determine that the image resolution is 771x1800.
[0373] For example, when the shooting parameters include normal video recording mode, non-preview state, unfolded state, rear main camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1662x1900.
[0374] For example, when the shooting parameters include normal video recording mode, non-preview state, unfolded state, front camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1488x1700.
[0375] For example, when the shooting parameters include normal video recording mode, preview state, folded state, rear main camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 810x1440.
[0376] For example, when the shooting parameters include normal video recording mode, preview state, folded state, rear main camera, and image ratio of 21:9, the electronic device 100 can determine that the image resolution is 571x1333.
[0377] For example, when the shooting parameters include normal video recording mode, preview state, folded state, front camera, and image ratio of 16:9, the electronic device 100 can determine that the image resolution is 743x1320.
[0378] For example, when the shooting parameters include normal video recording mode, preview state, folded state, front camera, and image ratio of 21:9, the electronic device 100 can determine that the image resolution is 514x1200.
[0379] For example, when the shooting parameters include normal video recording mode, preview state, unfolded state, rear main camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 1108x1267.
[0380] For example, when the shooting parameters include normal video recording mode, preview state, unfolded state, front camera, and image ratio of 8:7, the electronic device 100 can determine that the image resolution is 992x1133.
[0381] In some embodiments, the configuration files corresponding to other recording modes may be the same as the configuration file corresponding to the normal recording mode. In this case, only the configuration file corresponding to the normal recording mode is retained in the first configuration file, and other recording modes and the normal recording mode can share the configuration file corresponding to the normal recording mode.
[0382] For example, the other recording mode may be a delayed recording mode, as shown in FIG13 , where the root nodes are the delayed recording mode and the normal recording mode, and the delayed recording mode and the normal recording mode may share a configuration file, thereby reducing the data volume of the first configuration file.
[0383] For the introduction of the configuration file shown in FIG13 , please refer to the introduction in the embodiment of FIG12 , and this application will not go into details here.
[0384] This application uses the normal photo mode and the normal video recording mode as examples to illustrate the composition structure of the configuration file. The composition structure of the configuration file of other shooting modes may be similar to that of the normal photo mode or the normal video recording mode, and this application will not go into details here.
[0385] Optionally, the configuration files corresponding to multiple shooting modes can be a complete file, for example, the configuration file of the normal photo mode and the configuration file of the normal video recording mode can be stored in one file, and the configuration file corresponding to each shooting mode can also be a separate file, for example, the configuration file of the normal photo mode and the configuration file of the normal video recording mode can be stored in two different files respectively.
[0386] Optionally, the composition structure of the configuration files in Figures 10-13 is only used to explain this application and does not constitute a limitation.
[0387] S909: The camera application stores the first configuration file in the running memory of the camera application.
[0388] After receiving the first configuration file sent by the HAL layer, the camera application may store the first configuration file in the running memory of the camera application.
[0389] Optionally, after the electronic device 100 closes the camera application process, the electronic device 100 clears the first configuration file stored in the camera application's running memory. After the camera application is reopened, the electronic device 100 reloads the first configuration file into the camera application's running memory.
[0390] In some embodiments, if the user operation of opening the camera application is to switch the camera application running in the background to the foreground, the first configuration file has been stored in the running memory of the camera application, and the camera application can directly obtain the first configuration file from the running memory of the camera application.
[0391] S910: The camera application obtains an initial preview resolution and an initial shooting resolution from a first configuration file based on initial shooting parameters.
[0392] The shooting parameters may include but are not limited to any one or more of the following: shooting status, shooting mode, device display status, camera type, image ratio, etc.
[0393] For example, if the user operation of opening the camera application is the first time the camera application is opened, after the electronic device 100 enters the camera application, the camera application may enter the normal shooting mode by default, and the electronic device 100 may display the user interface shown in Figure 8B. The electronic device 100 may obtain the initial shooting parameters corresponding to the normal shooting mode.
[0394] Exemplarily, the initial shooting parameters may include but are not limited to: normal photo mode, preview state, folded state, rear main camera and 4:3 picture ratio.
[0395] The shooting state in the initial shooting parameters for obtaining the initial preview resolution may be a preview state, and the shooting state in the initial shooting parameters for obtaining the preview resolution may be a non-preview state.
[0396] For how the electronic device 100 obtains the image resolution based on the shooting parameters, please refer to the description of the embodiment in FIG10 below, which will not be elaborated in this application.
[0397] The first configuration file includes image resolutions corresponding to multiple different shooting parameters. The first configuration file may be pre-installed in the file system of the camera application. For example, the first configuration file may be pre-installed in the file system of the camera application before the electronic device 100 leaves the factory. The first configuration file in the file system of the camera application may also be periodically / irregularly obtained and updated from a server by the electronic device 100.
[0398] In some embodiments, it is not necessary to first confirm the initial shooting resolution. The initial shooting resolution can be confirmed after the camera application receives the user's input operation on the shutter key. This application does not limit this.
[0399] Optionally, the preview resolution is lower than the shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0400] Optionally, the preview resolution may be the same as the shooting resolution, which is not limited in this application.
[0401] In this way, the camera application determines the initial shooting resolution in advance. When a user operation acting on the shooting control 502 is detected, the electronic device 100 can capture an image based on the initial shooting resolution acquired in advance to speed up the electronic device 100's response to the user's shooting action.
[0402] S911. The camera application sends the initial preview resolution to the HAL layer.
[0403] S912: The HAL layer sends the initial preview resolution to the camera driver.
[0404] S913: The camera driver sends the initial preview resolution to the camera module.
[0405] S914: The camera module captures images at an initial preview resolution.
[0406] After receiving the initial preview resolution, initial shooting resolution, and first configuration file sent by the HAL layer, the camera application can send the initial preview resolution to the HAL layer. The HAL layer then sends the initial preview resolution to the camera driver, and the camera driver sends the initial preview resolution to the camera module.
[0407] After receiving the initial preview resolution, the camera module can capture images based on the initial preview resolution and display the images captured by the camera module at the initial preview resolution in the preview window of the camera application.
[0408] S915: The camera application receives a user operation on the shutter key.
[0409] S916: The camera application sends the initial shooting resolution to the HAL layer.
[0410] S917: The HAL layer sends the initial shooting resolution to the camera driver.
[0411] S918: The camera driver sends the shooting preview resolution to the camera module.
[0412] S919: The camera module captures an image or video at an initial shooting resolution and saves the image or video.
[0413] In some embodiments, the electronic device 100 may receive a user operation on a shutter key and save a picture or video.
[0414] For example, the user operation on the shutter key may be an input operation on the shooting control 502 in FIG. 8B , such as a single click.
[0415] In response to a user operation on the shutter key, the camera application may send the initial shooting resolution acquired in advance to the HAL layer, which then sends the initial shooting resolution to the camera driver, which then sends the initial shooting resolution to the camera module.
[0416] After receiving the initial shooting resolution, the camera module may capture images or videos based on the initial shooting resolution, and save the images or videos captured by the camera module at the initial shooting resolution in a gallery.
[0417] In some embodiments, S914-S918 may not be executed, and this application does not limit this.
[0418] 2. The electronic device 100 changes the shooting parameters of the camera application based on the user operation, and the electronic device 100 needs to obtain the updated preview resolution.
[0419] In some embodiments, the electronic device 100 may change the shooting parameters of the camera application. After the electronic device 100 changes the shooting parameters of the camera application, the electronic device 100 needs to obtain an updated preview resolution.
[0420] Optionally, the updated preview resolution and the initial preview resolution may be the same or different.
[0421] As can be seen from the above description, the shooting parameters may include, but are not limited to, any one or more of the following: shooting status, shooting mode, device display status, camera type, image ratio, etc. The user can change the shooting mode, change the device display status, change the camera type, or change the image ratio to obtain updated shooting parameters, so that the electronic device 100 can obtain an updated preview resolution based on the updated shooting parameters.
[0422] Next, we will introduce several ways to change the shooting parameters of the camera application.
[0423] Method 1: Change the shooting mode to change the shooting parameters of the camera application.
[0424] In the case where the electronic device 100 changes the photographing mode based on a user operation, the electronic device 100 may change a photographing parameter of a camera application.
[0425] For example, the user operation may switch the normal photographing mode to the normal video recording mode. In response to the camera application switching to the normal video recording mode, the electronic device 100 may obtain the shooting parameters of the normal video recording mode.
[0426] The shooting parameters of the normal video recording mode may be different from or the same as those of the normal photo taking mode.
[0427] After obtaining the shooting parameters of the normal recording mode, the electronic device 100 can obtain an updated preview resolution from the configuration file corresponding to the normal recording mode based on the shooting parameters of the normal recording mode. The updated preview resolution can be the preview resolution corresponding to the normal recording mode.
[0428] Exemplarily, the shooting parameters of the normal recording mode include, but are not limited to, normal recording mode, preview state, folded state, rear main camera, and a 16:9 image ratio. Based on the shooting parameters, an updated preview resolution corresponding to the normal recording mode is obtained from the first configuration file. Exemplarily, the updated preview resolution may be 810x1440. For information on how the electronic device 100 obtains the updated preview resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0429] After acquiring the updated preview resolution, the electronic device 100 may capture an image based on the updated preview resolution and display a preview image frame.
[0430] In some embodiments, the electronic device 100 also needs to obtain the updated shooting resolution corresponding to the normal recording mode. In this way, when a user operation on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution corresponding to the normal recording mode obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0431] For example, the electronic device 100 can obtain shooting parameters for obtaining an updated shooting resolution, including but not limited to: normal recording mode, non-preview state, folded state, rear main camera, and 16:9 image ratio. Based on the shooting parameters, the shooting resolution corresponding to the normal recording mode is obtained from the first configuration file. For example, the updated preview resolution can be 1215x2160. For how the electronic device 100 obtains the shooting resolution based on the shooting parameters, please refer to the description of the embodiment of Figure 10.
[0432] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0433] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0434] In other embodiments, the electronic device 100 may also determine the updated shooting resolution corresponding to the normal video recording mode after detecting the user operation on the shooting control 502, and this application does not limit this.
[0435] In some embodiments, after the electronic device 100 detects a user operation (e.g., a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can record the video at an updated shooting resolution corresponding to the pre-configured normal recording mode, and save the captured video file in the gallery. This can speed up the electronic device 100's response to the user's shooting action. After the electronic device 100 receives the user operation on the shooting control 502 again, the camera application stops recording, and the electronic device 100 continues to capture and display preview image frames at the updated preview resolution corresponding to the normal recording mode.
[0436] Method 2: Change the shooting parameters of the camera application without changing the shooting mode.
[0437] In some embodiments, the electronic device 100 may change the shooting parameters of the camera application without changing the shooting mode.
[0438] For example, in the same shooting mode, the electronic device 100 can change the electronic device display screen state and / or change the camera type and / or change the image ratio based on user operations, and can change the shooting parameters of the camera application to obtain an updated preview resolution.
[0439] This application is explained by taking the example of changing other shooting parameters corresponding to the normal shooting mode without changing the normal shooting mode.
[0440] Without changing the normal photographing mode, changing other photographing parameters corresponding to the normal photographing mode may include but is not limited to the following methods.
[0441] Method 1: Change the display status of the electronic device to obtain the updated preview resolution.
[0442] When the electronic device display screen is a foldable screen or an expandable screen, the user can change the state of the electronic device display screen, for example, switching the electronic device display screen from a folded state to an unfolded state, or switching the electronic device display screen from an unfolded state to a folded state.
[0443] For example, in the normal photographing mode, the electronic device 100 may switch the state of the electronic device display screen from the folded state to the unfolded state based on a user operation.
[0444] In response to the electronic device display screen state being switched from the folded state to the unfolded state, the electronic device 100 may obtain updated shooting parameters of the normal shooting mode.
[0445] The updated shooting parameters of the normal shooting mode may be different from or the same as the shooting parameters of the normal shooting mode.
[0446] After obtaining the updated shooting parameters of the normal shooting mode, the electronic device 100 can obtain the updated preview resolution from the configuration file corresponding to the normal shooting mode based on the updated shooting parameters of the normal shooting mode. The updated preview resolution can be the updated preview resolution corresponding to the normal shooting mode.
[0447] Exemplarily, the updated shooting parameters for the normal photo mode include, but are not limited to, normal photo mode, preview state, expanded state, rear main camera, and an 8:7 image ratio. Based on these shooting parameters, an updated preview resolution corresponding to the normal photo mode is obtained from the first configuration file. Exemplarily, this updated preview resolution may be 1280x1120. For information on how the electronic device 100 obtains the updated preview resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0448] After acquiring the updated preview resolution, the electronic device 100 may capture an image based on the updated preview resolution and display a preview image frame.
[0449] In some embodiments, the electronic device 100 also needs to obtain an updated shooting resolution corresponding to the normal shooting mode. In this way, when a user operation on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution corresponding to the normal shooting mode obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0450] For example, the electronic device 100 may obtain shooting parameters for obtaining an updated shooting resolution, including but not limited to: normal shooting mode, non-preview state, unfolded state, rear main camera, and 8:7 image ratio. Based on the shooting parameters, the electronic device 100 may obtain an updated shooting resolution corresponding to the normal shooting mode from the first configuration file. For example, the updated preview resolution may be 1920x1680. For information on how the electronic device 100 obtains an updated shooting resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0451] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0452] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0453] In other embodiments, the electronic device 100 may also determine the updated shooting resolution corresponding to the normal shooting mode after detecting the user operation acting on the shooting control 502. This application does not limit this.
[0454] In some embodiments, after the electronic device 100 detects a user operation (e.g., a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can take a picture at an updated shooting resolution corresponding to the pre-configured normal shooting mode and save the captured picture in the gallery. This can speed up the electronic device 100's response to the user's shooting action. After acquiring the picture, the camera application stops taking pictures and enters the preview state again. The electronic device 100 continues to capture and display the preview image frame at the updated preview resolution corresponding to the normal shooting mode.
[0455] Method 2: Change the camera type to update the preview resolution.
[0456] Based on the foregoing description, it can be seen that the electronic device 100 may include a front camera and a rear camera. The front camera may include one or more cameras, and the rear camera may also include one or more cameras. The electronic device 100 can switch between different rear cameras based on user operations to change the shooting parameters of the camera application. The electronic device 100 can also switch between the front and rear cameras based on user operations to change the shooting parameters of the camera application.
[0457] Method A: Switch from the main camera to the wide-angle camera to obtain an updated preview resolution.
[0458] The rear camera of the electronic device 100 may include one or more cameras, such as a main camera, a wide-angle camera, and a telephoto camera.
[0459] The electronic device 100 can switch between multiple rear cameras based on user operations. For example, the electronic device 100 receives a user operation to increase the zoom ratio of the camera application, and can switch from the main camera to the wide-angle camera to change the shooting parameters of the camera application, obtain updated shooting parameters, and obtain an updated preview resolution based on the updated shooting parameters.
[0460] The updated shooting parameters of the normal shooting mode may be different from or the same as the shooting parameters of the normal shooting mode.
[0461] After obtaining the updated shooting parameters of the normal shooting mode, the electronic device 100 can obtain the updated preview resolution from the configuration file corresponding to the normal shooting mode based on the updated shooting parameters of the normal shooting mode. The updated preview resolution can be the updated preview resolution corresponding to the normal shooting mode.
[0462] Exemplarily, the updated shooting parameters for the normal photo mode include, but are not limited to, normal photo mode, preview state, folded state, rear wide-angle camera, and a 4:3 image ratio. Based on the shooting parameters, the updated preview resolution corresponding to the normal photo mode is obtained from the first configuration file. Exemplarily, the updated preview resolution can be 640×853. For information on how the electronic device 100 obtains the updated preview resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0463] After acquiring the updated preview resolution, the electronic device 100 may capture an image based on the updated preview resolution and display a preview image frame.
[0464] In some embodiments, the electronic device 100 also needs to obtain an updated shooting resolution corresponding to the normal shooting mode. In this way, when a user operation on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution corresponding to the normal shooting mode obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0465] For example, the electronic device 100 can obtain shooting parameters for obtaining an updated shooting resolution, including but not limited to: normal shooting mode, non-preview state, folded state, rear wide-angle camera, and 4:3 image ratio. Based on the shooting parameters, the electronic device 100 can obtain an updated shooting resolution corresponding to the normal shooting mode from the first configuration file. For example, the updated preview resolution can be 960×1280. For how the electronic device 100 obtains the updated shooting resolution based on the shooting parameters, please refer to the description of the embodiment of Figure 10.
[0466] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0467] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0468] In other embodiments, the electronic device 100 may also determine the updated shooting resolution corresponding to the normal shooting mode after detecting the user operation acting on the shooting control 502. This application does not limit this.
[0469] In some embodiments, after the electronic device 100 detects a user operation (e.g., a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can take a picture at an updated shooting resolution corresponding to the pre-configured normal shooting mode and save the captured picture in the gallery. This can speed up the electronic device 100's response to the user's shooting action. After acquiring the picture, the camera application stops taking pictures and enters the preview state again. The electronic device 100 continues to capture and display the preview image frame at the updated preview resolution corresponding to the normal shooting mode.
[0470] Method B: Switch from the front camera to the rear camera to get the updated preview resolution.
[0471] In some embodiments, the electronic device 100 may switch from the front camera to the rear camera based on a user operation to change the shooting parameters of the camera application, obtain updated shooting parameters, and obtain an updated preview resolution based on the updated shooting parameters.
[0472] The updated shooting parameters of the normal shooting mode may be different from or the same as the shooting parameters of the normal shooting mode.
[0473] After obtaining the updated shooting parameters of the normal shooting mode, the electronic device 100 can obtain the updated preview resolution from the configuration file corresponding to the normal shooting mode based on the updated shooting parameters of the normal shooting mode. The updated preview resolution can be the updated preview resolution corresponding to the normal shooting mode.
[0474] Exemplarily, the updated shooting parameters for the normal photo mode include, but are not limited to, normal photo mode, preview state, folded state, front camera, and 4:3 image ratio. Based on the shooting parameters, the updated preview resolution corresponding to the normal photo mode is obtained from the first configuration file. Exemplarily, the updated preview resolution can be 640×853. For information on how the electronic device 100 obtains the updated preview resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0475] After acquiring the updated preview resolution, the electronic device 100 may capture an image based on the updated preview resolution and display a preview image frame.
[0476] In some embodiments, the electronic device 100 also needs to obtain an updated shooting resolution corresponding to the normal shooting mode. In this way, when a user operation on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution corresponding to the normal shooting mode obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0477] For example, the electronic device 100 can obtain shooting parameters for obtaining an updated shooting resolution, including but not limited to: normal shooting mode, non-preview state, folded state, front camera, and 4:3 image ratio. Based on the shooting parameters, the electronic device 100 can obtain an updated shooting resolution corresponding to the normal shooting mode from the first configuration file. For example, the updated preview resolution can be 960×1280. For how the electronic device 100 obtains the updated shooting resolution based on the shooting parameters, please refer to the description of the embodiment of Figure 10.
[0478] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0479] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0480] In other embodiments, the electronic device 100 may also determine the updated shooting resolution corresponding to the normal shooting mode after detecting the user operation acting on the shooting control 502. This application does not limit this.
[0481] In some embodiments, after the electronic device 100 detects a user operation (e.g., a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can take a picture at an updated shooting resolution corresponding to the pre-configured normal shooting mode and save the captured picture in the gallery. This can speed up the electronic device 100's response to the user's shooting action. After acquiring the picture, the camera application stops taking pictures and enters the preview state again. The electronic device 100 continues to capture and display the preview image frame at the updated preview resolution corresponding to the normal shooting mode.
[0482] Method 3: Change the image ratio to get an updated preview resolution.
[0483] In some embodiments, the electronic device 100 can change the image ratio of photos or videos taken by the camera application based on user operations. For example, in normal photo mode, the electronic device 100 can receive a user operation to change the image ratio of the camera application from 4:3 to 16:9. In response to changing the image ratio from 4:3 to 16:9 to change the shooting parameters of the camera application, updated shooting parameters are obtained, and an updated preview resolution is obtained based on the updated shooting parameters.
[0484] The updated shooting parameters of the normal shooting mode may be different from or the same as the shooting parameters of the normal shooting mode.
[0485] After obtaining the updated shooting parameters of the normal shooting mode, the electronic device 100 can obtain the updated preview resolution from the configuration file corresponding to the normal shooting mode based on the updated shooting parameters of the normal shooting mode. The updated preview resolution can be the updated preview resolution corresponding to the normal shooting mode.
[0486] Exemplarily, the updated shooting parameters for the normal photo mode include, but are not limited to, normal photo mode, preview state, folded state, rear main camera, and a 16:9 image ratio. Based on the shooting parameters, the updated preview resolution corresponding to the normal photo mode is obtained from the first configuration file. Exemplarily, the updated preview resolution may be 720×1280. For information on how the electronic device 100 obtains the updated preview resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0487] After acquiring the updated preview resolution, the electronic device 100 may capture an image based on the updated preview resolution and display a preview image frame.
[0488] In some embodiments, the electronic device 100 also needs to obtain an updated shooting resolution corresponding to the normal shooting mode. In this way, when a user operation on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution corresponding to the normal shooting mode obtained in advance, thereby speeding up the electronic device 100's response to the user's shooting action.
[0489] For example, the electronic device 100 may obtain shooting parameters for obtaining an updated shooting resolution, including but not limited to: normal shooting mode, non-preview state, folded state, rear main camera, and 16:9 image ratio. Based on the shooting parameters, the electronic device 100 may obtain an updated shooting resolution corresponding to the normal shooting mode from the first configuration file. For example, the updated preview resolution may be 1440x1920. For information on how the electronic device 100 obtains an updated shooting resolution based on the shooting parameters, please refer to the description of the embodiment in FIG. 10 .
[0490] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0491] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0492] In other embodiments, the electronic device 100 may also determine the updated shooting resolution corresponding to the normal shooting mode after detecting the user operation acting on the shooting control 502. This application does not limit this.
[0493] In some embodiments, after the electronic device 100 detects a user operation (e.g., a single click) on the shooting control 502, in response to the user operation, the electronic device 100 can take a picture at an updated shooting resolution corresponding to the pre-configured normal shooting mode and save the captured picture in the gallery. This can speed up the electronic device 100's response to the user's shooting action. After acquiring the picture, the camera application stops taking pictures and enters the preview state again. The electronic device 100 continues to capture and display the preview image frame at the updated preview resolution corresponding to the normal shooting mode.
[0494] FIG14 is a flowchart of a method provided by the present application for an electronic device 100 to update the image resolution of a camera application based on user operations.
[0495] This method can be implemented through the interaction and collaboration between the application layer (such as the camera application), the hardware abstraction layer (HAL), the driver layer, and the hardware layer within the electronic device. The application layer primarily involves the camera application. The driver layer primarily involves the camera driver and disk driver. The hardware layer primarily involves the camera module and disk.
[0496] S1401: The camera application receives a user operation for changing a shooting parameter of the camera application.
[0497] S1402: In response to a user operation, the camera application obtains and updates shooting parameters.
[0498] Based on the introduction of the embodiment of FIG9 , after the camera application is started based on a user operation, the camera application may enter the normal photographing mode of the camera application by default.
[0499] In response to entering the normal photographing mode, the camera application can obtain the initial preview resolution of the normal photographing mode. In some embodiments, the camera application can also obtain the initial shooting resolution of the normal photographing mode.
[0500] In some embodiments, the camera application may receive a user operation to change the camera application's shooting parameters. In response to changing the camera application's shooting parameters, the camera application may obtain an updated preview resolution. In some embodiments, the camera application may also obtain an updated shooting resolution.
[0501] The electronic device 100 may change the shooting parameters of the camera application in the following manners, but not limited to the following.
[0502] Method 1: Change the shooting mode to change the shooting parameters of the camera application.
[0503] The shooting mode may include any of the following: normal shooting mode, portrait shooting mode, high-definition shooting mode, night scene shooting mode, panoramic shooting mode, normal video recording mode, delayed shooting mode, slow motion video recording mode, etc. The electronic device 100 may receive a user operation to switch between any two shooting modes to change the shooting parameters of the camera application. For example, the electronic device 100 may receive a user operation to switch between normal camera mode and normal video recording mode to change the shooting parameters of the camera application.
[0504] When the electronic device 100 changes the shooting mode based on the user operation, the electronic device 100 can change the shooting parameters of the camera application, and the electronic device 100 can obtain the updated shooting parameters. For details, please refer to the description of the above method 1, which will not be repeated here.
[0505] Method 2: Change the shooting parameters of the camera application without changing the shooting mode.
[0506] Without changing the shooting mode, the electronic device 100 can change the electronic device display screen state in the shooting mode and / or change the camera type and / or change the picture ratio based on user operations to change the shooting parameters of the camera application, obtain updated shooting parameters, and obtain updated preview resolution.
[0507] For details, please refer to the description of the above-mentioned method 2, and this application will not go into details here.
[0508] S1403: The camera application obtains a first configuration file from the running memory of the camera application.
[0509] S1404: The camera application obtains an updated preview resolution and an updated shooting resolution from the first configuration file based on the updated shooting parameters.
[0510] In response to obtaining the updated shooting parameters, the camera application can obtain the first configuration file from the camera application's running memory. Since the camera application is already running, the first configuration file is stored in the camera application's running memory. There is no need to obtain the first configuration file from the camera application's file system. The camera application can directly obtain the first configuration file from the camera application's running memory, saving the camera application time in obtaining the first configuration file.
[0511] After acquiring the updated shooting parameters, the camera application may determine an updated preview resolution from the first configuration file based on the updated shooting parameters.
[0512] After acquiring the updated preview resolution, the electronic device 100 may capture images at the updated preview resolution and display preview image frames.
[0513] In some embodiments, the camera application also needs to obtain an updated shooting resolution. In this way, when a user operation acting on the shooting control 502 is detected, the electronic device 100 can capture image frames based on the updated shooting resolution obtained in advance to speed up the camera application's response to the user's shooting action.
[0514] Optionally, the updated preview resolution is lower than the updated shooting resolution. In this way, the electronic device 100 can capture the preview image at a lower resolution to reduce the power consumption of the electronic device 100.
[0515] Optionally, updating the preview resolution may be the same as updating the shooting resolution, which is not limited in this application.
[0516] In other embodiments, the camera application may also determine to update the shooting resolution after detecting a user operation on the shooting control 502, and this application does not limit this.
[0517] S1405: The camera application sends the updated preview resolution to the HAL layer.
[0518] S1406. The HAL layer sends the updated preview resolution to the camera driver.
[0519] S1407: The camera driver sends the updated preview resolution to the camera module.
[0520] S1408. The camera module captures images at the updated preview resolution.
[0521] After the camera application determines the updated preview resolution, the camera application can send the updated preview resolution to the HAL layer, and the HAL layer sends the updated preview resolution to the camera driver, and the camera driver sends the updated preview resolution to the camera module.
[0522] After receiving the updated preview resolution, the camera module can capture an image based on the updated preview resolution and display the image captured by the camera module at the updated preview resolution in the preview window of the camera application.
[0523] S1409: The camera application receives a user operation on the shutter key.
[0524] S1410: The camera application sends the updated shooting resolution to the HAL layer.
[0525] S1411. The HAL layer sends the updated shooting resolution to the camera driver.
[0526] S1412: The camera driver sends the updated shooting resolution to the camera module.
[0527] S1413: The camera module captures an image or video with the updated shooting resolution and saves the image or video.
[0528] In some embodiments, the electronic device 100 may receive a user operation on a shutter key and save a picture or video.
[0529] For example, the user operation on the shutter key may be an input operation on the shooting control 502 in FIG. 8B , such as a single click.
[0530] In response to the user operation on the shutter key, the camera application can send the updated shooting resolution obtained in advance to the HAL layer, and the HAL layer sends the updated shooting resolution to the camera driver, and the camera driver sends the updated shooting resolution to the camera module.
[0531] After receiving the updated shooting resolution, the camera module can capture images or videos based on the updated shooting resolution and save the images or videos captured by the camera module at the updated shooting resolution in the gallery. This can speed up the camera application's response to the user's shooting action.
[0532] In some embodiments, S1409-S1413 may not be executed, and this application does not limit this.
[0533] FIG15 is a flow chart of a method for configuring image resolution provided in this application.
[0534] S1501: When the electronic device runs a camera application, a first configuration file is stored in a running memory of the camera application. The first configuration file records a correspondence between a plurality of different shooting parameters and image resolutions.
[0535] Exemplarily, the first configuration file may be the configuration file shown in FIG. 10 to FIG. 13 .
[0536] In some embodiments, after the camera application is closed, the first configuration file stored in the running memory of the camera application is cleared. When the camera application is started again, the camera application loads the first configuration file into the running memory of the camera application.
[0537] S1502: The electronic device receives and responds to a first operation of a user on a camera application, and obtains a first shooting parameter.
[0538] S1503: The electronic device obtains a first configuration file from the running memory of the camera application.
[0539] S1504: The electronic device obtains a first image resolution from a first configuration file based on the first shooting parameter.
[0540] In some embodiments, the first picture resolution may be referred to as an updated preview resolution.
[0541] In some embodiments, the first shooting parameter may also be referred to as an updated shooting parameter.
[0542] For how the electronic device obtains the first image resolution from the first configuration file based on the first shooting parameter, reference may be made to the description in the embodiment of FIG14 .
[0543] S1505: The electronic device captures a first image at a first picture resolution through a camera application; the electronic device displays the first image in the camera application.
[0544] Optionally, the electronic device may display the first image in a preview window of a camera application.
[0545] Through this method, the electronic device 100 can store the resolution information supported by the camera application in a first configuration file. After the camera application is running, the electronic device 100 stores the first configuration file in the camera application's runtime memory. When the camera application needs to reconfigure the image resolution, the camera application only needs to obtain the updated image resolution from the first configuration file, which simplifies the process of the camera application obtaining the updated image resolution and speeds up the camera application's acquisition of the updated image resolution.
[0546] In a possible implementation, after the electronic device runs the camera application and before storing the first configuration file in the running memory of the camera application, the method further includes: the electronic device obtaining the first configuration file from the file system of the camera application.
[0547] The first configuration file is stored in the file system of the camera application. When the camera application is running, the camera application can obtain the first configuration file from the file system of the camera application and store it in the running memory of the camera application.
[0548] For how the electronic device obtains the first configuration file from the file system of the camera application, reference may be made to the description in the embodiment of FIG. 9 .
[0549] In one possible implementation, the first shooting parameter includes the shooting parameter of the camera application in the preview state corresponding to the first shooting mode. After the electronic device obtains the first configuration file, the method further includes: the electronic device obtains the second shooting parameter, the second shooting parameter includes the shooting parameter of the camera application in the shooting state corresponding to the first shooting mode; the electronic device obtains the first configuration file from the running memory of the camera application; the electronic device obtains the second image resolution from the first configuration file based on the second shooting parameter.
[0550] In some embodiments, the second picture resolution may be referred to as an updated capture resolution.
[0551] In some embodiments, the second shooting parameter may also be referred to as an updated shooting parameter.
[0552] In other possible implementations, the camera application may not obtain the second image resolution first, and may obtain the second image resolution after detecting the user's operation on the shutter key. This application does not limit this.
[0553] In this way, the camera application can obtain the second image resolution in advance before detecting the user's operation on the shutter key, so as to speed up the camera application's response to the user's operation on the shutter key and improve the user experience.
[0554] In one possible implementation, the method further includes: the electronic device receiving a second operation of the user on the shutter key in the camera application; in response to the second operation, the electronic device capturing a second image or a second video at a second picture resolution; and the electronic device saving the second image or the second video.
[0555] In this way, the camera application can obtain the second image resolution in advance before detecting the user's shutter key operation. When the camera application detects the user's shutter key operation, the second image or second video is captured at the pre-acquired second image resolution, thereby speeding up the camera application's response to the user's shutter key operation and improving the user experience.
[0556] In a possible implementation, the second image resolution is greater than the first image resolution.
[0557] Generally speaking, users don't have high requirements for the clarity of preview images. Camera apps can capture preview images at a lower resolution to save power. This resolution will not exceed the screen resolution of the device.
[0558] In a possible implementation, the first operation includes any one or more of the following: changing a shooting mode of a camera application, changing a display screen state of an electronic device, changing a camera type, and changing a picture ratio.
[0559] In one possible implementation, before the electronic device receives and responds to the user's first operation on the camera application, the method also includes: the electronic device obtains a third shooting parameter, and obtains a third picture resolution from the file system of the camera application based on the third shooting parameter; the electronic device captures a third image at the third picture resolution through the camera application; and the electronic device displays the third image within the camera application.
[0560] In one possible implementation, the third shooting parameter includes the shooting parameter of the camera application in the preview state corresponding to the default shooting mode; the method also includes: the electronic device obtains a fourth shooting parameter, the fourth shooting parameter includes the shooting parameter of the camera application in the shooting state corresponding to the default shooting mode; the electronic device obtains a fourth image resolution from the file system of the camera application based on the fourth shooting parameter.
[0561] In some embodiments, the third image resolution may be referred to as an initial preview resolution, and the fourth image resolution may be referred to as an initial capture resolution.
[0562] In some embodiments, the third shooting parameter and the fourth shooting parameter may also be referred to as initial shooting parameters.
[0563] For how the electronic device obtains the third image resolution and the fourth image resolution from the first configuration file based on the third shooting parameter and the fourth shooting parameter, reference may be made to the description in the embodiment of FIG. 14 .
[0564] In this way, when the camera application is first opened, before the user changes the shooting parameters, the camera application can obtain the initial preview resolution and the initial shooting resolution, and capture the preview image at the initial preview resolution.
[0565] Optionally, the camera application may also only obtain the initial preview resolution without obtaining the initial shooting resolution. When detecting the user's operation on the shutter key, the camera application then obtains the initial shooting resolution.
[0566] Optionally, after obtaining the first configuration file, the camera application may also obtain an initial shooting resolution from the first configuration file based on the initial shooting parameters.
[0567] In a possible implementation, the electronic device periodically or irregularly obtains a second configuration file from the server, where the second configuration file is partially different from or completely different from the first configuration file.
[0568] In this way, the first configuration file of the camera application stored on the electronic device can be updated periodically / irregularly.
[0569] In some embodiments, the content of the configuration file is related to the device model. The content of the configuration file corresponding to different device models may be different. In other embodiments, the content of the configuration file corresponding to different device models may also be the same, and this application does not limit this.
[0570] In a possible implementation, the shooting parameters include any one or more of the following: shooting status, shooting mode, device display status, camera type, and image ratio.
[0571] The present application provides an electronic device, which includes a camera, a memory, and a processor; wherein the camera, the memory, and the processor are coupled, and the memory is used to store a computer program. When the processor executes and calls the computer program, the electronic device executes a picture resolution configuration method shown in Figure 15.
[0572] The present application provides a computer-readable storage medium including instructions. When the instructions are executed on an electronic device, the electronic device executes a method for configuring image resolution as shown in FIG15 .
[0573] The present application provides a computer program product containing instructions. When the above-mentioned computer program product runs on an electronic device, it enables the electronic device to execute a picture resolution configuration method shown in Figure 15.
[0574] The present application provides a chip system, which includes one or more processors, and the processors are used to call computer instructions to enable an electronic device to execute a picture resolution configuration method shown in Figure 15.
[0575] The above are only some of the embodiments and implementations of this application. The scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0576] It is understood that the various user interfaces described in the embodiments of this application are merely exemplary interfaces and do not limit the scope of this application. In other embodiments, the user interface may adopt a different interface layout, include more or fewer controls, and add or remove other functional options. As long as they are based on the same inventive concept provided by this application, they are all within the scope of protection of this application.
[0577] It should be noted that, without causing any contradiction or conflict, any feature in any embodiment of the present application, or any part of any feature, can be combined, and the combined technical solution is also within the scope of the embodiments of the present application.
[0578] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for configuring image resolution, characterized in that: The method comprises: When the electronic device runs a camera application, a first configuration file is stored in a running memory of the camera application, wherein the first configuration file records a correspondence between a plurality of different shooting parameters and image resolutions; The electronic device receives and responds to a first operation of a user on a camera application to obtain a first shooting parameter; The electronic device obtains the first configuration file from the running memory of the camera application; The electronic device acquires a first picture resolution from the first configuration file based on the first shooting parameter; The electronic device acquires a first image at the first picture resolution through the camera application; The electronic device displays the first image within the camera application.
2. The method according to claim 1, after the electronic device runs a camera application and before storing the first configuration file in the running memory of the camera application, the method further comprises: The electronic device obtains the first configuration file from the file system of the camera application.
3. The method according to claim 1 or 2, characterized in that: The first shooting parameter includes a shooting parameter of the camera application in a preview state corresponding to the first shooting mode. After the electronic device obtains the first configuration file, the method further includes: The electronic device acquires a second shooting parameter, where the second shooting parameter includes a shooting parameter of the camera application in a shooting state corresponding to the first shooting mode; The electronic device obtains the first configuration file from the running memory of the camera application; The electronic device obtains a second picture resolution from the first configuration file based on the second shooting parameter.
4. The method according to claim 3, characterized in that The method further comprises: The electronic device receives a second operation of a user on a shutter key in a camera application; In response to the second operation, the electronic device captures a second image or a second video at the second picture resolution; The electronic device saves the second image or the second video.
5. The method according to claim 3 or 4, characterized in that: The second picture resolution is greater than the first picture resolution.
6. The method according to any one of claims 1 to 5, characterized in that: The first operation includes any one or more of the following: changing the shooting mode of the camera application, changing the display screen state of the electronic device, changing the camera type, and changing the image ratio.
7. The method according to claim 2, characterized in that Before the electronic device receives and responds to a first operation of the user on the camera application, the method further includes: The electronic device obtains the first configuration file from the running memory of the camera application; The electronic device acquires a third shooting parameter, and acquires a third picture resolution from the first configuration file based on the third shooting parameter; The electronic device acquires a third image at the third picture resolution through the camera application; The electronic device displays the third image within the camera application.
8. The method according to claim 7, characterized in that The third shooting parameter includes a shooting parameter of the camera application in a preview state corresponding to a default shooting mode; the method further includes: The electronic device acquires a fourth shooting parameter, where the fourth shooting parameter includes a shooting parameter of the camera application in a shooting state corresponding to the default shooting mode; The electronic device obtains the first configuration file from the running memory of the camera application; The electronic device obtains a fourth picture resolution from the first configuration file based on the fourth shooting parameter.
9. The method according to any one of claims 1 to 8, characterized in that: The electronic device periodically / irregularly obtains a second configuration file from the server, where the second configuration file is partially different from or completely different from the first configuration file.
10. The method according to any one of claims 1 to 9, characterized in that: The shooting parameters include any one or more of the following: shooting status, shooting mode, device display status, camera type, and image ratio.
11. An electronic device, characterized in that: The electronic device includes a camera, a memory, and a processor; wherein the camera, the memory, and the processor are coupled, the memory is used to store a computer program, and when the processor executes and calls the computer program, the electronic device executes the method described in any one of claims 1-10.
12. A computer-readable storage medium comprising instructions, characterized in that: When the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Terminal photograph capturing control method, mobile terminal, and readable storage medium
CN111213363A
Image acquisition method and device, electronic equipment and storage medium
CN114727004A
Resolution selection method and device of camera
CN116074623A
Image processing method and electronic equipment
CN116668866A
Image pickup device and image pickup method
JP2014007454A