Virtual camera shooting method and system based on Android system, terminal and storage medium
By configuring the playback attributes and target video address on the Android system, and using the hook mechanism to automatically detect and play virtual camera events, it solves the problem of manual setting of virtual cameras in the existing technology, realizes automated operations, and improves efficiency and application prospects.
Patent Information
- Application Number
- CN202410812321.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-21
- Publication Date
- 2024-09-10
AI Technical Summary
Existing virtual camera technology requires manual settings, and the operation steps are cumbersome and difficult to automate.
The virtual camera method based on the Android system detects the camera operation events of third-party applications by configuring the playback attributes and the storage address of the target video, and uses the hook mechanism to automatically play the target video to achieve automatic detection and playback.
No manual settings are required, it can automatically detect camera operation events from third-party applications, and quickly convert from live broadcast to recorded broadcast. The design principle is reliable, the structure is simple, and it has broad application prospects.
Smart Images

Figure CN118632117A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of virtual camera, and in particular relates to a virtual camera method, system, terminal and storage medium based on Android system. Background Art
[0002] A virtual camera is a real software camera that can simulate a "real" camera and successfully fool most video chat software, such as Microsoft Netmeeting, CU-Seeme, etc. In this way, even if there is no camera setting on the computer, these software can still be used to simulate video.
[0003] For example, after installing the virtual camera software, right-click the camera icon in the system tray area, select Show Panel, and the Softcam main window will pop up (you can also directly click Luminositi→Softcam in the start menu). Confirm that the two buttons on the top are placed at Play and Stored respectively, and then click Titles to pop up the Titles panel. Listed here are various animations built into the software. Select any one and click the Play button at the bottom, and the "My Display Picture" window will start playing lively and interesting animations.
[0004] This type of virtual camera needs to be manually set up, and the operation steps are relatively cumbersome. Summary of the invention
[0005] In view of the above-mentioned deficiencies in the prior art, the present invention provides a virtual camera method, system, terminal and storage medium based on the Android system to solve the above-mentioned technical problems.
[0006] In a first aspect, the present invention provides a virtual camera method based on an Android system, comprising: Configure playback attributes and write the playback attributes and the storage address of the target video into a configuration file; When it is detected that a third-party application is started, the configuration file is read and the read data is saved as a local variable, and the third-party application has the permission to read and write the memory card; An event of binding the camera to the third-party application is detected through a hook, the incoming object parameters are saved locally, and a new empty object is created and assigned to the object parameters; The event of the third-party application calling the camera is detected through the hook, and the player is called to play the target video based on the local variable.
[0007] In an optional implementation, configuring the playback attributes and writing the playback attributes and the storage address of the target video into a configuration file includes: Extracting a storage address of the target video based on a selection instruction of the target video; Set playback attributes, including volume and whether to play in a loop; The playback attributes are saved to VideoListBean, and the data in VideoListBean is written to sdcard to generate a configuration file.
[0008] In an optional implementation, when it is detected that a third-party application is started, after reading the configuration file and saving the read data as a local variable, the method includes: A timer is added to cyclically read the data of the configuration file, and the changed new data is updated to the local variables.
[0009] In an optional implementation, an event of binding the camera to the third-party application is detected through a hook, the incoming object parameters are saved locally, and a new empty object is assigned to the object parameters, including: When a third-party application calls the setPreviewDisplay interface in the Camera class, the Camera object and SurfaceHolder object are saved locally and used when the camera calls startPreview; a new empty SurfaceHolder is created and assigned to the original SurfaceHolder parameter; When a third-party application calls the setPreviewTexture interface in the Camera class, the incoming Camera object and SurfaceTexture object are saved locally for use when the camera calls startPreview; a new empty SurfaceTexture is created and assigned to the original incoming SurfaceTexture parameter; When a third-party application is detected calling the addTarget interface of Camera2, the incoming Surface object is saved locally for use when Camera2 calls CaptureRequest.build; a new empty Surface is assigned to the original incoming Surface parameter.
[0010] In an optional implementation, detecting an event in which the third-party application calls a camera through a hook, and calling a player to play the target video based on the local variable, includes: When the startPreview method of the camera is detected to be called, it is confirmed that the SurfacHolder or SurfaceTexture object is obtained, the storage address and the playback attribute in the local variable are read, and the storage address and the playback attribute are sent to the player so that the player plays the target video under the storage address according to the playback attribute; When it is detected that a third-party application calls the onPreviewFrame method, the camera resolution is read to determine whether the resolution of the target video matches the camera resolution. If the two do not match, the video frame of the target video is decoded, and the decoded video frame binary data is copied to the parameters of the video preview frame to achieve video playback; When it is detected that a third-party application calls the build interface of Camera2, confirm that the Surface parameter in the addTarget method exists, read the storage address and playback attributes in the local variables, and send the storage address and playback attributes to the player so that the player plays the target video under the storage address according to the playback attributes.
[0011] In a second aspect, the present invention provides a virtual camera system based on an Android system, comprising: A configuration generation module, used for configuring playback attributes and writing the playback attributes and the storage address of the target video into a configuration file; A configuration cache module is used to read the configuration file and save the read data as a local variable when detecting that a third-party application is started, and the third-party application has the permission to read and write the memory card; A first setting module is used to detect the event of the third-party application binding the camera through a hook, save the incoming object parameters locally, and create an empty object to assign the object parameters; The second setting module is used to detect the event of the third-party application calling the camera through a hook, and call the player to play the target video based on the local variable.
[0012] In an optional implementation, the configuration generation module includes: An address extraction unit, used for extracting a storage address of a target video based on a selection instruction of the target video; The property setting unit is used to set the playing properties, wherein the playing properties include volume and whether to play in a loop; The file generating unit is used to save the playing attribute to VideoListBean, write the data in VideoListBean to sdcard, and generate a configuration file.
[0013] In an optional embodiment, the system further includes: The data updating module is used to add a timer to cyclically read the data of the configuration file and update the changed new data to the local variables.
[0014] In a third aspect, a terminal is provided, including: processor, memory, wherein: The memory is used to store computer programs. The processor is used to call and run the computer program from the memory, so that the terminal executes the above-mentioned terminal method.
[0015] According to a fourth aspect, a computer storage medium is provided, wherein the computer-readable storage medium stores instructions, and when the instructions are executed on a computer, the computer executes the methods described in the above aspects.
[0016] The beneficial effect of the present invention is that the virtual camera method, system, terminal and storage medium based on the Android system provided by the present invention can automatically detect the operation events of the camera by the third-party application used for live broadcast without manual setting, and automatically play the target video based on the detection result, and quickly convert from live broadcast to recorded broadcast.
[0017] In addition, the invention has a reliable design principle, a simple structure and a very broad application prospect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0019] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention.
[0020] Figure 2 is a schematic block diagram of a system according to an embodiment of the present invention.
[0021] Figure 3 A schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only 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 should fall within the scope of protection of the present invention.
[0023] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0024] The professional terms involved in this invention include: Hook is a system mechanism provided by Windows to replace the "interrupt" in DOS. It is translated into Chinese as "hook" or "hook". After hooking a specific system event, once the hooked event occurs, the program that hooks the event will receive a notification from the system, and the program can respond to the event immediately.
[0025] SurfaceHolder is an interface for managing SurfaceView. It provides methods and callback functions for accessing the underlying Surface to control the display, drawing, and refresh operations of SurfaceView.
[0026] The main functions of SurfaceHolder include: Controlling the creation and destruction of Surface: Through SurfaceHolder, a new Surface can be created, or an existing Surface can be destroyed. For example, when SurfaceView is created, SurfaceHolder can be used to obtain and set the relevant parameters of Surface. Controlling the drawing and refreshing of Surface: Through SurfaceHolder, a Canvas object can be obtained, and custom drawing functions can be implemented by drawing operations on Canvas. At the same time, through the callback function of SurfaceHolder, Surface change events, such as size changes, visibility changes, etc., can be monitored, so that refresh operations can be performed in time when needed. Controlling the display and hiding of Surface: Through SurfaceHolder, the visibility of Surface can be set to control the display and hiding of Surface. For example, when the visibility of SurfaceView changes, SurfaceHolder can be used to control the display or hiding of Surface. In short, SurfaceHolder is an important interface connecting SurfaceView and the underlying Surface. Through it, Surface can be managed and controlled, and custom drawing and refreshing operations of SurfaceView can be implemented.
[0027] Surface means surface layer, as the name implies, SurfaceView refers to a View object on the surface. Why is it on the surface? This is because it is a little special and different from other Views. Other Views are drawn on the surface, while SurfaceView acts as the "surface" itself.
[0028] The drawing principle of SurfaceView is to lock the canvas (get the canvas) before drawing, then unlock the canvas after all drawing is completed, and finally display the canvas content on the screen.
[0029] The virtual camera method based on the Android system provided in the embodiment of the present invention is executed by a computer device, and accordingly, the virtual camera system based on the Android system runs in the computer device.
[0030] Figure 1 is a schematic flow chart of a method according to an embodiment of the present invention. Figure 1 The execution subject can be a virtual camera system based on the Android system. According to different requirements, the order of the steps in the flow chart can be changed, and some can be omitted.
[0031] like Figure 1 As shown, the method includes: Step 110, configuring the playback attributes and writing the playback attributes and the storage address of the target video into a configuration file; Step 120, when it is detected that a third-party application is started, the configuration file is read and the read data is saved as a local variable, and the third-party application has the permission to read and write the memory card; Step 130, detecting the event of the third-party application binding to the camera through the hook, saving the incoming object parameters locally, and creating an empty object to assign values to the object parameters; Step 140: Detect, through a hook, an event in which the third-party application calls the camera, and call a player to play the target video based on the local variable.
[0032] To facilitate understanding of the present invention, the virtual camera method based on the Android system provided by the present invention is further described below based on the principle of the virtual camera method based on the Android system provided by the present invention in combination with embodiments.
[0033] Specifically, the virtual camera method based on the Android system includes: Step 1: In the virtual camera application, select the local video or video list to be played, and set the playback volume, loop playback, and other properties. Save the set video properties to VideoListBean, and when the play button is clicked, write the data in VideoListBean to sdcard and generate a configuration file for use by third-party applications.
[0034] Step 2: When a third-party application is detected to be started, if the third-party application has the permission to read and write sdcard, it will read the video information in the configuration file, read the address and name of the video to be played, and save them to local variables. At the same time, a timer will be added to loop and read the configuration file data to check whether the configuration file has changed.
[0035] Step 3: When a third-party application calls the setPreviewDisplay interface in the Camera class, the Camera object and SurfaceHolder object are saved locally for easy use when the camera calls startPreview. Here, a new empty SurfaceHolder needs to be assigned to the original SurfaceHolder parameter, otherwise the local video cannot replace the original camera image.
[0036] Step 4: When a third-party application calls the setPreviewTexture interface in the Camera class, the Camera object and SurfaceTexture object are saved locally for use when the camera calls startPreview. Here, a new empty SurfaceTexture needs to be assigned to the original SurfaceTexture parameter, otherwise the local video cannot replace the original camera image.
[0037] Step 5: When the camera startPreview method is detected, first determine whether the SurfacHolder or SurfaceTexture object passed in when the setPreviewDisplay interface or setPreviewTexture interface is obtained. If it exists, read the local address of the video to be played in the configuration file, and determine whether the video file at this address exists. If it exists, use the player to set the video parameters and play the video. Add a listener for video playback completion. After the video is played, if it is a video list, continue to play the next video. If it is a single video, determine whether to play it repeatedly. If it is played repeatedly, continue to play the current video.
[0038] Step 6: When the onPreviewFrame method is detected, first read the resolution, frame rate and other parameters of the Camera, determine whether the video in the configuration file exists, and whether the resolution matches the camera resolution. If so, decode the video frame and copy the decoded video frame binary data to the parameters of the video preview frame to play the video.
[0039] Step 7: When a third-party application calls the addTarget interface of Camera2, the incoming Surface object is saved locally for use when Camera2 calls the CaptureRequest.build method. Here, a new empty Surface needs to be assigned to the original incoming Surface parameter, otherwise the local video cannot replace the original camera image.
[0040] Step 8: When a third-party application is detected to call the build interface of Camera2, first determine whether the Surface parameter in the addTarget method exists. If so, read the local address of the video to be played in the configuration file to determine whether the video file exists at this address. If so, use the player to set the video parameters and play the video. Add a listener for video playback completion. After the video is played, if it is a video list, continue to play the next video. If it is a single video, determine whether to play it repeatedly. If so, continue to play the current video.
[0041] Specifically, the communication between processes is carried out through files. The virtual camera application writes the video information to be played into the configuration file virtual_camera. The configuration file virtual_camera is read when the third-party application code calls the camera. A timer is added to read the content of the configuration file virtual_camera in a loop once per second. The updateTime in the configuration file is used to determine whether the accessory file data is updated. If so, the variable data related to the video playback is updated.
[0042] Since Android has two classes, Camera and Camera2, which can manage the use of cameras, in order to adapt to the scenarios where most third-party applications call the camera, the methods for calling the camera in these two classes need to be modified.
[0043] To call the camera in Camera, you first need to call setPreviewTexture and pass in the SurfaceTexture of TextureView to bind the camera, or call the setPreviewDisplay method to pass in the SurfaceHolder of SurfaceView to bind the camera. The images captured by the camera are rendered on the Surface in these two ways, so you need to hook these two methods to get the Surface required to play the local video. Then hook the startPreview method in Camera. This method is used to preview the camera screen. Here, first determine whether the Surface for rendering the camera is obtained. If it is obtained, call the custom playVideoInOtherApp method to play the locally set video. The above method is used to replace the local video with the native camera screen. If the third-party application also calls the setPreviewCallback method in the Camera class, you also need to hook the onPreviewFrame method in the Camera class. Here, use the video parsing function decode in the custom VideoToFrames class to parse the local video to be played into binary frame data, and then copy the binary frame data to the camera video frame parameter returned in the onPreviewFrame method. In this way, the third-party application can replace the local video with the native camera screen when using the camera video frame.
[0044] To use the camera in Camera2, you need to call the addTarget method first. Its main function is to add the target Surface of the image information to the target of CaptureRequest. It is similar to the setPreviewTexture or setPreviewDisplay method in the Camera method. Then call the build method to display the camera image on the Surface. Therefore, these two methods need to be hooked here. First, get the target Surface through the addTarget method, and set the incoming Surface to zero. Then call the playVideoInOtherApp method in the build method to play the locally set video. The above method is used to replace the native camera image with the local video in the Camera2 class.
[0045] In some embodiments, the virtual camera system based on the Android system may include multiple functional modules composed of computer program segments. The computer programs of the various program segments in the virtual camera system based on the Android system may be stored in the memory of the computer device and executed by at least one processor to perform (see Figure 1 Description) The function of virtual camera based on Android system.
[0046] In this embodiment, the virtual camera system based on the Android system can be divided into multiple functional modules according to the functions it performs, such as Figure 2 As shown. The functional modules of the system 200 may include: a configuration generation module 210, a configuration cache module 220, a first setting module 230 and a second setting module 240. The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, which are stored in a memory. In this embodiment, the functions of each module will be described in detail in subsequent embodiments.
[0047] A configuration generation module, used for configuring playback attributes and writing the playback attributes and the storage address of the target video into a configuration file; A configuration cache module is used to read the configuration file and save the read data as a local variable when detecting that a third-party application is started, and the third-party application has the permission to read and write the memory card; A first setting module is used to detect the event of the third-party application binding the camera through a hook, save the incoming object parameters locally, and create an empty object to assign the object parameters; The second setting module is used to detect the event of the third-party application calling the camera through a hook, and call the player to play the target video based on the local variable.
[0048] Optionally, as an embodiment of the present invention, the configuration generation module includes: An address extraction unit, used for extracting a storage address of a target video based on a selection instruction of the target video; The property setting unit is used to set the playing properties, wherein the playing properties include volume and whether to play in a loop; The file generating unit is used to save the playing attribute to VideoListBean, write the data in VideoListBean to sdcard, and generate a configuration file.
[0049] Optionally, as an embodiment of the present invention, the system further includes: The data updating module is used to add a timer to cyclically read the data of the configuration file and update the changed new data to the local variables.
[0050] Figure 3 The present invention provides a schematic diagram of the structure of a terminal 300 provided in an embodiment of the present invention. The terminal 300 can be used to execute the virtual camera method based on the Android system provided in an embodiment of the present invention.
[0051] The terminal 300 may include: a processor 310, a memory 320 and a communication unit 330. These components communicate via one or more buses. Those skilled in the art will appreciate that the server structure shown in the figure does not limit the present invention, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0052] The memory 320 can be used to store the execution instructions of the processor 310, and the memory 320 can be implemented by any type of volatile or non-volatile storage terminal or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. When the execution instructions in the memory 320 are executed by the processor 310, the terminal 300 can perform some or all of the steps in the following method embodiments.
[0053] The processor 310 is the control center of the storage terminal, and uses various interfaces and lines to connect various parts of the entire electronic terminal. It runs or executes software programs and / or modules stored in the memory 320, and calls data stored in the memory to perform various functions of the electronic terminal and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of multiple packaged ICs with the same or different functions. For example, the processor 310 can only include a central processing unit (CPU). In the embodiment of the present invention, the CPU can be a single computing core or multiple computing cores.
[0054] The communication unit 330 is used to establish a communication channel so that the storage terminal can communicate with other terminals, receive user data sent by other terminals or send user data to other terminals.
[0055] The present invention also provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0056] Therefore, the present invention does not require manual settings, and can automatically detect the operation events of the camera by the third-party application used for live broadcast, and automatically play the target video based on the detection results, and quickly convert from live broadcast to recorded broadcast. The technical effects that can be achieved by this embodiment can be found in the description above and will not be repeated here.
[0057] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solution in the embodiments of the present invention, in essence or in other words, the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, and other media that can store program codes, including several instructions for enabling a computer terminal (which can be a personal computer, a server, or a second terminal, a network terminal, etc.) to execute all or part of the steps of the methods described in each embodiment of the present invention.
[0058] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the terminal embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
[0059] In the several embodiments provided by the present invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of systems or modules, which can be electrical, mechanical or other forms.
[0060] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0061] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0062] Although the present invention has been described in detail with reference to the accompanying drawings and in combination with the preferred embodiments, the present invention is not limited thereto. Without departing from the spirit and essence of the present invention, a person of ordinary skill in the art may make various equivalent modifications or substitutions to the embodiments of the present invention, and these modifications or substitutions shall be within the scope of the present invention. Any person of ordinary skill in the art may easily think of changes or substitutions within the technical scope disclosed by the present invention, and these shall be within the scope of protection of the present invention.
Claims
1. A virtual camera method based on Android system, characterized in that: include: Configure playback attributes and write the playback attributes and the storage address of the target video into a configuration file; When it is detected that a third-party application is started, the configuration file is read and the read data is saved as a local variable, and the third-party application has the permission to read and write the memory card; An event of binding the camera to the third-party application is detected through a hook, the incoming object parameters are saved locally, and a new empty object is created and assigned to the object parameters; The event of the third-party application calling the camera is detected through the hook, and the player is called to play the target video based on the local variable.
2. The method according to claim 1, characterized in that Configuring the playback attributes and writing the playback attributes and the storage address of the target video into the configuration file includes: Extracting a storage address of the target video based on a selection instruction of the target video; Set playback attributes, including volume and whether to play in a loop; The playback attributes are saved to VideoListBean, and the data in VideoListBean is written to sdcard to generate a configuration file.
3. The method according to claim 1, characterized in that When detecting that a third-party application is started, after reading the configuration file and saving the read data as a local variable, the method includes: A timer is added to cyclically read the data of the configuration file, and the changed new data is updated to the local variables.
4. The method according to claim 1, characterized in that: The event of the third-party application binding the camera is detected through the hook, the incoming object parameters are saved locally, and a new empty object is created and assigned to the object parameters, including: When a third-party application calls the setPreviewDisplay interface in the Camera class, the Camera object and SurfaceHolder object are saved locally and used when the camera calls startPreview; a new empty SurfaceHolder is created and assigned to the original SurfaceHolder parameter; When a third-party application calls the setPreviewTexture interface in the Camera class, the incoming Camera object and SurfaceTexture object are saved locally for use when the camera calls startPreview; a new empty SurfaceTexture is created and assigned to the original incoming SurfaceTexture parameter; When a third-party application is detected calling the addTarget interface of Camera2, the incoming Surface object is saved locally for use when Camera2 calls CaptureRequest.build; a new empty Surface is assigned to the original incoming Surface parameter.
5. The method according to claim 4, characterized in that The event of the third-party application calling the camera is detected through a hook, and a player is called based on the local variable to play the target video, including: When the startPreview method of the camera is detected to be called, it is confirmed that the SurfacHolder or SurfaceTexture object is obtained, the storage address and the playback attribute in the local variable are read, and the storage address and the playback attribute are sent to the player so that the player plays the target video under the storage address according to the playback attribute; When it is detected that a third-party application calls the onPreviewFrame method, the camera resolution is read to determine whether the resolution of the target video matches the camera resolution. If the two do not match, the video frame of the target video is decoded, and the decoded video frame binary data is copied to the parameters of the video preview frame to achieve video playback; When it is detected that a third-party application calls the build interface of Camera2, confirm that the Surface parameter in the addTarget method exists, read the storage address and playback attributes in the local variables, and send the storage address and playback attributes to the player so that the player plays the target video under the storage address according to the playback attributes.
6. A virtual camera system based on Android system, characterized in that: include: A configuration generation module, used for configuring playback attributes and writing the playback attributes and the storage address of the target video into a configuration file; A configuration cache module is used to read the configuration file and save the read data as a local variable when detecting that a third-party application is started, and the third-party application has the permission to read and write the memory card; A first setting module is used to detect the event of the third-party application binding the camera through a hook, save the incoming object parameters locally, and create an empty object to assign the object parameters; The second setting module is used to detect the event of the third-party application calling the camera through a hook, and call the player to play the target video based on the local variable.
7. The system according to claim 6, characterized in that The configuration generation module includes: An address extraction unit, used for extracting a storage address of a target video based on a selection instruction of the target video; The property setting unit is used to set the playing properties, wherein the playing properties include volume and whether to play in a loop; The file generating unit is used to save the playing attribute to VideoListBean, write the data in VideoListBean to sdcard, and generate a configuration file.
8. The system according to claim 6, characterized in that The system further comprises: The data updating module is used to add a timer to cyclically read the data of the configuration file and update the changed new data to the local variables.
9. A terminal, characterized in that: include: A memory, used for storing a virtual camera program based on the Android system; A processor is used to implement the steps of the virtual camera method based on the Android system as described in any one of claims 1 to 5 when executing the virtual camera program based on the Android system.
10. A computer-readable storage medium storing a computer program, characterized in that: The readable storage medium stores a virtual camera program based on the Android system, and when the virtual camera program based on the Android system is executed by the processor, the steps of the virtual camera method based on the Android system as described in any one of claims 1-5 are implemented.
