WO-2026091228-A1 - CAMERA SHARING METHOD AND APPARATUS, DEVICE, AND MEDIUM
Abstract
Disclosed are a camera sharing method and apparatus, a device, and a medium, relating to the technical field of image processing. The method comprises: when a first camera process is started, requesting a first memory for the first camera process according to a first image configuration requirement corresponding to the first camera process, and requesting a second memory for a second camera process according to a second image configuration requirement corresponding to the second camera process, wherein the second camera process is a camera process that may simultaneously access the same target camera as the first camera process; controlling the target camera to acquire first image data according to the first image configuration requirement, and storing the first image data in the first memory; when the second camera process is started, requesting a third memory for the second camera process according to the second image configuration requirement; controlling the target camera to acquire second image data according to the second image configuration requirement, and storing the second image data in the second memory; and copying the second image data in the second memory to the third memory.
Inventors
- Yang, Mingming
- WANG, YUYING
- LI, BAOCHENG
- QIU, XUDONG
- YANG, QINGHE
- WU, JIN
- LI, YUFENG
Assignees
- 歌尔科技有限公司
Dates
- Publication Date
- 20260507
- Application Date
- 20241203
- Priority Date
- 20241028
Claims (10)
- A camera sharing method, characterized in that the method includes: When the first camera process is started, first memory is requested for the first camera process according to the first image configuration requirements corresponding to the first camera process, and second memory is requested for the second camera process according to the second image configuration requirements corresponding to the second camera process. The second camera process is a camera process that may call the same target camera at the same time as the first camera process. The target camera is controlled to acquire first image data according to the first image configuration requirements, and the first image data is stored in the first memory; When the second camera process is started, third memory is requested for the second camera process according to the second image configuration requirements; The target camera is controlled to acquire second image data according to the second image configuration requirements, and the second image data is stored in the second memory; The second image data in the second memory is copied to the third memory.
- The method according to claim 1, characterized in that, before the step of requesting first memory for the first camera process according to the first image configuration requirement corresponding to the first camera process and requesting second memory for the second camera process according to the second image configuration requirement corresponding to the second camera process when the first camera process is started, includes: When the first camera process is enabled, the target camera is determined; Based on the target camera, determine the target preset mapping relationship corresponding to the target camera from the candidate preset mapping relationships; Based on the target preset mapping relationship, determine the second camera process corresponding to the first camera process; The candidate preset mapping relationship is used to reflect the correspondence between the camera and the camera process that may call the camera at the same time.
- The method according to claim 1, characterized in that the method further comprises: If the first camera process is closed and the second camera process is not started, the second memory is reclaimed.
- According to the method of claim 1, the step of copying the second image data from the second memory to the third memory includes: Once the second image data has been filled into the second memory, the second image data in the second memory is copied to the third memory.
- The method according to claim 1, wherein either the first image configuration requirement or the second image configuration requirement includes at least one of image size and image format.
- A camera sharing device, characterized in that the device comprises: The first application module is used to apply for first memory for the first camera process according to the first image configuration requirements corresponding to the first camera process when the first camera process is started, and to apply for second memory for the second camera process according to the second image configuration requirements corresponding to the second camera process, wherein the second camera process is a camera process that may call the same target camera at the same time as the first camera process. The first control module is used to control the target camera to acquire first image data according to the first image configuration requirements, and to store the first image data in the first memory; The second application module is used to apply for third memory for the second camera process according to the second image configuration requirements when the second camera process is started. The second control module is used to control the target camera to acquire second image data according to the second image configuration requirements, and to store the second image data in the second memory; The copying module is used to copy the second image data in the second memory to the third memory.
- The apparatus according to claim 6, characterized in that the apparatus further comprises: The determination module is used to determine the target camera when the first camera process is started; Based on the target camera, determine the target preset mapping relationship corresponding to the target camera from the candidate preset mapping relationships; Based on the target preset mapping relationship, determine the second camera process corresponding to the first camera process; The candidate preset mapping relationship is used to reflect the correspondence between the camera and the camera process that may call the camera at the same time.
- The apparatus according to claim 6, wherein the copying module is specifically used for: Once the second image data has been filled into the second memory, the second image data in the second memory is copied to the third memory.
- An electronic device, characterized in that the electronic device comprises the means as described in any one of claims 6 to 8; or, The electronic device includes a memory and a processor, the memory being used to store computer instructions, and the processor being used to retrieve the computer instructions from the memory to perform the method as described in any one of claims 1-5.
- A computer-readable storage medium, characterized in that it stores a computer program thereon, which, when executed by a processor, implements the method according to any one of claims 1-5.
Description
Camera sharing methods, devices, equipment and media This application claims priority to Chinese Patent Application No. 202411516947.8, filed on October 28, 2024, entitled "Camera Sharing Method, Apparatus, Device and Medium", the entire contents of which are incorporated herein by reference. Technical Field This invention relates to the field of image processing technology, and more specifically, to a camera sharing method, apparatus, device, and medium. Background Technology With the rapid development of economy and technology, wearable devices, especially head-mounted devices (such as AR, VR, MR and XR smart glasses or helmets), are widely used in various fields. Multiple applications running simultaneously is a typical application scenario in head-mounted displays (HMDs), where multiple applications run in the foreground on the HMD simultaneously. In this scenario, the HMD may simultaneously run at least two processes that need to access the same camera. For example, it might run both a 6DoF algorithm and a gesture algorithm simultaneously, or it might run both a camera app and a QR code scanning app simultaneously. However, when a head-mounted device simultaneously launches at least two processes that need to access the same camera, once that same camera is accessed by one process, it cannot be accessed by other processes. This results in at least two processes that need to access the same camera being unable to simultaneously obtain camera data, or the camera function of the later-launched process becoming invalid. Summary of the Invention One object of the present invention is to provide a new technical solution for camera sharing. According to a first aspect of the present invention, a camera sharing method is provided, the method comprising: When the first camera process is started, first memory is requested for the first camera process according to the first image configuration requirements corresponding to the first camera process, and second memory is requested for the second camera process according to the second image configuration requirements corresponding to the second camera process. The second camera process is a camera process that may call the same target camera at the same time as the first camera process. The target camera is controlled to acquire first image data according to the first image configuration requirements, and the first image data is stored in the first memory; When the second camera process is started, third memory is requested for the second camera process according to the second image configuration requirements; The target camera is controlled to acquire second image data according to the second image configuration requirements, and the second image data is stored in the second memory; The second image data in the second memory is copied to the third memory. Optionally, before allocating first memory for the first camera process according to the first image configuration requirement corresponding to the first camera process and allocating second memory for the second camera process according to the second image configuration requirement corresponding to the second camera process when the first camera process is started, the process includes: When the first camera process is enabled, the target camera is determined; Based on the target camera, determine the target preset mapping relationship corresponding to the target camera from the candidate preset mapping relationships; Based on the target preset mapping relationship, determine the second camera process corresponding to the first camera process; The candidate preset mapping relationship is used to reflect the correspondence between the camera and the camera process that may call the camera at the same time. Optionally, the method further includes: If the first camera process is closed and the second camera process is not started, the second memory is reclaimed. Optionally, copying the second image data from the second memory to the third memory includes: Once the second image data has been filled into the second memory, the second image data in the second memory is copied to the third memory. Optionally, either the first image configuration requirement or the second image configuration requirement includes at least one of image size and image format. According to a second aspect of the present invention, a camera sharing device is provided, the device comprising: The first application module is used to apply for first memory for the first camera process according to the first image configuration requirements corresponding to the first camera process when the first camera process is started, and to apply for second memory for the second camera process according to the second image configuration requirements corresponding to the second camera process, wherein the second camera process is a camera process that may call the same target camera at the same time as the first camera process. The first control module is use