CN115242972A - Method and device for calling camera by application, electronic equipment and storage medium - Google Patents

Method and device for calling camera by application, electronic equipment and storage medium Download PDF

Info

Publication number
CN115242972A
CN115242972A CN202210720147.2A CN202210720147A CN115242972A CN 115242972 A CN115242972 A CN 115242972A CN 202210720147 A CN202210720147 A CN 202210720147A CN 115242972 A CN115242972 A CN 115242972A
Authority
CN
China
Prior art keywords
camera
application
calling
api
system camera
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210720147.2A
Other languages
Chinese (zh)
Inventor
宋向阳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Konka Electronic Technology Co Ltd
Original Assignee
Shenzhen Konka Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Konka Electronic Technology Co Ltd filed Critical Shenzhen Konka Electronic Technology Co Ltd
Priority to CN202210720147.2A priority Critical patent/CN115242972A/en
Publication of CN115242972A publication Critical patent/CN115242972A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication

Abstract

The disclosure provides a method and a device for calling a camera by using an application, an electronic device and a storage medium, wherein the method comprises the following steps: receiving a calling request of an application to a system camera of a terminal device; responding the calling request to call a virtual camera API, and interacting with the system camera API through the virtual camera API; and returning the interactive result to the application through the virtual camera API. Through the method and the device, the problem that a plurality of applications cannot access the camera simultaneously in the related art is solved, and the effect that the plurality of applications equally share the camera of the system is achieved.

Description

Method and device for calling camera by application, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for invoking a camera by an application, an electronic device, and a storage medium.
Background
The conventional android system is widely applied to devices such as smart phones, flat panels and smart televisions. And each large mobile phone and television manufacturer also performs respective optimization based on the android system, and provides various APIs for app developers to use. The camera-related API enables android developers to call camera-related interfaces to achieve functions of shooting in the app, video calling and the like.
The existing android system cannot enable a plurality of applications to access the camera API simultaneously, when the plurality of apps access the camera simultaneously, hardware equipment preemption is generated, or the current app with the camera permission stops using and gives permission to a new app for use, or the current app with permission does not release permission, and the new app applying for using the camera cannot acquire permission, so that related functions cannot be realized. Meanwhile, hardware preemption is taken as a special error needing to be processed in the development process, which is not only beneficial to code conciseness but also beneficial to development efficiency.
At present, no effective solution is provided for the problem that a plurality of applications cannot access a camera simultaneously in the related art.
Disclosure of Invention
The present disclosure is directed to overcome the deficiencies in the prior art, and provides a method and an apparatus for an application to invoke a camera, an electronic device, and a storage medium, so as to at least solve the problem that multiple applications cannot access the camera simultaneously in the related art.
According to an aspect of the present disclosure, a method for an application to call a camera is provided, including:
receiving a calling request of an application to a system camera of a terminal device;
responding the calling request to call a virtual camera API, and interacting with the system camera API through the virtual camera API;
and returning the interactive result to the application through the virtual camera API.
According to another aspect of the present disclosure, there is provided an apparatus for calling a camera by an application, including:
the receiving unit is used for receiving a calling request of an application to a system camera of the terminal equipment;
the interaction unit is used for responding the calling request to call a virtual camera API and interacting with the system camera API through the virtual camera API;
and the return unit is used for returning the interaction result to the application through the virtual camera API.
According to another aspect of the present disclosure, there is provided an electronic device including:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions that when executed by the processor cause the processor to perform the method of the application invoking a camera in the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform a method of the application calling a camera in the present disclosure.
According to one or more technical schemes provided by the embodiment of the disclosure, a call request of an application to a system camera of a terminal device is received; responding the calling request to call a virtual camera API, and interacting with the system camera API through the virtual camera API; and returning the interactive result to the application through the virtual camera API. Through the method and the device, the problem that a plurality of applications cannot access the camera simultaneously in the related technology is solved, and the technical effect that the plurality of applications equally share the camera of the system is achieved.
Drawings
Further details, features and advantages of the disclosure are disclosed in the following description of exemplary embodiments, taken in conjunction with the accompanying drawings, in which:
fig. 1 illustrates a flowchart of a method of an application calling a camera according to an exemplary embodiment of the present disclosure;
fig. 2 shows a schematic diagram of a virtual camera module interacting with a native system, according to an example embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of a camera service registration process according to an example embodiment of the present disclosure;
fig. 4 shows a schematic diagram of a video stream acquisition process according to an exemplary embodiment of the present disclosure;
fig. 5 shows a schematic diagram of a camera service parameter setting process according to an example embodiment of the present disclosure;
FIG. 6 shows a schematic block diagram of an apparatus for applying a call to a camera according to an example embodiment of the present disclosure;
FIG. 7 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description. It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Aspects of the present disclosure are described below with reference to the accompanying drawings.
The exemplary embodiment of the present disclosure provides a method for an application to call a camera. The method for calling the camera by the application can be applied to the fields of smart phones, smart televisions and the like. In the method for calling the camera by the application, the problem of camera preemption can be solved by calling the virtual camera API by the application.
Fig. 1 shows a flowchart of a method for calling a camera by an application according to an exemplary embodiment of the present disclosure, and as shown in fig. 1, the method includes the following steps:
step S101, receiving a calling request of an application to a system camera of a terminal device;
step S102, responding to the calling request, calling a virtual camera API, and interacting with the system camera API through the virtual camera API;
and step S103, returning the interactive result to the application through the virtual camera API.
Through the steps, the application calls the system camera by calling the virtual camera API, the problem that multiple applications cannot access the camera simultaneously in the related technology is solved, the technical effect that the multiple applications share the system camera equally is achieved, and then the use experience of a user is improved.
In some embodiments, when the call request is used to indicate that the system camera is applied for use, the step S102 may include the following steps:
calling a camera application interface, wherein the virtual camera API comprises the camera application interface;
judging whether the system camera is used at present;
if the system camera is not called currently, calling the system camera API through the camera application interface, and setting a virtual camera API as a proxy of the system camera;
judging whether the system camera is successfully called or not;
if the system camera is successfully called, returning a first callback message to the application, wherein the first callback message is used for indicating that the system camera is successfully called;
and if the calling of the system camera is judged to be failed, returning a second callback message to the application, wherein the second callback message is used for indicating that the calling of the system camera is failed.
If the system camera has been called currently, judging whether the number of applications which have successfully called the system camera reaches a threshold value;
if the number of applications which successfully call the system camera reaches a threshold value, sending a third callback message to the applications, wherein the third callback message is used for indicating that the system camera fails to call, and the reason for the failure is that the number of applications which call the system camera reaches the threshold value;
and if the number of the applications which have successfully called the system camera is judged not to reach the threshold value, the first callback message is sent to the applications.
In some embodiments, when the call request is used to indicate to read a video stream, in a case that the system camera call is successful, the step S102 may include the following procedures:
calling an interface for acquiring a video stream, wherein the virtual camera API comprises the interface for acquiring the video stream;
determining whether the application is reading a video stream;
if the application is judged to be reading the video stream, adding the application into an application set to be pushed;
if the application is not in the process of reading the video stream, calling the system camera API through the video stream acquiring interface to read the video stream, and pushing the read video stream to the application in the application set of the stream to be pushed.
In some embodiments, when the invocation request is used to indicate to modify the system camera parameters, in a case that the system camera invocation is successful, the step S102 may include the following procedures:
calling a camera parameter modification interface, wherein the virtual camera API comprises the camera parameter modification interface;
calling the system camera API through the camera parameter modification interface to modify the parameters of the system camera;
judging whether the parameters of the system camera are successfully modified;
if the parameter of the system camera is not successfully modified, returning a fourth callback message to the application, wherein the fourth callback message is used for indicating that the parameter of the system camera is unsuccessfully modified;
and if the parameter modification of the system camera is judged to be successful, returning a parameter modification message to other applications using the system camera.
It should be noted that the virtual camera API provides a virtual camera component between the system layer and the application layer, as a single instance of an application call. The virtual camera API is a single instance of a virtual camera module constructed between a native system and an application, the application calls the system camera by calling the virtual camera API, and a plurality of applications can simultaneously access the camera, so that a plurality of video chat applications can be used simultaneously, or the camera setting effect (such as a beautifying effect) of one application can be simultaneously realized in other applications, and other scenes.
As shown in fig. 2, in the embodiment of the present disclosure, a virtual camera module interacts with a native system, an application calls the virtual camera module to implement camera call, the virtual camera module implements parameter setting and transparent transmission of a callback, and distributes video data to all required applications, thereby achieving a purpose that multiple applications can acquire a video stream captured by a camera.
The application needs to follow the use rule of the method, does not directly call the service of the system camera, and calls the virtual camera API instead. The application and the virtual camera API and the system camera API are mainly and interactively divided into: the method comprises the steps of camera service registration, video stream acquisition and camera service parameter setting.
The implementation process of the camera service registration may be as shown in fig. 3, and the specific process may be described as follows:
applying the app for the camera to use; calling a camera application interface by the app; judging whether the system camera is called currently or not, and if the system camera is called currently, judging whether the performance of the current equipment is enough or not; and if the current equipment performance is enough, sending a callback to the app: calling the camera successfully; if the current equipment performance is not enough, sending a callback to the app: the camera call fails because the maximum number of connections is reached; if the system camera is not called currently, calling a system camera API (application program interface) to obtain a video stream, setting a camera proxy as the camera proxy and calling the system camera API; judging whether the calling of the camera is successful or not; if the camera is successfully called, sending a callback to the app: calling the camera successfully; and if the calling of the camera fails, transparently transmitting the failure reason to the app.
The implementation process of video stream acquisition may be as shown in fig. 4, and the specific process may be described as follows:
reading the video stream by the application app; judging whether the camera is applied for use or not; if the camera is not applied for use, prompting that the camera application needs to be carried out firstly; if the camera is applied for use, calling the app to acquire a video stream interface; judging whether the video stream is being read; if the video stream is being read, adding the apps into all the app sets needing stream pushing; if the video stream is not read, calling an API (application program interface) of a system camera to read the system video stream; and pushing data to all the apps needing push streaming.
The implementation process of setting the camera service parameters may be as shown in fig. 5, and the specific process may be described as follows:
the app is applied to modify the camera parameters; judging whether the camera is applied for use or not; if the camera is not applied for use, prompting that the camera application needs to be carried out firstly; if the application for the camera is applied, calling a camera parameter modification interface by the app; then calling an API (application program interface) of the system camera to modify parameters; judging whether the modification is successful; if the modification is unsuccessful, transmitting the failure reason to the app; if the modification is successful, judging whether other apps use the camera or not; and if other apps use the camera, calling back the parameter modification message to the other apps.
The embodiment of the disclosure divides the system camera API into video stream acquisition and parameter setting, and the video stream as data can be distributed to different applications, thereby realizing that a plurality of applications acquire the video stream at the same time. And the parameter setting can be shared through parameter passthrough and notification. The embodiment of the disclosure realizes the technical effect that a plurality of applications equally share the camera.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The exemplary embodiment of the present disclosure further provides a device for invoking a camera, where the device is used to implement the foregoing embodiments and preferred embodiments, and the descriptions already made are omitted. As used below, the terms "module," "unit," "sub-unit," and the like may implement a combination of software and/or hardware of predetermined functions. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 6 is a schematic block diagram illustrating an apparatus for calling a camera by an application according to an exemplary embodiment of the present disclosure, and as shown in fig. 6, the apparatus includes:
a receiving unit 61, configured to receive a call request of an application to a system camera of a terminal device;
the interaction unit 62 is configured to respond to the call request to call a virtual camera API, and interact with the system camera API through the virtual camera API;
a returning unit 63, configured to return the interaction result to the application through the virtual camera API.
In some embodiments, when the call request is used to indicate that the system camera is applied for use, the interaction unit 62 includes:
the first calling module is used for calling a camera application interface, wherein the virtual camera API comprises the camera application interface;
the first judgment module is used for judging whether the system camera is used at present;
the second calling module is used for calling the system camera API through the camera application interface if the fact that the system camera is not called currently is judged, and setting a virtual camera API as a proxy of the system camera;
the second judgment module is used for judging whether the system camera is successfully called;
the first returning module is used for returning a first returning message to the application if the system camera is successfully called, wherein the first returning message is used for indicating that the system camera is successfully called;
and the second returning module is used for returning a second callback message to the application if the calling of the system camera is judged to be failed, wherein the second callback message is used for indicating that the calling of the system camera is failed.
In some of these embodiments, the interaction unit 62 further includes:
the third judging module is used for judging whether the number of applications which have successfully called the system camera reaches a threshold value or not if the system camera has been used currently;
a third returning module, configured to send a third callback message to the application if it is determined that the number of applications that have successfully called the system camera reaches a threshold, where the third callback message is used to indicate that the system camera fails to call, and a failure reason is that the number of applications that have called the system camera reaches the threshold;
and the fourth returning module is used for sending the first returning message to the application if the number of the applications which have successfully called the system camera is judged not to reach the threshold value.
In some embodiments, when the call request is used to indicate to read a video stream, in a case where the system camera call is successful, the interaction unit 62 includes:
the second calling module is used for calling an interface for acquiring the video stream, wherein the virtual camera API comprises the interface for acquiring the video stream;
a fourth judging module, configured to judge whether the application is reading a video stream;
the adding module is used for adding the application into an application set to be pushed if the application is judged to be reading the video stream;
and a fifth returning module, configured to, if it is determined that the application is not reading a video stream, call the system camera API to read the video stream through the video stream acquiring interface, and push the read video stream to an application in the application set to be pushed.
In some embodiments, when the invocation request is used to indicate to modify the system camera parameters, in a case that the system camera invocation is successful, the interacting unit 62 includes:
the third calling module is used for calling a camera parameter modification interface, wherein the virtual camera API comprises the camera parameter modification interface;
the modification module is used for calling the system camera API through the camera parameter modification interface to modify the parameters of the system camera;
the fifth judgment module is used for judging whether the parameters of the system camera are successfully modified;
a sixth returning module, configured to return a fourth callback message to the application if it is determined that the parameter of the system camera is not successfully modified, where the fourth callback message is used to indicate that the parameter of the system camera is unsuccessfully modified;
and the seventh returning module is used for returning a parameter modification message to other applications using the system camera if the parameter modification of the system camera is judged to be successful.
The above modules may be functional modules or program modules, and may be implemented by software or hardware. For a module implemented by hardware, the modules may be located in the same processor; or the modules can be respectively positioned in different processors in any combination.
An exemplary embodiment of the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program, when executed by the at least one processor, is for causing the electronic device to perform a method according to an embodiment of the disclosure.
The disclosed exemplary embodiments also provide a non-transitory computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
The exemplary embodiments of the present disclosure also provide a computer program product comprising a computer program, wherein the computer program, when executed by a processor of a computer, is adapted to cause the computer to perform a method according to an embodiment of the present disclosure.
Referring to fig. 7, a block diagram of a structure of an electronic device 700, which may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic device is intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the electronic device 700 includes a computing unit 701, which may perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can be stored. The calculation unit 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
A number of components in the electronic device 700 are connected to the I/O interface 705, including: an input unit 706, an output unit 707, a storage unit 708, and a communication unit 709. The input unit 706 may be any type of device capable of inputting information to the electronic device 700, and the input unit 706 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device. Output unit 707 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 708 may include, but is not limited to, magnetic or optical disks. The communication unit 709 allows the electronic device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and/or chipsets, such as bluetooth devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 performs the respective methods and processes described above. For example, in some embodiments, the method of an application calling a camera may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 700 via the ROM 702 and/or the communication unit 709. In some embodiments, the computing unit 701 may be configured by any other suitable means (e.g., by means of firmware) to execute a method of an application calling a camera.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program code, when executed by the processor or controller, causes the functions/acts specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.

Claims (10)

1. A method for calling a camera by an application is characterized by comprising the following steps:
receiving a calling request of an application to a system camera of a terminal device;
responding the calling request to call a virtual camera API, and interacting with the system camera API through the virtual camera API;
and returning the interactive result to the application through the virtual camera API.
2. The method for calling a camera according to claim 1, wherein when the call request indicates that the system camera is applied for use, the calling a virtual camera API in response to the call request, and interacting with the system camera API through the virtual camera API, comprises:
calling a camera application interface, wherein the virtual camera API comprises the camera application interface;
judging whether the system camera is used at present;
if the system camera is not called currently, calling the system camera API through the camera application interface, and setting a virtual camera API as a proxy of the system camera;
judging whether the system camera is successfully called;
if the system camera is successfully called, returning a first callback message to the application, wherein the first callback message is used for indicating that the system camera is successfully called;
and if the calling of the system camera is judged to be failed, returning a second callback message to the application, wherein the second callback message is used for indicating that the calling of the system camera is failed.
3. The method for calling a camera according to claim 2, further comprising:
if the currently called system camera is judged, judging whether the number of applications which successfully call the system camera reaches a threshold value;
if the number of applications which successfully call the system camera reaches a threshold value, sending a third callback message to the applications, wherein the third callback message is used for indicating that the system camera fails to call, and the reason for the failure is that the number of applications which call the system camera reaches the threshold value;
and if the number of the applications which have successfully called the system camera is judged not to reach the threshold value, the first callback message is sent to the applications.
4. The method for calling a camera according to claim 2 or 3, wherein when the call request is used to indicate reading of a video stream, in case that the system camera call is successful, the calling a virtual camera API in response to the call request, and interacting with the system camera API through the virtual camera API comprises:
calling an interface for acquiring a video stream, wherein the virtual camera API comprises the interface for acquiring the video stream;
determining whether the application is reading a video stream;
if the application is judged to be reading the video stream, adding the application into an application set to be pushed;
if the application is not in the process of reading the video stream, calling the system camera API through the video stream acquiring interface to read the video stream, and pushing the read video stream to the application in the application set of the stream to be pushed.
5. The method for calling a camera by an application according to claim 2 or 3, wherein when the call request is used to indicate to modify the system camera parameters, in case that the system camera call is successful, the calling a virtual camera API in response to the call request, and interacting with the system camera API through the virtual camera API comprises:
calling a camera parameter modification interface, wherein the virtual camera API comprises the camera parameter modification interface;
calling the system camera API through the camera parameter modification interface to modify the parameters of the system camera;
judging whether the parameters of the system camera are successfully modified;
if the parameter of the system camera is not successfully modified, returning a fourth callback message to the application, wherein the fourth callback message is used for indicating that the parameter of the system camera is unsuccessfully modified;
and if the parameter modification of the system camera is judged to be successful, returning a parameter modification message to other applications using the system camera.
6. An apparatus for calling a camera by an application, comprising:
the receiving unit is used for receiving a calling request of an application to a system camera of the terminal equipment;
the interaction unit is used for responding the calling request to call a virtual camera API and interacting with the system camera API through the virtual camera API;
and the return unit is used for returning the interaction result to the application through the virtual camera API.
7. The apparatus for calling a camera according to claim 6, wherein when the call request indicates to apply for using the system camera, the interacting unit comprises:
the first calling module is used for calling a camera application interface, wherein the virtual camera API comprises the camera application interface;
the first judgment module is used for judging whether the system camera is used at present;
the second calling module is used for calling the system camera API through the camera application interface and setting a virtual camera API as an agent of the system camera if the fact that the system camera is not called currently is judged;
the second judgment module is used for judging whether the system camera is successfully called;
the first returning module is used for returning a first returning message to the application if the system camera is successfully called, wherein the first returning message is used for indicating that the system camera is successfully called;
and the second returning module is used for returning a second callback message to the application if the system camera is judged to be failed to call, wherein the second callback message is used for indicating that the system camera is failed to call.
8. The apparatus for invoking a camera according to claim 7, wherein said interacting unit further comprises:
the third judging module is used for judging whether the number of applications which have successfully called the system camera reaches a threshold value or not if the system camera has been used currently;
a third returning module, configured to send a third callback message to the application if it is determined that the number of applications that have successfully called the camera of the system reaches a threshold, where the third callback message is used to indicate that the system camera fails to be called, and a failure reason is that the number of applications that have called the system camera reaches the threshold;
and the fourth returning module is used for sending the first returning message to the application if the number of the applications which have successfully called the system camera is judged not to reach the threshold value.
9. An electronic device, comprising:
a processor; and
a memory for storing a program, wherein the program is stored in the memory,
wherein the program comprises instructions which, when executed by the processor, cause the processor to perform the method of an application calling a camera according to any of claims 1-5.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of an application calling a camera according to any one of claims 1-5.
CN202210720147.2A 2022-06-23 2022-06-23 Method and device for calling camera by application, electronic equipment and storage medium Pending CN115242972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210720147.2A CN115242972A (en) 2022-06-23 2022-06-23 Method and device for calling camera by application, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210720147.2A CN115242972A (en) 2022-06-23 2022-06-23 Method and device for calling camera by application, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115242972A true CN115242972A (en) 2022-10-25

Family

ID=83670071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210720147.2A Pending CN115242972A (en) 2022-06-23 2022-06-23 Method and device for calling camera by application, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115242972A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242970A (en) * 2022-06-23 2022-10-25 重庆长安汽车股份有限公司 Vehicle camera data sharing system, method, electronic device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314646A (en) * 2020-02-27 2020-06-19 Oppo(重庆)智能科技有限公司 Image acquisition method, image acquisition device, terminal device and readable storage medium
CN112118459A (en) * 2020-08-28 2020-12-22 上海商米科技集团股份有限公司 Method for realizing common live broadcast of multiple apps by sharing camera data and readable medium
CN112579322A (en) * 2020-12-25 2021-03-30 莜腾(上海)自动化设备科技有限公司 Method and device for sharing camera by multiple applications and computer readable storage medium
CN113220445A (en) * 2021-03-26 2021-08-06 西安神鸟软件科技有限公司 Image or video data acquisition method and terminal equipment
CN113497945A (en) * 2020-03-20 2021-10-12 华为技术有限公司 Live broadcast and configuration method based on cloud mobile phone and related device and system
CN113965809A (en) * 2020-11-30 2022-01-21 深圳卡多希科技有限公司 Method and device for simultaneous interactive live broadcast based on single terminal and multiple platforms

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111314646A (en) * 2020-02-27 2020-06-19 Oppo(重庆)智能科技有限公司 Image acquisition method, image acquisition device, terminal device and readable storage medium
CN113497945A (en) * 2020-03-20 2021-10-12 华为技术有限公司 Live broadcast and configuration method based on cloud mobile phone and related device and system
CN112118459A (en) * 2020-08-28 2020-12-22 上海商米科技集团股份有限公司 Method for realizing common live broadcast of multiple apps by sharing camera data and readable medium
CN113965809A (en) * 2020-11-30 2022-01-21 深圳卡多希科技有限公司 Method and device for simultaneous interactive live broadcast based on single terminal and multiple platforms
CN112579322A (en) * 2020-12-25 2021-03-30 莜腾(上海)自动化设备科技有限公司 Method and device for sharing camera by multiple applications and computer readable storage medium
CN113220445A (en) * 2021-03-26 2021-08-06 西安神鸟软件科技有限公司 Image or video data acquisition method and terminal equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115242970A (en) * 2022-06-23 2022-10-25 重庆长安汽车股份有限公司 Vehicle camera data sharing system, method, electronic device and storage medium

Similar Documents

Publication Publication Date Title
EP3046331B1 (en) Media control method and system based on cloud desktop
EP3637771A1 (en) Cloud desktop system, and image sequence compression and encoding method, and medium therefor
EP3779690A1 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN110933075B (en) Service calling method and device, electronic equipment and storage medium
CN113784049B (en) Camera calling method of android system virtual machine, electronic equipment and storage medium
CN113556584A (en) Screenshot transmission method and device of cloud mobile phone, electronic equipment and storage medium
US20240022661A1 (en) Suppressing indications of events in user interfaces
CN111200606A (en) Deep learning model task processing method, system, server and storage medium
CN115242972A (en) Method and device for calling camera by application, electronic equipment and storage medium
WO2024061308A1 (en) Notification processing method, and terminal device, server side and computer storage medium
CN111381965B (en) Method and apparatus for processing requests
CN114748873B (en) Interface rendering method, device, equipment and storage medium
CN113452948B (en) Conference terminal control method, device, equipment and storage medium
CN114244700A (en) Port processing method and device, electronic equipment and computer readable storage medium
CN110691002B (en) Interrupt detection method and device
CN115250276A (en) Distributed system and data processing method and device
CN112769824B (en) Information transmission state updating method, terminal, device and storage medium
CN111324386A (en) Method and device for starting personal application program, electronic equipment and storage medium
CN114006902B (en) Cloud mobile phone restarting method, device, equipment and storage medium
CN113485856B (en) Page processing method and device, electronic equipment, medium and product
CN115802086A (en) Screen projection request processing method and device and electronic equipment
CN115086263A (en) IM message sending method, system, storage medium and computer equipment of IOS terminal
CN114095758A (en) Cloud image intercepting method, related device and computer program product
CN117041325A (en) Website access method, device, equipment and storage medium
CN116708422A (en) Method, equipment and storage medium for accessing cloud application in cloud desktop

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination