A method and apparatus for browser access and control of a camera
Patent Information
- Application Number
- CN202311733858.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2026-09-01
- Estimated Expiration
- 2043-12-15
AI Technical Summary
[0003]鉴于以上现有技术的不足,发明的目的在于提供一种浏览器调用和控制摄像头的方法、装置、设备和介质,解决了浏览器内无法对UVC设备进行调用和控制的问题,提高了用户在浏览器上使用UVC摄像头的体验和效率
[0043]本发明的有益效果如下:本发明通过虚拟化和增加控制通道的方式,实现了UVC摄像头的远程调节,解决了浏览器内无法对UVC设备进行调节的问题,提高了用户在浏览器上使用UVC摄像头的体验和效率。支持多种UVC摄像头设备,并且不需要对UVC摄像头设备进行任何修改,使得用户可以轻松地在浏览器中使用多种不同的UVC摄像头,通过自定义协议将修改信息发送回终端设备,实现了终端对UVC摄像头设备的操作,如亮度、对比度、饱和度和白平衡等参数的调节,提高了用户在浏览器上对UVC摄像头的使用便利性和灵活性。
Smart Images

Figure CN117851296B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of browser-based camera access and control technology, and particularly relates to a method, apparatus, device, and medium for browser-based camera access and control. Background Technology
[0002] Traditional browsers typically only allow access to cameras via Flash or browser plugins. However, controlling or adjusting the camera requires writing additional local processes to access the corresponding terminal system API. This presents limitations in accessing and controlling UVC cameras, leading to performance and compatibility issues. While HTML5 has increased support for camera devices, browser support varies, and some browsers do not support adjusting the camera using the UVC protocol. Although UVC cameras are driverless, compatibility may be compromised on certain operating systems. In some cases, users may need to manually install or configure appropriate drivers for the UVC camera to function correctly. Summary of the Invention
[0003] In view of the shortcomings of the prior art, the purpose of the invention is to provide a method, device, equipment and medium for browser to call and control a camera, which solves the problem that the browser cannot call and control UVC devices, and improves the user experience and efficiency of using UVC cameras in the browser.
[0004] A first aspect of the present invention provides a method for a browser to access and control a camera, comprising:
[0005] When the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device.
[0006] The application layer processing / remote server initializes the system, starts the web service, and listens for USB bus callbacks.
[0007] The application layer processing process / remote server sends a command to read the report descriptor to obtain the report descriptor of the UVC device, analyzes whether the report descriptor is a supported UVC device, and saves the UVC capability supported by the camera.
[0008] If the analysis result indicates that the UVC device is a supported UVC device, the USB bus driver will take over the UVC device and issue a reset command.
[0009] The UVC device performs a reset operation and re-enumerates the UVC devices;
[0010] The application layer processing process / remote server performs UVC device initialization, completes the UVC device driver in the business layer, stores the UVC device information in the device list, sends the UVC device online message to the browser webpage, and sends the device list to the browser webpage;
[0011] The browser opens the UVC device and sends resolution and format information to the application layer processing process / remote server.
[0012] The application layer processing / remote server creates the first USB packet and opens the UVC device.
[0013] Furthermore, in the aforementioned method for browser access and control of the camera, after opening the UVC device, it also includes:
[0014] UVC devices send ISO packets containing video data back to the application layer processing process / remote server by enabling isochronous transmission.
[0015] The application layer processing process / remote server parses, splits, and splices the ISO packets of video data into video data, converts the format according to the configuration, and sends it to the browser webpage;
[0016] The browser webpage operates the UVC device and sends the operation content and parameters to the application layer processing process / remote server;
[0017] The application layer processing / remote server creates a second USB packet and sends it to the UVC device;
[0018] The UVC device parses the second USB packet and returns the operation result to the application layer processing process / remote server;
[0019] The application layer processing process / remote server parses the operation result and returns the result.
[0020] Furthermore, in the above-mentioned method for a browser to call and control a camera, the application layer processing process / remote server creates a first USB packet and opens the UVC device, including: the application layer processing process / remote server creates a first USB packet and opens the UVC device through control transmission.
[0021] Furthermore, in the above-mentioned method for a browser to call and control a camera, the application layer processing process / remote server creates a second USB packet and sends it to the UVC device, including: the application layer processing process / remote server creates a second USB packet and sends it to the UVC device via the UVC protocol.
[0022] A second aspect of the present invention provides an apparatus for a browser to access and control a camera, comprising:
[0023] Enumeration and initialization module: Used when the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device;
[0024] Callback module: Used for application layer processing / remote server system initialization, starting web services, and listening for USB bus callbacks;
[0025] Acquisition and Analysis Modules: These modules are used by the application layer processing process / remote server to send a command to read the report descriptor to obtain the report descriptor of the UVC device, analyze whether the report descriptor is a supported UVC device, and save the UVC capabilities supported by the camera.
[0026] Reset module: If the analysis result indicates that the UVC device is a supported UVC device, the module takes over the UVC device at the USB bus driver and issues a reset command.
[0027] Re-enumeration module: Used to perform a reset operation on UVC devices and re-enumerate UVC devices;
[0028] The first sending module is used by the application layer processing process / remote server to perform UVC device initialization work, complete the UVC device driver in the business layer, store the UVC device information in the device list, send the UVC device online message to the browser webpage, and send the device list to the browser webpage.
[0029] The second sending module is used to open the UVC device in the browser webpage and send resolution and format information to the application layer processing process / remote server.
[0030] Open module: Used by the application layer processing process / remote server to create the first USB packet and open the UVC device.
[0031] Furthermore, the aforementioned device for a browser to access and control a camera also includes:
[0032] Isochronous transmission module: After the UVC device is turned on, the UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission;
[0033] The third sending module is used by the application layer processing process / remote server to parse, split, and splice the ISO packets of video data into video data, convert the format according to the configuration, and send it to the browser webpage.
[0034] The fourth sending module is used for operating UVC devices via browser web pages, sending operation content and parameters to the application layer processing process / remote server;
[0035] Creation module: Used by the application layer processing process / remote server to create a second USB packet and send it to the UVC device;
[0036] Parsing module: Used by UVC devices to parse the second USB packet and return the operation result to the application layer processing process / remote server;
[0037] Return module: Used by the application layer processing process / remote server to parse the operation result and return the result.
[0038] Furthermore, in the aforementioned device for browser access and control of a camera, the application layer processing process / remote server creates a first USB packet and opens the UVC device, including: the application layer processing process / remote server creates a first USB packet and opens the UVC device through control transmission.
[0039] Furthermore, in the aforementioned device for browser access and control of a camera, the application layer processing process / remote server creating a second USB packet and sending it to the UVC device includes: the application layer processing process / remote server creating a second USB packet and sending it to the UVC device via the UVC protocol.
[0040] A third aspect of the present invention also provides an electronic device comprising: a processor and a memory;
[0041] The processor executes a method for a browser to access and control a camera, as described above, by calling programs or instructions stored in the memory.
[0042] In a fourth aspect, the present invention also provides a computer-readable storage medium storing a program or instructions that cause a computer to perform a method for a browser to invoke and control a camera as described in any of the above claims.
[0043] The beneficial effects of this invention are as follows: This invention achieves remote adjustment of UVC cameras through virtualization and the addition of control channels, solving the problem of not being able to adjust UVC devices within the browser, thus improving the user experience and efficiency of using UVC cameras in the browser. It supports multiple UVC camera devices without requiring any modifications, allowing users to easily use various different UVC cameras in the browser. By sending modification information back to the terminal device through a custom protocol, it enables terminal operation of the UVC camera device, such as adjusting parameters like brightness, contrast, saturation, and white balance, improving the convenience and flexibility of using UVC cameras in the browser. Attached Figure Description
[0044] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts. It is obvious that the drawings described below are merely some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings.
[0045] Figure 1 This invention provides a method for browser access and control of a camera. Figure 1 ;
[0046] Figure 2 This invention provides a method for browser access and control of a camera. Figure 2 ;
[0047] Figure 3 A browser-based device for accessing and controlling a camera is provided as an embodiment of the present invention. Figure 1 ;
[0048] Figure 4 A browser-based device for accessing and controlling a camera is provided as an embodiment of the present invention. Figure 2 ;
[0049] Figure 5 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0050] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0051] Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts disclosed in this invention.
[0052] In the description of this invention, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. The terms "installed," "connected," and "linked" should be interpreted broadly; for example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art will understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0053] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of methods and systems consistent with some aspects of the invention as detailed in the appended claims.
[0054] This invention proposes a method, apparatus, electronic device, and storage medium for browser access and control of a camera, enabling browser access and control of a camera.
[0055] Method Implementation Examples
[0056] Figure 1 This invention provides a method for browser access and control of a camera. Figure 1 .
[0057] In a first aspect, the present invention provides a method for browser access and control of a camera, combined with Figure 1 It includes eight steps from S1 to S8:
[0058] S1: The UVC device is powered on, and the operating system begins to enumerate and initialize the UVC device.
[0059] Specifically, in this embodiment of the invention, UVC stands for USB Video Class, which is a USB device category for video devices. UVC defines a set of standards and specifications that enable video devices such as cameras and camcorders to communicate and interact with computers via USB interfaces. UVC devices can be powered on by plugging into the USB port of a computer terminal, and the operating system begins to enumerate and initialize UVC devices.
[0060] S2: Application layer processing / remote server initializes the system, starts web services, and listens for USB bus callbacks.
[0061] Specifically, in this embodiment of the invention, the application layer processing process or the remote server initializes the operating system, starts the web service and listens for USB bus callbacks. The web service can be opening a webpage in a browser.
[0062] S3: The application layer processing process / remote server sends a command to read the report descriptor to obtain the report descriptor of the UVC device, analyzes whether the report descriptor is a supported UVC device, and saves the UVC capabilities supported by the camera.
[0063] Specifically, in this embodiment of the invention, the application layer processing process / remote server sends a command to read the report descriptor to obtain the report descriptor of the UVC device, analyzes whether the report descriptor is a UVC device supported by the browser webpage, and saves the UVC capabilities supported by the camera.
[0064] S4: If the analysis result indicates that the UVC device is a supported UVC device, take over the UVC device at the USB bus driver and issue a reset command.
[0065] Specifically, in this embodiment of the invention, if the analysis result indicates that the UVC device is a UVC device supported by the browser webpage, the application layer processing process / remote server takes over the UVC device at the USB bus driver and issues a reset command.
[0066] S5: The UVC device performs a reset operation and re-enumerates UVC devices.
[0067] Specifically, in this embodiment of the invention, the UVC device performs a reset operation, and the operating system re-enumerates the UVC devices.
[0068] S6: The application layer processing process / remote server performs UVC device initialization, completes the UVC device driver in the business layer, stores the UVC device information in the device list, sends the UVC device online message to the browser webpage, and sends the device list to the browser webpage.
[0069] Specifically, in this embodiment of the invention, the equipment list may include the model of the UVC equipment, etc.
[0070] S7: The browser opens the UVC device and sends resolution and format information to the application layer processing process / remote server.
[0071] It should be understood that when a browser attempts to open a UVC device, the UVC device is not yet open; resolution and format information are sent to the application layer processing process / remote server.
[0072] S8: The application layer processing process / remote server creates the first USB packet and opens the UVC device.
[0073] Specifically, in this embodiment of the invention, the application layer processing process / remote server creates a corresponding USB packet based on the resolution and format information, and opens the UVC device through control transmission.
[0074] Figure 2 This invention provides a method for browser access and control of a camera. Figure 2 .
[0075] Furthermore, in the aforementioned method for browser access and control of the camera, after opening the UVC device, combined with... Figure 2 It also includes six steps, S21 to S26:
[0076] S21: The UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission.
[0077] Specifically, in this embodiment of the invention, after the UVC device is turned on by control transmission, the UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission.
[0078] S22: The application layer processing process / remote server parses, splits, and splices the ISO packets of video data into video data, converts the format according to the configuration, and sends it to the browser webpage.
[0079] Specifically, in this embodiment of the invention, after the application layer processing process / remote server receives the ISO packet of video data, it parses, splits, and splices the ISO packet of video data into video data, converts the format according to the configuration, and sends it to the browser webpage, where the browser webpage displays the video data of the UVC device.
[0080] S23: The browser webpage performs UVC device operations and sends operation content and parameters to the application layer processing process / remote server.
[0081] Specifically, in this embodiment of the invention, the browser webpage performs UVC device operations, sending operation content and parameters to the application layer processing process / remote server. The operation content can be taking pictures or recording videos, and the parameters can be setting brightness, contrast, saturation, and white balance, etc.
[0082] S24: The application layer processing process / remote server creates a second USB packet and sends it to the UVC device.
[0083] Specifically, in this embodiment of the invention, the application layer processing process / remote server creates a second USB packet based on the received operation content and parameters, and sends the second USB packet containing the operation content and parameters to the UVC device via the UVC protocol.
[0084] S25: The UVC device parses the second USB packet and returns the operation result to the application layer processing process / remote server.
[0085] Specifically, in this embodiment of the invention, the UVC device parses the second USB packet and returns the operation result to the application layer processing process / remote server.
[0086] S26: The application layer processing process / remote server parses the operation results and returns the results.
[0087] Specifically, in this embodiment of the invention, the application layer processing process / remote server parses the operation result and returns the result to enable UVC device operation on a browser webpage.
[0088] Furthermore, in the above-mentioned method for a browser to call and control a camera, the application layer processing process / remote server creates a first USB packet and opens the UVC device, including: the application layer processing process / remote server creates a first USB packet and opens the UVC device through control transmission.
[0089] Furthermore, in the above-mentioned method for a browser to call and control a camera, the application layer processing process / remote server creates a second USB packet and sends it to the UVC device, including: the application layer processing process / remote server creates a second USB packet and sends it to the UVC device via the UVC protocol.
[0090] Device Examples
[0091] Figure 3 A browser-based device for accessing and controlling a camera is provided as an embodiment of the present invention. Figure 1 .
[0092] A second aspect of the present invention provides an apparatus for a browser to access and control a camera, comprising:
[0093] Enumeration and initialization module 31: Used when the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device.
[0094] Specifically, in this embodiment of the invention, UVC stands for USB Video Class, which is a USB device category for video devices. UVC defines a set of standards and specifications that enable video devices such as cameras and camcorders to communicate and interact with computers via USB interfaces. UVC devices can be powered on by plugging into the USB port of a computer terminal. The operating system starts enumerating and initializing UVC devices through the enumeration and initialization module 31.
[0095] Callback module 32: Used for application layer processing / remote server system initialization, starting web services, and listening for USB bus callbacks.
[0096] Specifically, in this embodiment of the invention, the application layer processing process or the remote server initializes the operating system, and the callback module 32 starts the web service and listens for USB bus callbacks. The web service can be a webpage opened in a browser.
[0097] Acquisition module 33 and analysis module 34 are used to send a command to the application layer processing process / remote server to read the report descriptor of the UVC device, analyze whether the report descriptor is a supported UVC device, and save the UVC capabilities supported by the camera.
[0098] Specifically, in this embodiment of the invention, the application layer processing process / remote server acquisition module 33 sends a read report descriptor command to obtain the report descriptor of the UVC device, and the analysis module 34 analyzes whether the report descriptor is a UVC device supported by the browser webpage and saves the UVC capability supported by the camera.
[0099] Reset module 35: If the analysis result indicates that the UVC device is a supported UVC device, it takes over the UVC device at the USB bus driver and issues a reset command.
[0100] Specifically, in this embodiment of the invention, if the analysis result indicates that the UVC device is a UVC device supported by the browser webpage, the application layer processing process / remote server takes over the UVC device at the USB bus driver and issues a reset command to the reset module 35.
[0101] Re-enumeration module 36: Used to perform a reset operation on UVC devices and re-enumerate UVC devices.
[0102] Specifically, in this embodiment of the invention, the UVC device performs a reset operation, and the operating system's re-enumeration module 36 re-enumerates the UVC device.
[0103] First sending module 37: Used for the application layer processing process / remote server to perform UVC device initialization work, complete the UVC device driver in the business layer, store the UVC device information in the device list, send the UVC device online message to the browser webpage, and send the device list to the browser webpage.
[0104] Specifically, in this embodiment of the invention, the equipment list may include the model of the UVC equipment, etc.
[0105] The second sending module 38 is used to open the UVC device in the browser webpage and send resolution and format information to the application layer processing process / remote server.
[0106] It should be understood that when a browser performs the operation to open a UVC device, the UVC device has not yet been opened. The second sending module 38 sends resolution and format information to the application layer processing process / remote server.
[0107] Open module 39: Used for application layer processing / remote server to create the first USB packet and open the UVC device.
[0108] Specifically, in this embodiment of the invention, the application layer processing process / remote server creates a corresponding USB packet based on the resolution and format information, and the opening module 39 opens the UVC device through control transmission.
[0109] Figure 4 A browser-based device for accessing and controlling a camera is provided as an embodiment of the present invention. Figure 2 .
[0110] Furthermore, in the aforementioned device for browser access and control of the camera, combined with Figure 4 It also includes:
[0111] Isochronous transmission module 41: After the UVC device is turned on, the UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission.
[0112] Specifically, in this embodiment of the invention, after the UVC device is turned on by control transmission, the isochronous transmission module 41 of the UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission.
[0113] The third sending module 42 is used by the application layer processing process / remote server to parse, split, and splice the ISO packets of video data into video data, convert the format according to the configuration, and send it to the browser webpage.
[0114] Specifically, in this embodiment of the invention, after the application layer processing process / remote server receives the ISO packet of video data, it parses, splits, and splices the ISO packet of video data into video data, converts the format according to the configuration, and sends it to the browser webpage by the third sending module 42. The browser webpage displays the video data of the UVC device.
[0115] The fourth sending module 43 is used for operating UVC devices via browser web pages, sending operation content and parameters to the application layer processing process / remote server.
[0116] Specifically, in this embodiment of the invention, when a browser webpage performs UVC device operations, the fourth sending module 43 sends the operation content and parameters to the application layer processing process / remote server. The operation content can be taking a picture or recording a video, and the parameters can be setting brightness, contrast, saturation, and white balance, etc.
[0117] Create module 44: Used by the application layer processing process / remote server to create a second USB packet and send it to the UVC device.
[0118] Specifically, in this embodiment of the invention, the creation module 44 application layer processing process / remote server creates a second USB packet based on the received operation content and parameters, and sends the second USB packet containing the operation content and parameters to the UVC device through the UVC protocol.
[0119] Parsing module 45: Used by UVC devices to parse the second USB packet and return the operation result to the application layer processing process / remote server.
[0120] Specifically, in this embodiment of the invention, the parsing module 45 of the UVC device parses the second USB packet and returns the operation result to the application layer processing process / remote server.
[0121] Return module 46: Used by the application layer processing process / remote server to parse the operation result and return the result.
[0122] Specifically, in this embodiment of the invention, the application layer processing process / remote server parses the operation result and returns the result to enable UVC device operation on a browser webpage.
[0123] Furthermore, in the aforementioned device for browser access and control of a camera, the application layer processing process / remote server creates a first USB packet and opens the UVC device, including: the application layer processing process / remote server creates a first USB packet and opens the UVC device through control transmission.
[0124] Furthermore, in the aforementioned device for browser access and control of a camera, the application layer processing process / remote server creating a second USB packet and sending it to the UVC device includes: the application layer processing process / remote server creating a second USB packet and sending it to the UVC device via the UVC protocol.
[0125] Figure 5 This is a schematic block diagram of an electronic device provided in an embodiment of the present invention.
[0126] like Figure 5 As shown, the electronic device includes at least one processor 501, at least one memory 502, and at least one communication interface 503. The various components in the electronic device are coupled together via a bus system 504. The communication interface 503 is used for information transmission with external devices. It is understood that the bus system 504 is used to implement communication between these components. In addition to a data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 5 The general designated all buses as Bus System 504.
[0127] It is understood that the memory 502 in this embodiment can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0128] In some implementations, memory 502 stores elements such as executable units or data structures, or subsets thereof, or extended sets thereof: operating systems and applications.
[0129] The operating system includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application programs include various applications, such as media players and browsers, used to implement various application functions. The program implementing any of the methods in the browser-based method for calling and controlling a camera provided in this embodiment of the invention can be included in the application programs.
[0130] In this embodiment of the invention, the processor 501 executes the steps of various embodiments of the method for browser invocation and camera control provided by the present invention by calling the program or instructions stored in the memory 502, specifically, the program or instructions stored in the application.
[0131] When the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device.
[0132] The application layer processing / remote server initializes the system, starts the web service, and listens for USB bus callbacks.
[0133] The application layer processing process / remote server sends a command to read the report descriptor to obtain the report descriptor of the UVC device, analyzes whether the report descriptor is a supported UVC device, and saves the UVC capability supported by the camera.
[0134] If the analysis result indicates that the UVC device is a supported UVC device, the USB bus driver will take over the UVC device and issue a reset command.
[0135] The UVC device performs a reset operation and re-enumerates the UVC devices;
[0136] The application layer processing process / remote server performs UVC device initialization, completes the UVC device driver in the business layer, stores the UVC device information in the device list, sends the UVC device online message to the browser webpage, and sends the device list to the browser webpage;
[0137] The browser opens the UVC device and sends resolution and format information to the application layer processing process / remote server.
[0138] The application layer processing / remote server creates the first USB packet and opens the UVC device.
[0139] Any of the methods in the browser-based method for calling and controlling a camera provided in this embodiment of the invention can be applied to, or implemented by, the processor 501. The processor 501 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of the processor 501 or by instructions in software form. The processor 501 can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0140] The steps of any method in the browser-based method for calling and controlling a camera provided in this embodiment of the invention can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software units in the decoding processor. The software units can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. This storage medium is located in memory 502, and processor 501 reads the information in memory 502 and combines it with its hardware to complete the steps of the method.
[0141] Those skilled in the art will understand that although some embodiments described herein include certain features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention and form different embodiments.
[0142] Those skilled in the art will understand that the descriptions of the various embodiments have different focuses, and for parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0143] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention. All such modifications and variations fall within the scope defined by the appended claims. The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0144] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for a browser to access and control a camera, characterized in that, include: When the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device. The application layer processing / remote server initializes the system, starts the web service, and listens for USB bus callbacks. The application layer processing process / remote server sends a command to read the report descriptor to obtain the report descriptor of the UVC device, analyzes whether the report descriptor is a supported UVC device, and saves the UVC capability supported by the camera. If the analysis result indicates that the UVC device is a supported UVC device, the USB bus driver will take over the UVC device and issue a reset command. The UVC device performs a reset operation and re-enumerates the UVC devices; The application layer processing process / remote server performs UVC device initialization, completes the UVC device driver in the business layer, stores the UVC device information in the device list, sends the UVC device online message to the browser webpage, and sends the device list to the browser webpage; The browser opens the UVC device and sends resolution and format information to the application layer processing process / remote server. The application layer processing / remote server creates the first USB packet and opens the UVC device.
2. The method for browser access and control of a camera according to claim 1, characterized in that, After turning on the UVC device, the method further includes: UVC devices send ISO packets containing video data back to the application layer processing process / remote server by enabling isochronous transmission. The application layer processing process / remote server parses, splits, and splices the ISO packets of video data into video data, converts the format according to the configuration, and sends it to the browser webpage; The browser webpage operates the UVC device and sends the operation content and parameters to the application layer processing process / remote server; The application layer processing / remote server creates a second USB packet and sends it to the UVC device; The UVC device parses the second USB packet and returns the operation result to the application layer processing process / remote server; The application layer processing process / remote server parses the operation result and returns the result.
3. The method for browser access and control of a camera according to claim 1, characterized in that, The application layer processing process / remote server creates the first USB packet and opens the UVC device, including: the application layer processing process / remote server creates the first USB packet and opens the UVC device through control transfer.
4. A method for browser accessing and controlling a camera according to claim 2, characterized in that, The application layer processing process / remote server creates a second USB packet and sends it to the UVC device, including: the application layer processing process / remote server creates a second USB packet and sends it to the UVC device via the UVC protocol.
5. A device for a browser to access and control a camera, characterized in that, include: Enumeration and initialization module: Used when the UVC device is powered on, the operating system begins to enumerate and initialize the UVC device; Callback module: Used for application layer processing / remote server system initialization, starting web services, and listening for USB bus callbacks; Acquisition and Analysis Modules: These modules are used by the application layer processing process / remote server to send a command to read the report descriptor to obtain the report descriptor of the UVC device, analyze whether the report descriptor is a supported UVC device, and save the UVC capabilities supported by the camera. Reset module: If the analysis result indicates that the UVC device is a supported UVC device, the module takes over the UVC device at the USB bus driver and issues a reset command. Re-enumeration module: Used to perform a reset operation on UVC devices and re-enumerate UVC devices; The first sending module is used by the application layer processing process / remote server to perform UVC device initialization work, complete the UVC device driver in the business layer, store the UVC device information in the device list, send the UVC device online message to the browser webpage, and send the device list to the browser webpage. The second sending module is used to open the UVC device in the browser webpage and send resolution and format information to the application layer processing process / remote server. Open module: Used by the application layer processing process / remote server to create the first USB packet and open the UVC device.
6. The device for browser access and control of a camera according to claim 5, characterized in that, Also includes: Isochronous transmission module: After the UVC device is turned on, the UVC device returns ISO packets of video data to the application layer processing process / remote server by enabling isochronous transmission; The third sending module is used by the application layer processing process / remote server to parse, split, and splice the ISO packets of video data into video data, convert the format according to the configuration, and send it to the browser webpage. The fourth sending module is used for operating UVC devices via browser web pages, sending operation content and parameters to the application layer processing process / remote server; Creation module: Used by the application layer processing process / remote server to create a second USB packet and send it to the UVC device; Parsing module: Used by UVC devices to parse the second USB packet and return the operation result to the application layer processing process / remote server; Return module: Used by the application layer processing process / remote server to parse the operation result and return the result.
7. The device for browser access and control of a camera according to claim 5, characterized in that, The application layer processing process / remote server creates the first USB packet and opens the UVC device, including: the application layer processing process / remote server creates the first USB packet and opens the UVC device through control transfer.
8. The device for browser access and control of a camera according to claim 6, characterized in that, The application layer processing process / remote server creates a second USB packet and sends it to the UVC device, including: the application layer processing process / remote server creates a second USB packet and sends it to the UVC device via the UVC protocol.
9. An electronic device, characterized in that, include: Processor and memory; The processor executes a method for a browser to invoke and control a camera as described in any one of claims 1 to 4 by calling programs or instructions stored in the memory.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program or instructions that cause a computer to perform a method for a browser to invoke and control a camera as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Method and device for utilizing camera in browser
CN102789561A
Camera calling method, electronic equipment and camera
CN113873140A