Method and device for calling camera by application

By implementing camera authorization management and shooting parameter configuration in the terminal device, it supports multiple applications to call the same camera at the same time, solves the problem of limited functions in multiple application scenarios in the existing technology, and improves user experience and data processing performance.

CN118632114APending Publication Date: 2024-09-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310247792.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-07
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing terminal devices do not support multiple applications calling the same camera at the same time, which results in limited functions of some applications in multiple application scenarios and affects user experience. For example, in a live broadcast scenario, only one application can successfully live broadcast.

Method used

By implementing camera authorization management in the terminal device, multiple applications are allowed to call the same camera at the same time, and the shooting parameters are reasonably configured according to the shooting needs of each application to provide image data that meets the application needs.

Benefits of technology

It enables multiple applications to capture images simultaneously, simplifying user operations, improving data processing performance, and avoiding the additional cost of adding camera peripherals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118632114A
    Figure CN118632114A
Patent Text Reader

Abstract

The invention discloses a method and equipment for calling a camera by an application, relates to the technical field of terminals, and can support a plurality of applications to call the same camera of terminal equipment at the same time. The terminal equipment can support a plurality of applications installed in the terminal equipment to call the same camera of the terminal equipment at the same time for image shooting by managing the authorization relation of one camera to the plurality of applications. According to the scheme, the problem that multiple applications cannot perform image shooting at the same time can be solved, and the operation of a user can be greatly simplified. Besides, the terminal equipment can reasonably configure the shooting parameters according to the shooting requirements of the plurality of applications calling the same camera, and provide the image data meeting the shooting requirements of the applications for the applications according to the shooting requirements of the plurality of applications, so as to improve the data processing performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a method and device for using an application to call a camera. Background Art

[0002] Currently, mobile phones, tablets, personal computers (PCs) and other terminal devices are equipped with cameras to provide users with services such as taking photos, shooting videos, and making video calls.

[0003] Usually, when an application needs to use a camera, it will initiate a request to the relevant module of the operating system. After the operating system assigns the camera usage permission to the application based on the application's request, other applications can no longer use the camera. In other words, the conventional camera calling mechanism does not support multiple applications calling the same camera at the same time, which results in the function of some applications being limited in multi-application scenarios. Taking the live broadcast scenario as an example, if the user wants to broadcast live simultaneously through multiple application platforms, but the terminal device does not support multiple applications calling the same camera at the same time, the user can only successfully broadcast live through one application platform (such as the application that first obtains the camera usage permission), which will greatly affect the user experience. Summary of the invention

[0004] The present application provides a method and device for an application to call a camera, which can support multiple applications to call the same camera of a terminal device at the same time.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions:

[0006] In a first aspect, a method for an application to call a camera is provided, the method being applied to a terminal device, the terminal device including a camera, the method comprising: during a process in which a first application performs shooting through the camera, the terminal device receives a first operation, the first operation being used to instruct a second application to call the camera; in response to the first operation, the terminal device determines a first shooting parameter of the camera according to a first shooting requirement of the first application and a second shooting requirement of the second application; the terminal device performs shooting with the first shooting parameter to obtain first initial image data; the terminal device sends first image data to the first application based on the first initial image data, and sends second image data to the second application, wherein the first image data is image data that meets the first shooting requirement, and the second image data is image data that meets the second shooting requirement.

[0007] As an example, the terminal device includes only one camera.

[0008] As another example, the terminal device includes multiple cameras (such as a first camera and a second camera), and the camera called by the first application and the second application is the same camera of the terminal device (such as the first camera).

[0009] The solution provided in the first aspect above is that the terminal device can support multiple applications installed therein to call the same camera of the terminal device to capture images at the same time, and after completing the image capture, the terminal device can provide the multiple applications with image data that meets their shooting needs. This solution can not only solve the problem that multiple applications cannot capture images at the same time, but also greatly simplify the user's operation. In addition, the terminal device can reasonably configure the shooting parameters according to the shooting requirements of multiple applications that call the same camera, and provide the application with image data that meets the application shooting requirements according to the shooting requirements of the multiple applications, so as to improve the performance of data processing.

[0010] As a possible implementation, the method further includes: in response to the first operation, the terminal device updates the camera authorization information, the camera authorization information being used to indicate that the camera provides shooting services for the first application and the second application at the same time. Based on this, the terminal device can manage the authorization relationship between one camera and multiple applications to support the terminal device to allow multiple applications installed therein to simultaneously call the same camera of the terminal device for image shooting.

[0011] As an example, the camera authorization information may include: a relationship index between the camera and the first application; and a relationship index between the camera and the second application.

[0012] As an example, the camera authorization information may include: a white list, wherein the white list includes an application identifier (such as an application name or an application ID) of the first application and an application identifier of the second application.

[0013] As a possible implementation method, the camera authorization information also includes: the real-time number of applications that call the camera. Based on this, the terminal device can facilitate authorization-related management, such as refusing allocation when the number exceeds the limit, releasing corresponding resources (such as computing power and memory resources) after the camera is called, etc. For example, when the amount of application data requesting to call the camera exceeds a preset threshold, the terminal device can reject the application's camera call request. For another example, when the number of applications provided by the camera is 0, the terminal device can release the relevant resources of the camera.

[0014] As a possible implementation, the first shooting requirement may include but is not limited to the requirement of the first application for at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness; the second shooting requirement may include but is not limited to the requirement of the second application for at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness. Based on this, the terminal device can provide image data that can meet the shooting needs of the application according to its diverse needs. For example, the terminal device can reasonably configure the shooting parameters according to the needs of the application. For another example, the terminal device can process the initial image data obtained by shooting accordingly according to the needs of the application so that it meets the shooting needs of the application.

[0015] As a possible implementation method, when the first shooting requirement and the second shooting requirement are the same, the first shooting parameter is a shooting parameter corresponding to the first shooting requirement or the second shooting requirement; the above-mentioned terminal device sends the first image data to the first application based on the first initial image data, including: the terminal device sends the first initial image data as the first image data to the first application; the above-mentioned terminal device sends the second image data to the second application based on the first initial image data, including: the terminal device sends the first initial image data as the second image data to the second application.

[0016] It can be understood that, since the first shooting requirement and the second shooting requirement are the same, the terminal device can directly determine the first shooting parameter, such as the first shooting parameter is the shooting parameter corresponding to the first shooting requirement, that is, the shooting parameter corresponding to the second shooting requirement. In this case, the first initial image data obtained by shooting with the first shooting parameter must be able to meet the shooting requirements of the first application and the second application at the same time. Therefore, the terminal device does not need to process the first initial image data, but can directly provide the first initial image data as the first image data and the second image data to the first application and the second application respectively.

[0017] As an example, assuming that the first shooting requirement includes a first resolution requirement and a first direction requirement of the first application for image data, and the second shooting requirement includes a first resolution requirement and a first direction requirement of the second application for image data, the first shooting parameter determined by the terminal device includes: a first resolution and a first direction.

[0018] As a possible implementation, when the first shooting requirement and the second shooting requirement are different, the terminal device determines the first shooting parameter of the camera according to the first shooting requirement of the first application and the second shooting requirement of the second application, including: the terminal device determines the first shooting parameter according to the preset rules corresponding to the parameters in the first shooting requirement and the second shooting requirement; wherein the preset rules include one or more of the following: application priority rule, parameter priority rule, minority obeys majority rule, random determination rule. Based on this, reasonable shooting parameters can be determined according to the shooting requirements of multiple applications to maximize the shooting requirements of each application and improve the user experience.

[0019] Among them, the principle of the application priority rule is to give priority to meeting the shooting needs of applications with higher priority; the principle of the parameter priority rule is to give priority to meeting the shooting needs of applications with higher priority requirements for different needs of the same parameter; the principle of the minority obeys the majority rule is to give priority to meeting the shooting needs of most applications; the random determination rule refers to randomly determining the first shooting parameter according to one or some shooting needs.

[0020] As a possible implementation, the terminal device sends the first image data to the first application based on the first initial image data, including: if the first initial image data meets the first shooting requirement, the terminal device sends the first initial image data as the first image data to the first application; if the first initial image data does not meet the first shooting requirement, the terminal device adjusts the corresponding parameters in the first initial image data and sends it to the first application as the first image data; the terminal device sends the second image data to the second application based on the first initial image data, including: if the first initial image data meets the second shooting requirement, the terminal device sends the first initial image data as the second image data to the second application; if the first initial image data does not meet the second shooting requirement, the terminal device adjusts the corresponding parameters in the first initial image data and sends it to the second application as the second image data. Based on this, the terminal device can directly provide the initial image data to the application when the initial image data obtained by shooting meets the shooting requirement of the application, and when the initial image data obtained by shooting does not meet the shooting requirement of the application, the initial image data obtained by shooting is processed accordingly to meet the shooting requirement of the application. In this way, the shooting requirements of each application are guaranteed to the greatest extent, and the user experience is improved.

[0021] As an example, assuming that the first shooting requirement includes the first resolution requirement and the first direction requirement of the first application for the image data, and the second shooting requirement includes the second resolution requirement and the first direction requirement of the second application for the image data, if the first resolution is greater than the second resolution, the terminal device can determine that the first shooting parameter includes: the first resolution and the first direction. Among them, the first resolution in the above-mentioned first shooting parameter can be determined by the terminal device based on the parameter priority rule. In this case, the first image data provided by the terminal device to the first application is the first initial image data; the second image data provided by the terminal device to the second application is the image data after the resolution of the first initial image data is adjusted to the second resolution.

[0022] As another example, assuming that the first shooting requirement includes the first resolution requirement and the first direction requirement of the first application for the image data, and the second shooting requirement includes the first resolution requirement and the second direction requirement of the second application for the image data, the terminal device can determine that the first shooting parameter includes: the first resolution and the first direction. Among them, the first direction in the above-mentioned first shooting parameter can be determined by the terminal device based on a random determination rule. In this case, the first image data provided by the terminal device to the first application is the first initial image data; the second image data provided by the terminal device to the second application is the image data after the direction of the first initial image data is adjusted to the second direction. Alternatively, in this example, the terminal device can determine that the first shooting parameter includes: the first resolution and the second direction. Among them, the second direction in the above-mentioned first shooting parameter can be determined by the terminal device based on a random determination rule. In this case, the second image data provided by the terminal device to the second application is the first initial image data; the first image data provided by the terminal device to the first application is the image data after the direction of the first initial image data is adjusted to the first direction.

[0023] As a possible implementation, the method further includes: when the real-time number of applications that call the camera is reduced to 0, the terminal device releases the resources corresponding to the camera. Based on this, the terminal device can manage the real-time number of applications that call the camera to facilitate the release of related resources at the end of the process, thereby maximally saving the computing power and memory resources of the terminal device.

[0024] As a possible implementation, the method further includes: during the process of the first application and the second application shooting through the camera, the terminal device receives a second operation, the second operation is used to instruct the third application to call the camera; in response to the second operation, the terminal device determines the second shooting parameter of the camera according to the first shooting requirement of the first application, the second shooting requirement of the second application and the third shooting requirement of the third application; the terminal device shoots with the second shooting parameter to obtain the second initial image data; the terminal device sends the third image data to the first application based on the second initial image data, sends the fourth image data to the second application and sends the fifth image data to the third application, wherein the third image data is image data that meets the first shooting requirement, the fourth image data is image data that meets the second shooting requirement, and the fifth image data is image data that meets the third shooting requirement. Based on this, the terminal device can support the three applications installed therein to call the same camera of the terminal device for image shooting at the same time, and after completing the image shooting, the terminal device can provide the three applications with image data that meets their shooting requirements respectively.

[0025] Of course, this application does not limit the maximum number of applications that can call the same camera at the same time. For example, the terminal device can allow the maximum number of applications that can call the same camera at the same time to be M, where M is any integer greater than 1.

[0026] As a possible implementation, the terminal device includes a first system, and the first application, the second application, and the third application are all installed in the first system. That is, the solution provided by the present application is applicable to the scenario where multiple applications in the native operating system call the same camera.

[0027] As a possible implementation method, the above-mentioned terminal device includes a first system and a second system, and the first application, the second application and the third application are all installed in the second system. Among them, the first system is the native operating system of the terminal device (also called the Host system), and the second system is the operating system installed in the simulator or container (also called the Guest system). In other words, the solution provided in this application is applicable to ecological fusion scenarios. Exemplarily, the solution provided in this application is applicable to scenarios where multiple applications in the Guest system call the same camera.

[0028] As a possible implementation method, the terminal device includes a first system and a second system, and at least one of the first application, the second application, and the third application is installed in the first system and at least one is installed in the second system. Among them, the first system is the native operating system of the terminal device (also called the Host system), and the second system is the operating system installed in the simulator or container (also called the Guest system). In other words, the solution provided in this application is applicable to ecological fusion scenarios. Exemplarily, the solution provided in this application is applicable to scenarios where applications in the Host system and applications in the Guest system call the same camera.

[0029] In a second aspect, a terminal device is provided, which includes: a user input unit, for receiving a first operation during a process in which a first application performs shooting through the above-mentioned camera, the first operation being used to instruct a second application to call the camera; a processing unit, for responding to the first operation, and determining a first shooting parameter of the camera according to a first shooting requirement of the first application and a second shooting requirement of the second application; an image acquisition unit, for performing shooting with the first shooting parameter, and acquiring first initial image data; the above-mentioned processing unit is also used to: send first image data to the first application based on the first initial image data, and send second image data to the second application, wherein the first image data is image data that meets the first shooting requirement, and the second image data is image data that meets the second shooting requirement.

[0030] The solution provided in the second aspect above is that the terminal device can support multiple applications installed therein to call the same camera of the terminal device to capture images at the same time, and after completing the image capture, the terminal device can provide the multiple applications with image data that meets their shooting needs. This solution can not only solve the problem that multiple applications cannot capture images at the same time, but also greatly simplify the user's operation. In addition, the terminal device can reasonably configure the shooting parameters according to the shooting requirements of multiple applications that call the same camera, and provide the application with image data that meets the application shooting requirements according to the shooting requirements of the multiple applications, so as to improve the performance of data processing.

[0031] As a possible implementation, the processing unit is further used to: in response to the first operation, update the camera authorization information, the camera authorization information being used to indicate that the camera provides shooting services for the first application and the second application at the same time. Based on this, the terminal device can manage the authorization relationship between one camera and multiple applications to support the terminal device to allow multiple applications installed therein to simultaneously call the same camera of the terminal device for image shooting.

[0032] As an example, the camera authorization information may include: a relationship index between the camera and the first application; and a relationship index between the camera and the second application.

[0033] As an example, the camera authorization information may include: a white list, wherein the white list includes an application identifier (such as an application name or an application ID) of the first application and an application identifier of the second application.

[0034] As a possible implementation method, the camera authorization information also includes: the real-time number of applications that call the camera. Based on this, the terminal device can facilitate authorization-related management, such as refusing allocation when the number exceeds the limit, releasing corresponding resources (such as computing power and memory resources) after the camera is called, etc. For example, when the amount of application data requesting to call the camera exceeds a preset threshold, the terminal device can reject the application's camera call request. For another example, when the number of applications provided by the camera is 0, the terminal device can release the relevant resources of the camera.

[0035] As a possible implementation, the first shooting requirement may include but is not limited to the requirement of the first application for at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness; the second shooting requirement may include but is not limited to the requirement of the second application for at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness. Based on this, the terminal device can provide image data that can meet the shooting needs of the application according to its diverse needs. For example, the terminal device can reasonably configure the shooting parameters according to the needs of the application. For another example, the terminal device can process the initial image data obtained by shooting accordingly according to the needs of the application so that it meets the shooting needs of the application.

[0036] As a possible implementation method, when the first shooting requirement and the second shooting requirement are the same, the first shooting parameter is a shooting parameter corresponding to the first shooting requirement or the second shooting requirement; the above-mentioned processing unit sends the first image data to the first application based on the first initial image data, including: the processing unit sends the first initial image data as the first image data to the first application; the above-mentioned processing unit sends the second image data to the second application based on the first initial image data, including: the processing unit sends the first initial image data as the second image data to the second application.

[0037] As a possible implementation, when the first shooting requirement and the second shooting requirement are different, the processing unit determines the first shooting parameter of the camera according to the first shooting requirement of the first application and the second shooting requirement of the second application, including: the processing unit determines the first shooting parameter according to the preset rules corresponding to the parameters in the first shooting requirement and the second shooting requirement; wherein the preset rules include one or more of the following: application priority rule, parameter priority rule, minority obeys majority rule, random determination rule. Based on this, reasonable shooting parameters can be determined according to the shooting requirements of multiple applications to maximize the shooting requirements of each application and improve user experience.

[0038] As a possible implementation, the processing unit sends the first image data to the first application based on the first initial image data, including: if the first initial image data meets the first shooting requirement, the processing unit sends the first initial image data as the first image data to the first application; if the first initial image data does not meet the first shooting requirement, the processing unit adjusts the corresponding parameters in the first initial image data and sends it to the first application as the first image data; the processing unit sends the second image data to the second application based on the first initial image data, including: if the first initial image data meets the second shooting requirement, the processing unit sends the first initial image data as the second image data to the second application; if the first initial image data does not meet the second shooting requirement, the processing unit adjusts the corresponding parameters in the first initial image data and sends it to the second application as the second image data. Based on this, the terminal device can directly provide the initial image data to the application when the initial image data obtained by shooting meets the shooting requirement of the application, and when the initial image data obtained by shooting does not meet the shooting requirement of the application, the initial image data obtained by shooting is processed accordingly to meet the shooting requirement of the application. In this way, the shooting requirements of each application are guaranteed to the greatest extent, and the user experience is improved.

[0039] As a possible implementation, the processing unit is further used to release resources corresponding to the camera when the real-time number of applications calling the camera is reduced to 0. Based on this, the terminal device can manage the real-time number of applications calling the camera to facilitate the release of related resources at the end of the process, thereby maximally saving computing power, memory and other resources of the terminal device.

[0040] As a possible implementation, the user input unit is further used to: receive a second operation during the process of the first application and the second application shooting through the camera, the second operation is used to instruct the third application to call the camera; the processing unit is further used to: determine the second shooting parameter of the camera in response to the second operation according to the first shooting requirement of the first application, the second shooting requirement of the second application and the third shooting requirement of the third application; the image acquisition unit is further used to: shoot with the second shooting parameter to acquire the second initial image data; the processing unit is further used to: send the third image data to the first application based on the second initial image data, send the fourth image data to the second application and send the fifth image data to the third application, wherein the third image data is the image data that meets the first shooting requirement, the fourth image data is the image data that meets the second shooting requirement, and the fifth image data is the image data that meets the third shooting requirement. Based on this, the terminal device can support the three applications installed therein to call the same camera of the terminal device for image shooting at the same time, and after completing the image shooting, the terminal device can provide the three applications with image data that meets their shooting requirements respectively.

[0041] As a possible implementation, the terminal device includes a first system, and the first application, the second application, and the third application are all installed in the first system. That is, the solution provided by the present application is applicable to the scenario where multiple applications in the native operating system call the same camera.

[0042] As a possible implementation, the terminal device includes a first system and a second system, and the first application, the second application, and the third application are all installed in the second system. Exemplarily, the solution provided in the present application is applicable to a scenario in which multiple applications in the Guest system call the same camera.

[0043] As a possible implementation, the terminal device includes a first system and a second system, and at least one of the first application, the second application, and the third application is installed in the first system and at least one is installed in the second system. Exemplarily, the solution provided in the present application is applicable to a scenario in which an application in a host system and an application in a guest system call the same camera.

[0044] In a third aspect, a terminal device is provided, comprising: a camera for capturing images; a memory for storing computer program instructions; and a processor for executing the computer program instructions to support the terminal device in implementing a method in any possible implementation of the first aspect.

[0045] According to a fourth aspect, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method in any possible implementation of the first aspect is implemented.

[0046] According to a fifth aspect, a computer program product comprising instructions is provided. When the computer program product is run on a computer, the computer implements the method in any possible implementation of the first aspect.

[0047] In a sixth aspect, a chip system is provided, the chip system comprising a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processor, the method in any possible implementation of the first aspect is implemented. The chip system may be composed of a chip, or may include a chip and other discrete devices. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic diagram of a conventional solution for multiple applications to call cameras;

[0049] Figure 2 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of the software structure of the first terminal device provided in the embodiment of the present application;

[0051] Figure 4 A schematic diagram of the software structure of the second terminal device provided in the embodiment of the present application;

[0052] Figure 5 A schematic diagram of the software structure of the third terminal device provided in the embodiment of the present application;

[0053] Figure 6 This is a flow chart of a conventional camera calling mechanism;

[0054] Figure 7 A flowchart of a method for using an application to call a camera provided in an embodiment of the present application;

[0055] Figure 8 A flowchart of another method for using an application to call a camera provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of an implementation process of multiple applications calling the same camera provided in an embodiment of the present application;

[0057] Fig.10 A schematic diagram of another implementation process of multiple applications calling the same camera provided in an embodiment of the present application;

[0058] Fig.11 A schematic diagram of the effect of multiple applications calling the same camera that can be achieved in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. 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 this article is only a description of the association relationship of associated 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.

[0060] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.

[0061] It is understandable that since the conventional camera calling mechanism does not support multiple applications calling the same camera at the same time, when a user has multiple applications calling the camera at the same time, for example, when a user wants to broadcast live simultaneously through multiple application platforms, the user needs to add multiple camera peripherals to the terminal device so that multiple applications can obtain the permission of one camera respectively, thereby achieving the purpose of shooting live videos for multiple applications through multiple cameras at the same time. Figure 1 Taking the PC shown in the figure as an example, when application 1, application 2 and application 3 on the PC all have the need to call the camera, since the PC itself is only configured with one camera (such as camera A), the user adds camera peripherals B and camera peripherals C to the PC, and assigns multiple cameras to multiple applications respectively, such as Figure 1 As shown, camera A, camera peripheral B, and camera peripheral C are assigned to application 1, application 2, and application 3, respectively.

[0062] However, the above method of adding camera peripherals undoubtedly requires additional costs, and it is cumbersome for users to authorize multiple camera permissions for multiple applications. In addition, the number of interfaces (such as universal serial bus (USB)) that terminal devices can access peripherals is usually limited. Due to the number of device terminals connected, when the number of applications is large, some applications may still not be matched with cameras.

[0063] In order to solve the above problems existing in the prior art, the embodiment of the present application provides a method for an application to call a camera, based on which a terminal device can support the camera to be called by multiple applications at the same time. In addition, based on a method for an application to call a camera provided in an embodiment of the present application, the terminal device can provide multiple applications with image data that meets their parameter requirements based on the initial image data collected by the camera.

[0064] The terminal device described in the embodiment of the present application may include but is not limited to a smart phone, a netbook, a tablet computer, a smart watch, a smart bracelet, a phone watch, a smart camera, a PDA, a personal computer (PC), a personal digital assistant (PDA), a portable multimedia player (PMP), an augmented reality (AR) / virtual reality (VR) device, a television, a projection device, or a somatosensory game console in a human-computer interaction scene, etc. Alternatively, the terminal device may also be an electronic device including a camera of other types or structures, which is not limited in the embodiment of the present application.

[0065] Please refer to Figure 2 , Figure 2 A schematic diagram of the hardware structure of a terminal device provided in an embodiment of the present application is shown.

[0066] like Figure 2 As shown, the terminal device may include a processor 210, a memory (including an external memory interface 220 and an internal memory 221), a universal serial bus (USB) interface 230, a charging management module 240, a power management module 241, a battery 242, an antenna 1, an antenna 2, a mobile communication module 250, a wireless communication module 260, an audio module 270, a speaker 270A, a receiver 270B, a microphone 270C, an earphone interface 270D, a sensor module 280, a button 290, a motor 291, an indicator 292, a camera 293, a display screen 294, etc. Among them, the sensor module 280 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, etc.

[0067] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

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

[0069] The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may store instructions or data that the processor 210 has just used or cyclically used. If the processor 210 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 210, and thus improves the efficiency of the system.

[0070] In some embodiments, the processor 210 may include one or more interfaces. The interface 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, etc.

[0071] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 210 may include multiple I2C buses. The processor 210 may be coupled to the touch sensor, microphone, camera 293, etc. through different I2C bus interfaces.

[0072] The I2S interface can be used for audio data transmission. In some embodiments, the processor 210 can include multiple I2S buses. The processor 210 can be coupled to the audio module 270 via the I2S bus to achieve communication between the processor 210 and the audio module 270. In some embodiments, the audio module 270 can receive audio signals via the I2S interface to achieve the function of recording audio, such as achieving omnidirectional sound pickup, directional sound pickup, and the like.

[0073] In some embodiments of the present application, the I2S interface can be used to transmit the audio data synchronously recorded by the audio module 270 during the shooting process of the camera 293 to the processor 210.

[0074] The PCM interface can also be used for audio communication, sampling, quantizing and encoding analog signals. In some embodiments, the audio module 270 and the wireless communication module 260 can be coupled via a PCM bus interface. In some embodiments, the audio module 270 can also transmit audio signals to the wireless communication module 260 via the PCM interface to implement the function of answering a call via a Bluetooth headset; or, receive the audio signal input by the wireless communication module 260 via the PCM interface to obtain audio data collected by a wireless microphone, such as audio data obtained after directional sound pickup.

[0075] The MIPI interface can be used to connect the processor 210 with peripheral devices such as the display screen 294 and the camera 293. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 210 and the camera 293 communicate via the CSI interface to implement the shooting function of the terminal device. The processor 210 and the display screen 294 communicate via the DSI interface to implement the display function of the terminal device, such as realizing the display function of the shooting preview interface, the shooting interface, etc.

[0076] In some embodiments of the present application, the MIPI interface can be used to transmit image data captured by the camera 293 to the processor 210.

[0077] The GPIO interface can be configured by software. The GPIO can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 210 with the camera 293, the display 294, the wireless communication module 260, the audio module 270, the sensor module 280, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0078] The USB interface 230 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 230 can be used to connect a charger to charge the terminal device, and can also be used to transfer data between the terminal device and peripheral devices. It can also be used to connect headphones to play audio through the headphones, such as playing audio after directional pickup. The interface can also be used to connect other terminal devices, such as AR devices, etc.

[0079] It should be understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments of the present application, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0080] The charging management module 240 is used to receive charging input from a charger. In some wired charging embodiments, the charging management module 240 can receive charging input from a wired charger through the USB interface 230. In some wireless charging embodiments, the charging management module 240 can receive wireless charging input through a wireless charging coil of the terminal device. While the charging management module 240 is charging the battery 242, it can also power the terminal device through the power management module 241.

[0081] The power management module 241 is used to connect the battery 242, the charging management module 240 and the processor 210. The power management module 241 receives input from the battery 242 and / or the charging management module 240 to power the processor 210, the internal memory 221, the display screen 294, the camera assembly 293 and the wireless communication module 260.

[0082] The wireless communication function of the terminal device can be realized through antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, modem processor and baseband processor.

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

[0084] The mobile communication module 250 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to terminal devices. The mobile communication module 250 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 250 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 250 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 250 can be set in the processor 210. In some embodiments, at least some of the functional modules of the mobile communication module 250 can be set in the same device as at least some of the modules of the processor 210.

[0085] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent 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 the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 270A, a receiver 270B, etc.), or displays an image or video through a display screen 294. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 210 and be set in the same device as the mobile communication module 250 or other functional modules.

[0086] The wireless communication module 260 can provide wireless communication solutions including wireless local area networks (WLAN) (such as WiFi networks), Bluetooth BT, global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to terminal devices. The wireless communication module 260 can be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 210. The wireless communication module 260 can also receive the signal to be sent from the processor 210, modulate the frequency of the signal, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0087] In some embodiments, the antenna 1 of the terminal device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the terminal device can communicate with the network and other devices through wireless communication technology. The wireless communication technology 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).

[0088] The terminal device implements the display function through a GPU, a display screen 294, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 294 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 210 may include one or more GPUs, which execute program instructions to generate or change display information.

[0089] The display screen 294 is used to display images, videos, etc. The display screen 294 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device may include 1 or N display screens 294, where N is a positive integer greater than 1.

[0090] In the embodiment of the present application, the terminal device can display interfaces such as application interfaces and image capture interfaces through the display screen 294. The terminal device can implement the capture function through the ISP, the camera component 293, the video codec, the GPU, the display screen 294, and the application processor. In the present application, the camera 293 may include a front camera and / or a rear camera, which is not limited in the present application.

[0091] In some embodiments, the ISP may be provided in the camera 293, which is not limited in this application.

[0092] The camera 293 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 optical signal into an electrical signal, and then transmits 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 three primary colors (red green blue, RGB), YUV or other formats.

[0093] In this embodiment of the present application, the terminal device may include one or more cameras 293, such as at least one front camera and a rear camera, multiple front cameras or multiple rear cameras, etc.

[0094] The external memory interface 220 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0095] Internal memory 221 may be used to store computer executable program code. For example, the computer program may include an operating system program and an application program. The operating system may include but is not limited to apple OS and other operating systems. Among them, the executable program code includes instructions. The processor 210 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 221. The internal memory 221 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function, etc. The data storage area may store data (such as interface data, etc.) created during the use of the terminal device. In addition, the internal memory 221 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. The processor 210 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 221, and / or the instructions stored in the memory provided in the processor.

[0096] The terminal device can realize audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C and the application processor, such as music playing, recording, etc. For the specific working principles and functions of the audio module 270, the speaker 270A, the receiver 270B and the microphone 270C, reference can be made to the introduction in the conventional technology.

[0097] In addition, for the introduction of hardware such as buttons 290, motor 291, and indicator 292, reference may be made to conventional technologies, and the embodiments of the present application will not be repeated.

[0098] It is understandable that this application Figure 2 The illustrated structure does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0099] As a possible example, see Figure 3 , Figure 3 FIG. 1 shows a schematic diagram of the software structure of a terminal device provided in an embodiment of the present application. Figure 3 As shown, the operating system of the terminal device may include an application layer, an application framework layer (framework, FWK), a system library, an Android runtime and a kernel layer.

[0100] The application layer can include a range of applications, such as Figure 3 As shown in the figure, application 1, application 2 and application 3, the application in the application layer may include but is not limited to camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, etc. For the convenience of description, the application is referred to as application below. The above application can be a native application (such as an application integrated in the operating system) or a third-party application (such as an application downloaded and installed by the user through the application store), which is not limited in the embodiment of the present application.

[0101] The application framework layer provides application programming interface (API) and programming framework for applications in the application layer. Figure 3 As shown, the application framework layer may include a camera management module, which is used to provide camera management services (camera management server) such as camera authority management (such as authority allocation, authority withdrawal, etc.), camera resource management (such as resource allocation, resource release, etc.), etc., to support multiple applications to call the same camera at the same time. In addition, the camera management module can also be used to provide services such as camera logic control, parameter requirement management, image data processing and allocation, etc.

[0102] Among them, in the embodiment of the present application, the camera management module performs permission allocation, which means that the camera management module allocates the camera's usage permission to the application, and the camera management module performs permission withdrawal, which means that the camera management module withdraws the camera's usage permission from the application. The camera management module performs resource allocation, which means that the camera management module allocates computing power sources and other resources to support the operation of the camera process, and the camera management module performs resource release, which means that the camera management module releases the computing power and memory and other resources allocated to the camera process when the camera process ends.

[0103] As an example, Figure 3As shown, the camera management module can provide the above-mentioned camera authority management (such as authority allocation, authority withdrawal, etc.), camera resource management (such as resource allocation, resource release, etc.), camera logic control, parameter demand management and other services through the camera manager (cameramanager) and the camera data processor (camera data processor). For example, the camera manager can be used to be responsible for camera authority management (such as authority allocation, authority withdrawal, etc.), camera resource management (such as resource allocation, resource release, etc.), camera logic control and parameter demand management and other management-related services; the camera data processor can be used to be responsible for data-related services such as image data processing and allocation.

[0104] In an embodiment of the present application, the camera manager can support allocating the same camera of the terminal device to multiple applications at the same time, that is, allowing multiple applications to call the same camera at the same time. In addition, the camera manager can obtain the image parameter requirements of multiple applications and determine the shooting parameters of the camera when it finally shoots based on this. In addition, the camera manager can also send the image parameter requirements of multiple applications to the camera data processor, which is used for the camera data processor to process the image data captured by the camera according to the image parameter requirements of multiple applications and provide it to the application, so as to achieve an image (including photos or videos) display effect adapted to the application requirements.

[0105] Of course, the application framework layer can also be used to provide other management services, such as window management services, activity management services, package management services, content provision services, phone management services, resource management services, notification management services, location management services, and view system services. Among them, the window management service carries data and attributes related to the "interface" and is used to manage and manage the status related to the "interface", such as managing window programs and event dispatching. The activity management service is responsible for managing activities, starting, switching, scheduling, and managing and scheduling applications of various components in the system. The package management service is responsible for program management within the system. The content provision service is used to support an application to access the data of another application (such as a contact database), or to share its own data with other applications, where the data may include video, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The phone management service is used to provide a method for obtaining access to the status and information related to terminal device communication; and provide communication functions of terminal devices, such as the management of call status (including connected, hung up, etc.). The resource management service is used to provide access to non-code resources, such as local strings, icons, pictures, graphics, video files, or layout files. The notification management service is used to provide the function of displaying customized prompt information in the status bar. The prompt information can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. The location management service is used to provide services related to processing geographic location. The view system can be used to build the display interface of the application. The view system includes visual controls, such as text box (TextBox) controls, list (List) controls, grid (Grid) controls, button (Button) controls, and embeddable Web browser controls.

[0106] The kernel layer is the layer between hardware and software. The kernel layer can include camera drivers, input / output device drivers (such as keyboard drivers, touch screen drivers, microphone drivers, etc.), audio drivers (such as headphone drivers, speaker drivers, etc.), sensor drivers, Bluetooth drivers, etc. Among them, the camera driver is used to call and control the camera hardware through the driver, such as shooting control (such as starting shooting, pausing shooting, ending shooting, etc.), shooting parameter adjustment, etc.

[0107] It should be noted that Figure 3Only as an example of a software structure diagram of a terminal device, only the levels and software modules related to the scheme of the present application are simply listed. In practical applications, the operating system of the terminal device may also include other levels and each level may also include other software modules for implementing one or more functions or services. To this end, the embodiment of the present application is not specifically limited. For example, as a possible structure, the operating system of the terminal device may also include a system library and a runtime, wherein the system library and the runtime contain the function functions needed to be called by the application framework layer, for example, the system library may include a media library (Media Libraries) for supporting audio, video format playback and recording, and static image files, etc.

[0108] In addition, in actual applications, the terminal device may also be a terminal device that supports ecological integration. For example, in an ecological integration scenario such as a simulator scenario or a container scenario, a first operating system (also called a host system) may be installed in the terminal device, and a second operating system (i.e., a guest system) may be installed in the simulator or container, that is, the terminal device may include a host (Host) and a client (Guest). As a possible example, a simulator scenario or a container scenario such as Mobile application engine scenario.

[0109] As an example, see Figure 4 or Figure 5 , Figure 4 and Figure 5 The following is a schematic diagram showing the software structure of the terminal device in two ecological integration scenarios provided by the embodiments of the present application. Figure 4 and Figure 5 As shown, the Host system and the Guest system of the terminal device both include an application layer, an application framework layer (framework, FWK), a system library, an Android runtime and a kernel layer.

[0110] Among them, Figure 4 and Figure 5 As shown, the application layer of the Host system may include a series of applications such as Application 1, Application 2, and Application 3, and the application layer of the Guest system may include a series of applications such as Application 4, Application 5, and Application 6.

[0111] As a possible scenario, the camera driver in the kernel layer of the Guest system can provide a virtual interface that directly calls the camera hardware of the terminal device, such as Figure 4 The virtual interface 400 is shown. Based on this, the application in the Guest system can directly call the terminal device camera. And, Figure 4The camera manager in the Guest system shown can obtain the image parameter requirements of multiple applications in the Guest system, and based on this, determine the shooting parameters of the camera when it finally shoots. And, Figure 4 The camera manager in the Guest system shown can also send image parameter requirements of multiple applications in the Guest system to the camera data processor, which is used for the camera data processor to process the image data captured by the camera according to the image parameter requirements of the multiple applications and provide them to the multiple applications, so as to achieve an image (including photos or videos) display effect that is adapted to the application requirements.

[0112] As another possible scenario, the application framework layer can provide camera management services such as camera permission management (such as permission allocation, permission withdrawal, etc.), camera resource management (such as resource allocation, resource release, etc.), camera logic control, parameter requirement management, etc. through the camera manager and camera data processor, and can also provide inter-device communication in ecological integration scenarios and realize cross-system display features. For example, Figure 5 As shown, the application framework layer of the Host system and the Guest system can also be used to provide cross-system task components, such as a mobile application engine component, which is responsible for implementing the unique features of the mobile application engine and realizing communication between the Host system and the Guest system. Based on this, when an application in the Guest system has a need to call a camera, the Guest system can convey the need to the Host system through the cross-system task component, and the camera manager of the Host system can support the allocation of the same camera of the terminal device to any multiple applications in the Guest system (such as multiple applications in application 4, application 5, and application 6) at the same time, that is, allowing multiple applications in the Guest system to call the same camera at the same time; or the camera manager of the Host system can support the allocation of the same camera of the terminal device to one or more applications in the Guest system (such as one or more applications in application 4, application 5, and application 6) and one or more applications in the Host system (such as one or more applications in application 1, application 2, and application 3) at the same time, that is, allowing multiple applications in the Guest system and the Host system to call the same camera at the same time; of course, the camera manager of the Host system can also support the allocation of the same camera of the terminal device to any multiple applications in the Host system (such as multiple applications in application 1, application 2, and application 3) at the same time, that is, allowing multiple applications in the Host system to call the same camera at the same time. And, Figure 5 The camera manager in the Host system can obtain the image parameter requirements of multiple applications in the Guest system and / or the Host system, and determine the shooting parameters of the camera when shooting. Figure 5 The camera manager in the Host system shown can also send image parameter requirements of multiple applications in the Guest system and / or the Host system to the camera data processor, so that the camera data processor can process the image data captured by the camera according to the image parameter requirements of the multiple applications and provide them to the multiple applications, so as to achieve an image (including photos or videos) display effect that is adapted to the application requirements.

[0113] It is understandable that based on the conventional camera calling mechanism, when a camera is called by an application, other applications cannot successfully call the camera. Figure 6 As shown, the camera management module of the terminal device obtains the available cameras (such as Figure 6 Camera A) and start the available cameras (such as Figure 6 After that, if application 2 requests the camera management module to call the camera, since camera A is occupied by application 1, the camera management module fails to obtain the available camera, and thus cannot successfully start camera A.

[0114] Compared with the conventional camera calling mechanism, Figure 3 According to the software structure shown, the terminal device can support any multiple applications among application 1, application 2 and application 3 installed therein to simultaneously call the same camera of the terminal device to capture images, such as taking photos or videos. This can not only solve the problem that multiple applications cannot capture images at the same time, but also avoid the extra cost caused by adding camera peripherals to meet the problem that multiple applications cannot capture images at the same time, and can greatly simplify the user's operation.

[0115] Or, compared to the conventional camera calling mechanism, based on Figure 4 According to the software structure shown, the terminal device in the ecological integration scenario can support any multiple applications of application 4, application 5 and application 6 installed in the guest side (such as an emulator or container) to simultaneously call the same camera of the terminal device to capture images, such as taking photos or videos. It can not only solve the problem that multiple applications cannot capture images at the same time, but also avoid the additional cost caused by adding camera peripherals to meet the problem that multiple applications cannot capture images at the same time, and can greatly simplify the user's operation.

[0116] Or, compared to the conventional camera calling mechanism, based on Figure 5The software structure shown, the terminal device in the ecological integration scenario can support the application 1, application 2 and application 3 installed on the host side, and / or any multiple applications of application 4, application 5 and application 6 in the guest side (such as an emulator or container) can simultaneously call the same camera of the terminal device to capture images, such as taking photos or videos. Not only can it solve the problem that multiple applications cannot capture images at the same time, but it can also avoid the additional cost caused by adding camera peripherals to meet the problem that multiple applications cannot capture images at the same time, and it can greatly simplify the user's operation.

[0117] The following will be combined Figure 3 , Figure 4 and Figure 5 The scenario shown specifically introduces a method for an application to call a camera provided in an embodiment of the present application.

[0118] In one scenario, the terminal device includes multiple cameras. When a first application and a second application both need to call cameras, the terminal device can allocate different cameras to the first application and the second application. For example, assuming that the terminal device includes a first camera and a second camera, the terminal device can allocate the first camera to the first application to provide shooting services for the first application, and allocate the second camera to the second application to provide shooting services for the second application.

[0119] In another scenario, the terminal device includes multiple cameras, and when the first application and the second application both need to call the camera, the terminal device can allocate the same camera to the first application and the second application. For example, assuming that the terminal device includes a first camera and a second camera, the terminal device can allocate the first camera to the first application and the second application at the same time, so as to provide shooting services for the first application and the second application at the same time.

[0120] Among them, in the above two scenarios, the first camera and the second camera can both be front cameras, or both can be rear cameras, or one can be a front camera and the other can be a rear camera, which is not limited in the embodiments of the present application.

[0121] In another scenario, the terminal device includes a camera (such as a first camera). When a first application and a second application simultaneously need to call the camera, the terminal device can allocate the first camera to the first application and the second application at the same time to provide shooting services for the first application and the second application at the same time.

[0122] Please refer to Figure 7 , Figure 7Taking the example of a terminal device supporting the allocation of the same camera (taking the first camera as an example) to multiple applications at the same time, a flow chart of a method for an application to call a camera provided by an embodiment of the present application is shown. Figure 7 As shown, the above method may include the following S701-S705:

[0123] S701: During the process in which a first camera of a terminal device provides a shooting service for a first application, the terminal device receives an operation of a user invoking the first camera on an interface of a second application.

[0124] The first application and the second application may include, but are not limited to, native applications or third-party applications such as calls, maps, navigation, and short messages installed in the terminal device. In some embodiments, the first application or the second application may also be a quick application (also called a light application), which is not specifically limited in the embodiments of this application.

[0125] by Figure 3 Taking the terminal device with the software structure shown as an example, the first application and the second application are applications installed in the native operating system of the terminal device.

[0126] by Figure 4 or Figure 5 Taking the terminal device with the software structure shown as an example, the first application and the second application are applications installed in the host system of the terminal device; or the first application and the second application are applications installed in the guest system of the terminal device; or the first application is an application installed in the host system of the terminal device, and the second application is an application installed in the guest system of the terminal device; or the first application is an application installed in the guest system of the terminal device, and the second application is an application installed in the host system of the terminal device. All of the above situations are possible.

[0127] As a possible example, the operation of the user calling the first camera on the interface of the second application may include but is not limited to the operation of the user clicking a preset control on the interface of the second application, the preset control being such as a preset button, a preset option, a preset link, etc. Among them, the user's click operation on the preset control may trigger the function of calling the camera, such as the user's click operation on the preset control may trigger the code to run through the "event" and complete the function of calling the camera.

[0128] It can be understood that interface controls contain properties, methods and events. The properties of interface controls determine the visual appearance of interface controls, usually including the name, shape, display style, font color, etc. of the control. The methods of interface controls refer to the class methods preset by .NET Framework for controls. These methods are specially provided for programmers and can be used to set and process the characteristics of the controls themselves. The events of interface controls refer to the responses of interface controls to touch operations, keyboard operations, mouse operations and other operations. Any interface control has its own event collection. Once an event of an interface control occurs, it can cause the execution of the corresponding event process. The event object has its own specific name. The event process code is written by the programmer according to his own problem requirements, such as the button click event Click. Therefore, when receiving the user's click operation on the preset control, the terminal device can trigger the code to run through the "event" and complete the function of calling the camera.

[0129] Of course, the embodiment of the present application does not specifically limit the operation form and specific method of the user calling the first camera on the interface of the second application. For example, the operation of the user calling the first camera on the interface of the second application can also be a voice command, a preset sliding gesture, a preset body movement, a preset eye movement, etc.

[0130] In an embodiment of the present application, the first camera providing a shooting service for the first application includes the first camera shooting image data according to a call of the first application and providing the shot image data to the first application.

[0131] S702: The terminal device allocates the first camera to the second application and updates the camera authorization information, where the camera authorization information is used to indicate that the first camera provides shooting services for both the first application and the second application.

[0132] In an embodiment of the present application, the terminal device supports allocating usage rights of the same camera (such as the first camera) to multiple applications at the same time, that is, the terminal device supports multiple applications calling the same camera (such as the first camera) at the same time.

[0133] The terminal device assigning the first camera to the second application means that the terminal device assigns the use permission of the first camera to the first application, that is, the terminal device allows the first application to call the first camera.

[0134] As a possible example, the camera authorization information includes: a relationship index between the camera and the first application; and a relationship index between the first camera and the second application.

[0135] As another possible example, the camera authorization information includes: an identifier of an application that is calling the camera (such as an application name or an application ID), that is, the camera authorization information includes an application whitelist.

[0136] In some cases, the terminal device can only accept a maximum of M (M is an arbitrary integer greater than 1) applications calling the camera at the same time. In order to facilitate related management, such as refusing allocation when the number exceeds the limit, releasing corresponding resources (such as computing power and memory resources) after the camera call is completed, etc., the camera authorization information can also represent the real-time number of applications calling the camera. For example, the camera authorization information can include the real-time number of applications calling the camera.

[0137] For example, when the amount of application data requesting to call the camera exceeds a preset threshold, the terminal device may reject the application's camera call request. For another example, when the number of applications provided by the camera is 0, the terminal device may release the camera's related resources.

[0138] S703: The terminal device determines a first shooting parameter of the first camera according to a first shooting requirement of the first application and a second shooting requirement of the second application.

[0139] The first shooting requirement of the first application may include but is not limited to the requirements of the first application on multiple parameters (such as image resolution, direction, exposure, filter, brightness, contrast, saturation, sharpness, etc.). The second shooting requirement of the second application may include but is not limited to the requirements of the second application on multiple parameters (such as image resolution, direction, exposure, filter, brightness, contrast, saturation, sharpness, etc.).

[0140] In some examples, the first shooting requirement of the first application and the second shooting requirement of the second application are the same. In this case, the first shooting parameter determined by the terminal device may be the shooting parameter corresponding to the first shooting requirement, that is, the shooting parameter corresponding to the second shooting requirement.

[0141] For example, the first shooting requirement of the first application and the second shooting requirement of the second application are both the requirements of the first application for the same parameter. For example, taking the first shooting requirement being the requirement of the first application for the first resolution of the image and the second shooting requirement being the requirement of the second application for the first resolution of the image, the first shooting parameter determined by the terminal device is the first resolution.

[0142] For another example, the first shooting requirement of the first application and the second shooting requirement of the second application both include the first application's requirements for multiple parameters. For example, taking the first shooting requirement including the first application's requirements for a first resolution of the image and a requirement for the image to be horizontal, and the second shooting requirement including the second application's requirements for the first resolution of the image and a requirement for the image to be horizontal, the first shooting parameter determined by the terminal device includes a resolution parameter of the first resolution and a direction parameter of horizontal.

[0143] In other examples, the first shooting requirement of the first application and the second shooting requirement of the second application are different. In this case, the terminal device can determine the first shooting parameter of the first camera according to the preset rules corresponding to each parameter.

[0144] Among them, the preset rules may include but are not limited to the following rules: application priority rule, parameter priority rule, minority obeys majority rule, random determination rule, etc.

[0145] The principle of the application priority rule is to give priority to the shooting requirements of applications with higher priority, where the priority of the application can be pre-specified or determined based on the application business, which is not limited in the embodiments of the present application. For example, assuming that the priority of the first application is higher than the priority of the second application, in order to give priority to the shooting requirements of the first application, the first shooting parameter determined by the terminal device is the shooting parameter corresponding to the first shooting requirement of the first application.

[0146] The principle of the parameter priority rule is that for different requirements for the same parameter, the shooting requirements with higher parameter requirements are given priority. For example, taking the case where the first shooting requirement includes the first application's requirement for a first resolution of the image, and the second shooting requirement includes the second application's requirement for a second resolution of the image, the resolution parameter included in the first shooting parameter determined by the terminal device may be the higher resolution required between the first resolution and the second resolution. Exemplarily, assuming that the first application's requirement for the image is to meet the first resolution of 1080P (i.e., horizontal pixels × vertical pixels are 1920 × 1080), and the second application's requirement for the image is to meet the second resolution of 720P (i.e., horizontal pixels × vertical pixels are 1280 × 720), since the first application has a higher requirement for the image resolution, the terminal device can determine that the first shooting parameter used by the first camera for shooting includes a resolution of the first resolution of 1080P.

[0147] The principle of the majority rule is to give priority to satisfying the shooting requirements of most applications. For example, taking the first shooting requirement including the first application's requirement that the image direction is horizontal, the second shooting requirement including the second application's requirement that the image direction is horizontal, and the third shooting requirement including the second application's requirement that the image direction is vertical as an example, since the number of applications requiring the image direction to be horizontal (i.e., 2) is greater than the number of applications requiring the image direction to be vertical (i.e., 2), the direction parameter included in the first shooting parameter determined by the terminal device is horizontal.

[0148] The random determination rule refers to randomly determining the first shooting parameter according to one or some shooting requirements. For example, taking the first shooting requirement including the requirement of the first application that the image direction is horizontal and the second shooting requirement including the requirement of the second application that the image direction is horizontal as an example, based on the random determination rule, the terminal device can randomly determine whether the direction parameter included in the first shooting parameter is horizontal or vertical.

[0149] It should be noted that, in some examples, if the camera hardware of the terminal device cannot meet the requirements of one or more applications for a certain parameter, such as if the camera hardware of the terminal device cannot meet the requirements of one or more applications regarding resolution, the resolution parameter included in the first shooting parameter determined by the terminal device is the first resolution supported by the terminal device; and if the camera hardware of the terminal device cannot meet the requirements of one or more applications regarding direction, the direction parameter included in the first shooting parameter determined by the terminal device is the direction parameter supported by the terminal device.

[0150] Regarding the method for the terminal device to determine other parameters (such as exposure, filter, brightness, contrast, saturation, sharpness, etc.) according to the first shooting requirement of the first application and the second shooting requirement of the second application, reference may also be made to the above-mentioned process of determining resolution or direction. For example, regarding the specific method for the terminal device to determine the exposure parameter in the first shooting parameter, reference may also be made to the above-mentioned process of determining resolution; regarding the specific method for the terminal device to determine the filter parameter in the first shooting parameter, reference may also be made to the above-mentioned process of determining direction parameters.

[0151] It should be noted that, as another possible implementation, the terminal device may also obtain the first shooting parameter and the first processing parameter according to the first shooting requirement of the first application and the second shooting requirement of the second application. The first shooting parameter is used for shooting with the first camera, and the first processing parameter is used for data processing before providing the image data shot by the camera to the application. This part will be introduced in the following embodiments (such as S705).

[0152] S704: The terminal device shoots with a first camera using a first shooting parameter to obtain first initial image data.

[0153] As a possible implementation manner, the terminal device uses a first camera to shoot with a first shooting parameter, including:

[0154] After the terminal device starts the first camera, it sets the shooting parameters of the first camera to the first shooting parameters, and then executes the shooting action of the camera, and the first initial image data obtained by shooting conforms to the first shooting parameters.

[0155] For example, the terminal device can set the shooting resolution of the first camera to 1080P, set the shooting direction to horizontal shooting, and then execute the camera shooting action. In this case, the first initial image data obtained by the terminal device is a horizontal image with a resolution of 1080P.

[0156] S705: The terminal device sends first image data to the first application, and sends second image data to the second application, wherein the first image data meets the first shooting requirement of the first application, and the second image data meets the second shooting requirement of the second application.

[0157] In some embodiments, the first image data and the second image data are both first initial image data.

[0158] For example, when the first shooting requirement of the first application and the second shooting requirement of the second application are the same, the first shooting parameter is the shooting parameter corresponding to the first shooting requirement, that is, the shooting parameter corresponding to the second shooting requirement, the first image data and the second image data are both the first initial image data.

[0159] As an example, assuming that the first application and the second application both have image requirements of a first resolution of 1080P and a horizontal direction, and the terminal device determines that the first camera uses a first shooting parameter with a shooting resolution of 1080P and a horizontal shooting direction. In this case, the first initial image data obtained by the terminal device can meet both the first shooting requirement of the first application and the second shooting requirement of the second application. Therefore, the terminal device may not process the first initial image data, and directly provide the first initial image data to the first application and the second application.

[0160] In other embodiments, the first image data or the second image data is image data obtained by performing processing such as parameter adjustment on the first initial image data.

[0161] For example, when the first shooting requirement of the first application and the second shooting requirement of the second application are different, and the terminal device determines the first shooting parameter of the first camera according to the preset rules corresponding to each parameter, the first initial image data obtained by shooting with the first shooting parameter will inevitably fail to meet the shooting requirements of each application. For the case where the shooting requirements cannot be met, the terminal device needs to adjust the parameters of the first initial image data to obtain image data that can meet the shooting requirements of the application. For example, assuming that the first initial image data cannot meet the first shooting requirement of the first application, the terminal device can adjust the parameters of the first initial image data according to the first shooting requirement of the first application to obtain the first image data that meets the first shooting requirement; or assuming that the first initial image data cannot meet the second shooting requirement of the second application, the terminal device can adjust the parameters of the first initial image data according to the second shooting requirement of the second application to obtain the second image data that meets the second shooting requirement.

[0162] The parameter adjustment performed by the terminal device on the first initial image data may include but is not limited to adjusting one or more of the following parameters of the terminal device: image resolution, direction, exposure, filter, etc.

[0163] As an example, assume that the first application's image requirements are to meet a first resolution of 1080P and a horizontal orientation, and the second application's image requirements are to meet a second resolution of 720P and a horizontal orientation. The terminal device determines that the first camera uses a first shooting parameter with a shooting resolution of 1080P and a horizontal shooting direction. In this case, the first initial image data obtained by the terminal device can only meet the first shooting requirement of the first application. Therefore, the first initial image data can be provided directly to the first application without being processed. However, the first initial image data obtained by the terminal device cannot meet the second application's requirements for direction. In this case, the terminal device can process the first initial image data (for example, in units of image frames) so that the image direction is horizontal, and then provide the adjusted image data to the second application.

[0164] As another example, assuming that the first application's image requirements are to meet a first resolution of 1080P, a horizontal orientation, and a first filter, and the second application's image requirements are to meet a second resolution of 1080P, a horizontal orientation, and a second filter, the first initial image data obtained by the terminal device can only meet the resolution and orientation requirements of the first application and the second application. In this case, the terminal device can add filter parameters to the first initial image data to obtain first image data that meets the first filter and second image data that meets the second filter, and provide them to the first application and the second application, respectively.

[0165] For another example, if the camera hardware of a terminal device cannot meet the requirements of one or more applications for a certain parameter, and the terminal device captures the first initial image data using the parameters it can support, the first initial image data will inevitably not meet the shooting requirements of the one or more applications for the parameters. In the case of non-satisfaction, the terminal device can adjust the parameters of the first initial image data to obtain image data that can meet the shooting requirements of the applications.

[0166] As an example, suppose that the first application requires that the image meet the first resolution of 1080P, and the second application requires that the image meet the second resolution of 720P, but the terminal device can only support shooting images with a resolution of 480P. In this case, the terminal device intelligently shoots at a resolution of 480P, and the obtained first initial image data cannot meet the resolution requirements of the first application and the second application. In this case, as a possible implementation method, suppose that the terminal device has the ability to adjust the resolution of the first initial image data from 480P to 720P and 1080P, the terminal device can make corresponding adjustments to it and then send it to the corresponding application. It should be noted that the method for an application to call a camera provided in an embodiment of the present application does not limit the number of applications that the terminal device supports and can call the same camera at the same time. For example, Figure 8 As shown, in Figure 7 Based on the method shown, the terminal device can also reallocate the first camera to a third application. The method specifically includes Figure 8 S801-S805 shown:

[0167] S801: During the process in which a first camera of a terminal device provides shooting services for a first application and a second application, the terminal device receives an operation of a user invoking the first camera on an interface of a third application.

[0168] Among them, the third application may include but is not limited to native applications or third-party applications such as calls, maps, navigation, and short messages installed in the terminal device. In some embodiments, the third application can also be a quick application (also called a light application), which is not specifically limited in the embodiments of this application.

[0169] by Figure 3 Taking the terminal device with the software structure shown as an example, the third application is an application installed in the native operating system of the terminal device.

[0170] by Figure 4 or Figure 5 Taking the terminal device with the software structure shown in the figure as an example, the third application may be an application installed in the Host system of the terminal device, or may be an application installed in the Guest system of the terminal device.

[0171] As a possible example, the operation of the user calling the first camera on the interface of the third application may include but is not limited to the operation of the user clicking a preset control on the interface of the third application, the preset control being such as a preset button, a preset option, a preset link, etc. Among them, the user's click operation on the preset control may trigger the function of calling the camera, such as the user's click operation on the preset control may trigger the code to run through the "event" and complete the function of calling the camera.

[0172] Of course, the embodiment of the present application does not specifically limit the operation form and specific method of the user calling the first camera on the interface of the third application. For example, the operation of the user calling the first camera on the interface of the third application can also be a voice command, a preset sliding gesture, a preset body movement, a preset eye movement, etc.

[0173] In an embodiment of the present application, the first camera providing shooting services for the first application and the second application may also include the first camera processing the captured image data according to the shooting requirements of the first application and the second application respectively (for example, processing in units of image frames), and then providing image data that meets their respective shooting requirements to the first application and the second application respectively.

[0174] S802: The terminal device allocates the first camera to the third application and updates the camera authorization information, where the camera authorization information is used to indicate that the first camera provides shooting services for the first application, the second application, and the third application at the same time.

[0175] The terminal device assigning the first camera to the second application means that the terminal device assigns the use permission of the first camera to the first application, that is, the terminal device allows the first application to call the first camera.

[0176] As a possible example, the camera authorization information includes: a relationship index between the camera and the first application; and a relationship index between the first camera and the second application.

[0177] As another possible example, the camera authorization information includes: an identifier of an application that is calling the camera (ie, an application whitelist).

[0178] In some cases, the camera authorization information may also include the real-time number of applications that call the camera.

[0179] S803: The terminal device determines a second shooting parameter of the first camera according to the first shooting requirement of the first application, the second shooting requirement of the second application, and the third shooting requirement of the third application.

[0180] Among them, the third shooting requirement of the third application may include but is not limited to the third application's requirements for multiple parameters (such as image resolution, direction, exposure, filter, brightness, contrast, saturation, sharpness and other parameters).

[0181] In some examples, the first shooting requirement of the first application, the second shooting requirement of the second application, and the third shooting requirement of the third application are the same. In this case, the first shooting parameter determined by the terminal device may be the shooting parameter corresponding to the first shooting requirement, that is, the shooting parameter corresponding to the second shooting requirement, and that is, the shooting parameter corresponding to the third shooting requirement.

[0182] In other examples, at least two of the first shooting requirement of the first application, the second shooting requirement of the second application, and the third shooting requirement of the third application are different. In this case, the terminal device can determine the first shooting parameter of the first camera according to the preset rules corresponding to each parameter.

[0183] Among them, the preset rules may include but are not limited to the following rules: application priority rule, parameter priority rule, minority obeys majority rule, random determination rule, etc.

[0184] Also, in some examples, if the camera hardware of the terminal device cannot meet the requirements of one or more applications for a certain parameter, such as if the camera hardware of the terminal device cannot meet the requirements of one or more applications regarding resolution, the resolution parameter included in the first shooting parameter determined by the terminal device is the first resolution supported by the terminal device; and if the camera hardware of the terminal device cannot meet the requirements of one or more applications regarding direction, the direction parameter included in the first shooting parameter determined by the terminal device is the direction parameter supported by the terminal device.

[0185] S804: The terminal device shoots with the first camera using the second shooting parameters to obtain second initial image data.

[0186] As a possible implementation method, the terminal device shoots with the second shooting parameters through the first camera, including: the terminal device can set the shooting parameters of the first camera to the second shooting parameters and then execute the camera shooting action, and the second initial image data obtained by shooting conforms to the second shooting parameters.

[0187] S805: The terminal device sends the third image data to the first application, sends the fourth image data to the second application, and sends the fifth image data to the third application, wherein the third image data meets the first shooting requirement of the first application, the fourth image data meets the second shooting requirement of the second application, and the fifth image data meets the third shooting requirement of the third application.

[0188] In some embodiments, the second initial image data obtained by the terminal device can meet at least one of the first shooting requirement, the second shooting requirement, and the third shooting requirement. If the second initial image data meets the shooting requirement, the terminal device can provide the second initial image data to the corresponding application. If the second initial image data does not meet the shooting requirement, the terminal device can adjust the parameters of the second initial image data according to the specific shooting requirements of the application, and provide the adjusted image data that meets the shooting requirements of the application to the corresponding application.

[0189] The parameter adjustment performed by the terminal device on the second initial image data may include but is not limited to adjusting one or more of the following parameters of the terminal device: image resolution, direction, exposure, filter, etc.

[0190] Understandably, based on Figure 7 or Figure 8 In the method of using an application to call a camera, the terminal device can manage the authorization relationship between a camera and multiple applications based on the newly added management capability to support multiple applications installed therein to call the same camera of the terminal device to capture images at the same time, such as taking photos or videos. Compared with the conventional camera calling mechanism, it can not only solve the problem that multiple applications cannot capture images at the same time, but also avoid the additional cost caused by adding camera peripherals to meet the problem that multiple applications cannot capture images at the same time, and can greatly simplify the user's operation.

[0191] In addition, based on Figure 7 or Figure 8 A method for an application to call a camera is shown. Based on the newly added management capabilities, the terminal device can reasonably configure shooting parameters according to the shooting requirements of multiple applications that call the same camera, and provide the application with image data that meets the shooting requirements of the application according to the shooting requirements of the multiple applications, so as to improve data processing performance, including the performance of image data shooting and distribution.

[0192] As an example, the following Fig. 9 by Figure 3 Taking the terminal device with the software structure shown in the figure as an example, a possible implementation process of multiple applications calling the same camera is introduced. Fig. 9 As shown, the process of multiple applications calling cameras may include S901-S923b:

[0193] S901: The first application receives an operation by a user to call a first camera on the interface of the first application.

[0194] As a possible example, the operation of the user calling the first camera on the interface of the first application may include but is not limited to the operation of the user clicking a preset control on the interface of the first application, the preset control being such as a preset button, a preset option, a preset link, etc. Among them, the user's click operation on the preset control may trigger the function of calling the camera, such as the user's click operation on the preset control may trigger the code to run and complete the function of calling the camera through an "event". S902: The first application requests the camera manager to call the first camera.

[0195] S903: The camera manager starts the first camera.

[0196] S904: The camera manager updates the camera authorization information.

[0197] The camera authorization information is used to indicate that the first camera provides shooting services for the first application.

[0198] As an example, the camera manager updating the camera authorization information may include: the camera manager saving the relationship index between the first camera and the first application, wherein the relationship index between the first camera and the first application is such as the identification (ID) of the first camera and the application name or application ID index of the first application.

[0199] As another example, the camera manager updating the camera authorization information this time may include: the camera manager saving the identifier of the first application (such as the application name or the application ID), that is, the camera manager adds the identifier of the first application to the whitelist.

[0200] In some cases, if the camera authorization information also includes the real-time number of applications that call the camera, the camera manager updating the camera authorization information may also include: after starting the first camera according to the request of the first application, the camera manager may increase the real-time number of applications that call the first camera by 1. Correspondingly, when the first application subsequently ends calling the first camera, the camera manager may decrease the real-time number of applications that call the first camera by 1. Based on this, the camera manager can release the resources corresponding to the first camera (such as computing power and memory resources) when all applications end calling the first camera.

[0201] S905: The camera manager notifies the first application that the call to the first camera is successful.

[0202] S906: The first application sends a first shooting request of the first application to the camera manager.

[0203] It should be noted that this application Fig. 9This is only an example, and the timing relationship between the various steps is not specifically limited. For example, S906 may also be executed synchronously with S902, S903, S904 or S905.

[0204] S907: The camera manager determines a third shooting parameter according to the first shooting requirement.

[0205] As an example, since the first camera currently only provides services to the first application, the third shooting parameter may be a shooting parameter corresponding to the first shooting requirement.

[0206] S908: The camera manager sends a third shooting parameter to the first camera.

[0207] S909: The first camera shoots with a third shooting parameter to obtain third initial image data.

[0208] S910: The first camera sends third initial image data to the camera data processor.

[0209] S911: The camera data processor obtains a first shooting requirement from the camera manager.

[0210] S912: The camera data processor sends image data that meets the first shooting requirement to the first application.

[0211] It can be understood that, since the third shooting parameter is the shooting parameter corresponding to the first shooting requirement, the third initial image data obtained by shooting with the third shooting parameter can definitely meet the first shooting requirement, so the terminal device does not need to process the third initial image data. That is, the first image data sent by the camera data processor to the first application is the third initial image data obtained by shooting.

[0212] S913: The second application receives an operation by the user to call the first camera on the interface of the second application.

[0213] For a detailed description of the operation of the user calling the first camera on the interface of the second application, please refer to the description in the above embodiment, which will not be repeated here.

[0214] S914: The second application requests the camera manager to call the first camera.

[0215] S915: The camera manager notifies the second application that the call to the first camera is successful.

[0216] S916: The camera manager updates the camera authorization information.

[0217] As an example, the camera manager updating the camera authorization information may include: the camera manager saving the relationship index between the first camera and the second application, wherein the relationship index between the first camera and the second application is such as the index of the ID of the first camera and the application name or application ID of the second application.

[0218] As another example, the camera manager updating the camera authorization information this time may include: the camera manager saving the identifier of the second application (such as the application name or the application ID), that is, the camera manager adds the identifier of the second application to the whitelist.

[0219] In some cases, if the camera authorization information also includes the real-time number of applications that call the camera, the camera manager updating the camera authorization information may also include: after calling the first camera according to the request of the second application, the camera manager may increase the real-time number of applications that call the first camera by 1. Correspondingly, when the second application subsequently ends calling the first camera, the camera manager may reduce the real-time number of applications that call the first camera by 1.

[0220] S917: The second application sends a second shooting request of the second application to the camera manager.

[0221] It should be noted that the embodiment of the present application does not specifically limit the timing relationship between S917 and other steps. For example, S917 may also be executed synchronously with S914, S915 or S916.

[0222] S918: The camera manager determines a first shooting parameter according to the first shooting requirement and the second shooting requirement.

[0223] For a detailed introduction on how the camera manager determines the first shooting parameter according to the first shooting requirement and the second shooting requirement, please refer to the description in the above embodiment, which will not be repeated here.

[0224] S919: The camera manager sends a first shooting parameter to the first camera.

[0225] S920: The first camera performs shooting with a first shooting parameter to obtain first initial image data.

[0226] S921: The first camera sends first initial image data to the camera data processor.

[0227] S922: The camera data processor obtains a second shooting requirement from the camera manager.

[0228] S923a: The camera data processor sends first image data to the first application, where the first image data is image data that meets a first shooting requirement.

[0229] S923b: The camera data processor sends second image data to the second application, where the second image data is image data that meets a second shooting requirement.

[0230] about Fig. 9 The detailed description of S901-S923b shown in the figure can be referred to in the above embodiment. Figure 8 The related introduction of S701-S705 and S801-S805 shown in the figure will not be repeated here.

[0231] As an example, the following Fig.10 by Figure 5 Taking the terminal device with the software structure shown in the figure as an example, taking the first application being an application installed in the Host system and the second application being an application installed in the Guest system as an example, another possible implementation process of multiple applications calling the same camera is introduced. Fig.10 As shown, the process of multiple applications calling cameras may include S1001-S1026b:

[0232] S1001: A first application in a host system receives an operation of a user invoking a first camera on an interface of the first application.

[0233] For a detailed description of the operation of the user calling the first camera on the interface of the first application, please refer to the description in the above embodiment, which will not be repeated here.

[0234] S1002: A first application in the host system requests a camera manager in the host system to call a first camera.

[0235] S1003: The camera manager in the host system starts the first camera.

[0236] S1004: The camera manager in the Host system updates the camera authorization information.

[0237] For the related introduction of camera authorization information and the related introduction of the camera manager updating camera authorization information, please refer to the description in the above embodiment, which will not be repeated here.

[0238] S1005: The camera manager in the host system notifies the first application that the call to the first camera is successful.

[0239] S1006: The first application in the Host system sends a first shooting request of the first application to the camera manager in the Host system.

[0240] It should be noted that the embodiment of the present application does not specifically limit the timing relationship between S1006 and other steps. For example, S1006 may also be executed synchronously with S1002, S1003, S1004 or S1005.

[0241] S1007: The camera manager in the Host system determines a third shooting parameter according to the first shooting requirement.

[0242] For example, the third shooting parameter may be a shooting parameter corresponding to the first shooting requirement.

[0243] S1008: The camera manager in the Host system sends a third shooting parameter to the first camera.

[0244] S1009: The first camera shoots with a third shooting parameter to obtain third initial image data.

[0245] S1010: The first camera sends third initial image data to a camera data processor in the Host system.

[0246] S1011: The camera data processor in the Host system obtains a first shooting requirement from the camera manager in the Host system.

[0247] S1012: The camera data processor in the host system sends image data that meets the first shooting requirement to the first application.

[0248] For example, the first image data sent by the camera data processor in the Host system to the first application is the third initial image data obtained by shooting.

[0249] S1013: The second application in the Guest system receives an operation of the user invoking the first camera on the interface of the second application.

[0250] For a detailed description of the operation of the user calling the first camera on the interface of the second application, please refer to the description in the above embodiment, which will not be repeated here.

[0251] S1014: The second application in the Guest system requests the camera manager in the Guest system to call the first camera.

[0252] S1015: The camera manager in the Guest system requests the camera manager in the Host system to call the first camera.

[0253] S1016: The camera manager in the Host system notifies the camera manager in the Guest system that the second application successfully calls the first camera.

[0254] As an example, the camera manager in the host system and the camera manager in the guest system can be Figure 5 The cross-system task components are shown communicating.

[0255] S1017: The camera manager in the Guest system notifies the second application that the call to the first camera is successful.

[0256] S1018: The camera manager in the Host system updates the camera authorization information.

[0257] For the related introduction of camera authorization information and the related introduction of the camera manager updating camera authorization information, please refer to the description in the above embodiment, which will not be repeated here.

[0258] S1019: The second application in the Guest system sends a second shooting request of the second application to the camera manager in the Guest system.

[0259] It should be noted that the embodiment of the present application does not specifically limit the timing relationship between S1019 and other steps. For example, S1019 can also be executed synchronously with S1014, S1015, S1016, S1017 or S1018.

[0260] S1020: The camera manager in the Guest system sends a second shooting request of the second application to the camera manager in the Host system.

[0261] S1021: The camera manager in the host system determines a first shooting parameter according to the first shooting requirement and the second shooting requirement.

[0262] For a detailed introduction on how the camera manager determines the first shooting parameter according to the first shooting requirement and the second shooting requirement, please refer to the description in the above embodiment, which will not be repeated here.

[0263] S1022: The camera manager in the host system sends a first shooting parameter to the first camera.

[0264] S1023: The first camera in the Host system shoots with the first shooting parameter to obtain first initial image data.

[0265] S1024: The first camera sends first initial image data to a camera data processor in the Host system.

[0266] S1025: The camera data processor in the Host system obtains the second shooting requirement from the camera manager in the Host system.

[0267] S1026a: The camera data processor in the Host system sends first image data to the first application, where the first image data is image data that meets a first shooting requirement.

[0268] S1026b: The camera data processor in the Host system sends second image data to the second application, wherein the second image data is image data that meets the second shooting requirement.

[0269] about Figure 5 The implementation process of multiple applications installed in the Guest system in the terminal device of the software structure shown in the figure can be referred to Fig. 9 In this case, Fig. 9 The first application and the second application are both installed in the Guest system. Fig. 9 The camera image manager and camera data processor shown belong to the Guest system.

[0270] It should be noted that this application Fig. 9 and Fig.10 This is just an example of a possible implementation process of two or more applications calling the camera. In actual use, it can also include Fig. 9 or Fig.10 More or fewer steps. And, in actual use, it is not limited to Fig. 9 or Fig.10 The order of certain steps in the process. For example, Fig. 9 As shown, S903 can be executed simultaneously with S904, or S903 can be executed before S904, or S904 can be executed before S903. Fig. 9 As shown, S915 can be executed simultaneously with S916, or S915 can be executed before S916, or S916 can be executed before S915. Fig. 9 As shown, S923a and S923b can be executed simultaneously, or S923a can be executed first and S923b can be executed later, or S923b can be executed first and S923a can be executed later.

[0271] Based on a method for an application to call a camera provided in an embodiment of the present application, a terminal device can support multiple applications installed therein (such as Fig.11 The first application, the second application and the third application) simultaneously call the same camera of the terminal device (such as Fig.11 Compared with the conventional camera calling mechanism, this method can not only solve the problem that multiple applications cannot simultaneously capture images, but also avoid the extra cost caused by adding camera peripherals to meet the requirement that multiple applications cannot simultaneously capture images, and can greatly simplify the user's operation.

[0272] In addition, based on a method for calling a camera by an application provided in an embodiment of the present application, the terminal device can reasonably configure shooting parameters (such as Fig.11 The resolution shown is 1080P and the direction parameter is horizontal), and image data that meets the shooting requirements of the application is provided to the application according to the shooting requirements of the multiple applications (such as Fig.11 As shown, image data with a resolution of 1080P and a horizontal orientation parameter is provided to the first application, image data with a resolution of 720P and a horizontal orientation parameter is provided to the second application, and image data with a resolution of 1080P and a vertical orientation parameter is provided to the third application) to improve data processing performance, including the performance of image data capture and distribution.

[0273] It should be understood that the various schemes of the embodiments of the present application can be used in reasonable combination, and the explanations or descriptions of the various terms appearing in the embodiments can be mutually referenced or explained in the various embodiments, without limitation.

[0274] It should also be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0275] It is understandable that, in order to implement the functions of any of the above-mentioned embodiments, the terminal device includes a hardware structure and / or software module corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0276] The embodiment of the present application can divide the terminal device into functional modules. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing module. The above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0277] As an example, the terminal device may include a user input unit, a processing unit, and an image capture unit according to the division of functional modules. Among them, the user input unit is used to receive user input operations, the processing unit is used to perform camera authorization, resource allocation, and image data processing and distribution and other related management, and the image capture unit is used to capture images. Of course, the terminal device may also include a display unit for interface display.

[0278] It should also be understood that each module in the terminal device can be implemented in software and / or hardware form, without specific limitation. In other words, the electronic device is presented in the form of functional modules. The "module" here can refer to a specific application integrated circuit ASIC, a circuit, a processor and memory that executes one or more software or firmware programs, an integrated logic circuit, and / or other devices that can provide the above functions.

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

[0280] The steps of the method or algorithm described in conjunction with the embodiments of the present application can be implemented in a hardware manner, or can be implemented by a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile hard disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC. In addition, the ASIC can be located in a terminal device. Of course, the processor and the storage medium can also exist as discrete components.

[0281] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

Claims

1. A method for using an application to call a camera, the method being applied to a terminal device, the terminal device including a camera, characterized in that: The method comprises: During the process of the first application taking pictures through the camera, the terminal device receives a first operation, where the first operation is used to instruct the second application to call the camera; In response to the first operation, the terminal device determines a first shooting parameter of the camera according to a first shooting requirement of the first application and a second shooting requirement of the second application; The terminal device shoots with the first shooting parameter to obtain first initial image data; The terminal device sends first image data to the first application based on the first initial image data, and sends second image data to the second application, wherein the first image data is image data that meets the first shooting requirement, and the second image data is image data that meets the second shooting requirement.

2. The method according to claim 1, characterized in that The method further comprises: In response to the first operation, the terminal device updates camera authorization information, where the camera authorization information is used to indicate that the camera provides shooting services for both the first application and the second application.

3. The method according to claim 2, characterized in that The camera authorization information also includes: The real-time number of applications calling the camera.

4. The method according to any one of claims 1 to 3, characterized in that The first shooting requirement includes a requirement of the first application on at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness; The second shooting requirement includes a requirement of the second application on at least one of the following parameters of the image data: resolution, direction, exposure, filter, brightness, contrast, saturation, and sharpness.

5. The method according to any one of claims 1 to 4, characterized in that When the first shooting requirement and the second shooting requirement are the same, the first shooting parameter is a shooting parameter corresponding to the first shooting requirement or the second shooting requirement; The terminal device sends the first image data to the first application based on the first initial image data, including: the terminal device sends the first initial image data as the first image data to the first application; The terminal device sending the second image data to the second application based on the first initial image data includes: the terminal device sending the first initial image data to the second application as the second image data.

6. The method according to any one of claims 1 to 4, characterized in that When the first shooting requirement and the second shooting requirement are different, the terminal device determines the first shooting parameter of the camera according to the first shooting requirement of the first application and the second shooting requirement of the second application, including: The terminal device determines the first shooting parameter according to preset rules corresponding to the parameters in the first shooting requirement and the second shooting requirement; wherein the preset rules include one or more of the following: application priority rule, parameter priority rule, minority obeys majority rule, and random determination rule.

7. The method according to claim 6, characterized in that The terminal device sends the first image data to the first application based on the first initial image data, including: If the first initial image data meets the first shooting requirement, the terminal device sends the first initial image data as the first image data to the first application; if the first initial image data does not meet the first shooting requirement, the terminal device adjusts the corresponding parameters in the first initial image data and sends the data as the first image data to the first application; The terminal device sends second image data to the second application based on the first initial image data, including: If the first initial image data meets the second shooting requirement, the terminal device sends the first initial image data as the second image data to the second application; if the first initial image data does not meet the second shooting requirement, the terminal device adjusts the corresponding parameters in the first initial image data and sends it as the second image data to the second application.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: When the real-time number of applications calling the camera is reduced to 0, the terminal device releases the resources corresponding to the camera.

9. The method according to any one of claims 1 to 8, characterized in that The method further comprises: During the process of the first application and the second application taking photos through the camera, the terminal device receives a second operation, where the second operation is used to instruct a third application to call the camera; In response to the second operation, the terminal device determines a second shooting parameter of the camera according to a first shooting requirement of the first application, a second shooting requirement of the second application, and a third shooting requirement of the third application; The terminal device shoots with the second shooting parameter to obtain second initial image data; The terminal device sends third image data to the first application based on the second initial image data, sends fourth image data to the second application, and sends fifth image data to the third application, wherein the third image data is image data that meets the first shooting requirement, the fourth image data is image data that meets the second shooting requirement, and the fifth image data is image data that meets the third shooting requirement.

10. The method according to claim 9, characterized in that The terminal device includes a first system, and the first application, the second application and the third application are all installed in the first system.

11. The method according to claim 9, characterized in that The terminal device includes a first system and a second system, and the first application, the second application and the third application are all installed in the second system.

12. The method according to claim 9, characterized in that The terminal device includes a first system and a second system, at least one of the first application, the second application, and the third application is installed in the first system and at least one is installed in the second system.

13. A terminal device, characterized in that: The terminal device comprises: A camera, used for capturing images; a memory for storing computer program instructions; A processor, configured to execute the computer program instructions to support the terminal device to implement the method as described in any one of claims 1-12.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processing circuit, the method according to any one of claims 1 to 12 is implemented.

15. A computer program product comprising instructions, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 12.

16. A chip system, characterized in that: The chip system includes a processing circuit and a storage medium, wherein the storage medium stores computer program instructions; when the computer program instructions are executed by the processing circuit, the method as described in any one of claims 1 to 12 is implemented.