WO2020125572A1 - 摄像头共享方法及装置 - Google Patents

摄像头共享方法及装置 Download PDF

Info

Publication number
WO2020125572A1
WO2020125572A1 PCT/CN2019/125547 CN2019125547W WO2020125572A1 WO 2020125572 A1 WO2020125572 A1 WO 2020125572A1 CN 2019125547 W CN2019125547 W CN 2019125547W WO 2020125572 A1 WO2020125572 A1 WO 2020125572A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
virtual camera
shooting data
data
buffer
Prior art date
Application number
PCT/CN2019/125547
Other languages
English (en)
French (fr)
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 中兴通讯股份有限公司
Priority to EP19900957.2A priority Critical patent/EP3902239A4/en
Publication of WO2020125572A1 publication Critical patent/WO2020125572A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/72406User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality by software upgrading or downloading
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • 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/617Upgrading or updating of programs or applications for camera control
    • 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/63Control of cameras or camera modules by using electronic viewfinders
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/141Systems for two-way working between two video terminals, e.g. videophone
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/14Systems for two-way working
    • H04N7/141Systems for two-way working between two video terminals, e.g. videophone
    • H04N7/147Communication arrangements, e.g. identifying the communication as a video-communication, intermediate storage of the signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M2250/00Details of telephonic subscriber devices
    • H04M2250/52Details of telephonic subscriber devices including functional features of a camera

Definitions

  • This disclosure relates to, but is not limited to, the field of communications.
  • the current camera sharing technology is mainly applied between the web camera and the user terminal.
  • the network camera has a public IP, and the mobile phone operating system of the user terminal (for example, Android and IPhone) will provide a common API interface to obtain remote camera data, so as to achieve camera sharing.
  • the mobile phone operating system of the user terminal for example, Android and IPhone
  • the camera between the two mobile terminals does not have a public IP, it is impossible to use a common API to achieve camera sharing.
  • a camera sharing method including: a first device writes shooting data acquired by a camera to a kernel state address space of a first virtual camera of the first device; the first device Writing the shooting data to the buffer of the second virtual camera of the first device in the kernel state address space; and the first device reading the buffer in the buffer through the second virtual camera The shooting data.
  • a camera sharing device is also provided.
  • the camera sharing device is located in the first device and includes: a first writing module for writing the shooting data acquired by the camera to the kernel state address space of the first virtual camera of the first device; the second writing A module for writing the shooting data to the buffer of the second virtual camera of the first device in the kernel state address space; and a reading module for reading the camera by the second virtual camera The shooting data in the buffer.
  • a storage medium in which a computer program is stored, wherein when the computer program is executed by a processor, the processor is caused to execute the camera according to the present disclosure Steps of sharing method.
  • an electronic device including a memory and a processor, the memory stores a computer program, the processor is configured to run the computer program to execute according to the present disclosure Steps of the camera sharing method.
  • FIG. 1 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure
  • FIG. 2 is a flowchart of a camera sharing method according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart of camera data transmission according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic diagram of user operation steps according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic diagram of data transmission by a virtual camera according to an embodiment of the present disclosure.
  • FIG. 6 is a flowchart of a camera sharing method according to an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of camera sharing display according to an embodiment of the present disclosure.
  • FIG. 8 is a flowchart of a camera sharing method according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of a camera sharing device module according to an embodiment of the present disclosure.
  • FIG. 10 is a schematic structural diagram of a camera sharing device module according to an embodiment of the present disclosure.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal according to a camera sharing method according to an embodiment of the present disclosure.
  • the mobile terminal 100 may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc. ), a memory 104 for storing data, a camera 106, and a transmission device 108 for a communication function.
  • a driver of a virtual camera is also installed in the mobile terminal, and a pair of virtual cameras (ie, a first virtual camera and a second virtual camera) are generated.
  • a pair of virtual cameras ie, a first virtual camera and a second virtual camera
  • FIG. 1 is merely an illustration, which does not limit the structure of the mobile terminal described above.
  • the mobile terminal 100 may further include more or fewer components than those shown in FIG. 1, or have a configuration different from that shown in FIG.
  • the memory 104 may be used to store computer programs, for example, software programs and modules of application software, such as computer programs corresponding to the camera sharing method in the embodiments of the present disclosure.
  • the processor 102 executes various functional applications and data processing by running a computer program stored in the memory 104 to implement the camera sharing method according to the present disclosure.
  • the memory 104 may include volatile memory, such as high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memories remotely provided with respect to the processor 102, and these remote memories may be connected to the mobile terminal 100 through a network. Examples of the aforementioned network include, but are not limited to, the Internet, intranet, local area network, mobile communication network, and combinations thereof.
  • the camera 106 is used for shooting, for example, through a video call, the captured data is transmitted to the peer device through the transmission device 108.
  • the transmission device 108 is used to receive or transmit data via the network.
  • the network may include a wireless network provided by a communication provider of the mobile terminal 100.
  • the transmission device 108 includes a network interface controller (Network Interface Controller, NIC), which can be connected to other network devices through a base station to enable networked communication.
  • the transmission device 108 may be a radio frequency (Radio Frequency) module, which is used for wireless network communication.
  • Radio Frequency Radio Frequency
  • FIG. 2 is a flowchart of camera sharing according to an embodiment of the present disclosure.
  • the mobile terminal at the local end is called It is the first device, and the remote mobile terminal is called the second device.
  • the flow includes the following steps S202 to S206.
  • step S202 the first device writes the shooting data acquired by the camera to the kernel state address space of the first virtual camera of the first device.
  • step S204 the first device writes the shooting data to the buffer of the second virtual camera of the first device in the kernel state address space.
  • step S206 the first device reads the shooting data in the buffer through the second virtual camera.
  • the shooting data by converting the shooting data into the kernel state shooting data of a virtual camera of the first device, and reading the shooting data from another virtual camera, it can be used by existing applications, so as to achieve camera sharing.
  • the shooting data may be data shot in real time by a camera on the second device.
  • the first device may communicate with the second device through a wired or wireless network connection, and from the second device Obtain data shot in real time by the camera of the second device.
  • the shooting data may also be data shot by a camera on the first device.
  • the first device needs to establish a network connection with the second device and pass the network Connect and obtain the data captured by the camera on the second device in real time. If the shooting data is the data shot by the camera on the first device, the first device only needs to acquire the shot data.
  • the camera sharing method before step S202, further includes: starting an application in the first device, and switching the camera to the second virtual camera in the application.
  • the first virtual camera and the second virtual camera may be generated in the first device in advance, and each virtual camera includes its own read-write interface and buffer.
  • the camera collection data sharing can be realized on the two networked terminals.
  • a pair of virtual cameras can be added to the terminal, and each camera-related APP has a camera traversal function. For example, you can select one of the front camera, rear camera, and virtual camera.
  • the socket data of the remote camera to the kernel state data of the virtual camera of the machine, and reading the data from another virtual camera, and for the APP to use, camera sharing is achieved.
  • the shooting data of the camera can be made independent of the specific APP.
  • the method flow includes the following steps S301 to S307.
  • step S301 the camera on the terminal A shoots to generate shooting data.
  • step S302 terminal A sends the shooting data to terminal B through a communication tool.
  • the communication tool may be a general-purpose communication tool.
  • step S303 the terminal B obtains remote camera data through a common communication tool under the condition of ensuring safety authentication.
  • step S304 the terminal B writes the shooting data acquired from the terminal A to the kernel state address space of a virtual camera of the terminal B.
  • step S305 the transfer of the shooting data is implemented in the kernel state address space, that is, after the shooting data is received in the kernel state address space, it is directly written to the buffer of another virtual camera, so as to ensure that another virtual camera is ready for data, It is read in real time.
  • step S306 the corresponding APP is opened in the terminal B, and the camera is switched to the virtual camera in which the shooting data has been written in the buffer. If the APP has its own camera switching function, it can traverse to select a virtual camera.
  • step S307 the virtual camera reads the camera data in the buffer.
  • the APP on the terminal B can display the data captured by the camera on the terminal A at any time.
  • the following provides an embodiment of camera sharing from the perspective of user use.
  • a general communication tool and a virtual camera driver need to be installed on the terminal used.
  • FIG. 4 it specifically includes the following steps S401 to S408.
  • step S401 an application is downloaded from an official channel for installation, and the application has a driver for a virtual camera.
  • step S402 the official user is registered with the official.
  • step S403 make friends with other registered users.
  • step S404 a screen sharing authentication request is sent to a friend.
  • step S405 after successful authentication, the camera test interface is opened. At this time, if the picture taken by the camera of the other party's friend can be seen in the interface, it indicates that the socket communication is normal.
  • step S406 the test is closed and the working state is switched to.
  • the data captured by the camera is sent to the kernel buffer in the driver of the virtual camera.
  • step S407 select a camera-related APP on the local machine, and switch to the virtual camera in the APP.
  • step S408 the APP displays the picture taken by the camera of the friend of the other party, thereby achieving universal sharing of the remote camera.
  • the following describes in detail the transmission of shooting data between two virtual cameras through an embodiment.
  • the virtual camera driver can generate two virtual camera devices at the same time, for example, dev0 and dev1, and each virtual camera device has its own read and write interface and buffer. There is no need for two-way data transmission between the two virtual camera devices.
  • dev0 can be regarded as a data input device and dev1 as a data output device.
  • the transmission of the shooting data of the camera includes the following steps S501 to S504.
  • step S501 the acquired shooting data is sent to the kernel state address space of dev0 through the V4L2 write interface.
  • step S502 dev0 does not directly save the data.
  • step S503 when the shooting data from dev0 is received in the kernel state address space, it is directly written to the V4L2 buffer of dev1.
  • step S504 the shooting data in the buffer of dev1 is read through the read interface of dev1.
  • a fixed-size space can be applied for the buffer area, and the head and tail buoys are defined, and the head and tail buoys are changed during read and write operations, respectively.
  • step S601 both terminal A and terminal B open the communication APP and check whether video communication is possible.
  • step S602 terminal B switches to the working state and selects dev0 as a data input device in a pair of virtual camera devices, so that the picture taken by the camera on terminal A is written into the kernel state address space of virtual camera dev0.
  • step S603 open an APP related to camera shooting, and select dev1 as a data output device through the camera switching function, so that the screen shot by the camera on the terminal A can be seen, for example, as shown in FIG. 7.
  • a camera sharing method is also provided.
  • real-time video communication is not performed between the two terminals, but terminal A will use the recorded shooting data through the virtual Camera output.
  • the process includes the following steps S801 to S802.
  • step S801 read the recorded video on terminal A, and select the virtual camera dev0 as a data input device, read the shooting data according to normal playback and write it to the kernel state address space of the virtual camera dev0, and then switch to the background to execute .
  • step S802 open the video chat APP on the terminal A, and select the virtual camera dev1 as the data output device through the camera switching function, so that the terminal A prepares the recorded video to be displayed before the video chat, after the video chat communication is established , Terminal B will display the video recorded by terminal A, to achieve fake chat.
  • the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware.
  • the technical solution of the present disclosure can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, and optical disk) and includes several instructions to make a terminal
  • the device which may be a mobile phone, computer, server, or network device, etc.) executes the camera sharing method of various embodiments of the present disclosure.
  • An embodiment of the present disclosure also provides a camera sharing device, which is used to implement a camera sharing method according to an embodiment of the present disclosure, and descriptions that have already been described will not be repeated.
  • the term "module” may implement a combination of software and/or hardware that performs predetermined functions.
  • the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 9 is a structural block diagram of a camera sharing apparatus according to an embodiment of the present disclosure, the camera sharing apparatus is located in a first device. As shown in FIG. 9, the device includes a first writing module 10, a second writing module 20 and a reading module 30.
  • the first writing module 10 is used to write the shooting data acquired by the camera to the kernel state address space of the first virtual camera of the first device.
  • the second writing module 20 is used to write the shooting data to the buffer of the second virtual camera of the first device in the kernel state address space.
  • the reading module 30 is used to read the shooting data in the buffer through the second virtual camera.
  • the device includes an acquisition module 40, a control module 50, and a generation module 60 in addition to all the modules shown in FIG.
  • the shooting data may be data shot in real time by the camera on the second device, and the first device may communicate with the second device through a wired or wireless network connection, and obtain the data from the second device.
  • the shooting data may also be data shot by a camera on the first device.
  • the shooting data is real-time shooting data of the camera on the second device
  • a network connection can be established with the second device through the acquiring module 40, and the real-time shooting of the camera on the second device can be acquired through the network connection The data.
  • the acquisition module 40 may directly acquire the shot data from the first device.
  • the control module 50 is used to start an application in the first device and switch the camera to the second virtual camera in the application.
  • the first virtual camera and the second virtual camera may be generated in the first device by the generating module 60 in advance, and each virtual camera includes its own read-write interface and buffer.
  • the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but not limited to this: the above modules are all located in the same processor; or the above modules can be combined in any combination The forms are located in different processors.
  • An embodiment of the present disclosure also provides a storage medium in which a computer program is stored, wherein, when the computer program is executed by a processor, the processor is caused to execute the camera sharing method according to various embodiments of the present disclosure.
  • An embodiment of the present disclosure also provides an electronic device including a memory and a processor, in which a computer program is stored, and the processor is configured to run the computer program to perform a camera sharing method according to various embodiments of the present disclosure.
  • modules or steps can be implemented by a general-purpose computing device. They can be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Ground, they can be implemented with program code executable by the computing device, so that they can be stored in the storage device to be executed by the computing device, and in some cases, can be executed in a different order than shown here Or described steps, or they are made into individual integrated circuit modules, or multiple modules or steps among them are made into a single integrated circuit module to achieve. In this way, the present disclosure is not limited to any specific combination of hardware and software.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Software Systems (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Studio Devices (AREA)

Abstract

本公开提供了一种摄像头共享方法及装置、存储介质和电子设备。该方法包括:第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间;所述第一设备在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区;以及所述第一设备通过所述第二虚拟摄像头读取所述缓冲区中的所述拍摄数据。

Description

摄像头共享方法及装置 技术领域
本公开涉及(但不限于)通信领域。
背景技术
很多应用程序通过刷二维码可以实现身份验证或者支付,但都是只能本机扫码实现,不能远程共享扫码实现。实际上,远程实时扫码代付、代验证等会是时常发生需求的。
目前的摄像头共享技术,主要是应用在网络摄像头和用户终端之间。网络摄像头是有公网IP,用户终端的手机操作系统(例如,Android和IPhone)会提供通用的API接口获取远端的摄像头数据,从而实现摄像头共享。而在两个手机终端之间的摄像头,由于没有公网IP,所以是无法使用通用API实现摄像头共享。
发明内容
根据本公开的实施例,提供了一种摄像头共享方法,包括:第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间;所述第一设备在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区;以及所述第一设备通过所述第二虚拟摄像头读取所述缓冲区中的所述拍摄数据。
根据本公开的又一实施例,还提供了一种摄像头共享装置。该摄像头共享装置位于第一设备中,并且包括:第一写入模块,用于将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间;第二写入模块,用于在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区;以及读取模块,用于通过所述第二虚拟摄像头读取所述缓冲区中的所述拍摄数据。
根据本公开的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被处理器运行时, 使得所述处理器执行根据本公开的摄像头共享方法的步骤。
根据本公开的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序,以执行根据本公开的摄像头共享方法的步骤。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本公开的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是根据本公开实施例的终端结构示意图;
图2是根据本公开实施例的摄像头共享方法流程图;
图3是根据本公开实施例的摄像头数据传输流程图;
图4是根据本公开实施例的用户操作步骤示意图;
图5是根据本公开实施例的虚拟摄像头对数据传输示意图;
图6是根据本公开实施例的摄像头共享方法流程图;
图7是根据本公开实施例的摄像头共享显示示意图;
图8是根据本公开实施例的摄像头共享方法流程图;
图9是根据本公开实施例的摄像头共享装置模块结构示意图;以及
图10是根据本公开实施例的摄像头共享装置模块结构示意图。
具体实施方式
下文中将参考附图并结合实施例来详细说明本公开。需要说明的是,在不冲突的情况下,本公开中的实施例及实施例中的特征可以相互组合。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。
本公开所提供的方法实施例可以在移动终端、计算机终端或者类似的带有摄像头的电子装置中执行。以运行在移动终端上为例,图 1是根据本公开实施例的一种摄像头共享方法的移动终端的硬件结构框图。如图1所示,移动终端100可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器104、摄像头106以及用于通信功能的传输设备108。在所述移动终端中还安装了虚拟摄像头的驱动程序,并生成了一对虚拟摄像头(即,第一虚拟摄像头和第二虚拟摄像个头)。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端100还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可用于存储计算机程序,例如,应用软件的软件程序以及模块,如本公开实施例中的摄像头共享方法对应的计算机程序。处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,以实现根据本公开的摄像头共享方法。存储器104可包括易失性存储器,如高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端100。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
摄像头106用于进行拍摄,例如,通过视频通话,将所拍摄的数据通过传输装置108传输给对端设备。
传输装置108用于经由网络接收或者发送数据。网络的具体实例可包括移动终端100的通信供应商提供的无线网络。在一个实例中,传输装置108包括网络接口控制器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可进行联网通讯。在一个实例中,传输装置108可以为射频(Radio Frequency,RF)模块,其用于通过无线方式进行联网通讯。
在本实施例中提供了一种运行于移动终端的摄像头共享方法,图2是根据本公开实施例的摄像头共享的流程图,为了描述方便,在 本实施例中,将本端的移动终端称之为第一设备,并且将远端的移动终端称之为第二设备。如图2所示,该流程包括如下步骤S202至S206。
在步骤S202,第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间。
在步骤S204,所述第一设备在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区。
在步骤S206,所述第一设备通过所述第二虚拟摄像头读取所述缓冲区中的拍摄数据。
在上述实施例中,通过将拍摄数据转成第一设备的一个虚拟摄像头的内核态的拍摄数据,并从另一个虚拟摄像头读取该拍摄数据,可供已有应用使用,从而实现摄像头共享。
在上述实施例中,所述拍摄数据可以是第二设备上的摄像头实时拍摄的数据,第一设备可通过有线或无线的网络连接方式与所述第二设备进行通信,从所述第二设备获取所述第二设备的摄像头实时拍摄的数据。在其他实施例中,所述拍摄数据也可以是第一设备上的摄像头已拍摄的数据。
在上述实施例中,如果所述拍摄数据是第二设备上的摄像头实时拍摄的数据,则在步骤S202之前,所述第一设备需要与所述第二设备建立网络连接,并通过所述网络连接获取所述第二设备上的摄像头实时拍摄的数据。如果所述拍摄数据是第一设备上的摄像头已拍摄的数据,则所述第一设备只需获取所述已拍摄的数据。
根据本公开的实施例,在步骤S202之前,所述摄像头共享方法还包括:启动所述第一设备中的应用,并在所述应用中将摄像头切换至所述第二虚拟摄像头。
在本实施例中,可预先在所述第一设备中生成第一虚拟摄像头和第二虚拟摄像头,并且每个虚拟摄像头包括各自的读写接口和缓冲区。
根据本公开的实施例,不需要对终端上的应用程序(APP)重新开发,并且可以基于已有APP,在两个联网的终端上实现摄像头采集数据共享。可以在终端中增加一对虚拟摄像头,并且每个涉及摄像的 APP都具有摄像头遍历功能,例如,可以选择前置摄像头、后置摄像头、以及虚拟摄像头其中之一。通过将远端摄像头的套接字(socket)数据转成本机的虚拟摄像头的内核态数据,并从另一个虚拟摄像头读取该数据,以及供APP使用,从而实现摄像头共享。通过这种实现方式,可以使得摄像头的拍摄数据与具体的APP无关。
下面将根据本公开的实施例,提供两个终端间进行摄像头共享的方法流程,如图3所示,该方法流程包括以下步骤S301至S307。
在步骤S301,终端A上的摄像头进行拍摄,生成拍摄数据。
在步骤S302,终端A通过通讯工具将拍摄数据发送给终端B。该通讯工具可以是通用的通讯工具。
在步骤S303,终端B在保证安全认证的情况下通过通用的通讯工具获取远端的摄像头数据。
在步骤S304,终端B把从终端A获取的拍摄数据写到终端B的一个虚拟摄像头的内核态地址空间。
在步骤S305,在内核态地址空间实现拍摄数据的传递,即,在内核态地址空间接收到拍摄数据后直接写到另一个虚拟摄像头的缓冲区中,从而保证另外一个虚拟摄像头准备好数据,以被实时读取。
在步骤S306,在终端B中开启相应的APP,并切换摄像头至缓冲区中已写入拍摄数据的虚拟摄像头。APP如果自带切换摄像头功能的话,可以进行遍历以选择虚拟摄像头。
在步骤S307,虚拟摄像头读取缓冲区中的摄像头数据,此时,终端B上的APP可以随时显示终端A上的摄像头拍摄的数据。
下面从用户使用的角度提供了一个摄像头共享的实施例,在本实施例中,需要在使用的终端上安装通用的通讯工具和虚拟摄像头的驱动程序。如图4所示,具体包括以下步骤S401至S408。
在步骤S401,从官方渠道下载应用进行安装,该应用带虚拟摄像头的驱动程序。
在步骤S402,向官方注册成为正式用户。
在步骤S403,跟其他注册用户成为好友。
在步骤S404,向好友发送屏幕共享鉴权请求。
在步骤S405,鉴权成功后,打开摄像头测试界面,此时如果可以在界面中看到对方好友的摄像头拍摄的画面,表明socket通讯正常。
在步骤S406,关闭测试,切换到工作状态,在工作状态下,摄像头拍摄的数据发送至虚拟摄像头的驱动程序中的内核缓冲区。
在步骤S407,在本机上选择某个涉及摄像的APP,并在该APP中切换到虚拟摄像头。
在步骤S408,该APP显示对方好友的摄像头的拍摄的画面,从而实现了远程摄像头通用共享。
下面将通过实施例对在两个虚拟摄像头之间传输拍摄数据进行详细描述。虚拟摄像头的驱动程序可以同时生成两个虚拟摄像头设备,例如,分别是dev0和dev1,每个虚拟摄像头设备分别具有自己的读写接口和缓冲区。两个虚拟摄像头设备之间不需要进行双向的数据传输,为了描述简化,可以将dev0看作是数据输入设备,并且将dev1看作是数据输出设备。如图5所示,摄像头的拍摄数据的传输包括以下步骤S501至S504。
在步骤S501,把获取到的拍摄数据通过V4L2写接口发送到dev0的内核态地址空间。
在步骤S502,dev0不直接保存数据。
在步骤S503,在内核态地址空间接收到来自dev0的拍摄数据时,直接写到dev1的V4L2缓冲区中。
在步骤S504,通过dev1的读接口读取dev1的缓冲区中的拍摄数据。
在本实施例中,可为缓冲区申请一段固定大小空间,并定义头尾浮标,分别在读写操作的同时改变头尾浮标。
下面从用户使用界面的角度,详细描述本公开实施例提供的摄像头共享技术方案。在本实施例中,当终端A和终端B进行视频通讯时,在终端B上共享了终端A的摄像头。如图6所示,具体的操作可以包括以下步骤S601至S603。
在步骤S601,终端A和终端B都打开通讯APP,检查是否可以 进行视频通讯。
在步骤S602,终端B切换到工作状态,并选择一对虚拟摄像头设备中的作为数据输入设备的dev0,这样终端A上的摄像头拍摄的画面就会写到虚拟摄像头dev0的内核态地址空间中。
在步骤S603,打开某个涉及摄像的APP,并通过摄像头切换功能选择作为数据输出设备的dev1,从而可以看到终端A上的摄像头拍摄的画面,例如,如图7所示。
根据本公开的实施例,还提供了一种摄像头共享方法,在本实施例中,在两个终端之间并不是进行实时的视频通讯,而是终端A将以已录制好的拍摄数据通过虚拟摄像头输出。如图8所示,该过程包括如下步骤S801至S802。
在步骤S801,在终端A读取录制好的视频,并选择作为数据输入设备的虚拟摄像头dev0,按照正常播放读取拍摄数据并写到虚拟摄像头dev0的内核态地址空间中,然后切到后台执行。
在步骤S802,在终端A上打开视频聊天APP,并通过摄像头切换功能选择作为数据输出设备的虚拟摄像头dev1,这样终端A在视频聊天前准备好要显示的录制的视频,等到视频聊天通讯建立之后,在终端B上会显示终端A已录制的视频,实现了假聊天。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,本公开的技术方案可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例的摄像头共享方法。
本公开实施例还提供了一种摄像头共享装置,该装置用于实现根据本公开实施例的摄像头共享方法,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图9是根据本公开实施例的摄像头共享装置的结构框图,该摄像头共享装置位于第一设备中。如图9所示,该装置包括第一写入模块10、第二写入模块20和读取模块30。
第一写入模块10用于将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间。
第二写入模块20用于在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区。
读取模块30用于通过所述第二虚拟摄像头读取所述缓冲区中的拍摄数据。
图10是根据本公开实施例的摄像头共享装置的结构框图,如图10所示,该装置除包括图9所示的所有模块外,还包括获取模块40、控制模块50和生成模块60。
在本实施例中,拍摄数据可以是第二设备上的摄像头实时拍摄的数据,第一设备可通过有线或无线的网络连接方式与所述第二设备进行通信,从所述第二设备获取所述第二设备的摄像头实时拍摄的数据。在其他实施例中,所述拍摄数据也可以是第一设备上的摄像头已拍摄的数据。
如果所述拍摄数据为第二设备上的摄像头实时拍摄的数据,则可通过获取模块40与所述第二设备建立网络连接,并通过所述网络连接获取所述第二设备上的摄像头实时拍摄的数据。
如果所述拍摄数据为第一设备上的摄像头已拍摄的数据,则获取模块40可直接从所述第一设备获取已拍摄的数据。
控制模块50用于启动所述第一设备中的应用,并在所述应用中将摄像头切换至所述第二虚拟摄像头。
在本实施例中,可预先通过生成模块60在所述第一设备中生成第一虚拟摄像头和第二虚拟摄像头,并且每个虚拟摄像头包括各自的读写接口和缓冲区。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者上述各个模块以任意组合的形式分别位于不同的处 理器中。
本公开的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被处理器运行时,使得所述处理器执行根据本公开各实施例的摄像头共享方法。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行根据本公开各实施例的摄像头共享方法。
显然,本领域的技术人员应该明白,上述各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅为本公开的实施例,并不用于限制本公开,对于本领域的技术人员来说,本公开可以有各种更改和变化。凡在本公开的原则之内,所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (12)

  1. 一种摄像头共享方法,包括:
    第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间;
    所述第一设备在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区;以及
    所述第一设备通过所述第二虚拟摄像头读取所述缓冲区中的所述拍摄数据。
  2. 根据权利要求1所述的方法,其中,所述拍摄数据包括下列之一:
    与所述第一设备通信连接的第二设备上的摄像头实时拍摄的数据,以及
    所述第一设备上的摄像头已拍摄的数据。
  3. 根据权利要求1所述的方法,其中,在所述第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间的步骤之前,所述方法还包括:
    所述第一设备与第二设备建立网络连接,并通过所述网络连接获取所述第二设备上的摄像头实时拍摄的数据。
  4. 根据权利要求1所述的方法,其中,在所述第一设备通过所述第二虚拟摄像头读取所述缓冲区中的拍摄数据的步骤之前,所述方法还包括:
    启动所述第一设备中的应用,并在所述应用中将摄像头切换至所述第二虚拟摄像头。
  5. 根据权利要求1所述的方法,其中,在所述第一设备将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态 地址空间的步骤之前,所述方法还包括:
    在所述第一设备中生成所述第一虚拟摄像头和所述第二虚拟摄像头,其中,每个虚拟摄像头包括各自的读写接口和缓冲区。
  6. 一种摄像头共享装置,位于第一设备中,包括:
    第一写入模块,用于将摄像头获取的拍摄数据写入到所述第一设备的第一虚拟摄像头的内核态地址空间;
    第二写入模块,用于在所述内核态地址空间将所述拍摄数据写入到所述第一设备的第二虚拟摄像头的缓冲区;以及
    读取模块,用于通过所述第二虚拟摄像头读取所述缓冲区中的所述拍摄数据。
  7. 根据权利要求6所述的装置,其中,所述拍摄数据包括下列之一:
    与所述第一设备通信连接的第二设备上的摄像头实时拍摄的数据,以及
    所述第一设备上的摄像头已拍摄的数据。
  8. 根据权利要求6所述的装置,还包括:
    获取模块,用于与第二设备建立网络连接,并通过所述网络连接获取所述第二设备上的摄像头实时拍摄的数据。
  9. 根据权利要求6所述的装置,还包括:
    控制模块,用于启动所述第一设备中的应用,并在所述应用中将摄像头切换至所述第二虚拟摄像头。
  10. 根据权利要求1所述的装置,还包括:
    生成模块,用于在所述第一设备中生成所述第一虚拟摄像头和所述第二虚拟摄像头,其中,每个虚拟摄像头包括各自的读写接口和缓冲区。
  11. 一种存储介质,其上存储有计算机程序,所述计算机程序被处理器运行时,使得所述处理器执行根据权利要求1至5任一项中所述的摄像头共享方法。
  12. 一种电子设备,包括存储器和处理器,其中,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行根据权利要求1至5任一项中所述的摄像头共享方法。
PCT/CN2019/125547 2018-12-17 2019-12-16 摄像头共享方法及装置 WO2020125572A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
EP19900957.2A EP3902239A4 (en) 2018-12-17 2019-12-16 METHOD AND DEVICE FOR SHARING CAMERAS

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811543983.8A CN111327758B (zh) 2018-12-17 2018-12-17 摄像头共享方法及装置
CN201811543983.8 2018-12-17

Publications (1)

Publication Number Publication Date
WO2020125572A1 true WO2020125572A1 (zh) 2020-06-25

Family

ID=71101995

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/125547 WO2020125572A1 (zh) 2018-12-17 2019-12-16 摄像头共享方法及装置

Country Status (3)

Country Link
EP (1) EP3902239A4 (zh)
CN (1) CN111327758B (zh)
WO (1) WO2020125572A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113193979A (zh) * 2021-03-25 2021-07-30 深圳市广和通无线股份有限公司 实现物联网模块虚拟外设共享的方法、装置、计算机设备
CN115185711A (zh) * 2022-09-06 2022-10-14 湖北芯擎科技有限公司 基于虚拟摄像头的数据交互方法、装置、电子设备及介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112118459A (zh) * 2020-08-28 2020-12-22 上海商米科技集团股份有限公司 共享摄像头数据实现多个app共同直播的方法及可读介质
CN112839194A (zh) * 2020-12-25 2021-05-25 广州朗国电子科技有限公司 双系统下共享摄像头的方法、装置、一体机及储存介质
CN114205529A (zh) * 2021-12-20 2022-03-18 北京鸿合爱学教育科技有限公司 一种单摄像头的调用方法、装置、终端和可读存储介质
CN114584738A (zh) * 2022-05-06 2022-06-03 深圳市飞图视讯有限公司 摄像头共享方法、装置、终端设备及存储介质
CN115242970B (zh) * 2022-06-23 2023-06-30 重庆长安汽车股份有限公司 车机摄像头数据共享系统、方法、电子设备及存储介质

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080170133A1 (en) * 2007-01-17 2008-07-17 Asustek Computer Inc. Video processing method and system for a virtual camera
CN101594510A (zh) * 2009-06-23 2009-12-02 腾讯科技(深圳)有限公司 一种实现摄像头资源共享的方法及系统
CN101833520A (zh) * 2009-03-11 2010-09-15 凹凸电子(武汉)有限公司 计算机系统、多个应用程序同时使用一个摄像头的方法
CN103516994A (zh) * 2012-06-29 2014-01-15 深圳市快播科技有限公司 多屏适配器摄像头配置方法、多屏适配器及多屏互动系统
CN104918112A (zh) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 相机资源的应用方法及装置
CN105450986A (zh) * 2015-11-12 2016-03-30 厦门雅迅网络股份有限公司 一种Linux下视频处理方法
CN107527317A (zh) * 2017-07-18 2017-12-29 西安电子科技大学 基于图像处理的数据传输系统
CN107659768A (zh) * 2017-08-08 2018-02-02 珠海全志科技股份有限公司 一种基于Android多应用共享摄像头的系统及方法
CN108304247A (zh) * 2017-12-19 2018-07-20 华为技术有限公司 访问摄像头的方法和装置、服务器、可读存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060050155A1 (en) * 2004-09-02 2006-03-09 Ing Stephen S Video camera sharing
US8284267B2 (en) * 2009-03-11 2012-10-09 O2Micro Inc. Virtual camera for sharing a physical camera
TW201304544A (zh) * 2011-07-07 2013-01-16 Chicony Electronics Co Ltd 即時影像通訊系統以及方法
CN102868877A (zh) * 2011-07-07 2013-01-09 群光电子股份有限公司 实时影像通讯系统以及方法
CN105357498A (zh) * 2015-12-10 2016-02-24 广东欧珀移动通信有限公司 一种移动终端摄像头的共享方法及装置
US10108462B2 (en) * 2016-02-12 2018-10-23 Microsoft Technology Licensing, Llc Virtualizing sensors
CN109002164B (zh) * 2018-07-10 2021-08-24 歌尔光学科技有限公司 头戴显示设备的显示方法、装置及头戴显示设备

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080170133A1 (en) * 2007-01-17 2008-07-17 Asustek Computer Inc. Video processing method and system for a virtual camera
CN101833520A (zh) * 2009-03-11 2010-09-15 凹凸电子(武汉)有限公司 计算机系统、多个应用程序同时使用一个摄像头的方法
CN101594510A (zh) * 2009-06-23 2009-12-02 腾讯科技(深圳)有限公司 一种实现摄像头资源共享的方法及系统
CN103516994A (zh) * 2012-06-29 2014-01-15 深圳市快播科技有限公司 多屏适配器摄像头配置方法、多屏适配器及多屏互动系统
CN104918112A (zh) * 2014-03-13 2015-09-16 深圳Tcl新技术有限公司 相机资源的应用方法及装置
CN105450986A (zh) * 2015-11-12 2016-03-30 厦门雅迅网络股份有限公司 一种Linux下视频处理方法
CN107527317A (zh) * 2017-07-18 2017-12-29 西安电子科技大学 基于图像处理的数据传输系统
CN107659768A (zh) * 2017-08-08 2018-02-02 珠海全志科技股份有限公司 一种基于Android多应用共享摄像头的系统及方法
CN108304247A (zh) * 2017-12-19 2018-07-20 华为技术有限公司 访问摄像头的方法和装置、服务器、可读存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3902239A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113193979A (zh) * 2021-03-25 2021-07-30 深圳市广和通无线股份有限公司 实现物联网模块虚拟外设共享的方法、装置、计算机设备
CN115185711A (zh) * 2022-09-06 2022-10-14 湖北芯擎科技有限公司 基于虚拟摄像头的数据交互方法、装置、电子设备及介质
CN115185711B (zh) * 2022-09-06 2023-10-10 湖北芯擎科技有限公司 基于虚拟摄像头的数据交互方法、装置、电子设备及介质

Also Published As

Publication number Publication date
EP3902239A1 (en) 2021-10-27
CN111327758B (zh) 2022-08-02
CN111327758A (zh) 2020-06-23
EP3902239A4 (en) 2022-09-07

Similar Documents

Publication Publication Date Title
WO2020125572A1 (zh) 摄像头共享方法及装置
CN109525990B (zh) 无线投屏方法、装置、计算机设备和存储介质
US9820083B2 (en) Method and system for data sharing
US10608988B2 (en) Method and apparatus for bluetooth-based identity recognition
US20140013100A1 (en) Establish bidirectional wireless communication between electronic devices using visual codes
WO2016146060A1 (zh) 照片的分享方法及装置
WO2016045478A1 (zh) Sim卡读写方法及终端
US9906570B2 (en) Session control system, communication terminal, communication system, session control method, and medium
CN110024395A (zh) 图像数据处理、传输的方法以及控制终端
US20170171508A1 (en) Method and Device for Inputting Audio and Video Information
KR102187227B1 (ko) 컨텐츠 생성 방법 및 그 전자 장치
CN105550934A (zh) 虚拟现实中微信软文的推送系统及方法
KR20210000957A (ko) 블록체인과 해쉬 암호화 기술을 기반으로 한 영상 인증 시스템 및 그 방법
KR20220024302A (ko) 블록체인과 해쉬 암호화 기술을 기반으로 한 영상 인증 시스템 및 그 방법
KR102197851B1 (ko) 단말간 직접 통신에서 대상 발견 방법 및 장치
US10298883B2 (en) Communication system, information processing apparatus, communication apparatus, and computer-readable medium
CN111030897A (zh) 有线配网方法及装置、电子设备和存储介质
US10091635B2 (en) Method and apparatus for communication using IP address exchanged via NFC
US10929703B2 (en) Method apparatus and program product for enabling two or more electronic devices to perform operations based on a common subject
US20140123260A1 (en) Terminal equipment, server, method of controlling terminal equipment, and method of controlling server
US20170155758A1 (en) Operating environment setting system, portable terminal, relay device and operating environment setting program
CN206364929U (zh) 影像服务系统
CN105162526A (zh) 在移动终端中发送照片的方法和设备
CN106656725B (zh) 智能终端、服务器及信息更新系统
US9756673B2 (en) Data sharing method and apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19900957

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2019900957

Country of ref document: EP

Effective date: 20210719