WO2024046028A1 - Camera calling method, electronic device, readable storage medium and chip - Google Patents

Camera calling method, electronic device, readable storage medium and chip Download PDF

Info

Publication number
WO2024046028A1
WO2024046028A1 PCT/CN2023/111068 CN2023111068W WO2024046028A1 WO 2024046028 A1 WO2024046028 A1 WO 2024046028A1 CN 2023111068 W CN2023111068 W CN 2023111068W WO 2024046028 A1 WO2024046028 A1 WO 2024046028A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
application
local
virtual camera
call
Prior art date
Application number
PCT/CN2023/111068
Other languages
French (fr)
Chinese (zh)
Inventor
董斌斌
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024046028A1 publication Critical patent/WO2024046028A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet

Definitions

  • the present application relates to the field of camera technology, and in particular to a camera calling method, electronic equipment, readable storage media and chips.
  • Virtual camera technology is an important component of multi-device interconnection and collaboration technology.
  • applications on the first device such as camera applications, video call applications, etc.
  • the camera of the second device is the virtual camera of the first device.
  • the process of calling the virtual camera by the first device is complicated, the calling speed is slow, and the user experience is poor.
  • This application provides a camera calling method, electronic device, readable storage medium and chip to solve the problems in the prior art that the virtual camera calling process is complicated, the calling speed is slow, and the user experience is poor.
  • embodiments of the present application provide a camera calling method, which is applied to a first device.
  • the first device is installed with an application.
  • the method includes: receiving an operation event.
  • the operation event is used to instruct the application to call a local camera.
  • the local camera is the camera of the first device; if the application has virtual camera calling permission, in response to the first device and the second device having a multi-device collaboration relationship, the virtual camera corresponding to the local camera is determined, and the application is supported to call the virtual camera to collect images.
  • the virtual camera It is the camera of the second device.
  • the local camera and the virtual camera have a mapping relationship; if the application does not have the permission to call the virtual camera, the application is supported to directly call the local camera to collect images.
  • the first device when the first device and the second device work together, the first device can quickly determine and call the virtual camera corresponding to the local camera after receiving an instruction from the application to call the local camera.
  • the calling process is simple, has a fast calling speed, and has a good user experience.
  • the multi-device collaboration relationship includes: the first device sends the first screen content of the first device to the second device, and the second device displays the first screen content, and the first screen content includes relevant content of the application (such as application icons, application interfaces, etc.); based on this, receiving the operation event includes: receiving the operation event sent by the second device, and the operation event is triggered in the first screen content displayed by the second device.
  • the user when the first device projects the screen to the second device, the user can control the application on the first device to call the camera through the second device.
  • the method after the application calls the virtual camera to collect images, the method also includes: updating the first screen content according to the image collected by the virtual camera; and sending the updated first screen content to the second device.
  • the method also includes: the first device and the second device The device disconnects the multi-device collaboration relationship; switches the virtual camera to a local camera, allowing the application to directly call the local camera to collect images.
  • the first device when the application calls the virtual camera, if the multi-device collaboration relationship between the first device and the second device is disconnected, the first device can switch the camera that collects images from the virtual camera to the local camera. camera to ensure the normal working of the application and improve user experience.
  • supporting the application to call the virtual camera to collect images includes: receiving the operation event; supporting the application to directly call the local The camera collects images; the first device establishes a multi-device collaboration relationship with the second device; switches the local camera to a virtual camera, and supports the application to call the virtual camera to collect images.
  • the application can switch the camera that collects images from the local camera to the virtual camera, thereby releasing the occupation of the local camera to ensure the implementation of some functions of the electronic device that rely on the local camera (such as ensuring the face recognition unlocking function implementation).
  • the application includes a first application and a second application.
  • the first application has the virtual camera calling permission, and the second application does not have the virtual camera calling permission.
  • the operation event includes instructing the first application to call the first local camera.
  • the first local camera and the second local camera are the same or different local cameras.
  • the method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving a first operation event; determining a first virtual camera corresponding to the first local camera, supporting the first application to call the first virtual camera to collect images; receiving a third Second operation event; supports the second application to directly call the second local camera to collect images.
  • another application can call the local camera, thereby ensuring the realization of more local functions of the first device and improving the user experience.
  • the face recognition unlocking application can call the local camera to collect face images and perform face recognition unlocking to ensure the realization of the face recognition unlocking function.
  • the application includes a first application and a second application. Both the first application and the second application have permission to call the virtual camera.
  • the operation event includes a first operation event and an instruction that instructs the first application to call the first local camera.
  • the second application calls a second operation event of the second local camera.
  • the method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving the first operation event; determining the first virtual camera corresponding to the first local camera, Support the first application to call the first virtual camera to collect images; receive the second operation event; display the first prompt information, the first prompt information is used to prompt that the virtual camera calling function has been occupied; or, stop supporting the first application to call the first virtual camera
  • the camera collects images, determines the second virtual camera corresponding to the second local camera, and supports the second application to call the second virtual camera to collect images.
  • first local camera and the second local camera are the same local camera, and the first virtual camera and the second virtual camera are the same virtual camera; or, the first local camera and the second local camera are different local cameras, And the first virtual camera and the second virtual camera are different virtual cameras.
  • the first device can prompt another application that the virtual camera can no longer be called. For example, in a scenario where the first device and the second device work together, if the video chat application has occupied the virtual camera, the first device prompts that the camera application cannot call the virtual camera for image collection. Alternatively, the first device can switch from the first application to the second application to call the virtual camera to meet the user's current usage needs.
  • the application includes a first application and a second application.
  • the first application does not have the virtual camera calling permission, and the second application has the virtual camera calling permission.
  • the operation event includes a third application that instructs the first application to call the first local camera.
  • An operation event and a second operation event that instructs the second application to call the second local camera.
  • the first local camera and the second local camera are the same or different local cameras.
  • the method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving a first operation event; supporting the first application to directly call the first local camera to collect images; receiving the second operation event; and determining the location corresponding to the second local camera.
  • the second virtual camera supports the second application to call the second virtual camera to collect images.
  • another application can call the virtual camera at the same time.
  • the camera application of the first device calls the local camera to collect images
  • the video chat application can simultaneously call the virtual camera of the second device to collect images.
  • the application includes a first application and a second application. Neither the first application nor the second application has permission to call the virtual camera.
  • the operation event includes a first operation event that instructs the first application to call the first local camera and Instruct the second application to call the second operation event of the second local camera, where the first local camera and the second local camera are the same or different local cameras.
  • the method also includes: receiving a first operation event; supporting the first application to directly call the first local camera to collect images; receiving a second operation event; displaying a second prompt information, the second prompt information being used to prompt that the local camera calling function has been occupied ; Or, stop supporting the first application to directly call the first local camera to collect images, and support the second application to directly call the second local camera to collect images.
  • the first device can prompt another application that it can no longer call the virtual camera. For example, in a scenario where the first device and the second device work together, if the camera application has occupied the local camera, the first device can prompt the video chat application that it cannot call the local camera for image collection. Alternatively, the first device may switch the application that calls the local camera from the first application to the second application to meet the user's current usage needs.
  • determining the virtual camera corresponding to the local camera includes: determining the virtual camera corresponding to the local camera according to the mapping relationship table.
  • Virtual camera, the mapping relationship table includes at least one set of mapping relationships between local cameras and virtual cameras.
  • the mapping relationship between the at least one set of local cameras and the virtual camera includes: the mapping relationship between the first local camera and the first virtual camera; and the mapping relationship between the second local camera and the second virtual camera.
  • the first local camera and the second local camera are different local cameras, and the first virtual camera and the second virtual camera are different virtual cameras.
  • the method further includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving the identification information of the virtual camera sent by the second device; and determining the mapping according to the identification information of the local camera and the identification information of the virtual camera. relation.
  • the first device includes a local camera module for parallel processing and a virtual camera module, the local camera module is used for calling the local camera, and the virtual camera module is used for calling the virtual camera.
  • a local camera module and a virtual camera module that can process tasks in parallel exist in the first device. Based on this, the first device can use the local camera module to call the local camera, and the virtual camera module to call the virtual camera, so that the first device's calls to the local camera and the virtual camera do not affect each other, ensuring the realization of more functions of the first device. , helping to improve the user experience.
  • embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the computer program, the above-mentioned first aspect and the above are implemented. The methods shown in each implementation.
  • embodiments of the present application provide a computer-readable storage medium that stores a computer program.
  • the computer program is executed by a processor, the method shown in the first aspect is implemented.
  • embodiments of the present application provide a chip.
  • the chip includes a processor and a memory.
  • a computer program is stored in the memory. When the computer program is executed by the processor, the method shown in the first aspect is implemented.
  • inventions of the present application provide a computer program file.
  • the computer program file includes a program.
  • the electronic device implements the method shown in the first aspect.
  • Figure 1 is a schematic diagram of the connection structure between devices in the multi-device collaboration process provided by the embodiment of the present application;
  • Figure 2 is a schematic diagram of a multi-device collaboration scenario provided by an embodiment of the present application.
  • Figure 3 is a schematic diagram of a multi-device collaboration scenario provided by another embodiment of the present application.
  • Figure 4A is a schematic diagram of a user control scenario in a multi-device collaboration process provided by an embodiment of the present application
  • Figure 4B is a schematic diagram of a user control scenario in a multi-device collaboration process provided by another embodiment of the present application.
  • Figure 4C is a schematic diagram of a video call scene during multi-device collaboration provided by an embodiment of the present application.
  • Figure 5 is a schematic flow chart of a camera calling method provided by an embodiment of the present application.
  • Figure 6 is a schematic flow chart of the camera calling method provided by the embodiment of the present application.
  • Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 8 is a schematic diagram of the software structure of the first device provided by the embodiment of the present application.
  • Figure 9 is a schematic flow chart of the first device independently calling the local camera provided by the embodiment of the present application.
  • Figure 10 is a schematic flow chart of the first device switching a local camera to a virtual camera according to an embodiment of the present application
  • Figure 11 is a schematic flow chart of the first device separately calling the virtual camera provided by the embodiment of the present application.
  • Figure 12 is a schematic flow chart of the first device switching the virtual camera to the local camera provided by the embodiment of the present application;
  • Figure 13 is a schematic diagram of a display interface of the first device provided by the embodiment of the present application.
  • Figure 14 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • first and second are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or The latter implicitly indicates the quantity of the technical characteristics indicated. Therefore, features defined as “first” and “second” may explicitly or implicitly include one or more of these features. In the description of the embodiments of this application, unless otherwise specified, "plurality” means two or more.
  • Multi-device interconnection and collaboration referred to as multi-device collaboration
  • multi-device collaboration is an important development direction of electronic equipment.
  • common multi-device collaboration scenarios include mobile phone-tablet collaboration, mobile phone-laptop collaboration, tablet-laptop collaboration, vehicle-machine collaboration, mobile phone-drone collaboration, mobile phone-camera device collaboration, etc.
  • multi-device collaboration different types of electronic devices can break down device and application barriers and achieve cross-platform and cross-system collaboration functions, thereby making full use of the advantages of different devices and improving people's work and life experience.
  • FIG 1 is a schematic diagram of the connection structure between devices in the multi-device collaboration process provided by the embodiment of the present application.
  • the first device and the second device may be connected wirelessly or wired.
  • wireless connections include wireless fidelity (WiFi) connections, Bluetooth (BT) connections, ultra-wide band (UWB) connections, near field communication (NFC) connections, etc.
  • Wired connections include data line connections, etc., which are not specifically limited in the embodiments of this application.
  • the first device and the second device can establish a multi-device collaboration relationship based on user operations. For example, when the first device is a mobile phone and the second device is a laptop, with the NFC function of the phone turned on, the user uses the NFC area on the back of the phone to touch the Huawei sharing sensing area of the laptop and confirms the connection to the laptop on the phone. After connecting to the computer, the screen content of the mobile phone can be displayed on the laptop in the form of a floating window (see Figure 2), thereby establishing a multi-device collaboration relationship.
  • the user can bring the phone close to the tablet and follow the prompts to complete the connection.
  • the screen content is displayed on the tablet in the form of a floating window (see Figure 3), establishing a multi-device collaboration relationship.
  • the user can display the screen content of the first device, which can be called the first screen content, through the floating window on the second device, and control the first device.
  • the second device can feed back the operation events (such as click events, touch sliding events, etc.) triggered by the user in the floating window to the first device, and the first device can update the screen of the first device based on the received operation events. content, and sends the updated screen content to the second device, so that the second device updates the screen content of the first device displayed in the floating window.
  • some functions of the first device can be operated by the second device, and the first device can simultaneously operate other functions.
  • virtual camera technology can also be used in the process of multi-device collaboration, that is, a device can not only use a local camera for image collection, which refers to the camera of the device itself, but can also use a virtual camera for image collection.
  • the virtual camera refers to Cameras from other connected devices.
  • the first device such as a mobile phone
  • the second device such as a laptop
  • the first device After the first device (such as a mobile phone) and the second device (such as a laptop) establish a multi-device collaboration relationship, if the first device is the master device and the second device is the collaboration device, then the first device Some applications (Apps) can call the camera of the second device to collect images (including pictures and videos).
  • the mobile phone in the process of collaborative work between a mobile phone and a tablet computer, the mobile phone is the main control device and the tablet computer is the collaborative device.
  • the mobile phone sends the screen content of the mobile phone to the tablet computer, and the tablet computer receives and displays the mobile phone screen content. screen content.
  • the tablet computer in response to the user's operation of the Changlian application on the tablet computer, the tablet computer sends an operation event to open the Changlian application to the first device, and the mobile phone updates the screen content of the mobile phone as shown in Figure 4B based on the operation event.
  • the call recording interface appears, and the call recording interface is sent to the tablet for display.
  • the call record interface includes call records between the user and each of his friends.
  • the second device in response to the user clicking the video call control of friend 1 in the floating window of the second device, the second device sends a first operation event to the first device.
  • the first device calls the camera of the second device to collect images, and generates a call interface based on the collected images.
  • the first device sends the call interface to the second device for display, thereby enabling the user to use the Changlian application of the first device to make a video call on the second device.
  • the first device and the second device display the same call interface, including user images, friend images, and other controls (such as “switch camera”, “hang up”, “update”). “Multiple”, etc.), where the user image is captured by the camera of the second device.
  • the first device can display screen content or turn off the screen.
  • the first device usually calls cameras from various sources through the camera session management module (Camera0) of the hardware abstraction layer to implement video stream switching and image collection, where the cameras from each source include the first device Local camera and virtual camera (such as the camera of the second device).
  • the camera session management module (Camera0) of the hardware abstraction layer to implement video stream switching and image collection, where the cameras from each source include the first device Local camera and virtual camera (such as the camera of the second device).
  • the application of the first device (such as )
  • the process of calling the local camera is shown in S0-1 to S0-4 in Figure 5.
  • the application sends camera calling instructions to the camera module (Camera Module).
  • the camera module in response to the camera calling instruction, sends a request to the camera session in the camera session management module (Camera0).
  • the unit (Camera Session) sends session establishment instructions.
  • the camera session unit in response to the session establishment instruction, establishes the camera session and sends a driver opening instruction to the camera driver (Camera Driver).
  • the camera driver in response to the driver opening instruction, opens and sends an image acquisition instruction to the local camera.
  • the images collected by the local camera are returned to the application through the camera driver, camera session unit, and camera module in sequence.
  • the application of the first device (such as )
  • the process of calling the virtual camera is shown in S0-1 to S0-9 in Figure 5.
  • the collaboration management application sends a camera switching instruction to the camera session management module through the distributed hardware management module.
  • the camera switching instruction is used to instruct the data stream of the camera session unit to be switched from a local camera to a virtual camera.
  • the data flow switching unit in the camera session management module in response to the camera switching instruction, sends a data interception request to the camera session unit.
  • This data interception request is used to request to intercept images collected by local cameras.
  • the camera session unit in response to the data interception request, sends a driver shutdown instruction to the camera driver to stop calling the local camera. After the first device stops calling the local camera, the first device does not use the local camera to collect images.
  • the camera session unit sends an interception success notification to the data flow switching unit.
  • the data flow switching unit sends a switching success notification to the distributed hardware management module.
  • the switching success notification is used to notify that the data stream of the camera session unit has been switched from the local camera to the virtual camera.
  • the distributed hardware management module sends a camera calling instruction to the second device to collect images through the virtual camera (ie, the camera of the second device).
  • the images collected by the virtual camera are returned to the application program through the distributed hardware management module, data flow switching unit, camera session unit, and camera module in sequence.
  • the first device needs to open the local camera first, and then switch the local camera to the virtual camera according to the instructions of the upper-layer application.
  • There is a redundant operation process for opening the local camera and the calling process is complicated, resulting in The calling speed of the virtual camera is slow and the user experience is poor.
  • the first device since the first device uses the camera session management module to call the virtual camera, the camera session management module will be occupied by the virtual camera, and the local camera cannot be used by other applications. Therefore, the first device cannot simultaneously call the local camera. Camera and virtual camera, thus affecting the implementation of some functions of the first device.
  • the mobile phone can call the virtual camera (that is, the camera of the laptop) to collect images during the video chat.
  • the virtual camera that is, the camera of the laptop
  • the camera session management module is occupied, so the phone can no longer call the local camera to collect face images. For example, face recognition unlocking will fail, resulting in poor user experience.
  • embodiments of the present application provide a camera calling method, which can avoid the redundant process of opening a local camera when an electronic device opens a virtual camera, improve the virtual camera calling speed, and improve user experience.
  • this method can also reduce the mutual influence when calling the local camera and the virtual camera, ensure the normal realization of more functions of the electronic device, and improve the user experience.
  • Figure 6 is a schematic flow chart of the camera calling method provided by the embodiment of the present application. The method is applied to the first device and specifically includes the following S601 to S603.
  • S601 Receive an operation event, which is used to instruct the application to call the local camera.
  • the application has the permission to call the virtual camera, in response to the first device and the second device having a multi-device collaboration relationship, determine the virtual camera corresponding to the local camera, and support the application to call the virtual camera to collect images.
  • the virtual camera is the camera of the second device.
  • the first device when the first device and the second device establish a multi-device collaboration relationship, the first device can quickly determine and call the local camera after receiving an instruction from the application program to call the local camera.
  • the corresponding virtual camera has faster calling speed and better user experience.
  • FIG. 7 is a schematic structural diagram of an electronic device suitable for providing a camera calling method according to an embodiment of the present application.
  • the electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, Charging management module 240, power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone interface 270D, sensor module 280, Button 290, motor 291, indicator 292, camera 293, display screen 294, and subscriber identification module (subscriber identification module, SIM) card interface 295, etc.
  • SIM subscriber identification module
  • the electronic device may be a mobile phone, a tablet computer (Pad), a computer with wireless transceiver functions, a smart TV, a projector, a wearable device (such as a smart watch), a vehicle-mounted device, or an augmented reality device.
  • augmented reality, AR /virtual reality (VR) equipment, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (personal digital assistant, PDA), etc.
  • UMPC ultra-mobile personal computer
  • PDA personal digital assistant
  • the embodiments of this application do not limit the specific type of electronic equipment.
  • the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic equipment.
  • the electronic device may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the electronic device when it is a mobile phone or a tablet computer, it may include all the components in the illustration, or may only include some of the components in the illustration.
  • the electronic device when it is a large-screen device, it may include the processor 210 in the figure, the external memory interface 220, the internal memory 221, the universal serial bus (universal serial bus, USB) interface 230, and the charging management module 240.
  • the processor 210 may include one or more processing units.
  • the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait.
  • application processor application processor, AP
  • modem processor graphics processing unit
  • GPU graphics processing unit
  • image signal processor image signal processor
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller can be the nerve center and command center of the electronic device.
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 210 may also be provided with a memory for storing instructions and data.
  • the memory in processor 210 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 210 is reduced, thus improving the efficiency of the system.
  • the charge management module 240 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 240 may receive charging input from the wired charger through the USB interface 230 .
  • the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device. While charging the battery 242, the charging management module 240 can also provide power to the electronic device through the power management module 241.
  • 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 and supplies power to the processor 210, internal memory 221, external memory, display screen 294, camera 293, wireless communication module 260, etc.
  • the power management module 241 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 241 may also be provided in the processor 210 . In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
  • the wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • Antenna 1 can be reused as a diversity antenna for a wireless LAN.
  • antennas may be used in conjunction with tuning switches.
  • the mobile communication module 250 can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices.
  • the mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc.
  • the mobile communication module 250 can receive electromagnetic waves from the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation.
  • the mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
  • At least part of the functional modules of the mobile communication module 250 may be disposed in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.
  • a modem processor may include a modulator and a demodulator.
  • 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.
  • the application processor outputs sound signals through audio devices (not limited to speaker 270A, receiver 270B, etc.), or displays images or videos through display screen 294.
  • the modem processor may be a stand-alone device.
  • the modem processor may be independent of the processor 210 and may be provided in the same device as the mobile communication module 250 or other functional modules.
  • the wireless communication module 260 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), and global navigation satellite systems for use in electronic devices. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • the wireless communication module 260 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 260 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 .
  • the wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
  • the antenna 1 of the electronic device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device can communicate with the network and other devices through wireless communication technology.
  • the electronic device implements display functions through the GPU, display screen 294, and application processor.
  • the GPU is an image processing microprocessor and is connected to the display screen 294 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 294 is used to display images, videos, etc.
  • the display screen 294 includes a display panel.
  • the electronic device may include 1 or N display screens 294, where N is a positive integer greater than 1.
  • the electronic device can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.
  • the ISP is used to process the data fed back by the camera 293. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the light signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 293.
  • Camera 293 is used to capture still images or video.
  • the object passes through the lens to produce an optical image that is projected onto the photosensitive element.
  • the photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other format image signals.
  • the electronic device may include 1 or N cameras 293, where N is a positive integer greater than 1.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Electronic devices may support one or more video codecs. In this way, electronic devices can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG)1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG Moving Picture Experts Group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • Intelligent cognitive applications of electronic devices can be realized through NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the NPU or other processors may be used to perform operations such as analysis and processing on images in videos stored on electronic devices.
  • 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 electronic device.
  • the external memory card communicates with the processor 210 through the external memory interface 220 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 221 may be used to store computer executable program code, which includes instructions.
  • the processor 210 executes instructions stored in the internal memory 221 to execute various functional applications and data processing of the electronic device.
  • the internal memory 221 may include a program storage area and a data storage area.
  • the stored program area can store the operating system and at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area can store data created during the use of electronic equipment (such as audio data, phone books, etc.).
  • the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • non-volatile memory such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the electronic device can implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D, and the application processor.
  • the audio module 270 is used to convert digital audio signals into analog audio signal outputs, and is also used to convert analog audio inputs into digital audio signals. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be provided in the processor 210 , or some functional modules of the audio module 270 may be provided in the processor 210 .
  • Speaker 270A also called “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device can listen to music through speaker 270A, or listen to hands-free calls.
  • Receiver 270B also called “earpiece” is used to convert audio electrical signals into sound signals.
  • the voice can be heard by bringing the receiver 270B close to the human ear.
  • Microphone 270C also called “microphone” or “microphone” is used to convert sound signals into electrical signals.
  • the user can speak close to the microphone 270C with the human mouth and input the sound signal to the microphone 270C.
  • the electronic device may be provided with at least one microphone 270C.
  • the headphone interface 270D is used to connect wired headphones.
  • the headphone interface 270D may be a USB interface 230, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
  • OMTP open mobile terminal platform
  • CTIA Cellular Telecommunications Industry Association of the USA
  • the buttons 290 include a power button, a volume button, etc.
  • Key 290 may be a mechanical key. It can also be a touch button.
  • the electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
  • the motor 291 can generate vibration prompts.
  • the motor 291 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback.
  • touch operations for different applications can correspond to different vibration feedback effects.
  • Acting on touch operations in different areas of the display screen 294, the motor 291 can also correspond to different vibration feedback effects.
  • Different application scenarios (such as time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects.
  • the touch vibration feedback effect can also be customized.
  • the indicator 292 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
  • the SIM card interface 295 is used to connect a SIM card.
  • the SIM card can be inserted into the SIM card interface 295 or pulled out from the SIM card interface 295 to realize contact and separation from the electronic device.
  • the electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
  • FIG 8 is a schematic diagram of the software structure of the first device provided by the embodiment of the present application.
  • the operating system of the first device is Taking the system as an example, the software system of the first device includes an application layer, an application framework layer (framework, FWK), a hardware abstraction layer (HAL), and a kernel layer (Kernel).
  • the layers are connected through software interfaces. communication.
  • the application layer includes a series of application packages, which can include Changlian applications, Camera, text messages, videos, emails, face recognition unlocking applications and collaborative management applications, etc.
  • some applications can call the camera, but some applications (such as text messages, emails) cannot call the camera.
  • the collaborative management application is used to manage and establish a collaborative relationship between the first device and other devices (such as the second device), which includes controlling and displaying relevant user operation interfaces, and discovering or connecting according to the control operations input by the user in the interface. Other equipment, etc.
  • applications capable of calling the camera on the first device are divided into first-type applications and second-type applications.
  • the first type of application has virtual camera calling permission, that is, it can call the virtual camera after the first device and the second device establish a multi-device collaboration relationship.
  • virtual camera calling permission that is, it can call the virtual camera after the first device and the second device establish a multi-device collaboration relationship.
  • these include: the first device can only call the virtual camera, or the first device can selectively call the virtual camera among the virtual camera and the local camera according to the user operation.
  • the first type of application can be Changlian application, Camera, mirror applications, etc.
  • the first device is a mobile phone
  • the second device is a laptop computer
  • the mobile phone and laptop computer establish a multi-device collaboration relationship. After tying, the phone is in use During a video call with a friend, the mobile phone can only call the laptop's camera to collect images, but cannot call the local camera to collect images. If the user wants to use the local camera to collect images, the multi-device collaboration relationship between the mobile phone and laptop needs to be disconnected.
  • the first device is a mobile phone and the second device is a laptop.
  • the mobile phone and the laptop establish a multi-device collaboration relationship
  • the mobile phone uses During a video call with a friend, the phone gives priority to calling the laptop's camera to collect images. If the user wants to use the local camera of the mobile phone to collect images, he can perform a switching operation on the mobile phone to switch the camera that collects images to the local camera without breaking the multi-device collaboration relationship between the mobile phone and the laptop.
  • the second type of application does not have the permission to call the virtual camera, that is, after the first device and the second device establish a multi-device collaboration relationship, it cannot call the virtual camera and can only call the local camera.
  • the second type of application may be determined in advance according to the type of application, or may be determined according to the user's configuration.
  • the second type of application may be a face recognition unlocking application, etc.
  • the application on the mobile phone give priority to calling the camera of the laptop to collect images?
  • the image collected by the local camera can be determined by configuring the type of the application, that is, by configuring whether the application belongs to the first type of application or the second type of application. by mobile phone For example, if the user would Configured as a first-class application, then when the mobile phone and laptop work together, Prioritize calling the virtual camera. If the user will Configured as a second category application, then when the mobile phone and laptop work together, Prioritize calling the local camera.
  • the application framework layer includes distributed hardware management modules and camera modules.
  • Distributed hardware management module used to control the hardware of collaborative devices.
  • the camera module includes a camera service module (Camera Service), a camera device module (Camera Device) and a virtual camera mapping management module.
  • Camera Service is used to provide Camera usage interfaces and services to upper-layer applications.
  • Camera Device is used to provide control capabilities for the corresponding Camera device.
  • the virtual camera mapping management module is used to store the mapping relationship between the local camera of the first device and the camera of the second device (the virtual camera of the first device).
  • the virtual camera mapping management module can determine the virtual camera corresponding to the local camera through the mapping relationship when the first type of application requests to call the local camera, and
  • the virtual camera that is, the camera of the second device
  • the virtual camera is called through the virtual camera module.
  • the application does not need to know the logic of calling different cameras in the scenario of multi-device collaboration.
  • Compatible programs are individually designed to suit.
  • the second device can send its camera information (such as camera ID) to the virtual camera mapping management module of the first device.
  • the virtual camera mapping management module Establish and store the mapping relationship according to preset rules.
  • the embodiment of this application does not specifically limit the preset rules.
  • the mapping The relationship can be shown in Table 1. It should be understood that in order to facilitate user operation, the front camera of the first device usually corresponds to the front camera of the second device, and the rear camera of the first device usually corresponds to the rear camera of the second device, that is, Camera1-1 corresponds to Camera2-1 , Camera1-2 corresponds to Camera2-2.
  • the mapping relationship It can be shown in Table 2. Based on this mapping relationship, the first device cannot switch between front and rear cameras when calling the camera of the second device through virtual camera technology.
  • the inability of the first device to switch the front and rear cameras can be understood as: the first device does not respond to the user's operation of the camera switching control.
  • the hardware abstraction layer is the layer between hardware and software.
  • the hardware abstraction layer includes a local camera module (which can be called Camera0) and a virtual camera module (Camera X), which are used to establish a corresponding camera session.
  • the camera session can be used to identify a session request of the application, control the request parameters, and pass the request image data, etc.
  • the local camera module (Camera0) is equipped with a local camera session unit (Camera Session), which is used to establish a local camera session. Through the local camera session unit, the electronic device can call the local camera to collect images.
  • a local camera session unit (Camera Session)
  • the electronic device can call the local camera to collect images.
  • the virtual camera module (Camera X) is provided with a virtual camera session unit (Virtual Camera Session), which is used to establish a virtual camera session.
  • a virtual camera session unit Virtual Camera Session
  • the first device can call the camera of the second device to collect images through the distributed hardware management module.
  • the virtual camera module may be preset in the hardware abstraction layer of the first device, or may be a module newly registered and added by the first device after establishing a multi-device collaboration relationship with the second device.
  • the kernel layer includes a series of drivers, such as camera driver (Camera Driver), sensor driver, etc., which are used to drive related hardware of the hardware layer, such as cameras, sensors, etc.
  • the camera driver includes a first video module
  • the first video module corresponds to the front camera and is used to process images collected by the front camera.
  • the second video module corresponds to the rear camera and is used to process images collected by the rear camera.
  • the application program on the first device can call a local camera or a virtual camera (ie, the camera of the second device) to collect images. They are explained below.
  • the first type of application and the second type of application on the first device can call the local camera, and the calling process Basically the same, that is, the part of the application responsible for calling the local camera is the same.
  • the process of calling a local camera by an application includes the following S1-1 to S1-4.
  • the application program of the first device sends a local camera calling instruction to the camera module for calling the local camera of the first device to collect images.
  • the user usually triggers an operation event on the first device, and the operation event is used to instruct the local camera to be called.
  • the operation event may be that the user opens the camera application on the mobile phone, or opens a video chat, or picks up the mobile phone to wake up the screen when the screen is turned off and locked, etc.
  • the operation event can also be the user's operation on the second device. Triggered within the floating window.
  • the camera application is configured by the user as a second-category application and does not have the permission to call the virtual camera. The user can click the icon of the camera application in the floating window of the second device to trigger an operation event and send the operation event to the mobile phone. So that the mobile phone can call the local camera according to the operation event.
  • the first device will first consider that these operation events are all It is to call the local camera. Only when the first device and the second device establish a collaborative relationship, for the first type of application, the first device can further convert the call to the local camera into a call to the virtual camera. For the second type of application, or when the first device and the second device do not establish a collaborative relationship, the first device does not need to convert the camera calling relationship, but directly calls the local camera.
  • the camera module sends a session establishment instruction to the local camera module.
  • the session establishment instruction is used to instruct the local camera module of the first device to establish a local camera session.
  • the camera session unit in the local camera module After establishing the camera session according to the session establishment instruction, the camera session unit in the local camera module sends a driver open instruction to the camera driver.
  • the driver open instruction is used to instruct the camera driver to work.
  • the camera driver sends image acquisition instructions to the local camera to drive the local camera to collect images.
  • the images collected by the local camera are returned to the application through the camera driver, local camera module, and camera module in sequence.
  • the application on the first device can call Local camera. Therefore, in some embodiments, before the application calls the local camera, a multi-device collaboration relationship is not established between the first device and the second device. Based on this, if the application calls the local camera , the first device and the second device have newly established a multi-device collaboration relationship, then the first device can switch the local camera to the virtual camera.
  • the process includes the following steps S2-1 to S2-8.
  • the collaborative management application of the first device controls the distributed hardware module management according to the user operation. Establish a multi-screen collaboration relationship with the second device.
  • S2-3 The distributed hardware management module configures the mapping relationship table to the virtual camera mapping management module.
  • the distributed hardware management module also needs to register the virtual camera module in the hardware abstraction layer.
  • the camera module of the first device sends a session closing notification to the local camera module to notify the local camera module to close the local camera session.
  • the local camera module After closing the local camera session, the local camera module sends a driver shutdown instruction to the camera driver to instruct the local camera module to close the camera driver.
  • the virtual camera management module determines the virtual camera corresponding to the local camera according to the mapping relationship table, and calls the virtual camera through the virtual camera module and the distributed hardware management module.
  • the second device responds to the virtual camera invocation and instructs the virtual camera to collect images.
  • the images collected by the virtual camera (that is, the camera of the second device) are returned to the application program of the first device through the distributed hardware module, virtual camera module, and camera module of the first device in sequence.
  • the application program that calls the virtual camera is a first-type application program.
  • the first type of application such as Changlian application
  • the second type of application such as face recognition unlocking application
  • the process specifically includes the following steps S3-1 to S3-7.
  • the collaboration management module of the first device sends a multi-device collaboration establishment instruction to the distributed hardware management module according to the user operation, and controls the distributed hardware management module to establish a multi-device collaboration relationship with the second device.
  • the distributed hardware management module configures the mapping relationship table to the virtual camera mapping management module.
  • the distributed hardware management module also needs to register the virtual camera module in the hardware abstraction layer.
  • the application program of the first device in response to the operation event, sends a camera calling instruction to the camera module, which is used to call the local camera of the first device for image collection.
  • the operation event may be triggered by the user on the first device, or may be triggered by the user on the second device and sent by the second device to the first device.
  • the operation event may be triggered by the user on the first device, or may be triggered by the user on the second device and sent by the second device to the first device.
  • the camera module determines the virtual camera corresponding to the local camera according to the preconfigured mapping relationship table, and sends a virtual camera calling instruction to the virtual camera module.
  • the virtual camera calling instruction is used to call the virtual camera.
  • the virtual camera is Camera2-1. If the local camera currently used by the first device is Camera1-2, the virtual camera is Camera2-2.
  • the virtual camera module sends the virtual camera calling instruction to the second device through the distributed hardware management module.
  • the second device responds to the virtual camera calling instruction and calls the virtual camera to collect images.
  • the second device After collecting the images, the second device sequentially sends the collected images to the application program of the first device through the distributed hardware module, virtual camera module, and camera module of the first device.
  • the application calls the virtual camera
  • the first device can Switch virtual camera to local camera.
  • the process includes the following steps S4-1 to S4-5.
  • the first device and the second device disconnect the multi-device collaboration relationship.
  • the first device receives a camera switching instruction input by the user, which is used to switch the camera called by the application program from the virtual camera to the local camera.
  • the second device may display a notification message in the notification management box to prompt the user.
  • the notification message can include the prompt information "Connected to "HUAWEI P50Pro"", and "You can operate the phone on the tablet and share data with each other", etc.
  • the notification message also includes "disconnect” controls and "switch audio and video to mobile phone” controls.
  • the "disconnect” control is used to control the second device to disconnect from the first device (i.e. HUAWEI P50Pro); the "audio and video switching to mobile phone” control is used to control the second device to switch the audio and video of the first device.
  • the collection and playback operations are switched from the current second device to the first device.
  • the first device and the second device can disconnect the multi-device collaboration relationship.
  • the camera of the first device that collects images can be switched from the virtual camera to the local camera.
  • the distributed hardware management module sends a camera switching notification to the camera module, which is used to notify the camera that collects images to switch from a virtual camera to a local camera.
  • the camera module sends a session establishment instruction to the local camera module.
  • the session establishment instruction is used to instruct the local camera module of the first device to establish a local camera session.
  • the camera session unit in the local camera module After establishing the camera session according to the session establishment instruction, the camera session unit in the local camera module sends a driver open instruction to the camera driver.
  • the driver open instruction is used to instruct the camera driver to work.
  • the camera driver sends image acquisition instructions to the local camera to drive the local camera to collect images.
  • the images collected by the local camera of the first device are returned to the application program through the camera driver, the local camera module and the camera module in sequence.
  • the first device and the second device when the first device and the second device establish a multi-device collaboration relationship, if the first device receives an instruction from the application program to call the local camera, and the application program has the virtual camera call permission, then the first device The device directly determines the virtual camera corresponding to the local camera based on the mapping relationship table, and calls the virtual camera through the virtual camera module. There is no need to establish a local camera session through the local camera module, and therefore there is no need to open the local camera. Therefore, in the process of opening the virtual camera, redundant operations of opening the local camera are reduced, the opening speed of the virtual camera can be improved, and a better user experience can be achieved.
  • the local camera module is responsible for the first device's call to the local camera
  • the virtual camera is responsible for the call to the virtual camera
  • the two modules can process tasks in parallel. Therefore, when the first device and the second device establish a multi-device collaboration relationship, the application's calls to the local camera and the virtual camera do not affect each other, and two applications can call the local camera and the virtual camera at the same time. Based on the fact that the first device and the second device have established a multi-device collaboration relationship, the process is illustrated below by taking the first application and the second application as examples.
  • Example 1 Both the first application and the second application are first-type applications.
  • both the first application and the second application have the virtual camera calling permission.
  • the first application may be a Changlian application
  • the second application may be a camera application.
  • the process of calling the camera by the first application and the second application at the same time includes the following contents (1) and (2).
  • the first application calls the first virtual camera to collect images.
  • the user may trigger a first operation event for the first application.
  • the first operation event is used to instruct the first application to call the first local camera of the first device to collect images.
  • the first operation event can allow the user to operate the Changlian application to invite friends for a video call. Since the first device has the virtual camera calling authority, the first device determines the first virtual camera corresponding to the first local camera according to the mapping relationship table, and calls the first virtual camera through the virtual camera module to collect images for the first application. . Please refer to the previous description for the specific calling process and will not be repeated here.
  • the user can trigger the second operation event for the second application.
  • the second operation event is used to instruct the second application to call the second local camera of the first device.
  • the second operation event may be that the user clicks on the application icon of the camera application.
  • the first device may display first prompt information to prompt that the virtual camera calling function has been occupied.
  • the first device may ask the user whether to switch to the second application to call the virtual camera. Based on this, the first device can continue to control the first application to call the virtual camera according to the user's instruction, or can switch to the second application to call the virtual camera through the virtual camera module.
  • the first device may automatically switch the application that calls the virtual camera from the first application to the second application.
  • the first application as a Changlian application and the second application as a camera application as an example, during the process of the Changlian application using the first virtual camera of the mobile phone, if the first device detects the user's operation of opening the camera application, it will automatically call the virtual camera.
  • the camera application is switched from Changlian application to Camera application.
  • first local camera called by the first operation event controlled by the first application and the second local camera called by the second operation event controlled by the second application may be the same.
  • first local camera and the second local camera may be the same. Both are front-facing cameras of the first device; they may also be different.
  • one of the first local camera and the second local camera may be a front-facing camera and the other may be a rear-facing camera. If the first local camera and the second local camera are the same, the first virtual camera and the second virtual camera are the same. If the first local camera and the second local camera are different, the first virtual camera and the second virtual camera are different.
  • Example 2 The first application is a first-type application, and the second application is a second-type application.
  • the first application has the permission to call the virtual camera, but the second application does not have the permission to call the virtual camera.
  • the first application is a Changlian application
  • the second application is a mirror application.
  • the process of calling the camera by the first application and the second application at the same time includes the following contents (1) and (2).
  • the first application calls the first virtual camera to collect images.
  • the user may trigger a first operation event for the first application.
  • the first operation event is used to instruct the first application to call the first local camera of the first device to collect images.
  • the first operation event can allow the user to operate the Changlian application to invite friends for a video call. Since the first device has the virtual camera calling authority, the first device determines the first virtual camera corresponding to the first local camera according to the mapping relationship table, and calls the first virtual camera through the virtual camera module to collect images for the first application. . Please refer to the previous description for the specific calling process and will not be repeated here.
  • the second application calls the second local camera to collect images.
  • the user can trigger the second operation event for the second application.
  • the second operation event is used to instruct the second application to call the second local camera of the first device.
  • the second operation event may be that the user clicks on the application icon of the mirror application. Since the second application does not have the right to call the virtual camera, the first device directly calls the second local camera through the local camera module to collect images for the second application. Please refer to the previous description for the specific calling process and will not be repeated here.
  • the hardware abstraction layer of the first device has both a local camera module and a virtual camera module, and these two camera modules can work in parallel and independently without affecting each other, therefore, the first device is in the process of multi-device collaboration. It is possible to call the local camera and virtual camera at the same time.
  • the first device mobile phone as an example, after the mobile phone and the tablet establish a multi-screen collaboration relationship, if the mobile phone is in the locked screen state and supports facial recognition unlocking, the mobile phone can call the local camera through the local camera module to collect user images, thereby Perform facial recognition unlocking.
  • Example 3 The first application is a second type application, and the second application is a first type application.
  • the first application does not have the virtual camera calling authority
  • the second application does have the virtual camera calling authority.
  • the first application is a mirror application
  • the second application is a Changlian application.
  • the process of calling the camera by the first application and the second application at the same time includes the following content (1) and content (2).
  • the first application calls the first local camera to collect images.
  • the user may trigger a first operation event for the first application.
  • the first operation event is used to instruct the first application to call the first local camera of the first device to collect images.
  • the first operation event may be that the user clicks on the application icon of the mirror application. Since the first device does not have the right to call the virtual camera, the first device directly calls the first local camera through the local camera module to collect images for the first application. Please refer to the previous description for the specific calling process and will not be repeated here.
  • the user can trigger a second operation event for the second application.
  • the second operation event is used to instruct the second application to call the second local camera of the first device to collect images.
  • the second operation event may be the video chat control of Friend 1 in the user's Changlian application. Since the second application has the permission to call the virtual camera, the first device determines the second virtual camera corresponding to the second local camera, and calls the second virtual camera through the virtual camera module to collect images for the second application. Please refer to the previous description for the body calling process and will not go into details here.
  • Example 4 Both the first application and the second application are second-type applications.
  • neither the first application nor the second application has the virtual camera calling permission.
  • the first application is a mirror application
  • the second application is a camera application.
  • the process of calling the camera by the first application and the second application at the same time includes the following content (1) and content (2).
  • the first application calls the first local camera to collect images.
  • the user may trigger a first operation event for the first application.
  • the first operation event is used to instruct the first application to call the first local camera of the first device to collect images.
  • the first operation event can be that the user clicks on the mirror application.
  • Application icon Since the first device does not have the right to call the virtual camera, the first device directly calls the first local camera through the local camera module to collect images for the first application. Please refer to the previous description for the specific calling process and will not be repeated here.
  • the second application fails to call the second local camera, or the first application switches to the second application to call the local camera.
  • the user can trigger the second operation event for the second application.
  • the second operation event is used to instruct the second application to call the second local camera of the first device.
  • the second operation event may be an application icon of the user's camera application. Since the second application does not have the permission to call the virtual camera, the first device needs to call the second local camera to collect images for the second application. However, the second local camera module responsible for calling the local camera has been occupied by the first application, so the second application fails to call the second local camera.
  • the first device may ask the user whether to switch to the second application to call the local camera.
  • the first device may continue to control the first application to call the first local camera according to user instructions, or switch to the second application to call the second local camera.
  • the first device may switch the application that calls the local camera from the first application to the second application.
  • the first application Take the first application as a mirror application and the second application as a camera application as an example.
  • the mirror application uses the first local camera, if the first device detects the user's operation of opening the camera application, it will automatically call the local camera application. Switch from the Changlian app to the Camera app.
  • sequence number of each step in the above embodiment 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 embodiment of the present application.
  • An embodiment of the present application also provides an electronic device.
  • the electronic device includes a local camera, a memory, a processor, and a computer program stored in the memory and executable on the processor.
  • the processor executes the computer program Implement the camera calling method as shown in the above embodiments.
  • An embodiment of the present application also provides a chip, as shown in Figure 14.
  • the chip includes a processor and a memory.
  • a computer program is stored in the memory.
  • the camera calling method in the above embodiments is implemented. .
  • Embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium stores a computer program.
  • the virtual camera calling method provided in the above embodiments is implemented.
  • An embodiment of the present application also provides a computer program product.
  • the program product includes a computer program.
  • the computer program When the computer program is run by an electronic device, it causes the electronic device to implement the camera calling method provided in the above embodiments.
  • processors mentioned in the embodiments of this application may be a central processing unit (CPU), or other general-purpose processor, digital signal processor (DSP), or application-specific integrated circuit (ASIC).
  • ASIC application specific integrated circuit
  • FPGA field programmable gate array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • non-volatile memory may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory.
  • Volatile memory can be random access memory (RAM), which is used as an external cache.
  • RAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • double data rate SDRAM double data rate SDRAM
  • DDR SDRAM double data rate SDRAM
  • ESDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous link dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • each framework or module is only a logical function division. In actual implementation, there may be other division methods. For example, multiple frameworks or modules may be combined or integrated into another system. , or some features can be ignored, or not implemented.
  • each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules.

Abstract

The present application relates to the technical field of cameras. Provided are a camera calling method, an electronic device, a readable storage medium and a chip. The method is applied to a first device, and an application is installed on the first device. The method comprises: receiving an operation event, wherein the operation event is used for indicating that an application calls a local camera (S601); if the application has a virtual-camera calling permission, in response to there being a multi-device cooperative relationship between a first device and a second device, determining a virtual camera corresponding to the local camera, and supporting the application to call the virtual camera to acquire an image (S602); and if the application does not have the virtual-camera calling permission, supporting the application to directly call the local camera to acquire an image (S603). In the method provided in the present application, when a first device and a second device operate cooperatively, after the first device receives an indication that an application calls a local camera, a virtual camera corresponding to the local camera can be quickly determined and called, thereby achieving a relatively fast calling speed and providing a good user experience.

Description

摄像头调用方法、电子设备、可读存储介质和芯片Camera calling method, electronic device, readable storage medium and chip
本申请要求于2022年09月02日提交国家知识产权局、申请号为202211073229.9、申请名称为“摄像头调用方法、电子设备、可读存储介质和芯片”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application submitted to the State Intellectual Property Office on September 2, 2022, with the application number 202211073229.9 and the application name "Camera calling method, electronic device, readable storage medium and chip", and its entire content incorporated herein by reference.
技术领域Technical field
本申请涉及摄像头技术领域,尤其涉及一种摄像头调用方法、电子设备、可读存储介质和芯片。The present application relates to the field of camera technology, and in particular to a camera calling method, electronic equipment, readable storage media and chips.
背景技术Background technique
虚拟摄像头技术是多设备互联协同技术中的一个重要组成部分。通过虚拟摄像头技术,第一设备上的应用程序(如相机应用、视频通话应用等)可以调用第二设备的摄像头采集图像,该第二设备的摄像头即为第一设备的虚拟摄像头。但是,第一设备调用虚拟摄像头的过程复杂,调用速度较慢,用户体验不佳。Virtual camera technology is an important component of multi-device interconnection and collaboration technology. Through virtual camera technology, applications on the first device (such as camera applications, video call applications, etc.) can call the camera of the second device to collect images. The camera of the second device is the virtual camera of the first device. However, the process of calling the virtual camera by the first device is complicated, the calling speed is slow, and the user experience is poor.
发明内容Contents of the invention
本申请提供一种摄像头调用方法、电子设备、可读存储介质和芯片,用于解决现有技术中虚拟摄像头的调用过程复杂,调用速度较慢,用户体验不佳的问题。This application provides a camera calling method, electronic device, readable storage medium and chip to solve the problems in the prior art that the virtual camera calling process is complicated, the calling speed is slow, and the user experience is poor.
为达到上述目的,本申请采用如下技术方案:In order to achieve the above purpose, this application adopts the following technical solutions:
第一方面,本申请实施例提供一种摄像头调用方法,应用于第一设备,第一设备安装有应用,该方法包括:接收操作事件,该操作事件用于指示该应用调用本地摄像头,本地摄像头为第一设备的摄像头;若该应用具备虚拟摄像头调用权限,响应于第一设备与第二设备具备多设备协同关系,确定本地摄像头对应的虚拟摄像头,支持该应用调用虚拟摄像头采集图像,虚拟摄像头为第二设备的摄像头,本地摄像头与虚拟摄像头具有映射关系;若该应用不具备虚拟摄像头调用权限,支持该应用直接调用本地摄像头采集图像。In a first aspect, embodiments of the present application provide a camera calling method, which is applied to a first device. The first device is installed with an application. The method includes: receiving an operation event. The operation event is used to instruct the application to call a local camera. The local camera is the camera of the first device; if the application has virtual camera calling permission, in response to the first device and the second device having a multi-device collaboration relationship, the virtual camera corresponding to the local camera is determined, and the application is supported to call the virtual camera to collect images. The virtual camera It is the camera of the second device. The local camera and the virtual camera have a mapping relationship; if the application does not have the permission to call the virtual camera, the application is supported to directly call the local camera to collect images.
通过本申请实施例提供的方法,在第一设备和第二设备协同工作的情况下,第一设备在接收到应用调用本地摄像头的指示后,可以快速确定并调用该本地摄像头对应的虚拟摄像头,调用过程简单,具有较快的调用速度,用户体验较好。Through the method provided by the embodiment of the present application, when the first device and the second device work together, the first device can quickly determine and call the virtual camera corresponding to the local camera after receiving an instruction from the application to call the local camera. The calling process is simple, has a fast calling speed, and has a good user experience.
在一些实现中,该多设备协同关系包括:第一设备向第二设备发送第一设备的第一屏幕内容,第二设备显示第一屏幕内容,该第一屏幕内容包括所述应用的相关内容(如应用图标、应用界面等);基于此,接收操作事件包括:接收第二设备发送的操作事件,该操作事件是在第二设备显示的第一屏幕内容中触发的。In some implementations, the multi-device collaboration relationship includes: the first device sends the first screen content of the first device to the second device, and the second device displays the first screen content, and the first screen content includes relevant content of the application (such as application icons, application interfaces, etc.); based on this, receiving the operation event includes: receiving the operation event sent by the second device, and the operation event is triggered in the first screen content displayed by the second device.
通过本申请实施例提供的方法,在第一设备向第二设备投屏的情况下,用户可以通过第二设备来控制第一设备上的应用进行摄像头的调用。Through the method provided by the embodiments of this application, when the first device projects the screen to the second device, the user can control the application on the first device to call the camera through the second device.
在一些实现中,支持该应用调用虚拟摄像头采集图像之后,该方法还包括:根据虚拟摄像头采集到的图像更新第一屏幕内容;向第二设备发送更新后的第一屏幕内容。In some implementations, after the application calls the virtual camera to collect images, the method also includes: updating the first screen content according to the image collected by the virtual camera; and sending the updated first screen content to the second device.
在一些实现中,若该应用具备虚拟摄像头调用权限,响应于第一设备与第二设备具备多设备协同关系,支持该应用调用虚拟摄像头采集图像之后,该方法还包括:第一设备与第二设备断开多设备协同关系;将虚拟摄像头切换为本地摄像头,支持该应用直接调用本地摄像头采集图像。In some implementations, if the application has the permission to call the virtual camera, in response to the first device and the second device having a multi-device collaboration relationship and supporting the application to call the virtual camera to collect images, the method also includes: the first device and the second device The device disconnects the multi-device collaboration relationship; switches the virtual camera to a local camera, allowing the application to directly call the local camera to collect images.
通过本申请实施例提供的方法,在应用调用虚拟摄像头的过程中,若第一设备和第二设备的多设备协同关系断开,那么第一设备可以将采集图像的摄像头由虚拟摄像头切换至本地摄像头,从而保证该应用的正常工作,提高用户体验。Through the method provided by the embodiment of the present application, when the application calls the virtual camera, if the multi-device collaboration relationship between the first device and the second device is disconnected, the first device can switch the camera that collects images from the virtual camera to the local camera. camera to ensure the normal working of the application and improve user experience.
在一些实现中,若该应用具备虚拟摄像头调用权限,响应于第一设备与第二设备具备多设备协同关系,支持该应用调用虚拟摄像头采集图像包括:接收该操作事件;支持该应用直接调用本地摄像头采集图像;第一设备与第二设备建立多设备协同关系;将本地摄像头切换为虚拟摄像头,支持该应用调用虚拟摄像头采集图像。In some implementations, if the application has the permission to call the virtual camera, in response to the first device and the second device having a multi-device collaboration relationship, supporting the application to call the virtual camera to collect images includes: receiving the operation event; supporting the application to directly call the local The camera collects images; the first device establishes a multi-device collaboration relationship with the second device; switches the local camera to a virtual camera, and supports the application to call the virtual camera to collect images.
通过本申请实施例提供的方法,在应用调用本地摄像头的过程中,若第一设备和第二设备建立了多 设备协同关系,那么该应用可以将采集图像的摄像头由本地摄像头切换至虚拟摄像头,从而解除对本地摄像头的占用,以保证电子设备的一些依赖于本地摄像头的功能的实现(例如保证人脸识别解锁功能的实现)。Through the method provided by the embodiments of this application, during the process of the application calling the local camera, if the first device and the second device establish multiple device synergy, then the application can switch the camera that collects images from the local camera to the virtual camera, thereby releasing the occupation of the local camera to ensure the implementation of some functions of the electronic device that rely on the local camera (such as ensuring the face recognition unlocking function implementation).
在一些实现中,该应用包括第一应用和第二应用,第一应用具备虚拟摄像头调用权限,第二应用不具备虚拟摄像头调用权限,该操作事件包括指示第一应用调用第一本地摄像头的第一操作事件及指示第二应用调用第二本地摄像头的第二操作事件,第一本地摄像头和第二本地摄像头为相同或者不同的本地摄像头。该方法还包括:第一设备与第二设备建立多设备协同关系;接收第一操作事件;确定第一本地摄像头对应的第一虚拟摄像头,支持第一应用调用第一虚拟摄像头采集图像;接收第二操作事件;支持第二应用直接调用第二本地摄像头采集图像。In some implementations, the application includes a first application and a second application. The first application has the virtual camera calling permission, and the second application does not have the virtual camera calling permission. The operation event includes instructing the first application to call the first local camera. An operation event and a second operation event that instructs the second application to call the second local camera. The first local camera and the second local camera are the same or different local cameras. The method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving a first operation event; determining a first virtual camera corresponding to the first local camera, supporting the first application to call the first virtual camera to collect images; receiving a third Second operation event; supports the second application to directly call the second local camera to collect images.
通过本申请实施例提供的方法,在一个应用调用虚拟摄像头的过程中,另一个应用可以调用本地摄像头,从而保证第一设备更多本地功能的实现,提高用户体验。例如,在第一设备的视频聊天应用调用第二设备的虚拟摄像头采集图像的过程中,人脸识别解锁应用可以调用本地摄像头采集人脸图像,进行人脸识别解锁,保证人脸识别解锁功能的实现。Through the method provided by the embodiments of this application, during the process of one application calling the virtual camera, another application can call the local camera, thereby ensuring the realization of more local functions of the first device and improving the user experience. For example, when the video chat application of the first device calls the virtual camera of the second device to collect images, the face recognition unlocking application can call the local camera to collect face images and perform face recognition unlocking to ensure the realization of the face recognition unlocking function. .
在一些实现中,该应用包括第一应用和第二应用,第一应用和第二应用均具备虚拟摄像头调用权限,该操作事件包括指示第一应用调用第一本地摄像头的第一操作事件及指示第二应用调用第二本地摄像头的第二操作事件,该方法还包括:第一设备与第二设备建立多设备协同关系;接收第一操作事件;确定第一本地摄像头对应的第一虚拟摄像头,支持第一应用调用第一虚拟摄像头采集图像;接收第二操作事件;显示第一提示信息,第一提示信息用于提示虚拟摄像头调用功能已被占用;或者,停止支持第一应用调用第一虚拟摄像头采集图像,确定第二本地摄像头对应的第二虚拟摄像头,支持第二应用调用第二虚拟摄像头采集图像。In some implementations, the application includes a first application and a second application. Both the first application and the second application have permission to call the virtual camera. The operation event includes a first operation event and an instruction that instructs the first application to call the first local camera. The second application calls a second operation event of the second local camera. The method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving the first operation event; determining the first virtual camera corresponding to the first local camera, Support the first application to call the first virtual camera to collect images; receive the second operation event; display the first prompt information, the first prompt information is used to prompt that the virtual camera calling function has been occupied; or, stop supporting the first application to call the first virtual camera The camera collects images, determines the second virtual camera corresponding to the second local camera, and supports the second application to call the second virtual camera to collect images.
其中,第一本地摄像头和第二本地摄像头为相同的本地摄像头,且第一虚拟摄像头和第二虚拟摄像头为相同的虚拟摄像头;或者,第一本地摄像头和第二本地摄像头为不同的本地摄像头,且第一虚拟摄像头和第二虚拟摄像头为不同的虚拟摄像头。Wherein, the first local camera and the second local camera are the same local camera, and the first virtual camera and the second virtual camera are the same virtual camera; or, the first local camera and the second local camera are different local cameras, And the first virtual camera and the second virtual camera are different virtual cameras.
通过本申请实施例提供的方法,在一个应用调用虚拟摄像头的过程中,第一设备可以提示另一应用不能再调用虚拟摄像头。例如,在第一设备和第二设备协同工作的场景下,若视频聊天应用已经占用了虚拟摄像头,那么第一设备提示相机应用不能调用虚拟摄像头进行图像采集。或者,第一设备可以由第一应用切换至第二应用调用虚拟摄像头,以满足用户当前的使用需求。Through the method provided by the embodiments of this application, during the process of one application calling the virtual camera, the first device can prompt another application that the virtual camera can no longer be called. For example, in a scenario where the first device and the second device work together, if the video chat application has occupied the virtual camera, the first device prompts that the camera application cannot call the virtual camera for image collection. Alternatively, the first device can switch from the first application to the second application to call the virtual camera to meet the user's current usage needs.
在一些实现中,该应用包括第一应用和第二应用,第一应用不具备虚拟摄像头调用权限,第二应用具备虚拟摄像头调用权限,该操作事件包括指示第一应用调用第一本地摄像头的第一操作事件及指示第二应用调用第二本地摄像头的第二操作事件,第一本地摄像头和第二本地摄像头为相同或者不同的本地摄像头。该方法还包括:第一设备与第二设备建立多设备协同关系;接收第一操作事件;支持第一应用直接调用第一本地摄像头采集图像;接收第二操作事件;确定第二本地摄像头对应的第二虚拟摄像头,支持第二应用调用第二虚拟摄像头采集图像。In some implementations, the application includes a first application and a second application. The first application does not have the virtual camera calling permission, and the second application has the virtual camera calling permission. The operation event includes a third application that instructs the first application to call the first local camera. An operation event and a second operation event that instructs the second application to call the second local camera. The first local camera and the second local camera are the same or different local cameras. The method also includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving a first operation event; supporting the first application to directly call the first local camera to collect images; receiving the second operation event; and determining the location corresponding to the second local camera. The second virtual camera supports the second application to call the second virtual camera to collect images.
通过本申请实施例提供的方法,第一设备的一个应用在调用本地摄像头的过程中,另一个应用可以同时调用虚拟摄像头。例如,在第一设备的相机应用调用本地摄像头采集图像的过程中,视频聊天应用可以同时调用第二设备的虚拟摄像头采集图像。Through the method provided by the embodiments of this application, while an application of the first device is calling the local camera, another application can call the virtual camera at the same time. For example, while the camera application of the first device calls the local camera to collect images, the video chat application can simultaneously call the virtual camera of the second device to collect images.
在一些实现中,该应用包括第一应用和第二应用,第一应用和第二应用均不具备虚拟摄像头调用权限,该操作事件包括指示第一应用调用第一本地摄像头的第一操作事件及指示第二应用调用第二本地摄像头的第二操作事件,第一本地摄像头和第二本地摄像头为相同或者不同的本地摄像头。该方法还包括:接收第一操作事件;支持第一应用直接调用第一本地摄像头采集图像;接收第二操作事件;显示第二提示信息,第二提示信息用于提示本地摄像头调用功能已被占用;或者,停止支持第一应用直接调用第一本地摄像头采集图像,并支持第二应用直接调用第二本地摄像头采集图像。In some implementations, the application includes a first application and a second application. Neither the first application nor the second application has permission to call the virtual camera. The operation event includes a first operation event that instructs the first application to call the first local camera and Instruct the second application to call the second operation event of the second local camera, where the first local camera and the second local camera are the same or different local cameras. The method also includes: receiving a first operation event; supporting the first application to directly call the first local camera to collect images; receiving a second operation event; displaying a second prompt information, the second prompt information being used to prompt that the local camera calling function has been occupied ; Or, stop supporting the first application to directly call the first local camera to collect images, and support the second application to directly call the second local camera to collect images.
通过本申请实施例提供的方法,在一个应用调用本地摄像头的过程中,第一设备可以提示另一个应用不能再调用虚拟摄像头。例如,在第一设备和第二设备协同工作的场景下,若相机应用已经占用了本地摄像头,那么第一设备可以提示视频聊天应用不能调用本地摄像头进行图像采集。或者,第一设备可以将调用本地摄像头的应用由第一应用切换至第二应用,以满足用户当前的使用需求。Through the method provided by the embodiments of this application, during the process of one application calling the local camera, the first device can prompt another application that it can no longer call the virtual camera. For example, in a scenario where the first device and the second device work together, if the camera application has occupied the local camera, the first device can prompt the video chat application that it cannot call the local camera for image collection. Alternatively, the first device may switch the application that calls the local camera from the first application to the second application to meet the user's current usage needs.
在一些实现中,确定本地摄像头对应的虚拟摄像头包括:根据映射关系表确定本地摄像头对应的虚 拟摄像头,该映射关系表包括至少一组本地摄像头和虚拟摄像头的映射关系。In some implementations, determining the virtual camera corresponding to the local camera includes: determining the virtual camera corresponding to the local camera according to the mapping relationship table. Virtual camera, the mapping relationship table includes at least one set of mapping relationships between local cameras and virtual cameras.
在一些实现中,该至少一组本地摄像头和虚拟摄像头的映射关系包括:第一本地摄像头和第一虚拟摄像头的映射关系;以及,第二本地摄像头和第二虚拟摄像头的映射关系。其中,第一本地摄像头和第二本地摄像头为不同的本地摄像头,第一虚拟摄像头和第二虚拟摄像头为不同的虚拟摄像头。In some implementations, the mapping relationship between the at least one set of local cameras and the virtual camera includes: the mapping relationship between the first local camera and the first virtual camera; and the mapping relationship between the second local camera and the second virtual camera. The first local camera and the second local camera are different local cameras, and the first virtual camera and the second virtual camera are different virtual cameras.
在一些实现中,该方法还包括:第一设备与第二设备建立多设备协同关系;接收第二设备发送的虚拟摄像头的标识信息;根据本地摄像头的标识信息和虚拟摄像头的标识信息确定该映射关系。In some implementations, the method further includes: establishing a multi-device collaboration relationship between the first device and the second device; receiving the identification information of the virtual camera sent by the second device; and determining the mapping according to the identification information of the local camera and the identification information of the virtual camera. relation.
在一些实现中,第一设备包括用于并行处理的本地摄像头模块和虚拟摄像头模块,本地摄像头模块用于调用本地摄像头,虚拟摄像头模块用于调用虚拟摄像头。In some implementations, the first device includes a local camera module for parallel processing and a virtual camera module, the local camera module is used for calling the local camera, and the virtual camera module is used for calling the virtual camera.
在本申请实施例提供的方法中,在第一设备和第二设备建立多设备协同关系的情况下,第一设备中同时存在能够并行处理任务的本地摄像头模块和虚拟摄像头模块。基于此,第一设备可以使用本地摄像头模块调用本地摄像头,使用虚拟摄像头模块调用虚拟摄像头,从而实现第一设备对本地摄像头和虚拟摄像头的调用相互不影响,保证了第一设备更多功能的实现,有助于提高用户的使用体验。In the method provided by the embodiment of the present application, when the first device and the second device establish a multi-device collaboration relationship, a local camera module and a virtual camera module that can process tasks in parallel exist in the first device. Based on this, the first device can use the local camera module to call the local camera, and the virtual camera module to call the virtual camera, so that the first device's calls to the local camera and the virtual camera do not affect each other, ensuring the realization of more functions of the first device. , helping to improve the user experience.
第二方面,本申请实施例提供一种电子设备,包括存储器、处理器以及存储在存储器中并可在处理器上运行的计算机程序,处理器执行该计算机程序时实现如上述第一方面及其各个实现方式所示出的方法。In a second aspect, embodiments of the present application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned first aspect and the above are implemented. The methods shown in each implementation.
第三方面,本申请实施例提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面所示出的方法。In a third aspect, embodiments of the present application provide a computer-readable storage medium that stores a computer program. When the computer program is executed by a processor, the method shown in the first aspect is implemented.
第四方面,本申请实施例提供一种芯片,该芯片包括处理器和存储器,该存储器中存储有计算机程序,该计算机程序被处理器执行时实现如上述第一方面示出的方法。In a fourth aspect, embodiments of the present application provide a chip. The chip includes a processor and a memory. A computer program is stored in the memory. When the computer program is executed by the processor, the method shown in the first aspect is implemented.
第五方面,本申请实施例提供一种计算机程序文件,所述计算机程序文件包括程序,当所述程序被电子设备运行时,使得电子设备实现如上述第一方面示出的方法。In a fifth aspect, embodiments of the present application provide a computer program file. The computer program file includes a program. When the program is run by an electronic device, the electronic device implements the method shown in the first aspect.
可以理解的是,上述第二方面至第五方面的有益效果可以参见上述第一方面中的相关描述,在此不再赘述。It can be understood that the beneficial effects of the above-mentioned second aspect to the fifth aspect can be referred to the relevant description in the above-mentioned first aspect, and will not be described again here.
附图说明Description of drawings
图1是本申请实施例提供的多设备协同过程中的设备间连接结构示意图;Figure 1 is a schematic diagram of the connection structure between devices in the multi-device collaboration process provided by the embodiment of the present application;
图2是本申请的一个实施例提供的多设备协同场景示意图;Figure 2 is a schematic diagram of a multi-device collaboration scenario provided by an embodiment of the present application;
图3是本申请另一个实施例提供的多设备协同场景示意图;Figure 3 is a schematic diagram of a multi-device collaboration scenario provided by another embodiment of the present application;
图4A是本申请的一个实施例提供的多设备协同过程中的用户控制场景示意图;Figure 4A is a schematic diagram of a user control scenario in a multi-device collaboration process provided by an embodiment of the present application;
图4B是本申请另一个实施例提供的多设备协同过程中的用户控制场景示意图;Figure 4B is a schematic diagram of a user control scenario in a multi-device collaboration process provided by another embodiment of the present application;
图4C是本申请的一个实施例提供的多设备协同过程中的视频通话场景示意图;Figure 4C is a schematic diagram of a video call scene during multi-device collaboration provided by an embodiment of the present application;
图5是本申请的一个实施例提供的摄像头调用方法的示意性流程图;Figure 5 is a schematic flow chart of a camera calling method provided by an embodiment of the present application;
图6是本申请实施例提供的摄像头调用方法的示意性流程图;Figure 6 is a schematic flow chart of the camera calling method provided by the embodiment of the present application;
图7是本申请实施例提供的一种电子设备的结构示意图;Figure 7 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图8是本申请实施例提供的第一设备的软件结构示意图;Figure 8 is a schematic diagram of the software structure of the first device provided by the embodiment of the present application;
图9是本申请实施例提供的第一设备单独调用本地摄像头的示意性流程图;Figure 9 is a schematic flow chart of the first device independently calling the local camera provided by the embodiment of the present application;
图10是本申请实施例提供的第一设备将本地摄像头切换至虚拟摄像头的示意性流程图;Figure 10 is a schematic flow chart of the first device switching a local camera to a virtual camera according to an embodiment of the present application;
图11是本申请实施例提供的第一设备单独调用虚拟摄像头的示意性流程图;Figure 11 is a schematic flow chart of the first device separately calling the virtual camera provided by the embodiment of the present application;
图12是本申请实施例提供的第一设备将虚拟摄像头切换至本地摄像头的示意性流程图;Figure 12 is a schematic flow chart of the first device switching the virtual camera to the local camera provided by the embodiment of the present application;
图13是本申请实施例提供的第一设备的一个显示界面示意图;Figure 13 is a schematic diagram of a display interface of the first device provided by the embodiment of the present application;
图14是本申请实施例提供的芯片结构示意图。Figure 14 is a schematic structural diagram of a chip provided by an embodiment of the present application.
具体实施方式Detailed ways
下面结合附图对本申请实施例提供的技术方案进行说明。The technical solutions provided by the embodiments of the present application will be described below with reference to the accompanying drawings.
应理解,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。It should be understood that in the description of the embodiments of this application, unless otherwise stated, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a descriptive association. The association relationship of objects means that there can be three relationships. For example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone.
在本申请实施例中,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或 者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。In the embodiments of this application, the terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or The latter implicitly indicates the quantity of the technical characteristics indicated. Therefore, features defined as "first" and "second" may explicitly or implicitly include one or more of these features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.
多设备互联协同,简称多设备协同,是电子设备的一个重要发展方向。目前,常见的多设备协同场景有手机-平板电脑协同、手机-笔记本电脑协同、平板电脑-笔记本电脑协同、车机-手机协同、手机-无人机协同、手机-相机设备协同等。通过多设备协同,不同类型的电子设备可以打破设备和应用壁垒,实现跨平台、跨系统的协作功能,从而充分利用不同设备的优势,提高人们的工作和生活体验。Multi-device interconnection and collaboration, referred to as multi-device collaboration, is an important development direction of electronic equipment. Currently, common multi-device collaboration scenarios include mobile phone-tablet collaboration, mobile phone-laptop collaboration, tablet-laptop collaboration, vehicle-machine collaboration, mobile phone-drone collaboration, mobile phone-camera device collaboration, etc. Through multi-device collaboration, different types of electronic devices can break down device and application barriers and achieve cross-platform and cross-system collaboration functions, thereby making full use of the advantages of different devices and improving people's work and life experience.
图1是本申请实施例提供的多设备协同过程中的设备间连接结构示意图。参见图1所示,以第一设备和第二设备进行多设备协同为例,第一设备和第二设备之间可以无线连接,也可以有线连接。其中,无线连接包括无线保真(wireless fidelity,WiFi)连接、蓝牙(bluetooth,BT)连接、超带宽(ultra wide band,UWB)连接、近场通信(near field communication,NFC)连接等。有线连接包括数据线连接等,本申请实施例对此不进行具体限制。Figure 1 is a schematic diagram of the connection structure between devices in the multi-device collaboration process provided by the embodiment of the present application. Referring to Figure 1, taking multi-device collaboration between a first device and a second device as an example, the first device and the second device may be connected wirelessly or wired. Among them, wireless connections include wireless fidelity (WiFi) connections, Bluetooth (BT) connections, ultra-wide band (UWB) connections, near field communication (NFC) connections, etc. Wired connections include data line connections, etc., which are not specifically limited in the embodiments of this application.
第一设备和第二设备可以根据用户操作建立多设备协同关系。例如,当第一设备是手机,第二设备是笔记本电脑时,在手机NFC功能开启的情况下,用户使用手机背部的NFC区域触碰笔记本电脑的华为分享感应区,并在手机上确认连接笔记本电脑之后,即可将手机的屏幕内容通过悬浮窗的形式显示在笔记本电脑上(可参见图2),从而建立多设备协同关系。或者,当第一设备是手机,第二设备是平板电脑时,在手机蓝牙开启以及平板电脑多屏协同功能开启的情况下,用户将手机靠近平板电脑并按照提示完成连接,即可将手机的屏幕内容通过悬浮窗的形式显示在平板电脑上(可参见图3),建立多设备协同关系。The first device and the second device can establish a multi-device collaboration relationship based on user operations. For example, when the first device is a mobile phone and the second device is a laptop, with the NFC function of the phone turned on, the user uses the NFC area on the back of the phone to touch the Huawei sharing sensing area of the laptop and confirms the connection to the laptop on the phone. After connecting to the computer, the screen content of the mobile phone can be displayed on the laptop in the form of a floating window (see Figure 2), thereby establishing a multi-device collaboration relationship. Or, when the first device is a mobile phone and the second device is a tablet, with the mobile phone's Bluetooth turned on and the tablet's multi-screen collaboration function turned on, the user can bring the phone close to the tablet and follow the prompts to complete the connection. The screen content is displayed on the tablet in the form of a floating window (see Figure 3), establishing a multi-device collaboration relationship.
基于此,用户可以通过第二设备上的悬浮窗显示第一设备的屏幕内容,可称作第一屏幕内容,并控制第一设备。示例性的,第二设备可以将用户在悬浮窗内触发的操作事件(如点击事件、触摸滑动事件等)反馈给第一设备,第一设备可以基于接收到的操作事件更新第一设备的屏幕内容,并将更新后的屏幕内容发送给第二设备,以由第二设备更新悬浮窗内显示的第一设备的屏幕内容。这样,第一设备的部分功能可以通过第二设备来操作,而第一设备可以同步进行其他功能的操作。Based on this, the user can display the screen content of the first device, which can be called the first screen content, through the floating window on the second device, and control the first device. For example, the second device can feed back the operation events (such as click events, touch sliding events, etc.) triggered by the user in the floating window to the first device, and the first device can update the screen of the first device based on the received operation events. content, and sends the updated screen content to the second device, so that the second device updates the screen content of the first device displayed in the floating window. In this way, some functions of the first device can be operated by the second device, and the first device can simultaneously operate other functions.
进一步,多设备协同过程中还可以采用虚拟摄像头技术,即一个设备不仅可以使用本地摄像头进行图像采集,本地摄像头是指设备自身所具有的摄像头,也可以使用虚拟摄像头进行图像采集,虚拟摄像头是指其他连接设备的摄像头。在一些示例中,第一设备(如手机)和第二设备(如笔记本电脑)在建立多设备协同关系之后,若第一设备是主控设备,第二设备是协同设备,那么第一设备上的部分应用程序(application,App)可以调用第二设备的摄像头来采集图像(包括图片和视频)。Furthermore, virtual camera technology can also be used in the process of multi-device collaboration, that is, a device can not only use a local camera for image collection, which refers to the camera of the device itself, but can also use a virtual camera for image collection. The virtual camera refers to Cameras from other connected devices. In some examples, after the first device (such as a mobile phone) and the second device (such as a laptop) establish a multi-device collaboration relationship, if the first device is the master device and the second device is the collaboration device, then the first device Some applications (Apps) can call the camera of the second device to collect images (including pictures and videos).
在一个示例中,参见图3所示,在手机和平板电脑协同工作的过程中,手机为主控设备,平板电脑为协同设备,手机向平板电脑发送手机的屏幕内容,平板电脑接收并显示手机的屏幕内容。参见图4A所示,响应于用户对平板电脑上畅连应用的操作,平板电脑向第一设备发送打开畅连应用的操作事件,手机根据该操作事件将手机的屏幕内容更新为图4B中示出的通话记录界面,并将通话记录界面发送给平板电脑进行显示。该通话记录界面中包括用户与其各个好友的通话记录。在一些通话记录下方,如好友1的通话记录下方,显示有语音通话控件和视频通话控件。参见图4B所示,响应于用户在第二设备的悬浮窗内点击好友1的视频通话控件,第二设备向第一设备发送第一操作事件。响应于第一操作事件,第一设备调用第二设备的摄像头采集图像,并根据采集到的图像生成通话界面。最后,第一设备将通话界面发送给第二设备进行显示,从而实现用户使用第一设备的畅连应用,在第二设备上进行视屏通话。在视频通话过程中,参见图4C所示,第一设备和第二设备的显示的通话界面相同,均包括用户图像、好友图像以及其他控件(如“切换摄像头”、“挂断”、“更多”等),其中,用户图像是由第二设备的摄像头采集到的。另外,需要说明的是,用户通过第二设备的悬浮窗控制第一设备时,第一设备可以显示屏幕内容,也可以熄屏。In an example, as shown in Figure 3, in the process of collaborative work between a mobile phone and a tablet computer, the mobile phone is the main control device and the tablet computer is the collaborative device. The mobile phone sends the screen content of the mobile phone to the tablet computer, and the tablet computer receives and displays the mobile phone screen content. screen content. As shown in Figure 4A, in response to the user's operation of the Changlian application on the tablet computer, the tablet computer sends an operation event to open the Changlian application to the first device, and the mobile phone updates the screen content of the mobile phone as shown in Figure 4B based on the operation event. The call recording interface appears, and the call recording interface is sent to the tablet for display. The call record interface includes call records between the user and each of his friends. Under some call records, such as the call record of Friend 1, there are voice call controls and video call controls. Referring to FIG. 4B , in response to the user clicking the video call control of friend 1 in the floating window of the second device, the second device sends a first operation event to the first device. In response to the first operation event, the first device calls the camera of the second device to collect images, and generates a call interface based on the collected images. Finally, the first device sends the call interface to the second device for display, thereby enabling the user to use the Changlian application of the first device to make a video call on the second device. During the video call, as shown in Figure 4C, the first device and the second device display the same call interface, including user images, friend images, and other controls (such as "switch camera", "hang up", "update"). "Multiple", etc.), where the user image is captured by the camera of the second device. In addition, it should be noted that when the user controls the first device through the floating window of the second device, the first device can display screen content or turn off the screen.
在一些实现中,参见图5所示,第一设备通常通过硬件抽象层的摄像头会话管理模块(Camera0)调用各个来源的摄像头,实现视频流切换及图像采集,其中各个来源的摄像头包括第一设备的本地摄像头和虚拟摄像头(比如第二设备的摄像头)。In some implementations, as shown in Figure 5, the first device usually calls cameras from various sources through the camera session management module (Camera0) of the hardware abstraction layer to implement video stream switching and image collection, where the cameras from each source include the first device Local camera and virtual camera (such as the camera of the second device).
示例性的,第一设备的应用程序(如)调用本地摄像头的过程如图5中的S0-1~S0-4所示。For example, the application of the first device (such as ) The process of calling the local camera is shown in S0-1 to S0-4 in Figure 5.
S0-1,应用程序向摄像头模组(Camera Module)发送摄像头调用指令。S0-1, the application sends camera calling instructions to the camera module (Camera Module).
S0-2,响应于该摄像头调用指令,摄像头模组向摄像头会话管理模块(Camera0)中的摄像头会话 单元(Camera Session)发送会话建立指令。S0-2, in response to the camera calling instruction, the camera module sends a request to the camera session in the camera session management module (Camera0). The unit (Camera Session) sends session establishment instructions.
S0-3,响应于会话建立指令,摄像头会话单元建立摄像头会话,并向摄像头驱动(Camera Driver)发送驱动打开指令。S0-3, in response to the session establishment instruction, the camera session unit establishes the camera session and sends a driver opening instruction to the camera driver (Camera Driver).
S0-4,响应于该驱动打开指令,摄像头驱动打开,并向本地摄像头发送图像采集指令。S0-4, in response to the driver opening instruction, the camera driver opens and sends an image acquisition instruction to the local camera.
需要说明的是,本地摄像头采集到的图像依次经过摄像头驱动、摄像头会话单元、摄像头模组返回至该应用程序。It should be noted that the images collected by the local camera are returned to the application through the camera driver, camera session unit, and camera module in sequence.
示例性的,第一设备的应用程序(如)调用虚拟摄像头的过程如图5中的S0-1~S0-9所示。For example, the application of the first device (such as ) The process of calling the virtual camera is shown in S0-1 to S0-9 in Figure 5.
S0-1~S0-4,应用程序打开本地摄像头。具体参见前文描述,此处不再赘述。S0-1~S0-4, the application opens the local camera. For details, please refer to the previous description and will not be repeated here.
S0-5,在第一设备和第二设备已建立多设备协同关系的情况下,协同管理应用通过分布式硬件管理模块向摄像头会话管理模块发送摄像头切换指令。该摄像头切换指令用于指示将摄像头会话单元的数据流由本地摄像头切换为虚拟摄像头。S0-5: When the first device and the second device have established a multi-device collaboration relationship, the collaboration management application sends a camera switching instruction to the camera session management module through the distributed hardware management module. The camera switching instruction is used to instruct the data stream of the camera session unit to be switched from a local camera to a virtual camera.
S0-6,响应于摄像头切换指令,摄像头会话管理模块中数据流切换单元向摄像头会话单元发送数据拦截请求。该数据拦截请求用于请求拦截本地摄像头采集的图像。S0-6, in response to the camera switching instruction, the data flow switching unit in the camera session management module sends a data interception request to the camera session unit. This data interception request is used to request to intercept images collected by local cameras.
S0-7,响应于数据拦截请求,摄像头会话单元向摄像头驱动发送驱动关闭指令,以停止对本地摄像头的调用。第一设备在停止对本地摄像头的调用后,第一设备不使用本地摄像头采集图像。S0-7, in response to the data interception request, the camera session unit sends a driver shutdown instruction to the camera driver to stop calling the local camera. After the first device stops calling the local camera, the first device does not use the local camera to collect images.
S0-8,摄像头会话单元向数据流切换单元发送拦截成功通知。S0-8, the camera session unit sends an interception success notification to the data flow switching unit.
S0-9,数据流切换单元向分布式硬件管理模块发送切换成功通知。该切换成功通知用于通知已将摄像头会话单元的数据流由本地摄像头切换为虚拟摄像头。S0-9, the data flow switching unit sends a switching success notification to the distributed hardware management module. The switching success notification is used to notify that the data stream of the camera session unit has been switched from the local camera to the virtual camera.
S0-10,分布式硬件管理模块向第二设备发送摄像头调用指令,以便通过虚拟摄像头(即第二设备的摄像头)采集图像。S0-10: The distributed hardware management module sends a camera calling instruction to the second device to collect images through the virtual camera (ie, the camera of the second device).
需要说明的是,虚拟摄像头(即第二设备的摄像头)采集到的图像依次经过分布式硬件管理模块、数据流切换单元、摄像头会话单元、摄像头模组返回至应用程序。It should be noted that the images collected by the virtual camera (that is, the camera of the second device) are returned to the application program through the distributed hardware management module, data flow switching unit, camera session unit, and camera module in sequence.
可以看出,第一设备在调用虚拟摄像头的过程中,需要先打开本地摄像头,再根据上层应用的指令将本地摄像头切换至虚拟摄像头,存在打开本地摄像头的冗余操作流程,调用过程复杂,导致虚拟摄像头的调用速度较慢,用户体验不佳。It can be seen that in the process of calling the virtual camera, the first device needs to open the local camera first, and then switch the local camera to the virtual camera according to the instructions of the upper-layer application. There is a redundant operation process for opening the local camera, and the calling process is complicated, resulting in The calling speed of the virtual camera is slow and the user experience is poor.
另外,由于第一设备在使用摄像头会话管理模块调用虚拟摄像头的过程中,摄像头会话管理模块会被虚拟摄像头占用,本地摄像头就无法被其他应用所使用,因此,第一设备不能够实现同时调用本地摄像头和虚拟摄像头,从而影响第一设备部分功能的实现。In addition, since the first device uses the camera session management module to call the virtual camera, the camera session management module will be occupied by the virtual camera, and the local camera cannot be used by other applications. Therefore, the first device cannot simultaneously call the local camera. Camera and virtual camera, thus affecting the implementation of some functions of the first device.
以第一设备是手机,第二设备是笔记本电脑为例,手机和笔记本电脑在建立多设备协同关系之后,手机在进行视频聊天的过程中可以调用虚拟摄像头(即笔记本电脑的摄像头)采集图像。但是,手机在调用虚拟摄像头时将摄像头会话管理模块占用,导致手机无法再调用本地摄像头采集人脸图像,比如人脸识别解锁就会失败,导致用户体验不佳。Taking the first device as a mobile phone and the second device as a laptop as an example, after the mobile phone and the laptop establish a multi-device collaboration relationship, the mobile phone can call the virtual camera (that is, the camera of the laptop) to collect images during the video chat. However, when the phone calls the virtual camera, the camera session management module is occupied, so the phone can no longer call the local camera to collect face images. For example, face recognition unlocking will fail, resulting in poor user experience.
为此,本申请实施例提供一种摄像头调用方法,该方法能够在电子设备打开虚拟摄像头的过程中,避免打开本地摄像头的冗余流程,提高虚拟摄像头的调用速度,提高用户体验。另外,该方法还能够减少本地摄像头和虚拟摄像头调用时的相互影响,保证电子设备更多功能的正常实现,提高用户体验。To this end, embodiments of the present application provide a camera calling method, which can avoid the redundant process of opening a local camera when an electronic device opens a virtual camera, improve the virtual camera calling speed, and improve user experience. In addition, this method can also reduce the mutual influence when calling the local camera and the virtual camera, ensure the normal realization of more functions of the electronic device, and improve the user experience.
图6是本申请实施例提供的摄像头调用方法的示意性流程图。该方法应用于第一设备,具体包括如下S601~S603。Figure 6 is a schematic flow chart of the camera calling method provided by the embodiment of the present application. The method is applied to the first device and specifically includes the following S601 to S603.
S601,接收操作事件,该操作事件用于指示应用程序调用本地摄像头。S601: Receive an operation event, which is used to instruct the application to call the local camera.
S602,若该应用程序具备虚拟摄像头调用权限,响应于第一设备和第二设备具备多设备协同关系,确定该本地摄像头对应的虚拟摄像头,支持该应用程序调用该虚拟摄像头采集图像。虚拟摄像头为第二设备的摄像头。S602, if the application has the permission to call the virtual camera, in response to the first device and the second device having a multi-device collaboration relationship, determine the virtual camera corresponding to the local camera, and support the application to call the virtual camera to collect images. The virtual camera is the camera of the second device.
S603,若该应用程序不具备虚拟摄像头调用权限,则支持该应用调用该本地摄像头采集图像。S603, if the application does not have the permission to call the virtual camera, the application is supported to call the local camera to collect images.
在本申请实施例提供的方法中,在第一设备和第二设备建立多设备协同关系的情况下,第一设备在接收到应用程序调用本地摄像头的指示后,可以快速确定并调用该本地摄像头对应的虚拟摄像头,具有较快调用速度,用户体验较好。In the method provided by the embodiment of the present application, when the first device and the second device establish a multi-device collaboration relationship, the first device can quickly determine and call the local camera after receiving an instruction from the application program to call the local camera. The corresponding virtual camera has faster calling speed and better user experience.
图7是本申请实施例提供摄像头调用方法所适用的电子设备的结构示意图。该电子设备可以包括处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230, 充电管理模块240,电源管理模块241,电池242,天线1,天线2,移动通信模块250,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,传感器模块280,按键290,马达291,指示器292,摄像头293,显示屏294,以及用户标识模块(subscriber identification module,SIM)卡接口295等。FIG. 7 is a schematic structural diagram of an electronic device suitable for providing a camera calling method according to an embodiment of the present application. The electronic device may include a processor 210, an external memory interface 220, an internal memory 221, a universal serial bus (USB) interface 230, Charging management module 240, power management module 241, battery 242, antenna 1, antenna 2, mobile communication module 250, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, headphone interface 270D, sensor module 280, Button 290, motor 291, indicator 292, camera 293, display screen 294, and subscriber identification module (subscriber identification module, SIM) card interface 295, etc.
在本申请实施例中,电子设备可以是手机(mobile phone)、平板电脑(Pad)、带无线收发功能的电脑、智能电视、投影仪、可穿戴设备(如智能手表)、车载设备、增强现实(augmented reality,AR)/虚拟现实(virtual reality,VR)设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)等。本申请实施例对电子设备的具体类型不进行限制。In the embodiment of this application, the electronic device may be a mobile phone, a tablet computer (Pad), a computer with wireless transceiver functions, a smart TV, a projector, a wearable device (such as a smart watch), a vehicle-mounted device, or an augmented reality device. (augmented reality, AR)/virtual reality (VR) equipment, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (personal digital assistant, PDA), etc. The embodiments of this application do not limit the specific type of electronic equipment.
可以理解的是,本申请实施例示意的结构并不构成对电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structures illustrated in the embodiments of the present application do not constitute specific limitations on the electronic equipment. In other embodiments of the present application, the electronic device may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
作为举例,当电子设备为手机或平板电脑时,可以包括图示中的全部部件,也可以仅包括图示中的部分部件。As an example, when the electronic device is a mobile phone or a tablet computer, it may include all the components in the illustration, or may only include some of the components in the illustration.
作为举例,当电子设备为大屏设备时,可以包括图示中的处理器210,外部存储器接口220,内部存储器221,通用串行总线(universal serial bus,USB)接口230,充电管理模块240,电源管理模块241,无线通信模块260,音频模块270,扬声器270A,受话器270B,麦克风270C,摄像头293,显示屏294。As an example, when the electronic device is a large-screen device, it may include the processor 210 in the figure, the external memory interface 220, the internal memory 221, the universal serial bus (universal serial bus, USB) interface 230, and the charging management module 240. Power management module 241, wireless communication module 260, audio module 270, speaker 270A, receiver 270B, microphone 270C, camera 293, and display screen 294.
处理器210可以包括一个或多个处理单元,例如:处理器210可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 210 may include one or more processing units. For example, the processor 210 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) wait. Among them, different processing units can be independent devices or integrated in one or more processors.
其中,控制器可以是电子设备的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Among them, the controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器210中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器210中的存储器为高速缓冲存储器。该存储器可以保存处理器210刚用过或循环使用的指令或数据。如果处理器210需要再次使用该指令或数据,可从存储器中直接调用。避免了重复存取,减少了处理器210的等待时间,因而提高了系统的效率。The processor 210 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 210 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 210 . If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 210 is reduced, thus improving the efficiency of the system.
充电管理模块240用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块240可以通过USB接口230接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块240可以通过电子设备的无线充电线圈接收无线充电输入。充电管理模块240为电池242充电的同时,还可以通过电源管理模块241为电子设备供电。The charge management module 240 is used to receive charging input from the charger. Among them, the charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 240 may receive charging input from the wired charger through the USB interface 230 . In some wireless charging embodiments, the charging management module 240 may receive wireless charging input through a wireless charging coil of the electronic device. While charging the battery 242, the charging management module 240 can also provide power to the electronic device through the power management module 241.
电源管理模块241用于连接电池242,充电管理模块240与处理器210。电源管理模块241接收电池242和/或充电管理模块240的输入,为处理器210,内部存储器221,外部存储器,显示屏294,摄像头293,和无线通信模块260等供电。电源管理模块241还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。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 and supplies power to the processor 210, internal memory 221, external memory, display screen 294, camera 293, wireless communication module 260, etc. The power management module 241 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
在其他一些实施例中,电源管理模块241也可以设置于处理器210中。在另一些实施例中,电源管理模块241和充电管理模块240也可以设置于同一个器件中。In some other embodiments, the power management module 241 may also be provided in the processor 210 . In other embodiments, the power management module 241 and the charging management module 240 may also be provided in the same device.
电子设备的无线通信功能可以通过天线1,天线2,移动通信模块250,无线通信模块260,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 250, the wireless communication module 260, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in an electronic device can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN. In other embodiments, antennas may be used in conjunction with tuning switches.
移动通信模块250可以提供应用在电子设备上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块250可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块250可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块250还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。 The mobile communication module 250 can provide wireless communication solutions including 2G/3G/4G/5G applied to electronic devices. The mobile communication module 250 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 250 can receive electromagnetic waves from the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 250 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
在一些实施例中,移动通信模块250的至少部分功能模块可以被设置于处理器210中。在一些实施例中,移动通信模块250的至少部分功能模块可以与处理器210的至少部分模块被设置在同一个器件中。In some embodiments, at least part of the functional modules of the mobile communication module 250 may be disposed in the processor 210 . In some embodiments, at least part of the functional modules of the mobile communication module 250 and at least part of the modules of the processor 210 may be provided in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器270A,受话器270B等)输出声音信号,或通过显示屏294显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器210,与移动通信模块250或其他功能模块设置在同一个器件中。A 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 sound signals through audio devices (not limited to speaker 270A, receiver 270B, etc.), or displays images or videos through display screen 294. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be independent of the processor 210 and may be provided in the same device as the mobile communication module 250 or other functional modules.
无线通信模块260可以提供应用在电子设备上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块260可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块260经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器210。无线通信模块260还可以从处理器210接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 260 can provide wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (BT), and global navigation satellite systems for use in electronic devices. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 260 may be one or more devices integrating at least one communication processing module. The wireless communication module 260 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 210 . The wireless communication module 260 can also receive the signal to be sent from the processor 210, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备的天线1和移动通信模块250耦合,天线2和无线通信模块260耦合,使得电子设备可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the antenna 1 of the electronic device is coupled to the mobile communication module 250, and the antenna 2 is coupled to the wireless communication module 260, so that the electronic device can communicate with the network and other devices through wireless communication technology.
电子设备通过GPU,显示屏294,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏294和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器210可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device implements display functions through the GPU, display screen 294, and application processor. The GPU is an image processing microprocessor and is connected to the display screen 294 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 210 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏294用于显示图像,视频等。例如本申请实施例中的教学视频和用户动作画面视频,显示屏294包括显示面板。在一些实施例中,电子设备可以包括1个或N个显示屏294,N为大于1的正整数。The display screen 294 is used to display images, videos, etc. For example, in the teaching video and user action scene video in the embodiment of the present application, the display screen 294 includes a display panel. In some embodiments, the electronic device may include 1 or N display screens 294, where N is a positive integer greater than 1.
电子设备可以通过ISP,摄像头293,视频编解码器,GPU,显示屏294以及应用处理器等实现拍摄功能。The electronic device can realize the shooting function through ISP, camera 293, video codec, GPU, display screen 294 and application processor.
ISP用于处理摄像头293反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头293中。The ISP is used to process the data fed back by the camera 293. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera sensor through the lens, the light signal is converted into an electrical signal, and the camera sensor passes the electrical signal to the ISP for processing, and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 293.
摄像头293用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备可以包括1个或N个摄像头293,N为大于1的正整数。Camera 293 is used to capture still images or video. The object passes through the lens to produce an optical image that is projected 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 passes the electrical signal to the ISP to convert it into a digital image signal. ISP outputs digital image signals to DSP for processing. DSP converts digital image signals into standard RGB, YUV and other format image signals. In some embodiments, the electronic device may include 1 or N cameras 293, where N is a positive integer greater than 1.
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
视频编解码器用于对数字视频压缩或解压缩。电子设备可以支持一种或多种视频编解码器。这样,电子设备可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. Electronic devices may support one or more video codecs. In this way, electronic devices can play or record videos in multiple encoding formats, such as: Moving Picture Experts Group (MPEG)1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can continuously learn by itself. Intelligent cognitive applications of electronic devices can be realized through NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
在本申请实施例中,NPU或其他处理器可以用于对电子设备存储的视频中的图像进行分析处理等操作。In this embodiment of the present application, the NPU or other processors may be used to perform operations such as analysis and processing on images in videos stored on electronic devices.
外部存储器接口220可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备的存储能力。外部存储卡通过外部存储器接口220与处理器210通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。 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 electronic device. The external memory card communicates with the processor 210 through the external memory interface 220 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
内部存储器221可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器210通过运行存储在内部存储器221的指令,从而执行电子设备的各种功能应用以及数据处理。内部存储器221可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)。存储数据区可存储电子设备使用过程中所创建的数据(比如音频数据,电话本等)。Internal memory 221 may be used to store computer executable program code, which includes instructions. The processor 210 executes instructions stored in the internal memory 221 to execute various functional applications and data processing of the electronic device. The internal memory 221 may include a program storage area and a data storage area. Among them, the stored program area can store the operating system and at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area can store data created during the use of electronic equipment (such as audio data, phone books, etc.).
此外,内部存储器221可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。In addition, the internal memory 221 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
电子设备可以通过音频模块270,扬声器270A,受话器270B,麦克风270C,耳机接口270D,以及应用处理器等实现音频功能。The electronic device can implement audio functions through the audio module 270, the speaker 270A, the receiver 270B, the microphone 270C, the headphone interface 270D, and the application processor.
音频模块270用于将数字音频信号转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块270还可以用于对音频信号编码和解码。在一些实施例中,音频模块270可以设置于处理器210中,或将音频模块270的部分功能模块设置于处理器210中。The audio module 270 is used to convert digital audio signals into analog audio signal outputs, and is also used to convert analog audio inputs into digital audio signals. Audio module 270 may also be used to encode and decode audio signals. In some embodiments, the audio module 270 may be provided in the processor 210 , or some functional modules of the audio module 270 may be provided in the processor 210 .
扬声器270A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备可以通过扬声器270A收听音乐,或收听免提通话。Speaker 270A, also called "speaker", is used to convert audio electrical signals into sound signals. The electronic device can listen to music through speaker 270A, or listen to hands-free calls.
受话器270B,也称“听筒”,用于将音频电信号转换成声音信号。当电子设备接听电话或语音信息时,可以通过将受话器270B靠近人耳接听语音。Receiver 270B, also called "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device answers a call or a voice message, the voice can be heard by bringing the receiver 270B close to the human ear.
麦克风270C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。当拨打电话或发送语音信息时,用户可以通过人嘴靠近麦克风270C发声,将声音信号输入到麦克风270C。电子设备可以设置至少一个麦克风270C。Microphone 270C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can speak close to the microphone 270C with the human mouth and input the sound signal to the microphone 270C. The electronic device may be provided with at least one microphone 270C.
耳机接口270D用于连接有线耳机。耳机接口270D可以是USB接口230,也可以是3.5mm的开放移动电子设备平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。The headphone interface 270D is used to connect wired headphones. The headphone interface 270D may be a USB interface 230, or may be a 3.5mm open mobile terminal platform (OMTP) standard interface, or a Cellular Telecommunications Industry Association of the USA (CTIA) standard interface.
按键290包括开机键,音量键等。按键290可以是机械按键。也可以是触摸式按键。电子设备可以接收按键输入,产生与电子设备的用户设置以及功能控制有关的键信号输入。The buttons 290 include a power button, a volume button, etc. Key 290 may be a mechanical key. It can also be a touch button. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.
马达291可以产生振动提示。马达291可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏294不同区域的触摸操作,马达291也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。The motor 291 can generate vibration prompts. The motor 291 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback. For example, touch operations for different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. Acting on touch operations in different areas of the display screen 294, the motor 291 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminders, receiving information, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.
指示器292可以是指示灯,可用于指示充电状态,电量变化,也可用于指示消息,未接来电,通知等。The indicator 292 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc.
SIM卡接口295用于连接SIM卡。SIM卡可以通过插入SIM卡接口295,或从SIM卡接口295拔出,实现和电子设备的接触和分离。电子设备可以支持1个或N个SIM卡接口,N为大于1的正整数。The SIM card interface 295 is used to connect a SIM card. The SIM card can be inserted into the SIM card interface 295 or pulled out from the SIM card interface 295 to realize contact and separation from the electronic device. The electronic device can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.
图8是本申请实施例提供的第一设备的软件结构示意图。参见图8所示,以第一设备的操作系统是系统为例,第一设备的软件系统包括应用程序层、应用程序框架层(framework,FWK)、硬件抽象层(hardware abstraction layer,HAL)以及内核层(Kernel),层与层之间通过软件接口通信。Figure 8 is a schematic diagram of the software structure of the first device provided by the embodiment of the present application. Referring to Figure 8, the operating system of the first device is Taking the system as an example, the software system of the first device includes an application layer, an application framework layer (framework, FWK), a hardware abstraction layer (HAL), and a kernel layer (Kernel). The layers are connected through software interfaces. communication.
应用程序层包括一系列应用程序包,应用程序包可以包括畅连应用、相机、短信息、视频、邮件、人脸识别解锁应用和协同管理应用等。在这些应用中,有的应用(如畅连应用、相机)能够调用摄像头,有的应用(如短信息、邮件)不能调用摄像头。其中,协同管理应用用于管理建立第一设备和其他设备(如第二设备)的协同关系,其中包括控制显示相关的用户操作界面,以及,根据用户在该界面中输入的控制操作发现或者连接其他设备等。The application layer includes a series of application packages, which can include Changlian applications, Camera, text messages, videos, emails, face recognition unlocking applications and collaborative management applications, etc. Among these applications, some applications (such as Changlian application, Camera) can call the camera, but some applications (such as text messages, emails) cannot call the camera. Among them, the collaborative management application is used to manage and establish a collaborative relationship between the first device and other devices (such as the second device), which includes controlling and displaying relevant user operation interfaces, and discovering or connecting according to the control operations input by the user in the interface. Other equipment, etc.
需要说明的是,本申请实施例将第一设备上能够调用摄像头的应用程序划分为第一类应用程序和第二类应用程序。It should be noted that, in this embodiment of the present application, applications capable of calling the camera on the first device are divided into first-type applications and second-type applications.
第一类应用程序具备虚拟摄像头调用权限,即可以在第一设备与第二设备建立多设备协同关系之后调用虚拟摄像头。其中包括:第一设备只能调用虚拟摄像头,或者,第一设备可以根据用户操作在虚拟摄像头和本地摄像头中选择性调用虚拟摄像头。示例性的,第一类应用程序可以是畅连应用、相机、镜子应用等。The first type of application has virtual camera calling permission, that is, it can call the virtual camera after the first device and the second device establish a multi-device collaboration relationship. These include: the first device can only call the virtual camera, or the first device can selectively call the virtual camera among the virtual camera and the local camera according to the user operation. For example, the first type of application can be Changlian application, Camera, mirror applications, etc.
在一些实施例中,第一设备是手机,第二设备是笔记本电脑,手机和笔记本电脑建立多设备协同关 系之后,手机在使用与好友进行视频通话的过程中,手机只能调用笔记本电脑的摄像头采集图像,而不能调用本地摄像头采集图像。若用户想使用本地摄像头采集图像,需断开手机和笔记本电脑之间的多设备协同关系。In some embodiments, the first device is a mobile phone, the second device is a laptop computer, and the mobile phone and laptop computer establish a multi-device collaboration relationship. After tying, the phone is in use During a video call with a friend, the mobile phone can only call the laptop's camera to collect images, but cannot call the local camera to collect images. If the user wants to use the local camera to collect images, the multi-device collaboration relationship between the mobile phone and laptop needs to be disconnected.
在另一些实施例中,第一设备是手机,第二设备是笔记本电脑,手机和笔记本电脑建立多设备协同关系之后,手机在使用与好友进行视频通话的过程中,手机优先调用笔记本电脑的摄像头采集图像。若用户想使用手机的本地摄像头采集图像,可以在手机上进行切换操作,将采集图像的摄像头切换为本地摄像头,而无需断开手机和笔记本电脑之间的多设备协同关系。In other embodiments, the first device is a mobile phone and the second device is a laptop. After the mobile phone and the laptop establish a multi-device collaboration relationship, the mobile phone uses During a video call with a friend, the phone gives priority to calling the laptop's camera to collect images. If the user wants to use the local camera of the mobile phone to collect images, he can perform a switching operation on the mobile phone to switch the camera that collects images to the local camera without breaking the multi-device collaboration relationship between the mobile phone and the laptop.
第二类应用程序不具备虚拟摄像头调用权限,即在第一设备与第二设备建立多设备协同关系之后不能够调用虚拟摄像头,仅能够调用本地摄像头。第二类应用程序可以是根据应用程序的类型事先确定的,也可以是根据用户的配置确定的。示例性的,第二类应用程序可以是人脸识别解锁应用等。The second type of application does not have the permission to call the virtual camera, that is, after the first device and the second device establish a multi-device collaboration relationship, it cannot call the virtual camera and can only call the local camera. The second type of application may be determined in advance according to the type of application, or may be determined according to the user's configuration. For example, the second type of application may be a face recognition unlocking application, etc.
在一些实施例中,以第一设备是手机,第二设备是笔记本电脑为例,手机在和笔记本电脑建立多设备协同关系之后,手机上的应用程序优先调用笔记本电脑的摄像头采集图像还是优先调用本地摄像头采集图像,可以通过配置该应用程序的类型来确定,即通过配置该应用程序是属于第一类应用程序还是第二类应用程序来确定。以手机的为例,若用户将配置为第一类应用程序,那么在手机和笔记本电脑协同工作的情况下,优先调用虚拟摄像头。若用户将配置为第二类应用程序,那么在手机和笔记本电脑协同工作的情况下,优先调用本地摄像头。In some embodiments, assuming that the first device is a mobile phone and the second device is a laptop, after the mobile phone establishes a multi-device collaboration relationship with the laptop, does the application on the mobile phone give priority to calling the camera of the laptop to collect images? The image collected by the local camera can be determined by configuring the type of the application, that is, by configuring whether the application belongs to the first type of application or the second type of application. by mobile phone For example, if the user would Configured as a first-class application, then when the mobile phone and laptop work together, Prioritize calling the virtual camera. If the user will Configured as a second category application, then when the mobile phone and laptop work together, Prioritize calling the local camera.
应用程序框架层包括分布硬件管理模块和摄像头模组(Camera Module)。分布式硬件管理模块,用于控制协同设备的硬件。摄像头模组包括摄像头服务模块(Camera Service)、摄像头设备模块(Camera Device)和虚拟摄像头映射管理模块。其中,Camera Service用于给上层应用提供Camera使用接口和服务。Camera Device用于提供对相应Camera设备的控制能力。虚拟摄像头映射管理模块中用于存储第一设备的本地摄像头与第二设备的摄像头(第一设备的虚拟摄像头)的映射关系。在第一设备和第二设备建立多设备协同关系的情况下,该虚拟摄像头映射管理模块能够在第一类应用程序请求调用本地摄像头时,通过该映射关系确定该本地摄像头对应的虚拟摄像头,并通过虚拟摄像头模块调用虚拟摄像头(即第二设备的摄像头),而对于上层的应用程序来讲,无须知道底层调用不同摄像头的逻辑,相应地,应用程序在多设备协同的场景中,也不需要单独设计兼容的程序来适应。The application framework layer includes distributed hardware management modules and camera modules. Distributed hardware management module, used to control the hardware of collaborative devices. The camera module includes a camera service module (Camera Service), a camera device module (Camera Device) and a virtual camera mapping management module. Among them, Camera Service is used to provide Camera usage interfaces and services to upper-layer applications. Camera Device is used to provide control capabilities for the corresponding Camera device. The virtual camera mapping management module is used to store the mapping relationship between the local camera of the first device and the camera of the second device (the virtual camera of the first device). When the first device and the second device establish a multi-device collaboration relationship, the virtual camera mapping management module can determine the virtual camera corresponding to the local camera through the mapping relationship when the first type of application requests to call the local camera, and The virtual camera (that is, the camera of the second device) is called through the virtual camera module. For the upper-layer application, there is no need to know the underlying logic of calling different cameras. Correspondingly, the application does not need to know the logic of calling different cameras in the scenario of multi-device collaboration. Compatible programs are individually designed to suit.
可选的,第一设备和第二设备在建立多设备协同关系之后,第二设备可以将其摄像头信息(如摄像头ID)发送给第一设备的虚拟摄像头映射管理模块,该虚拟摄像头映射管理模块根据预设的规则建立并存储该映射关系。本申请实施例对该预设的规则不进行具体限制。Optionally, after the first device and the second device establish a multi-device collaboration relationship, the second device can send its camera information (such as camera ID) to the virtual camera mapping management module of the first device. The virtual camera mapping management module Establish and store the mapping relationship according to preset rules. The embodiment of this application does not specifically limit the preset rules.
在一个示例中,若第一设备的本地摄像头包括前置摄像头Camera1-1、后置摄像头Camera1-2,第二设备的摄像头包括前置摄像头Camera2-1、后置摄像头Camera2-2,则该映射关系可以如表1所示。应理解,为了便于用户操作,第一设备的前置摄像头通常对应第二设备的前置摄像头,第一设备的后置摄像头通常对应第二设备的后置摄像头,即Camera1-1对应Camera2-1,Camera1-2对应Camera2-2。In an example, if the local camera of the first device includes front camera Camera1-1 and rear camera Camera1-2, and the camera of the second device includes front camera Camera2-1 and rear camera Camera2-2, then the mapping The relationship can be shown in Table 1. It should be understood that in order to facilitate user operation, the front camera of the first device usually corresponds to the front camera of the second device, and the rear camera of the first device usually corresponds to the rear camera of the second device, that is, Camera1-1 corresponds to Camera2-1 , Camera1-2 corresponds to Camera2-2.
基于表1所示的映射关系,用户在使用第一设备中前置摄像头Camera1-1拍摄图像时,实际上调用的是第二设备的前置摄像头Camera2-1采集图像。同理,当用户在第一设备选择使用后置摄像头Camera1-2拍摄图像时,实际上调用的是第二设备的后置摄像头Camera2-2采集图像。Based on the mapping relationship shown in Table 1, when the user uses the front-facing camera Camera1-1 of the first device to capture an image, the user actually calls the front-facing camera Camera2-1 of the second device to capture the image. Similarly, when the user chooses to use the rear camera Camera1-2 on the first device to capture images, the rear camera Camera2-2 of the second device is actually called to capture images.
表1映射关系表
Table 1 Mapping relationship table
在另一个示例中,若第一设备的本地摄像头包括前置摄像头Camera1-1、后置摄像头Camera1-2,第二设备的摄像头包括前置摄像头Camera2,且不包括后置摄像头,则该映射关系可以如表2所示。基于该映射关系,第一设备在通过虚拟摄像头技术调用第二设备的摄像头的过程中,无法进行前后置摄像头的切换。其中,第一设备无法进行前后置摄像头的切换可以理解为:第一设备不响应用户对摄像头切换控件的操作。 In another example, if the local camera of the first device includes front camera Camera1-1 and rear camera Camera1-2, and the camera of the second device includes front camera Camera2 and does not include the rear camera, then the mapping relationship It can be shown in Table 2. Based on this mapping relationship, the first device cannot switch between front and rear cameras when calling the camera of the second device through virtual camera technology. Wherein, the inability of the first device to switch the front and rear cameras can be understood as: the first device does not respond to the user's operation of the camera switching control.
表2映射关系表
Table 2 Mapping relationship table
硬件抽象层是硬件和软件之间的层。在本申请实施例中,硬件抽象层包括本地摄像头模块(可称作Camera0)和虚拟摄像头模块(Camera X),用于建立对应的摄像头会话。摄像头会话可以用来标识应用的一次会话请求,控制请求参数,以及传递请求图像数据等。The hardware abstraction layer is the layer between hardware and software. In the embodiment of this application, the hardware abstraction layer includes a local camera module (which can be called Camera0) and a virtual camera module (Camera X), which are used to establish a corresponding camera session. The camera session can be used to identify a session request of the application, control the request parameters, and pass the request image data, etc.
本地摄像头模块(Camera0)中设置有本地摄像头会话单元(Camera Session),用于建立本地摄像头会话。通过本地摄像头会话单元,电子设备可以调用本地摄像头采集图像。The local camera module (Camera0) is equipped with a local camera session unit (Camera Session), which is used to establish a local camera session. Through the local camera session unit, the electronic device can call the local camera to collect images.
虚拟摄像头模块(Camera X)中设置有虚拟摄像头会话单元(Virtual Camera Session),用于建立虚拟摄像头会话。通过虚拟摄像头会话单元,第一设备能够通过分布式硬件管理模块调用第二设备的摄像头采集图像。该虚拟摄像头模块可以是第一设备的硬件抽象层中预设的,也可以是第一设备在与第二设备建立多设备协同关系之后新注册增加的模块。The virtual camera module (Camera X) is provided with a virtual camera session unit (Virtual Camera Session), which is used to establish a virtual camera session. Through the virtual camera session unit, the first device can call the camera of the second device to collect images through the distributed hardware management module. The virtual camera module may be preset in the hardware abstraction layer of the first device, or may be a module newly registered and added by the first device after establishing a multi-device collaboration relationship with the second device.
内核层(Kernel)包括一系列的驱动,例如摄像头驱动(Camera Driver)、传感器驱动等,用于驱动硬件层的相关硬件,如摄像头、传感器等。在本申请实施例中,摄像头驱动包括第一视频模块The kernel layer (Kernel) includes a series of drivers, such as camera driver (Camera Driver), sensor driver, etc., which are used to drive related hardware of the hardware layer, such as cameras, sensors, etc. In this embodiment of the present application, the camera driver includes a first video module
(/dev/video0)和第二视频模块(/dev/video1),其中,第一视频模块对应前置摄像头,用于处理前置摄像头采集的图像。第二视频模块对应后置摄像头,用于处理后置摄像头采集的图像。(/dev/video0) and the second video module (/dev/video1), where the first video module corresponds to the front camera and is used to process images collected by the front camera. The second video module corresponds to the rear camera and is used to process images collected by the rear camera.
基于上述本申请实施例提供的第一设备的软件结构,第一设备上的应用程序可以调用本地摄像头或者虚拟摄像头(即第二设备的摄像头)采集图像。下面分别对其进行说明。Based on the software structure of the first device provided by the above embodiments of the present application, the application program on the first device can call a local camera or a virtual camera (ie, the camera of the second device) to collect images. They are explained below.
(一)应用程序调用本地摄像头(1) The application calls the local camera
在本申请实施例中,无论第一设备和第二设备之间是否建立了多设备协同关系,第一设备上的第一类应用程序和第二类应用程序都可以调用本地摄像头,且调用流程基本相同,即应用程序负责调用本地摄像头的部分都是一致的。In this embodiment of the present application, regardless of whether a multi-device collaboration relationship is established between the first device and the second device, the first type of application and the second type of application on the first device can call the local camera, and the calling process Basically the same, that is, the part of the application responsible for calling the local camera is the same.
示例性的,参见图9所示,应用程序调用本地摄像头的流程包括如下S1-1~S1-4。For example, as shown in Figure 9, the process of calling a local camera by an application includes the following S1-1 to S1-4.
S1-1,响应于操作事件,第一设备的应用程序向摄像头模组发送本地摄像头调用指令,用于调用第一设备的本地摄像头采集图像。S1-1. In response to the operation event, the application program of the first device sends a local camera calling instruction to the camera module for calling the local camera of the first device to collect images.
在本申请实施例中,用户通常在第一设备上触发操作事件,该操作事件用于指示调用本地摄像头。以第一设备是手机为例,该操作事件可以是用户打开手机上的相机应用,或者打开视频聊天,或者在手机熄屏并锁定的情况下拿起手机唤醒屏幕等。In the embodiment of the present application, the user usually triggers an operation event on the first device, and the operation event is used to instruct the local camera to be called. Taking the first device as a mobile phone as an example, the operation event may be that the user opens the camera application on the mobile phone, or opens a video chat, or picks up the mobile phone to wake up the screen when the screen is turned off and locked, etc.
但是,在一些实现中,若第一设备和第二设备建立了多设备协同关系,且第二设备通过悬浮窗显示第一设备的屏幕内容,那么该操作事件也可以是用户在第二设备的悬浮窗内触发的。例如,相机应用被用户配置为第二类应用程序,不具备虚拟摄像头调用权限,用户可以在第二设备的悬浮窗内点击相机应用的图标,触发操作事件,并将该操作事件发送给手机,以便手机根据该操作事件调用本地摄像头。However, in some implementations, if the first device and the second device establish a multi-device collaboration relationship, and the second device displays the screen content of the first device through a floating window, then the operation event can also be the user's operation on the second device. Triggered within the floating window. For example, the camera application is configured by the user as a second-category application and does not have the permission to call the virtual camera. The user can click the icon of the camera application in the floating window of the second device to trigger an operation event and send the operation event to the mobile phone. So that the mobile phone can call the local camera according to the operation event.
需要说明的是,对于应用程序而言,无论第一设备和第二设备是否建立了多设备协同关系,调用摄像头的操作事件通常都是相同的,因此,第一设备首先会认为这些操作事件都是要调用本地摄像头。只是在第一设备和第二设备建立协同关系的情况下,针对第一类应用程序,第一设备可以将对该本地摄像头的调用进一步转化为对虚拟摄像头的调用。而针对第二类应用程序,或者,在第一设备和第二设备未建立协同关系的情况下,第一设备无需进行摄像头调用关系的转化,而是直接调用本地摄像头。It should be noted that, for the application, no matter whether the first device and the second device have established a multi-device collaboration relationship, the operation events that call the camera are usually the same. Therefore, the first device will first consider that these operation events are all It is to call the local camera. Only when the first device and the second device establish a collaborative relationship, for the first type of application, the first device can further convert the call to the local camera into a call to the virtual camera. For the second type of application, or when the first device and the second device do not establish a collaborative relationship, the first device does not need to convert the camera calling relationship, but directly calls the local camera.
S1-2,摄像头模组向本地摄像头模块发送会话建立指令,该会话建立指令用于指示第一设备的本地摄像头模块建立本地摄像头会话。S1-2: The camera module sends a session establishment instruction to the local camera module. The session establishment instruction is used to instruct the local camera module of the first device to establish a local camera session.
S1-3,本地摄像头模块中的摄像头会话单元在根据会话建立指令建立摄像头会话之后,向摄像头驱动发送驱动打开指令,该驱动打开指令用于指示摄像头驱动工作。S1-3. After establishing the camera session according to the session establishment instruction, the camera session unit in the local camera module sends a driver open instruction to the camera driver. The driver open instruction is used to instruct the camera driver to work.
S1-4,摄像头驱动在工作过程中,向本地摄像头发送图像采集指令,以驱动该本地摄像头采集图像。S1-4: During the working process, the camera driver sends image acquisition instructions to the local camera to drive the local camera to collect images.
需要说明的是,本地摄像头采集的图像依次通过摄像头驱动、本地摄像头模块、摄像头模组返回至应用程序。It should be noted that the images collected by the local camera are returned to the application through the camera driver, local camera module, and camera module in sequence.
由于无论第一设备和第二设备之间是否建立了多设备协同关系,第一设备上的应用程序都可以调用 本地摄像头,因此,在一些实施例中,应用程序在调用本地摄像头之前,第一设备和第二设备之间是未建立多设备协同关系的,基于此,若应用程序在调用本地摄像头的过程中,第一设备和第二设备新建立了多设备协同关系,那么第一设备可以将本地摄像头切换至虚拟摄像头。Regardless of whether a multi-device collaboration relationship is established between the first device and the second device, the application on the first device can call Local camera. Therefore, in some embodiments, before the application calls the local camera, a multi-device collaboration relationship is not established between the first device and the second device. Based on this, if the application calls the local camera , the first device and the second device have newly established a multi-device collaboration relationship, then the first device can switch the local camera to the virtual camera.
示例性的,参见图10中所示,该过程包括如下步骤S2-1~S2-8。For example, as shown in Figure 10, the process includes the following steps S2-1 to S2-8.
S2-1~S2-2,在第一设备的应用程序使用本地摄像头采集图像的过程中(参见S1-1~S1-4),第一设备的协同管理应用根据用户操作控制分布式硬件模块管理与第二设备建立多屏协同关系。S2-1~S2-2, in the process of the application of the first device using the local camera to collect images (see S1-1~S1-4), the collaborative management application of the first device controls the distributed hardware module management according to the user operation. Establish a multi-screen collaboration relationship with the second device.
S2-3,分布式硬件管理模块向虚拟摄像头映射管理模块配置映射关系表。S2-3: The distributed hardware management module configures the mapping relationship table to the virtual camera mapping management module.
可选的,若第一设备的硬件抽象层中未预设有虚拟摄像头模块,则分布式硬件管理模块还需要在硬件抽象层中注册虚拟摄像头模块。Optionally, if the virtual camera module is not preset in the hardware abstraction layer of the first device, the distributed hardware management module also needs to register the virtual camera module in the hardware abstraction layer.
S2-4,在映射关系表配置成功之后,第一设备的摄像头模组向本地摄像头模块发送会话关闭通知,用于通知本地摄像头模块关闭本地摄像头会话。S2-4: After the mapping relationship table is successfully configured, the camera module of the first device sends a session closing notification to the local camera module to notify the local camera module to close the local camera session.
S2-5,本地摄像头模块在关闭本地摄像头会话之后向摄像头驱动发送驱动关闭指令,用于指示本地摄像头模块关闭摄像头驱动。S2-5: After closing the local camera session, the local camera module sends a driver shutdown instruction to the camera driver to instruct the local camera module to close the camera driver.
S2-6~S2-7,虚拟摄像头管理模块根据映射关系表,确定本地摄像头所对应的虚拟摄像头,并通过虚拟摄像头模块和分布式硬件管理模块调用该虚拟摄像头。S2-6~S2-7, the virtual camera management module determines the virtual camera corresponding to the local camera according to the mapping relationship table, and calls the virtual camera through the virtual camera module and the distributed hardware management module.
S2-8,第二设备响应于虚拟摄像头调用指令虚拟摄像头采集图像。S2-8, the second device responds to the virtual camera invocation and instructs the virtual camera to collect images.
虚拟摄像头(即第二设备的摄像头)采集到的图像依次通过第一设备的分布式硬件模块、虚拟摄像头模块、摄像头模组返回至第一设备的应用程序。The images collected by the virtual camera (that is, the camera of the second device) are returned to the application program of the first device through the distributed hardware module, virtual camera module, and camera module of the first device in sequence.
(二)调用虚拟摄像头(2) Call virtual camera
在本申请实施例中,调用虚拟摄像头的应用程序为第一类应用程序。换而言之,仅有第一设备上的第一类应用程序(如畅连应用)能够调用虚拟摄像头,而第二类应用程序(如人脸识别解锁应用)不能调用虚拟摄像头。In this embodiment of the present application, the application program that calls the virtual camera is a first-type application program. In other words, only the first type of application (such as Changlian application) on the first device can call the virtual camera, while the second type of application (such as face recognition unlocking application) cannot call the virtual camera.
示例性的,参见图11所示,该过程具体包括如下步骤S3-1~S3-7。For example, as shown in Figure 11, the process specifically includes the following steps S3-1 to S3-7.
S3-1~S3-2,第一设备的协同管理模块根据用户操作向分布式硬件管理模块发送多设备协同建立指令,控制分布式硬件管理模块与第二设备建立多设备协同关系。In S3-1 to S3-2, the collaboration management module of the first device sends a multi-device collaboration establishment instruction to the distributed hardware management module according to the user operation, and controls the distributed hardware management module to establish a multi-device collaboration relationship with the second device.
S3-3,分布式硬件管理模块向虚拟摄像头映射管理模块配置映射关系表。S3-3. The distributed hardware management module configures the mapping relationship table to the virtual camera mapping management module.
可选的,若第一设备的硬件抽象层中未预设有虚拟摄像头模块,则分布式硬件管理模块还需要在硬件抽象层中注册虚拟摄像头模块。Optionally, if the virtual camera module is not preset in the hardware abstraction layer of the first device, the distributed hardware management module also needs to register the virtual camera module in the hardware abstraction layer.
S3-4,响应于操作事件,第一设备的应用程序向摄像头模组发送摄像头调用指令,用于调用第一设备的本地摄像头进行图像采集。S3-4, in response to the operation event, the application program of the first device sends a camera calling instruction to the camera module, which is used to call the local camera of the first device for image collection.
可选的,操作事件可以是用户在第一设备上触发的,也可以是用户在第二设备上触发,并由第二设备发送给第一设备的。具体参见前文描述,此处不再赘述。Optionally, the operation event may be triggered by the user on the first device, or may be triggered by the user on the second device and sent by the second device to the first device. For details, please refer to the previous description and will not be repeated here.
S3-5,摄像头模组根据预先配置的映射关系表,确定该本地摄像头对应的虚拟摄像头,并向虚拟摄像头模块发送虚拟摄像头调用指令,该虚拟摄像头调用指令用于调用该虚拟摄像头。S3-5: The camera module determines the virtual camera corresponding to the local camera according to the preconfigured mapping relationship table, and sends a virtual camera calling instruction to the virtual camera module. The virtual camera calling instruction is used to call the virtual camera.
示例性的,根据表1所示的映射关系,若第一设备当前使用的本地摄像头是Camera1-1,则虚拟摄像头为Camera2-1。若第一设备当前使用的本地摄像头是Camera1-2,则虚拟摄像头为Camera2-2。For example, according to the mapping relationship shown in Table 1, if the local camera currently used by the first device is Camera1-1, the virtual camera is Camera2-1. If the local camera currently used by the first device is Camera1-2, the virtual camera is Camera2-2.
S3-6,虚拟摄像头模块通过分布式硬件管理模块向第二设备发送该虚拟摄像头调用指令。S3-6: The virtual camera module sends the virtual camera calling instruction to the second device through the distributed hardware management module.
S3-7,第二设备响应于虚拟摄像头调用指令,调用虚拟摄像头采集图像。S3-7, the second device responds to the virtual camera calling instruction and calls the virtual camera to collect images.
第二设备在采集到图像之后,依次通过第一设备的分布式硬件模块、虚拟摄像头模块、摄像头模组向第一设备的应用程序发送采集到的图像。After collecting the images, the second device sequentially sends the collected images to the application program of the first device through the distributed hardware module, virtual camera module, and camera module of the first device.
应用程序在调用虚拟摄像头的过程中,若第一设备和第二设备之间的多设备协同关系断开,或者用户指示将多设备协同时的音视频切换至第一设备,那么第一设备可以将虚拟摄像头切换至本地摄像头。When the application calls the virtual camera, if the multi-device collaboration relationship between the first device and the second device is disconnected, or the user instructs to switch the audio and video during multi-device collaboration to the first device, then the first device can Switch virtual camera to local camera.
示例性的,参见图12中所示,该过程包括如下步骤S4-1~S4-5。For example, as shown in Figure 12, the process includes the following steps S4-1 to S4-5.
S4-1,第一设备和第二设备断开多设备协同关系。或者,第一设备接收到用户输入的摄像头切换指令,该指令用于将应用程序调用的摄像头由虚拟摄像头切换至本地摄像头。S4-1: The first device and the second device disconnect the multi-device collaboration relationship. Alternatively, the first device receives a camera switching instruction input by the user, which is used to switch the camera called by the application program from the virtual camera to the local camera.
在一些实施例中,参见图13所示,第一设备和第二设备的多设备协同关系建立成功之后,第二设备可以在通知管理框中显示通知消息以提示用户。例如,当第二设备是型号为“HUAWEI P50Pro”的手 机时,该通知消息可以包括提示信息“已连接“HUAWEI P50Pro””,以及“可在平板上操作手机,互相共享数据”等。此外,该通知消息还包括“断开”控件和“音视频切换到手机”等控件。其中,“断开”控件用于控制第二设备断开与第一设备(即HUAWEI P50Pro)的连接;“音视频切换到手机”控件用于控制第二设备将第一设备的音频和视频的采集与播放操作由当前的第二设备切换至第一设备。In some embodiments, as shown in FIG. 13 , after the multi-device collaboration relationship between the first device and the second device is successfully established, the second device may display a notification message in the notification management box to prompt the user. For example, when the second device is a mobile phone with model "HUAWEI P50Pro" When the phone is powered on, the notification message can include the prompt information "Connected to "HUAWEI P50Pro"", and "You can operate the phone on the tablet and share data with each other", etc. In addition, the notification message also includes "disconnect" controls and "switch audio and video to mobile phone" controls. Among them, the "disconnect" control is used to control the second device to disconnect from the first device (i.e. HUAWEI P50Pro); the "audio and video switching to mobile phone" control is used to control the second device to switch the audio and video of the first device. The collection and playback operations are switched from the current second device to the first device.
响应于用户对于“断开”控件的操作,第一设备和第二设备即可断开多设备协同关系。响应于用户对“音视频切换到手机”控件的操作,即可将第一设备采集图像的摄像头由虚拟摄像头切换至本地摄像头。In response to the user's operation of the "disconnect" control, the first device and the second device can disconnect the multi-device collaboration relationship. In response to the user's operation of the "switch audio and video to mobile phone" control, the camera of the first device that collects images can be switched from the virtual camera to the local camera.
S4-2,分布式硬件管理模块向摄像头模组发送摄像头切换通知,用于通知将采集图像的摄像头由虚拟摄像头切换至本地摄像头。S4-2, the distributed hardware management module sends a camera switching notification to the camera module, which is used to notify the camera that collects images to switch from a virtual camera to a local camera.
S4-3,摄像头模组向本地摄像头模块发送会话建立指令,该会话建立指令用于指示第一设备的本地摄像头模块建立本地摄像头会话。S4-3. The camera module sends a session establishment instruction to the local camera module. The session establishment instruction is used to instruct the local camera module of the first device to establish a local camera session.
S4-4,本地摄像头模块中的摄像头会话单元在根据会话建立指令建立摄像头会话之后,向摄像头驱动发送驱动打开指令,该驱动打开指令用于指示摄像头驱动工作。S4-4. After establishing the camera session according to the session establishment instruction, the camera session unit in the local camera module sends a driver open instruction to the camera driver. The driver open instruction is used to instruct the camera driver to work.
S4-5,摄像头驱动在工作过程中,向本地摄像头发送图像采集指令,以驱动该本地摄像头采集图像。S4-5: During the working process, the camera driver sends image acquisition instructions to the local camera to drive the local camera to collect images.
需要说明的是,第一设备的本地摄像头采集的图像依次通过摄像头驱动、本地摄像头模块和摄像头模组返回至应用程序。It should be noted that the images collected by the local camera of the first device are returned to the application program through the camera driver, the local camera module and the camera module in sequence.
在本申请实施例中,在第一设备和第二设备建立多设备协同关系的情况下,若第一设备接收到应用程序调用本地摄像头的指令,且应用程序具备虚拟摄像头调用权限,那么第一设备是直接根据映射关系表确定本地摄像头所对应的虚拟摄像头,并通过虚拟摄像头模块调用虚拟摄像头的,而无需通过本地摄像头模块建立本地摄像头会话,因而无需打开本地摄像头。因此,在打开虚拟摄像头的过程中减少了打开本地摄像头的冗余操作,能够提高虚拟摄像头的打开速度,具有较好的用户体验。In the embodiment of the present application, when the first device and the second device establish a multi-device collaboration relationship, if the first device receives an instruction from the application program to call the local camera, and the application program has the virtual camera call permission, then the first device The device directly determines the virtual camera corresponding to the local camera based on the mapping relationship table, and calls the virtual camera through the virtual camera module. There is no need to establish a local camera session through the local camera module, and therefore there is no need to open the local camera. Therefore, in the process of opening the virtual camera, redundant operations of opening the local camera are reduced, the opening speed of the virtual camera can be improved, and a better user experience can be achieved.
由于第一设备对本地摄像头的调用是由本地摄像头模块负责的,对虚拟摄像头的调用是由虚拟摄像头负责的,且这两个模块能够并行处理任务。因此,在第一设备和第二设备建立多设备协同关系的情况下,应用程序对本地摄像头和虚拟摄像头的调用互不影响,可以实现两个应用同时调用本地摄像头和虚拟摄像头。下面基于第一设备和第二设备已建立多设备协同关系,以第一应用和第二应用为例,对该过程进行示例性说明。Since the local camera module is responsible for the first device's call to the local camera, the virtual camera is responsible for the call to the virtual camera, and the two modules can process tasks in parallel. Therefore, when the first device and the second device establish a multi-device collaboration relationship, the application's calls to the local camera and the virtual camera do not affect each other, and two applications can call the local camera and the virtual camera at the same time. Based on the fact that the first device and the second device have established a multi-device collaboration relationship, the process is illustrated below by taking the first application and the second application as examples.
示例1:第一应用和第二应用均为第一类应用程序。Example 1: Both the first application and the second application are first-type applications.
换而言之,第一应用和第二应用均具备虚拟摄像头调用权限。示例性的,该第一应用可以是畅连应用,第二应用可以是相机应用。In other words, both the first application and the second application have the virtual camera calling permission. For example, the first application may be a Changlian application, and the second application may be a camera application.
第一应用和第二应用同时调用摄像头的过程包括如下内容(1)和(2)。The process of calling the camera by the first application and the second application at the same time includes the following contents (1) and (2).
(1)第一应用调用第一虚拟摄像头采集图像。(1) The first application calls the first virtual camera to collect images.
具体地,用户可以针对第一应用触发第一操作事件。该第一操作事件用于指示第一应用调用第一设备的第一本地摄像头采集图像。以第一应用是畅连应用为例,第一操作事件可以为用户操作畅连应用邀请好友进行视频通话。由于第一设备具备虚拟摄像头调用权限,因此,第一设备根据映射关系表确定该第一本地摄像头对应的第一虚拟摄像头,并通过虚拟摄像头模块调用该第一虚拟摄像头为该第一应用采集图像。具体调用过程请参见前文描述,此处不再赘述。Specifically, the user may trigger a first operation event for the first application. The first operation event is used to instruct the first application to call the first local camera of the first device to collect images. Taking the first application as the Changlian application as an example, the first operation event can allow the user to operate the Changlian application to invite friends for a video call. Since the first device has the virtual camera calling authority, the first device determines the first virtual camera corresponding to the first local camera according to the mapping relationship table, and calls the first virtual camera through the virtual camera module to collect images for the first application. . Please refer to the previous description for the specific calling process and will not be repeated here.
(2)第二应用调用第二虚拟摄像头失败,或者,由第一应用切换至第二应用调用虚拟摄像头。(2) The second application fails to call the second virtual camera, or the first application switches to the second application to call the virtual camera.
在一些实施例中,在第一应用调用第一虚拟摄像头采集图像的过程中,用户可以针对第二应用触发第二操作事件。该第二操作事件用于指示第二应用调用第一设备的第二本地摄像头。以第二应用是相机应用为例,第二操作事件可以是用户点击相机应用的应用图标。此时,由于调用虚拟摄像头的虚拟摄像头模块已被第一应用占用,因此,第二应用调用虚拟摄像头失败。为此,第一设备可以显示第一提示信息,用于提示虚拟摄像头调用功能已被占用。In some embodiments, during the process of the first application calling the first virtual camera to collect images, the user can trigger the second operation event for the second application. The second operation event is used to instruct the second application to call the second local camera of the first device. Taking the second application as a camera application as an example, the second operation event may be that the user clicks on the application icon of the camera application. At this time, because the virtual camera module that calls the virtual camera has been occupied by the first application, the second application fails to call the virtual camera. To this end, the first device may display first prompt information to prompt that the virtual camera calling function has been occupied.
在另一些实施例中,在第二应用请求调用第二虚拟摄像头时,若虚拟摄像头模块已被第一应用占用,第一设备可以询问用户是否切换至第二应用调用虚拟摄像头。基于此,第一设备可以根据用户指令继续控制第一应用调用虚拟摄像头,也可以换至第二应用通过虚拟摄像头模块来调用虚拟摄像头。In other embodiments, when the second application requests to call the second virtual camera, if the virtual camera module is already occupied by the first application, the first device may ask the user whether to switch to the second application to call the virtual camera. Based on this, the first device can continue to control the first application to call the virtual camera according to the user's instruction, or can switch to the second application to call the virtual camera through the virtual camera module.
或者,第一设备可以自动将调用虚拟摄像头的应用由第一应用切换至第二应用。以第一应用是畅连应用,第二应用是相机应用为例,在畅连应用使用手机的第一虚拟摄像头的过程中,第一设备若检测到用户打开相机应用的操作,将自动调用虚拟摄像头的应用程序由畅连应用切换至相机应用。 Alternatively, the first device may automatically switch the application that calls the virtual camera from the first application to the second application. Taking the first application as a Changlian application and the second application as a camera application as an example, during the process of the Changlian application using the first virtual camera of the mobile phone, if the first device detects the user's operation of opening the camera application, it will automatically call the virtual camera. The camera application is switched from Changlian application to Camera application.
需要说明的是,第一操作事件控制第一应用调用的第一本地摄像头和第二操作事件控制第二应用调用的即第二本地摄像头可以相同,例如,第一本地摄像头、第二本地摄像头可以均是第一设备的前置摄像头;也可以不同,例如,第一本地摄像头、第二本地摄像头中可以一个是前置摄像头,另一个是后置摄像头。若第一本地摄像头和第二本地摄像头相同,则第一虚拟摄像头和第二虚拟摄像头相同。若第一本地摄像头和第二本地摄像头不相同,则第一虚拟摄像头和第二虚拟摄像头不相同。It should be noted that the first local camera called by the first operation event controlled by the first application and the second local camera called by the second operation event controlled by the second application may be the same. For example, the first local camera and the second local camera may be the same. Both are front-facing cameras of the first device; they may also be different. For example, one of the first local camera and the second local camera may be a front-facing camera and the other may be a rear-facing camera. If the first local camera and the second local camera are the same, the first virtual camera and the second virtual camera are the same. If the first local camera and the second local camera are different, the first virtual camera and the second virtual camera are different.
示例2:第一应用为第一类应用程序,第二应用为第二类应用程序。Example 2: The first application is a first-type application, and the second application is a second-type application.
换而言之,第一应用具备虚拟摄像头调用权限,第二应用不具备虚拟摄像头调用权限。示例性的,该第一应用是畅连应用,第二应用是镜子应用。第一应用和第二应用同时调用摄像头的过程包括如下内容(1)和(2)。In other words, the first application has the permission to call the virtual camera, but the second application does not have the permission to call the virtual camera. For example, the first application is a Changlian application, and the second application is a mirror application. The process of calling the camera by the first application and the second application at the same time includes the following contents (1) and (2).
(1)第一应用调用第一虚拟摄像头采集图像。(1) The first application calls the first virtual camera to collect images.
具体地,用户可以针对第一应用触发第一操作事件。该第一操作事件用于指示第一应用调用第一设备的第一本地摄像头采集图像。以第一应用是畅连应用为例,第一操作事件可以为用户操作畅连应用邀请好友进行视频通话。由于第一设备具备虚拟摄像头调用权限,因此,第一设备根据映射关系表确定该第一本地摄像头对应的第一虚拟摄像头,并通过虚拟摄像头模块调用该第一虚拟摄像头为该第一应用采集图像。具体调用过程请参见前文描述,此处不再赘述。Specifically, the user may trigger a first operation event for the first application. The first operation event is used to instruct the first application to call the first local camera of the first device to collect images. Taking the first application as the Changlian application as an example, the first operation event can allow the user to operate the Changlian application to invite friends for a video call. Since the first device has the virtual camera calling authority, the first device determines the first virtual camera corresponding to the first local camera according to the mapping relationship table, and calls the first virtual camera through the virtual camera module to collect images for the first application. . Please refer to the previous description for the specific calling process and will not be repeated here.
(2)在第一应用调用第一虚拟摄像头采集图像的过程中,第二应用调用第二本地摄像头采集图像。(2) During the process of the first application calling the first virtual camera to collect images, the second application calls the second local camera to collect images.
具体地,在第一应用调用第一虚拟摄像头采集图像的过程中,用户可以针对第二应用触发第二操作事件。该第二操作事件用于指示第二应用调用第一设备的第二本地摄像头。以第二应用是镜子应用为例,第二操作事件可以是用户点击镜子应用的应用图标。由于第二应用不具备虚拟摄像头调用权限,因此,第一设备直接通过本地摄像头模块调用第二本地摄像头为第二应用采集图像。具体调用过程请参见前文描述,此处不再赘述。Specifically, during the process of the first application calling the first virtual camera to collect images, the user can trigger the second operation event for the second application. The second operation event is used to instruct the second application to call the second local camera of the first device. Taking the second application as a mirror application as an example, the second operation event may be that the user clicks on the application icon of the mirror application. Since the second application does not have the right to call the virtual camera, the first device directly calls the second local camera through the local camera module to collect images for the second application. Please refer to the previous description for the specific calling process and will not be repeated here.
基于上述描述可知,由于第一设备的硬件抽象层同时设置了本地摄像头模块和虚拟摄像头模块,且这两个摄像头模块可以并行独立工作,互不影响,因此,第一设备在多设备协同的过程中可以实现同时调用本地摄像头和虚拟摄像头。以第一设备手机为例,当手机与平板电脑建立多屏协同关系之后,若手机处于熄灭锁定屏状态且支持人脸识别解锁,那么手机可以通过本地摄像头模块调用本地摄像头去采集用户图像,从而进行人脸识别解锁。Based on the above description, it can be seen that since the hardware abstraction layer of the first device has both a local camera module and a virtual camera module, and these two camera modules can work in parallel and independently without affecting each other, therefore, the first device is in the process of multi-device collaboration. It is possible to call the local camera and virtual camera at the same time. Taking the first device mobile phone as an example, after the mobile phone and the tablet establish a multi-screen collaboration relationship, if the mobile phone is in the locked screen state and supports facial recognition unlocking, the mobile phone can call the local camera through the local camera module to collect user images, thereby Perform facial recognition unlocking.
示例3:第一应用为第二类应用程序,第二应用为第一类应用程序。Example 3: The first application is a second type application, and the second application is a first type application.
换而言之,第一应用不具备虚拟摄像头调用权限,第二应用具备虚拟摄像头调用权限。示例性的,第一应用为镜子应用,第二应用为畅连应用。第一应用和第二应用同时调用摄像头的过程包括如下内容(1)和内容(2)。In other words, the first application does not have the virtual camera calling authority, and the second application does have the virtual camera calling authority. For example, the first application is a mirror application, and the second application is a Changlian application. The process of calling the camera by the first application and the second application at the same time includes the following content (1) and content (2).
(1)第一应用调用第一本地摄像头采集图像。(1) The first application calls the first local camera to collect images.
具体地,用户可以针对第一应用触发第一操作事件。该第一操作事件用于指示第一应用调用第一设备的第一本地摄像头采集图像。以第一应用是镜子应用为例,第一操作事件可以为用户点击镜子应用的应用图标。由于第一设备不具备虚拟摄像头调用权限,因此,第一设备直接通过本地摄像头模块调用该第一本地摄像头为该第一应用采集图像。具体调用过程请参见前文描述,此处不再赘述。Specifically, the user may trigger a first operation event for the first application. The first operation event is used to instruct the first application to call the first local camera of the first device to collect images. Taking the first application as a mirror application as an example, the first operation event may be that the user clicks on the application icon of the mirror application. Since the first device does not have the right to call the virtual camera, the first device directly calls the first local camera through the local camera module to collect images for the first application. Please refer to the previous description for the specific calling process and will not be repeated here.
(2)在第一应用调用第一本地摄像头采集图像的过程中,第二应用调用第二虚拟摄像头采集图像。(2) While the first application calls the first local camera to collect images, the second application calls the second virtual camera to collect images.
具体地,用户可以针对第二应用触发第二操作事件。该第二操作事件用于指示第二应用调用第一设备的第二本地摄像头采集图像。以第二应用是畅连应用为例,第二操作事件可以为用户畅连应用中好友1的视频聊天控件。由于第二应用具备虚拟摄像头调用权限,因此,第一设备确定第二本地摄像头对应的第二虚拟摄像头,并通过虚拟摄像头模块调用第二虚拟摄像头为第二应用采集图像。体调用过程请参见前文描述,此处不再赘述。Specifically, the user can trigger a second operation event for the second application. The second operation event is used to instruct the second application to call the second local camera of the first device to collect images. Taking the second application as a Changlian application as an example, the second operation event may be the video chat control of Friend 1 in the user's Changlian application. Since the second application has the permission to call the virtual camera, the first device determines the second virtual camera corresponding to the second local camera, and calls the second virtual camera through the virtual camera module to collect images for the second application. Please refer to the previous description for the body calling process and will not go into details here.
示例4:第一应用和第二应用均为第二类应用程序。Example 4: Both the first application and the second application are second-type applications.
换而言之,第一应用和第二应用均不具备虚拟摄像头调用权限。示例性的,第一应用为镜子应用,第二应用为相机应用。第一应用和第二应用同时调用摄像头的过程包括如下内容(1)和内容(2)。In other words, neither the first application nor the second application has the virtual camera calling permission. For example, the first application is a mirror application, and the second application is a camera application. The process of calling the camera by the first application and the second application at the same time includes the following content (1) and content (2).
(1)第一应用调用第一本地摄像头采集图像。(1) The first application calls the first local camera to collect images.
具体地,用户可以针对第一应用触发第一操作事件。该第一操作事件用于指示第一应用调用第一设备的第一本地摄像头采集图像。以第一应用是镜子应用为例,第一操作事件可以为用户点击镜子应用的 应用图标。由于第一设备不具备虚拟摄像头调用权限,因此,第一设备直接通过本地摄像头模块调用该第一本地摄像头为该第一应用采集图像。具体调用过程请参见前文描述,此处不再赘述。Specifically, the user may trigger a first operation event for the first application. The first operation event is used to instruct the first application to call the first local camera of the first device to collect images. Taking the first application as a mirror application as an example, the first operation event can be that the user clicks on the mirror application. Application icon. Since the first device does not have the right to call the virtual camera, the first device directly calls the first local camera through the local camera module to collect images for the first application. Please refer to the previous description for the specific calling process and will not be repeated here.
(2)在第一应用调用第一本地摄像头采集图像的过程中,第二应用调用第二本地摄像头失败,或者,由第一应用切换至第二应用调用本地摄像头。(2) During the process of the first application calling the first local camera to collect images, the second application fails to call the second local camera, or the first application switches to the second application to call the local camera.
在一些实施例中,在第一应用调用第一本地摄像头采集图像的过程中,用户可以针对第二应用触发第二操作事件。该第二操作事件用于指示第二应用调用第一设备的第二本地摄像头。以第二应用是相机应用为例,第二操作事件可以是用户相机应用的应用图标。由于第二应用不具备虚拟摄像头调用权限,因此,第一设备需要调用第二本地摄像头为第二应用采集图像。但是,第二负责调用本地摄像头的本地摄像头模块已被第一应用占用,因此第二应用调用第二本地摄像头失败。In some embodiments, during the process of the first application calling the first local camera to collect images, the user can trigger the second operation event for the second application. The second operation event is used to instruct the second application to call the second local camera of the first device. Taking the second application as a camera application as an example, the second operation event may be an application icon of the user's camera application. Since the second application does not have the permission to call the virtual camera, the first device needs to call the second local camera to collect images for the second application. However, the second local camera module responsible for calling the local camera has been occupied by the first application, so the second application fails to call the second local camera.
在另一些实施例中,在第二应用请求调用第二本地摄像头时,若本地摄像头模块已被第一应用占用,第一设备可以询问用户是否切换第二应用调用本地摄像头。第一设备可以根据用户指令继续控制第一应用调用第一本地摄像头,或者换至第二应用来调用第二本地摄像头。In other embodiments, when the second application requests to call the second local camera, if the local camera module is already occupied by the first application, the first device may ask the user whether to switch to the second application to call the local camera. The first device may continue to control the first application to call the first local camera according to user instructions, or switch to the second application to call the second local camera.
或者,第一设备可以将调用本地摄像头的应用由第一应用切换至第二应用。以第一应用是镜子应用,第二应用是相机应用为例,在镜子应用使用第一本地摄像头的过程中,第一设备若检测到用户打开相机应用的操作,将自动调用本地摄像头的应用程序由畅连应用切换至相机应用。Alternatively, the first device may switch the application that calls the local camera from the first application to the second application. Take the first application as a mirror application and the second application as a camera application as an example. When the mirror application uses the first local camera, if the first device detects the user's operation of opening the camera application, it will automatically call the local camera application. Switch from the Changlian app to the Camera app.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that the sequence number of each step in the above embodiment 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 embodiment of the present application.
本申请实施例还提供一种电子设备,该电子设备包括本地摄像头、存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,该处理器执行该计算机程序时实现如上述各个实施例中示出的摄像头调用方法。An embodiment of the present application also provides an electronic device. The electronic device includes a local camera, a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program Implement the camera calling method as shown in the above embodiments.
本申请实施例还提供一种芯片,参见图14所示,该芯片包括处理器和存储器,该存储器中存储有计算机程序,该计算机程序被处理器执行时实现上述各实施例中的摄像头调用方法。An embodiment of the present application also provides a chip, as shown in Figure 14. The chip includes a processor and a memory. A computer program is stored in the memory. When the computer program is executed by the processor, the camera calling method in the above embodiments is implemented. .
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序被处理器执行时实现上述各实施例中提供的虚拟摄像头调用方法。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the virtual camera calling method provided in the above embodiments is implemented.
本申请实施例还提供一种计算机程序产品,该程序产品包括计算机程序,当该计算机程序被电子设备运行时,使得电子设备实现上述各实施例中提供的摄像头调用方法。An embodiment of the present application also provides a computer program product. The program product includes a computer program. When the computer program is run by an electronic device, it causes the electronic device to implement the camera calling method provided in the above embodiments.
应理解,本申请实施例中提及的处理器可以是中央处理单元(central processing unit,CPU),还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor mentioned in the embodiments of this application may be a central processing unit (CPU), or other general-purpose processor, digital signal processor (DSP), or application-specific integrated circuit (ASIC). application specific integrated circuit (ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
还应理解,本申请实施例中提及的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(dynamic RAM,DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。It should also be understood that the memory mentioned in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, non-volatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically removable memory. Erase electrically programmable read-only memory (EPROM, EEPROM) or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (synchlink DRAM, SLDRAM) ) and direct memory bus random access memory (direct rambus RAM, DR RAM).
在本申请所提供的实施例中,各个框架或模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个框架或模块可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the embodiments provided in this application, the division of each framework or module is only a logical function division. In actual implementation, there may be other division methods. For example, multiple frameworks or modules may be combined or integrated into another system. , or some features can be ignored, or not implemented.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。 In addition, each functional module in each embodiment of the present application can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, devices and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be described again here.
在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。Reference in this specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Therefore, the phrases "in one embodiment", "in some embodiments", "in other embodiments", "in other embodiments", etc. appearing in different places in this specification are not necessarily References are made to the same embodiment, but rather to "one or more but not all embodiments" unless specifically stated otherwise. The terms “including,” “includes,” “having,” and variations thereof all mean “including but not limited to,” unless otherwise specifically emphasized.
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。 The above-described embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still implement the above-mentioned implementations. The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions in the embodiments of this application, and should be included in within the protection scope of this application.

Claims (16)

  1. 一种摄像头调用方法,其特征在于,应用于第一设备,所述第一设备安装有应用,所述方法包括:A camera calling method, characterized in that it is applied to a first device, and the first device is installed with an application. The method includes:
    接收操作事件,所述操作事件用于指示所述应用调用本地摄像头,所述本地摄像头为所述第一设备的摄像头;Receive an operation event, the operation event is used to instruct the application to call a local camera, and the local camera is the camera of the first device;
    若所述应用具备虚拟摄像头调用权限,响应于所述第一设备与第二设备具备多设备协同关系,确定所述本地摄像头对应的虚拟摄像头,支持所述应用调用所述虚拟摄像头采集图像,所述虚拟摄像头为所述第二设备的摄像头,所述本地摄像头与所述虚拟摄像头具有映射关系;If the application has virtual camera calling permission, in response to the first device and the second device having a multi-device collaboration relationship, the virtual camera corresponding to the local camera is determined, and the application is supported to call the virtual camera to collect images, so The virtual camera is the camera of the second device, and the local camera and the virtual camera have a mapping relationship;
    若所述应用不具备所述虚拟摄像头调用权限,支持所述应用直接调用所述本地摄像头采集图像。If the application does not have the permission to call the virtual camera, the application is supported to directly call the local camera to collect images.
  2. 根据权利要求1所述的方法,其特征在于,所述多设备协同关系包括:所述第一设备向所述第二设备发送所述第一设备的第一屏幕内容,所述第一屏幕内容包括所述应用的相关内容,所述第二设备显示所述第一屏幕内容;The method of claim 1, wherein the multi-device collaboration relationship includes: the first device sending the first screen content of the first device to the second device, and the first screen content Including relevant content of the application, the second device displays the first screen content;
    所述接收操作事件包括:接收所述第二设备发送的所述操作事件,所述操作事件是在所述第二设备显示的所述第一屏幕内容中触发的。The receiving the operation event includes: receiving the operation event sent by the second device, the operation event being triggered in the first screen content displayed by the second device.
  3. 根据权利要求2所述的方法,其特征在于,所述支持所述应用调用所述虚拟摄像头采集图像之后,所述方法还包括:The method according to claim 2, characterized in that after the supporting application calls the virtual camera to collect images, the method further includes:
    根据所述虚拟摄像头采集到的图像更新所述第一屏幕内容;Update the first screen content according to the image collected by the virtual camera;
    向所述第二设备发送更新后的所述第一屏幕内容。Send the updated first screen content to the second device.
  4. 根据权利要求1~3任一项所述的方法,其特征在于,若所述应用具备虚拟摄像头调用权限,响应于所述第一设备与第二设备具备多设备协同关系,支持所述应用调用所述虚拟摄像头采集图像之后,所述方法还包括:The method according to any one of claims 1 to 3, characterized in that, if the application has virtual camera calling permission, in response to the first device and the second device having a multi-device collaboration relationship, the application calling is supported. After the virtual camera collects images, the method further includes:
    所述第一设备与所述第二设备断开所述多设备协同关系;将所述虚拟摄像头切换为所述本地摄像头,支持所述应用直接调用所述本地摄像头采集图像。The first device and the second device disconnect the multi-device collaboration relationship; switch the virtual camera to the local camera to support the application to directly call the local camera to collect images.
  5. 根据权利要求1~3任一项所述的方法,其特征在于,若所述应用具备虚拟摄像头调用权限,响应于所述第一设备与第二设备具备多设备协同关系,支持所述应用调用所述虚拟摄像头采集图像包括:The method according to any one of claims 1 to 3, characterized in that if the application has virtual camera calling permission, in response to the first device and the second device having a multi-device collaboration relationship, the application calling is supported. The virtual camera collecting images includes:
    接收所述操作事件;receive the operation event;
    支持所述应用直接调用所述本地摄像头采集图像;Support the application to directly call the local camera to collect images;
    所述第一设备与所述第二设备建立多设备协同关系;The first device establishes a multi-device collaboration relationship with the second device;
    将所述本地摄像头切换为所述虚拟摄像头,支持所述应用调用所述虚拟摄像头采集图像。The local camera is switched to the virtual camera, and the application is supported to call the virtual camera to collect images.
  6. 根据权利要求1~5任一项所述的方法,其特征在于,所述应用包括第一应用和第二应用,所述第一应用具备虚拟摄像头调用权限,所述第二应用不具备虚拟摄像头调用权限,所述操作事件包括指示所述第一应用调用第一本地摄像头的第一操作事件及指示所述第二应用调用第二本地摄像头的第二操作事件,所述第一本地摄像头和所述第二本地摄像头为相同或者不同的本地摄像头,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the application includes a first application and a second application, the first application has virtual camera calling authority, and the second application does not have virtual camera Call permission, the operation event includes a first operation event instructing the first application to call the first local camera and a second operation event instructing the second application to call the second local camera, the first local camera and the The second local camera is the same or a different local camera, and the method further includes:
    所述第一设备与所述第二设备建立多设备协同关系;The first device establishes a multi-device collaboration relationship with the second device;
    接收所述第一操作事件;receiving the first operation event;
    确定所述第一本地摄像头对应的第一虚拟摄像头,支持所述第一应用调用所述第一虚拟摄像头采集图像;Determine the first virtual camera corresponding to the first local camera, and support the first application to call the first virtual camera to collect images;
    接收所述第二操作事件;Receive the second operation event;
    支持所述第二应用直接调用所述第二本地摄像头采集图像。The second application is supported to directly call the second local camera to collect images.
  7. 根据权利要求1~5任一项所述的方法,其特征在于,所述应用包括第一应用和第二应用,所述第一应用和所述第二应用均具备虚拟摄像头调用权限,所述操作事件包括指示所述第一应用调用第一本地摄像头的第一操作事件及指示所述第二应用调用第二本地摄像头的第二操作事件,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the application includes a first application and a second application, both the first application and the second application have virtual camera calling permissions, and the The operation event includes a first operation event that instructs the first application to call the first local camera and a second operation event that instructs the second application to call the second local camera. The method further includes:
    所述第一设备与所述第二设备建立多设备协同关系;The first device establishes a multi-device collaboration relationship with the second device;
    接收所述第一操作事件;receiving the first operation event;
    确定所述第一本地摄像头对应的第一虚拟摄像头,支持所述第一应用调用所述第一虚拟摄像头采集图像;Determine the first virtual camera corresponding to the first local camera, and support the first application to call the first virtual camera to collect images;
    接收所述第二操作事件;Receive the second operation event;
    显示第一提示信息,所述第一提示信息用于提示虚拟摄像头调用功能已被占用;或者, Display the first prompt information, the first prompt information is used to prompt that the virtual camera calling function has been occupied; or,
    停止支持所述第一应用调用所述第一虚拟摄像头采集图像,确定所述第二本地摄像头对应的第二虚拟摄像头,支持所述第二应用调用所述第二虚拟摄像头采集图像;Stop supporting the first application in calling the first virtual camera to collect images, determine the second virtual camera corresponding to the second local camera, and support the second application in calling the second virtual camera to collect images;
    其中,所述第一本地摄像头和所述第二本地摄像头为相同的本地摄像头,且所述第一虚拟摄像头和所述第二虚拟摄像头为相同的虚拟摄像头;或者,所述第一本地摄像头和所述第二本地摄像头为不同的本地摄像头,且所述第一虚拟摄像头和所述第二虚拟摄像头为不同的虚拟摄像头。Wherein, the first local camera and the second local camera are the same local camera, and the first virtual camera and the second virtual camera are the same virtual camera; or, the first local camera and The second local camera is a different local camera, and the first virtual camera and the second virtual camera are different virtual cameras.
  8. 根据权利要求1~5任一项所述的方法,其特征在于,所述应用包括第一应用和第二应用,所述第一应用不具备虚拟摄像头调用权限,所述第二应用具备虚拟摄像头调用权限,所述操作事件包括指示所述第一应用调用第一本地摄像头的第一操作事件及指示所述第二应用调用第二本地摄像头的第二操作事件,所述第一本地摄像头和所述第二本地摄像头为相同或者不同的本地摄像头,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the application includes a first application and a second application, the first application does not have the virtual camera calling authority, and the second application has the virtual camera Call permission, the operation event includes a first operation event instructing the first application to call the first local camera and a second operation event instructing the second application to call the second local camera, the first local camera and the The second local camera is the same or a different local camera, and the method further includes:
    所述第一设备与所述第二设备建立多设备协同关系;The first device establishes a multi-device collaboration relationship with the second device;
    接收所述第一操作事件;receiving the first operation event;
    支持所述第一应用直接调用所述第一本地摄像头采集图像;Support the first application to directly call the first local camera to collect images;
    接收所述第二操作事件;Receive the second operation event;
    确定所述第二本地摄像头对应的第二虚拟摄像头,支持所述第二应用调用所述第二虚拟摄像头采集图像。Determine a second virtual camera corresponding to the second local camera, and support the second application to call the second virtual camera to collect images.
  9. 根据权利要求1~5任一项所述的方法,其特征在于,所述应用包括第一应用和第二应用,所述第一应用和所述第二应用均不具备虚拟摄像头调用权限,所述操作事件包括指示所述第一应用调用第一本地摄像头的第一操作事件及指示所述第二应用调用第二本地摄像头的第二操作事件,所述第一本地摄像头和所述第二本地摄像头为相同或者不同的本地摄像头,所述方法还包括:The method according to any one of claims 1 to 5, characterized in that the application includes a first application and a second application, and neither the first application nor the second application has virtual camera calling permission, so The operation event includes a first operation event that instructs the first application to call a first local camera and a second operation event that instructs the second application to call a second local camera. The first local camera and the second local camera The cameras are the same or different local cameras, and the method further includes:
    接收所述第一操作事件;receiving the first operation event;
    支持所述第一应用直接调用所述第一本地摄像头采集图像;Support the first application to directly call the first local camera to collect images;
    接收所述第二操作事件;Receive the second operation event;
    显示第二提示信息,所述第二提示信息用于提示本地摄像头调用功能已被占用;或者,Display second prompt information, the second prompt information is used to prompt that the local camera calling function has been occupied; or,
    停止支持所述第一应用直接调用所述第一本地摄像头采集图像,并支持所述第二应用直接调用所述第二本地摄像头采集图像。Stop supporting the first application to directly call the first local camera to collect images, and support the second application to directly call the second local camera to collect images.
  10. 根据权利要求1~9任一项所述的方法,其特征在于,所述确定所述本地摄像头对应的虚拟摄像头包括:The method according to any one of claims 1 to 9, wherein determining the virtual camera corresponding to the local camera includes:
    根据映射关系表确定所述本地摄像头对应的虚拟摄像头,所述映射关系表包括至少一组本地摄像头和虚拟摄像头的映射关系。The virtual camera corresponding to the local camera is determined according to a mapping relationship table, where the mapping relationship table includes at least one set of mapping relationships between local cameras and virtual cameras.
  11. 根据权利要求10所述的方法,其特征在于,所述至少一组本地摄像头和虚拟摄像头的映射关系包括:第一本地摄像头和第一虚拟摄像头的映射关系;以及,第二本地摄像头和第二虚拟摄像头的映射关系;其中,所述第一本地摄像头和所述第二本地摄像头为不同的本地摄像头,所述第一虚拟摄像头和所述第二虚拟摄像头为不同的虚拟摄像头。The method according to claim 10, characterized in that the mapping relationship between the at least one set of local cameras and virtual cameras includes: the mapping relationship between the first local camera and the first virtual camera; and, the mapping relationship between the second local camera and the second Mapping relationship of virtual cameras; wherein, the first local camera and the second local camera are different local cameras, and the first virtual camera and the second virtual camera are different virtual cameras.
  12. 根据权利要求1-11中任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1-11, characterized in that the method further includes:
    所述第一设备与所述第二设备建立多设备协同关系;The first device establishes a multi-device collaboration relationship with the second device;
    接收所述第二设备发送的虚拟摄像头的标识信息;Receive the identification information of the virtual camera sent by the second device;
    根据本地摄像头的标识信息和所述虚拟摄像头的标识信息确定所述映射关系。The mapping relationship is determined based on the identification information of the local camera and the identification information of the virtual camera.
  13. 根据权利要求1~11任一项所述的方法,其特征在于,所述第一设备包括用于并行处理的本地摄像头模块和虚拟摄像头模块,所述本地摄像头模块用于调用所述本地摄像头,所述虚拟摄像头模块用于调用所述虚拟摄像头。The method according to any one of claims 1 to 11, characterized in that the first device includes a local camera module and a virtual camera module for parallel processing, and the local camera module is used to call the local camera, The virtual camera module is used to call the virtual camera.
  14. 一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1~13任一项所述的方法。An electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, it implements claims 1 to The method described in any one of 13.
  15. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1~13任一项所述的方法。A computer-readable storage medium stores a computer program, characterized in that when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
  16. 一种芯片,其特征在于,所述芯片包括处理器和存储器,所述存储器中存储有计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1~13任一项所述的方法。 A chip, characterized in that the chip includes a processor and a memory, and a computer program is stored in the memory. When the computer program is executed by the processor, the method of any one of claims 1 to 13 is implemented. method.
PCT/CN2023/111068 2022-09-02 2023-08-03 Camera calling method, electronic device, readable storage medium and chip WO2024046028A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211073229.9A CN117714854A (en) 2022-09-02 2022-09-02 Camera calling method, electronic equipment, readable storage medium and chip
CN202211073229.9 2022-09-02

Publications (1)

Publication Number Publication Date
WO2024046028A1 true WO2024046028A1 (en) 2024-03-07

Family

ID=90100362

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/111068 WO2024046028A1 (en) 2022-09-02 2023-08-03 Camera calling method, electronic device, readable storage medium and chip

Country Status (2)

Country Link
CN (1) CN117714854A (en)
WO (1) WO2024046028A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019031975A1 (en) * 2017-08-11 2019-02-14 Motorola Solutions, Inc. System, device, and method for transferring security access permissions between in-camera users
CN112597484A (en) * 2020-07-16 2021-04-02 同方股份有限公司 Privacy protection method and device, intelligent terminal and storage medium
US20210105397A1 (en) * 2019-06-17 2021-04-08 Snap Inc. Shared control of camera device by multiple devices
CN113852833A (en) * 2021-08-30 2021-12-28 阿里巴巴(中国)有限公司 Multi-device collaborative live broadcast method and device and electronic device
CN113873140A (en) * 2020-06-30 2021-12-31 华为技术有限公司 Camera calling method, electronic equipment and camera
WO2022057742A1 (en) * 2020-09-21 2022-03-24 荣耀终端有限公司 Cross-device application calling method and electronic device
CN114554000A (en) * 2020-11-20 2022-05-27 华为终端有限公司 Camera calling method and system and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019031975A1 (en) * 2017-08-11 2019-02-14 Motorola Solutions, Inc. System, device, and method for transferring security access permissions between in-camera users
US20210105397A1 (en) * 2019-06-17 2021-04-08 Snap Inc. Shared control of camera device by multiple devices
CN113873140A (en) * 2020-06-30 2021-12-31 华为技术有限公司 Camera calling method, electronic equipment and camera
CN112597484A (en) * 2020-07-16 2021-04-02 同方股份有限公司 Privacy protection method and device, intelligent terminal and storage medium
WO2022057742A1 (en) * 2020-09-21 2022-03-24 荣耀终端有限公司 Cross-device application calling method and electronic device
CN114554000A (en) * 2020-11-20 2022-05-27 华为终端有限公司 Camera calling method and system and electronic equipment
CN113852833A (en) * 2021-08-30 2021-12-28 阿里巴巴(中国)有限公司 Multi-device collaborative live broadcast method and device and electronic device

Also Published As

Publication number Publication date
CN117714854A (en) 2024-03-15

Similar Documents

Publication Publication Date Title
EP3934292B1 (en) Bluetooth connection method, device and system
WO2021078284A1 (en) Content continuation method and electronic device
WO2021051989A1 (en) Video call method and electronic device
WO2021164556A1 (en) Wireless earphone case and system
WO2021036771A1 (en) Electronic device having foldable screen, and display method
WO2021036651A1 (en) Display method and electronic device
WO2022100610A1 (en) Screen projection method and apparatus, and electronic device and computer-readable storage medium
US20230189366A1 (en) Bluetooth Communication Method, Terminal Device, and Computer-Readable Storage Medium
WO2020151385A1 (en) Method and device for controlling networking of smart home device
WO2021017909A1 (en) Method, electronic device and system for realizing functions through nfc tag
JP7468830B2 (en) Energy efficient display processing method and device - Patents.com
WO2021037146A1 (en) File sharing method and device for mobile terminal
EP4120074A1 (en) Full-screen display method and apparatus, and electronic device
US11899929B2 (en) Method for customizing key of foldable device, device, and storage medium
US20230350629A1 (en) Double-Channel Screen Mirroring Method and Electronic Device
WO2022267644A1 (en) Screen sharing method and system, and virtual display device
WO2024046028A1 (en) Camera calling method, electronic device, readable storage medium and chip
WO2022267974A1 (en) Screen projection method and related apparatus
EP4250074A1 (en) Screen projection display method and electronic device
WO2022007750A1 (en) Screen sharing method, terminal, and storage medium
WO2023093778A1 (en) Screenshot capture method and related apparatus
WO2022037412A1 (en) Method and apparatus for managing internet of things devices
WO2023241558A1 (en) Communication method, communication system and mouse
WO2023025059A1 (en) Communication system and communication method
WO2023051204A1 (en) Cross-device connection method, electronic device and storage medium