UVC transmission method, device, equipment and storage medium based on Android device

By implementing the backend service and system attribute monitoring mechanism in the Android system, and automatically configuring the Android device as a UVC camera, the configuration and compatibility problems of UVC cameras in the existing technology are solved, and the automatic configuration and user experience are improved.

CN119052419BActive Publication Date: 2025-04-18GUANGZHOU BAOLUN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411118772.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2025-04-18
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

In the prior art, configuration and compatibility issues of UVC cameras have caused users to be unable to use them normally in scenarios such as video conferencing and webcams, and developing external hardware cameras requires additional hardware design and manufacturing costs.

Method used

By implementing the background service and system attribute monitoring mechanism in the Android system, the Android device is automatically configured as a UVC camera, the camera parameters are obtained, and the UVC transmission stream is configured.

Benefits of technology

It realizes automatic configuration of UVC cameras on Android devices without manual user intervention, simplifies the device configuration process, improves user experience, and reduces the cost of hardware design and compatibility testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119052419B_ABST
    Figure CN119052419B_ABST
Patent Text Reader

Abstract

The UVC transmission method, device, equipment and storage medium based on Android devices provided by the present invention start a background service in response to a power-on broadcast, and the background service is used to manage the UVC configuration of the Android device to be configured; when the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service; the camera parameters of the Android device to be configured are obtained; and the UVC transmission stream is configured according to the camera parameters. Through the automated background service and system attribute monitoring mechanism, the solution of the present invention can automatically configure the Android device as a UVC camera after the device is started, without manual intervention by the user, which greatly simplifies the configuration process of the device and improves the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of UVC transmission technology, and in particular to a UVC transmission method, device, equipment and storage medium based on an Android device. Background Art

[0002] In the existing technology, UVC (USB Video Device Class) cameras are widely used in video conferencing, webcams, surveillance cameras and other scenarios due to their plug-and-play features. This standardized interface protocol enables the device to be compatible with various operating systems and hardware platforms without the need for additional drivers, greatly improving the user's convenience.

[0003] However, in the process of implementing the UVC function, the existing technical solutions have some shortcomings. Common solutions include installing third-party application solutions and external hardware camera solutions. Third-party applications may not be compatible with all device models or operating system versions, resulting in some users being unable to use this function normally. The development and integration of external hardware cameras requires additional hardware design and manufacturing costs, and involves complex hardware compatibility testing and debugging.

[0004] In summary, the problems existing in the prior art need to be solved urgently. Summary of the invention

[0005] The present invention provides a UVC transmission method, device, equipment and storage medium based on an Android device, so as to solve the defects in the prior art and directly realize the UVC function in the Android system.

[0006] The present invention provides a UVC transmission method based on an Android device, comprising:

[0007] In response to the power-on broadcast, a background service is started, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0008] When the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service;

[0009] Obtain the camera parameters of the Android device to be configured;

[0010] Configure the UVC transmission stream according to the camera parameters.

[0011] According to a UVC transmission method based on an Android device provided by the present invention, before the step of starting the background service in response to the boot broadcast, the method further includes:

[0012] Load the initialization script file;

[0013] The system properties are initialized according to the initialization script file.

[0014] According to a UVC transmission method based on an Android device provided by the present invention, when the system attribute changes to UVC, after the step of configuring the Android device to be configured to the UVC working mode through the background service, the method further includes:

[0015] The system properties are monitored through the monitoring instructions in the initialization script file.

[0016] According to a UVC transmission method based on an Android device provided by the present invention, when the system attribute changes to UVC, the step of configuring the Android device to be configured to the UVC working mode through the background service specifically includes:

[0017] Create a device node folder in the initialization script file, wherein the node folder includes a property file;

[0018] Initialize the property file according to the preset.

[0019] According to a UVC transmission method based on an Android device provided by the present invention, the step of obtaining the camera parameters of the Android device to be configured specifically includes:

[0020] The camera parameters of the Android device to be configured are obtained through the V4L2 standard interface, where the camera parameters include resolution and data format.

[0021] According to a UVC transmission method based on an Android device provided by the present invention, the step of configuring the UVC transmission stream according to the camera parameters specifically includes:

[0022] Setting a memory buffer, wherein the memory buffer is used to cache transmission data;

[0023] According to the resolution and the data format, the node folder is configured to a desired video format for UVC transmission.

[0024] According to a UVC transmission method based on an Android device provided by the present invention, after the step of configuring the UVC transmission stream according to the camera parameters, the method further includes:

[0025] Establishing a communication connection between the V4L2 standard interface and the device node folder;

[0026] The device status of the Android device to be configured is monitored through the V4L2 standard interface.

[0027] The present invention also provides a UVC transmission device based on an Android device, comprising:

[0028] A background service module, used to start a background service in response to a power-on broadcast, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0029] A device configuration module, used for configuring the Android device to be configured to a UVC working mode through the background service when the system attribute changes to UVC;

[0030] A parameter acquisition module, used to acquire the camera parameters of the Android device to be configured;

[0031] The parameter configuration module is used to configure the UVC transmission stream according to the camera parameters.

[0032] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the UVC transmission method based on an Android device as described above is implemented.

[0033] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the UVC transmission method based on an Android device as described in any one of the above is implemented.

[0034] The present invention also provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned UVC transmission methods based on an Android device.

[0035] The UVC transmission method, device, equipment and storage medium based on Android devices provided by the present invention start a background service in response to a power-on broadcast, and the background service is used to manage the UVC configuration of the Android device to be configured; when the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service; the camera parameters of the Android device to be configured are obtained; and the UVC transmission stream is configured according to the camera parameters. Through the automated background service and system attribute monitoring mechanism, the solution of the present invention can automatically configure the Android device as a UVC camera after the device is started, without manual intervention by the user, which greatly simplifies the configuration process of the device and improves the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0037] Figure 1 It is a flow chart of the UVC transmission method based on Android device provided by the present invention;

[0038] Figure 2 It is a structural schematic diagram of a UVC transmission device based on an Android device provided by the present invention;

[0039] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0040] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] In the existing technology, UVC (USB Video Device Class) cameras are widely used in video conferencing, webcams, surveillance cameras and other scenarios due to their plug-and-play features. This standardized interface protocol enables the device to be compatible with various operating systems and hardware platforms without the need for additional drivers, greatly improving the user's convenience.

[0042] However, in the process of realizing UVC function, the existing technical solutions have some shortcomings. Common solutions include:

[0043] Install a third-party application solution: This solution relies on installing a dedicated third-party application on the device to configure the device as a UVC camera. However, this approach has many problems:

[0044] Compatibility issues: Third-party apps may not be compatible with all device models or operating system versions, resulting in some users being unable to use this feature properly.

[0045] High resource consumption: Such applications usually occupy the device's CPU, memory and other system resources. Especially on low-performance devices, they may significantly affect the overall performance of the device, causing problems such as slow operation and heating.

[0046] Security risks: Third-party applications may involve calls to camera permissions, which poses a security risk. Especially during the development and release of the application, if there is no strict security review, it may bring risks of privacy leakage to users.

[0047] External hardware camera solution: Another common solution is to use an external UVC hardware camera to meet the needs of users in different scenarios. However, this solution also has its inherent limitations:

[0048] High development cost: Developing and integrating external hardware cameras requires additional hardware design and manufacturing costs, and involves complex hardware compatibility testing and debugging.

[0049] Poor compatibility: External hardware cameras may not always be compatible with all devices and systems, especially between devices of different brands and models. There may be problems with interface mismatch or driver unsupport.

[0050] Power management requirements: External cameras usually require additional power support, which not only increases the complexity of hardware design, but also requires consideration of device battery life and power management issues, affecting user portability and usage experience.

[0051] In order to solve the problems in the prior art, the present invention proposes a UVC transmission method based on an Android device to implement a UVC function based on an Android system. The UVC transmission method based on an Android device is described below. Figure 1 As shown, including but not limited to the following steps:

[0052] Step 110: In response to the power-on broadcast, start a background service, where the background service is used to manage the UVC configuration of the Android device to be configured.

[0053] In step 110, during the system startup process, in response to the boot broadcast, the system will start a dedicated background service. The main task of the background service is to manage the UVC configuration process of the Android device. After startup, the background service will keep running, continuously monitor the changes in the system status and related properties, and ensure that the UVC configuration operation is performed at the appropriate time.

[0054] Specifically, the background service can use a broadcast receiver in the Java code of the application layer to listen to the system's boot broadcast (such as BOOT_COMPLETED broadcast), and once this broadcast is captured, the service is started. The service can also call the underlying code through JNI to manage the UVC configuration.

[0055] Step 120: When the system attribute changes to UVC, the Android device to be configured is configured to a UVC working mode through the background service.

[0056] In step 120, when the system detects that the value of a specific system property (such as sys.usb.config) becomes "UVC", the background service will enter the working state and start to configure the UVC working mode of the device.

[0057] Specifically, the system can set and monitor changes in system properties through initialization scripts (such as init.rc). Once the property changes and matches the "UVC" value, the service will start a configuration script to complete the UVC-related configuration process, such as creating necessary folders and files, setting the initial parameters of the camera, etc., so that the device can be recognized as a UVC camera by external devices.

[0058] Step 130: Obtain camera parameters of the Android device to be configured.

[0059] In step 130, after the device is configured in UVC mode, the system needs to obtain detailed parameters from the camera. These parameters include the maximum resolution, frame rate, data format, etc. supported by the camera. Through the V4L2 standard interface, the system can call the relevant API to obtain these parameters, which provides accurate data support for subsequent video stream configuration.

[0060] Step 140: Configure the UVC transmission stream according to the camera parameters.

[0061] In step 140, based on the acquired camera parameters, the system configures the UVC transmission stream. During the configuration process, the system calls the V4L2 interface to set the parameters on the UVC node to ensure that the video stream can be transmitted in the correct format. The completion of this step indicates that the device is ready to transmit video data to external devices through the UVC interface, and application scenarios such as video conferencing and monitoring can operate normally.

[0062] It is understandable that the background service in the present invention is mainly divided into the following steps:

[0063] 1. Listen to the boot broadcast, respond to the boot broadcast, and then start the background service;

[0064] 2. The background service calls the serprop command to modify the system property (sys.usb.config) to uvc, which automatically triggers the uvc configuration script. The configuration script is part of the system / system / init.rc file. The script includes the configuration of the UVC data stream. After the script is executed, a video device node for transmitting data to UVC is generated;

[0065] 3. Start the thread, which obtains the camera device node and UVC device node of the Android device, obtains the data format (resolution, format, etc.) of the camera and the data format of UVC, configures the memory buffer, and binds the UVC device node's connection establishment, stream opening, disconnection, and stream closing events to the node through the ioctl function, then monitors these events through select, and then calls the corresponding function for processing;

[0066] 4. Initialize the device UVC transmission stream and control endpoint;

[0067] 5. Process the data from the host computer, usually modifying the transmission stream format and configuring the camera;

[0068] 6. Apply for uvc buffer space and continuously write the camera node data to the uvc device node;

[0069] 7. Stop reading and writing data and cancel data mapping.

[0070] The UVC transmission method based on Android devices provided by the present invention starts a background service in response to a startup broadcast, and the background service is used to manage the UVC configuration of the Android device to be configured; when the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service; the camera parameters of the Android device to be configured are obtained; and the UVC transmission stream is configured according to the camera parameters. Through the automated background service and system attribute monitoring mechanism, the solution of the present invention can automatically configure the Android device as a UVC camera after the device is started, without the need for manual intervention by the user, which greatly simplifies the configuration process of the device and improves the user experience.

[0071] As a further optional embodiment, before the step of starting the background service in response to the power-on broadcast, the method further includes:

[0072] Load the initialization script file;

[0073] The system properties are initialized according to the initialization script file.

[0074] In this embodiment, after the device is started, the system first loads the initialization script file. The initialization script file contains the configuration instructions and initialization parameters required for system startup, which are used to ensure that the system can be correctly loaded and enter the working state. After loading the initialization script file, the system performs initialization operations on the system properties according to the configuration instructions defined in the file. The purpose of this step is to lay the foundation for the subsequent working mode configuration of the device, and by setting the initial system properties, ensure that the device can enter the appropriate working state according to the predefined logic.

[0075] By adding the above steps, the device can complete the initialization of system properties during the startup process, providing necessary preparation and support for subsequent UVC configuration and background service startup. This not only improves the reliability and stability of system startup, but also ensures that the device can enter the UVC working mode as expected, further enhancing the device's automatic configuration capabilities.

[0076] As a further optional embodiment, when the system property changes to UVC, after the step of configuring the Android device to be configured to the UVC working mode through the background service, the method further includes:

[0077] The system properties are monitored through the monitoring instructions in the initialization script file.

[0078] After completing the configuration of the UVC working mode, the system continues to monitor system properties (such as sys.usb.config) through the monitoring instructions (such as onproperty) preset in the initialization script file. This monitoring mechanism can detect changes in system properties in real time, thereby ensuring that when the properties change, the system can respond immediately to maintain or adjust the working status of the device.

[0079] By continuously monitoring changes in system properties, the system can promptly detect and respond to any events that may affect the UVC configuration, ensuring that the device is always in the best working condition. This not only improves the reliability of the device, but also provides a basis for dynamic adjustment of the device in different usage scenarios, further improving the automated management and adaptability of the device.

[0080] As a further optional embodiment, when the system property changes to UVC, the step of configuring the Android device to be configured to the UVC working mode through the background service specifically includes:

[0081] Create a device node folder in the initialization script file, wherein the node folder includes a property file;

[0082] Initialize the property file according to the preset.

[0083] In the present embodiment, the system predefines instructions in the initialization script file so as to automatically create a device node folder during the system startup process. The device node folder is used to store files and data related to the UVC configuration, which is a necessary condition for the device to be identified as a UVC camera. In the device node folder, the system generates and configures a series of property files. The property file usually contains information about the device configuration, data format, transmission stream parameters, etc., which are essential for the normal operation of the device and for being identified as a UVC device by an external system. After creating the device node folder and property file, the system initializes these property files according to the preset in the initialization script file. Initialization includes setting initial values ​​for the property file, which can be parameters required for the UVC mode configuration, such as camera resolution, data format, transmission rate, etc.

[0084] When configuring the UVC working mode, the system can automatically create a device node folder and property file and initialize it according to the preset. This ensures that the device has the necessary configuration conditions during the startup process so that it can be recognized as a UVC camera by external devices. This design not only improves the automation of the configuration process, but also enhances the stability and compatibility of the system.

[0085] As a further optional embodiment, the step of obtaining the camera parameters of the Android device to be configured specifically includes:

[0086] The camera parameters of the Android device to be configured are obtained through the V4L2 standard interface, where the camera parameters include resolution and data format.

[0087] In this embodiment, the system communicates with the camera built into the Android device through a video device interface (Video4Linux2, referred to as V4L2). V4L2 is a standard interface for capturing video data, allowing the system to obtain various parameters of the camera.

[0088] During the communication with the camera, the system will obtain key parameters such as the resolution and data format supported by the camera. Resolution refers to the image size that the camera can capture, while the data format involves the encoding method of the image or video, such as YUV, MJPEG, etc. These parameters are very important for the subsequent configuration of the UVC transport stream, because they directly affect whether the device can be correctly identified and used by external devices.

[0089] By specifying these steps, the system can accurately obtain the hardware parameters of the Android device camera, thus laying the foundation for configuring the UVC transmission stream. This ensures that the video data can be transmitted through the UVC interface in the correct format and resolution, ensuring the compatibility and stability of the device in different application scenarios.

[0090] As a further optional embodiment, the step of configuring the UVC transmission stream according to the camera parameters specifically includes:

[0091] Setting a memory buffer, wherein the memory buffer is used to cache transmission data;

[0092] According to the resolution and the data format, the node folder is configured to a desired video format for UVC transmission.

[0093] In this embodiment, before configuring the UVC transmission stream, the system first needs to set up a memory buffer for the video data. The memory buffer is used to temporarily store the data collected from the camera to ensure that the data can be smoothly transmitted to the UVC interface to avoid data loss or transmission delay. The size of the memory buffer can be dynamically adjusted according to the resolution and frame rate of the camera to meet the data transmission requirements in different scenarios.

[0094] After setting up the memory buffer, the system will configure the property files in the device node folder according to the resolution and data format acquired by the camera. Specifically, the system will configure these property files to the required video format so that during UVC transmission, the video stream can be recognized and used by external devices in the correct format and resolution. This step ensures the transmission quality and compatibility of video data, allowing the device to work stably in different operating environments.

[0095] As a further optional embodiment, after the step of configuring the UVC transmission stream according to the camera parameters, the method further includes:

[0096] Establishing a communication connection between the V4L2 standard interface and the device node folder;

[0097] The device status of the Android device to be configured is monitored through the V4L2 standard interface.

[0098] In this embodiment, after configuring the UVC transmission stream, the system needs to ensure that the V4L2 standard interface can effectively communicate with the device node folder. This step involves establishing a stable communication connection between the V4L2 interface and the device node folder in the Android device (usually including the node file of the camera device) so that the system can manage and transmit video data through the interface.

[0099] After establishing the communication connection, the system will use the V4L2 standard interface to continuously monitor the device status of the Android device. The monitoring content may include the device's connection status, data transmission status, camera opening or closing, and other events that may affect the UVC transmission stream. By monitoring the device status in real time, the system can respond to various changes in a timely manner to ensure the normal operation of the UVC camera function.

[0100] This embodiment adds the real-time monitoring capability of the device status, so that the system can respond quickly when the device status changes, and improves the stability and reliability of the device. This not only improves the user experience, but also enhances the adaptability and compatibility of the system in a variety of complex environments.

[0101] The UVC transmission device based on Android device provided by the present invention is described below. Figure 2As shown, the UVC transmission device based on an Android device described below and the UVC transmission method based on an Android device described above can correspond to each other.

[0102] A UVC transmission device based on an Android device, comprising:

[0103] A background service module 210, for starting a background service in response to a power-on broadcast, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0104] The device configuration module 220 is used to configure the Android device to be configured to the UVC working mode through the background service when the system attribute changes to UVC;

[0105] The parameter acquisition module 230 is used to acquire the camera parameters of the Android device to be configured;

[0106] The parameter configuration module 240 is used to configure the UVC transmission stream according to the camera parameters.

[0107] Figure 3 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 3 As shown, the electronic device may include: a processor 310, a communications interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communications interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the UVC transmission method based on the Android device, and the method includes:

[0108] In response to the power-on broadcast, a background service is started, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0109] When the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service;

[0110] Obtain the camera parameters of the Android device to be configured;

[0111] Configure the UVC transmission stream according to the camera parameters.

[0112] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0113] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the UVC transmission method based on an Android device provided by the above methods, the method includes:

[0114] In response to the power-on broadcast, a background service is started, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0115] When the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service;

[0116] Obtain the camera parameters of the Android device to be configured;

[0117] Configure the UVC transmission stream according to the camera parameters.

[0118] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the UVC transmission method based on an Android device provided by the above methods is implemented, and the method includes:

[0119] In response to the power-on broadcast, a background service is started, wherein the background service is used to manage the UVC configuration of the Android device to be configured;

[0120] When the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service;

[0121] Obtain the camera parameters of the Android device to be configured;

[0122] Configure the UVC transmission stream according to the camera parameters.

[0123] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0124] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0125] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A UVC transmission method based on Android device, characterized in that: include: In response to the power-on broadcast, a background service is started, wherein the background service is used to manage the UVC configuration of the Android device to be configured; When the system attribute changes to UVC, the Android device to be configured is configured to the UVC working mode through the background service; Obtain the camera parameters of the Android device to be configured; Configure the UVC transmission stream according to the camera parameters; The step of configuring the Android device to be configured to the UVC working mode through the background service specifically includes: Starting a UVC configuration script through the background service, wherein the UVC configuration script is generated based on an initialization script file; Generate a device node for transmitting data to UVC through the UVC configuration script file, and generating a device node folder in the initialization script file, wherein the device node folder includes a property file; The step of configuring the UVC transmission stream according to the camera parameters specifically includes: Set the camera parameters to the UVC node and set the memory buffer; According to the camera parameters, the property file in the device node folder is configured to configure the property file to the required video format.

2. The UVC transmission method based on Android device according to claim 1, characterized in that, Before the step of starting the background service in response to the power-on broadcast, the method further includes: Load the initialization script file; Initialize system properties according to the initialization script file.

3. The UVC transmission method based on Android device according to claim 2, characterized in that, When the system property changes to UVC, after the step of configuring the Android device to be configured to the UVC working mode through the background service, the method further includes: The system properties are monitored through the monitoring instructions in the initialization script file.

4. The UVC transmission method based on Android device according to claim 3, characterized in that, When the system property changes to UVC, the step of configuring the Android device to be configured to the UVC working mode through the background service specifically includes: Create a device node folder in the initialization script file, wherein the node folder includes a property file; Initialize the property file according to the preset.

5. The UVC transmission method based on Android device according to claim 4, characterized in that, The step of obtaining the camera parameters of the Android device to be configured specifically includes: The camera parameters of the Android device to be configured are obtained through the V4L2 standard interface, where the camera parameters include resolution and data format.

6. The UVC transmission method based on Android device according to claim 5, characterized in that: The step of configuring the UVC transmission stream according to the camera parameters specifically includes: Setting a memory buffer, wherein the memory buffer is used to cache transmission data; According to the resolution and the data format, the node folder is configured to a desired video format for UVC transmission.

7. The UVC transmission method based on Android device according to claim 6, characterized in that: After the step of configuring the UVC transmission stream according to the camera parameters, the method further includes: Establishing a communication connection between the V4L2 standard interface and the device node folder; The device status of the Android device to be configured is monitored through the V4L2 standard interface.

8. A UVC transmission device based on an Android device, characterized in that: include: A background service module, used to start a background service in response to a power-on broadcast, wherein the background service is used to manage the UVC configuration of the Android device to be configured; A device configuration module, used for configuring the Android device to be configured to a UVC working mode through the background service when the system attribute changes to UVC; A parameter acquisition module, used to acquire the camera parameters of the Android device to be configured; A parameter configuration module, used to configure the UVC transmission stream according to the camera parameters; The step of configuring the Android device to be configured to the UVC working mode through the background service specifically includes: Starting a UVC configuration script through the background service, wherein the UVC configuration script is generated based on an initialization script file; Generate a device node for transmitting data to UVC through the UVC configuration script file, and generating a device node folder in the initialization script file, wherein the device node folder includes a property file; The step of configuring the UVC transmission stream according to the camera parameters specifically includes: Set the camera parameters to the UVC node and set the memory buffer; According to the camera parameters, the property file in the device node folder is configured to configure the property file to the required video format.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the UVC transmission method based on an Android device as described in any one of claims 1 to 7 is implemented.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the UVC transmission method based on an Android device as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • System attribute monitoring method, terminal device and computer-readable storage medium

    CN108052401A

  • UVC Camera driver implementation system and method based on V4L2 framework

    CN108255749A