WO2024001766A1 - 屏幕录制和共享的方法及电子设备 - Google Patents

屏幕录制和共享的方法及电子设备 Download PDF

Info

Publication number
WO2024001766A1
WO2024001766A1 PCT/CN2023/100032 CN2023100032W WO2024001766A1 WO 2024001766 A1 WO2024001766 A1 WO 2024001766A1 CN 2023100032 W CN2023100032 W CN 2023100032W WO 2024001766 A1 WO2024001766 A1 WO 2024001766A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
android
application
operating system
android operating
Prior art date
Application number
PCT/CN2023/100032
Other languages
English (en)
French (fr)
Inventor
李振
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2024001766A1 publication Critical patent/WO2024001766A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • G06F3/1423Digital output to display device ; Cooperation and interconnection of the display device with other functional units controlling a plurality of local displays, e.g. CRT and flat panel display

Definitions

  • the present application relates to the technical field of electronic equipment, and in particular, to a screen recording and sharing method and electronic equipment.
  • an electronic device such as a computer
  • a non-Android operating system may display an Android application window, the main interface window of the Android operating system, a non-Android application window, and a non-Android operating system window.
  • the Android emulator can simulate the Android operating system on a non-Android operating system (such as a computer operating system) to install, run, and uninstall Android applications on the computer, allowing users to experience Android applications on the computer.
  • the screen casting device such as a mobile phone
  • the screen being projected device such as a computer
  • the screen casting device can project the interface image of the screen casting device to the screen being projected. Displayed on the screen casting device.
  • This application provides a method and electronic device for screen recording and sharing.
  • it can also record and/or share windows other than the windows of the Android main interface, such as: Android applications.
  • windows One or more of windows, windows of non-Android applications, windows of the main interface of non-Android operating systems, etc.
  • this application provides a method for screen recording and sharing, which is applied to an electronic device with a display screen.
  • the method includes: receiving a user's target operation in a first window of the electronic device, and the first window is a first application. Window; in response to the target operation, record and/or share the target window of the electronic device, the target window is the first window or the second window, and the second window is the window of the second application; wherein the first application runs on Android In the system, the second application runs in a non-Android operating system.
  • the window of the Android application running in the Android operating system can be opened in a non-Android operating system (for example, etc.) are displayed.
  • the electronic device can start recording and/or sharing the window of the Android application based on the user's operation on the window of the Android application, or start one or more of the windows of non-Android applications, windows of non-Android main interface, etc. recording and/or sharing.
  • recording and/or sharing the target window in response to the target operation includes: if the first application is not a default application, recording and/or sharing the first window in response to the target operation; If the first application is a default application, in response to the target operation, the second window is recorded and/or shared.
  • the electronic device can determine whether to record and/or record the window of the Android application based on whether the Android application is a default application. Share, or record and/or share the windows of non-Android applications and/or the windows of non-Android main interfaces.
  • recording and/or sharing the first window includes: the Android operating system obtains the identifier of the logical display device corresponding to the first window from the non-Android operating system, and the logical display device is used to carry the first window's data; the Android operating system obtains the data of the first window according to the identification of the logical display device; the Android operating system records and/or shares the data of the first window. Based on this design, after the electronic device obtains the operation of the user to start the recording and/or sharing function of the Android application, it can obtain the identification of the logical display device corresponding to the Android application window, and then obtain the Android application based on the identification of the logical display device. Window data to achieve recording and/or sharing of Android application windows.
  • the Android operating system records and/or shares the data of the first window, including: the Android operating system renders the data of the first window into the memory of the first surface corresponding to the virtual display device, and the virtual display device
  • the display device is created based on the first surface, and the first surface corresponds to the first application; the Android operating system records and/or shares the data in the memory of the first surface corresponding to the rendered virtual display device.
  • the electronic device can render the data of the Android application window into the memory of the surface corresponding to the virtual display device, and then obtain the data in the memory of the surface corresponding to the virtual display device for recording and/or sharing, and it is completed. Recording and/or sharing of Android application windows.
  • recording and/or sharing the second window includes: the Android operating system obtains the data of the second window from a non-Android operating system; the Android operating system records and/or shares the data of the second window. .
  • the electronic device can obtain data of non-Android application windows and/or non-Android main interface windows, and realize recording and/or sharing of non-Android application windows and/or non-Android main interface windows. .
  • the Android operating system obtains the data of the second window from the non-Android operating system, including: the non-Android operating system obtains the data of the second window; the non-Android operating system renders the data of the second window to the second surface
  • the memory of the second surface is determined by the Android operating system, and the second surface corresponds to the first application; the non-Android operating system sends the data in the memory of the second surface after rendering to the Android operating system.
  • the electronic device can render the acquired data of non-Android application windows and/or non-Android main interface window data into the surface provided by the Android application, and subsequently obtain the data in the surface for recording and/or By sharing, you can record and/or share the windows of non-Android applications and/or the windows of non-Android main interfaces.
  • the method before the non-Android operating system renders the data of the second window into the memory of the second surface, the method also includes: the Android operating system determines the memory of the second surface; the Android operating system transmits data to the non-Android operating system Send the target handle, which is used to indicate the memory address of the second surface; non-Android operating systems determine the memory of the second surface based on the target handle. Based on this design, the electronic device can determine the memory of the surface based on the handle of the surface, so that it can subsequently render data into the memory of the surface.
  • the Android operating system records and/or shares the data of the second window, including: the Android operating system records and/or shares the data in the memory of the second surface after rendering.
  • the window of the second application includes one or more of a main interface window of a non-Android operating system and a window of an application in a non-Android operating system.
  • the target operation includes a triggering operation on a screen recording button and/or a screen sharing button included in the first window.
  • recording and/or sharing the target window of the electronic device includes: in response to the target operation, displaying at least one window option, and the at least one window option includes the first Options of the window and/or options of the second window; receiving a user's selection operation of the target window in the options of at least one window; in response to the selection operation, recording and/or sharing the target window.
  • the present application provides an electronic device that has the function of implementing the method described in the above first aspect and any one of the designs.
  • This function can be implemented by hardware, or it can be implemented by hardware executing corresponding software.
  • the hardware or software includes one or more modules corresponding to the above functions.
  • this application provides an electronic device, including: a processor, a memory, and a display screen.
  • the memory, the display screen, and the processor are coupled.
  • the memory is used to store computer program code.
  • the computer program code includes computer instructions.
  • the processor The computer instructions are read from the memory to cause the electronic device to execute the method described in the above first aspect and any of the designs.
  • the memory may be coupled to the processor, or may be independent of the processor.
  • the electronic device further includes a communication interface, and the communication interface can be used for the electronic device to communicate with other devices.
  • the communication interface may be a transceiver, an input/output interface, an interface circuit, an output circuit, an input circuit, a pin or a related circuit, etc.
  • the present application provides a computer-readable storage medium.
  • the computer-readable storage medium includes a computer program or instructions.
  • the electronic device causes the electronic device to execute the above-mentioned first aspect and Either design the method described.
  • the present application provides a computer program product.
  • the computer program product When the computer program product is run on a computer, the computer can execute the method described in the above first aspect and any one of the designs.
  • the present application provides a chip system, including at least one processor and at least one interface circuit.
  • the at least one interface circuit is used to perform transceiver functions and send instructions to at least one processor.
  • at least one processor executes the instructions
  • at least one processor executes the method described in the above first aspect and any one of the designs.
  • Figure 1 is a schematic diagram of an example of an Android emulator running scenario provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of another Android emulator running scenario example provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of an example of a multi-screen collaboration scenario provided by an embodiment of the present application.
  • Figure 4 is a schematic diagram of another example of a multi-screen collaboration scenario provided by an embodiment of the present application.
  • Figure 5 is a schematic diagram of another example of multi-screen collaboration scenario provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of another example of multi-screen collaboration scenario provided by the embodiment of the present application.
  • Figure 7 is a schematic diagram of a scene example of an existing screen recording method
  • Figure 8 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
  • Figure 9 is a schematic diagram of a scene example of a screen recording method provided by an embodiment of the present application.
  • Figure 10 is a schematic diagram of a scene example of yet another screen recording method provided by an embodiment of the present application.
  • Figure 11 is a schematic diagram of a scene example of yet another screen recording method provided by an embodiment of the present application.
  • Figure 12 is a schematic diagram of a scene example of a screen sharing method provided by an embodiment of the present application.
  • Figure 13 is a schematic diagram of a scenario example of yet another screen sharing method provided by an embodiment of the present application.
  • Figure 14 is a schematic diagram of a scenario example of yet another screen sharing method provided by an embodiment of the present application.
  • Figure 15 is a schematic framework diagram of a screen recording and sharing method provided by an embodiment of the present application.
  • Figure 16 is a schematic flowchart of a screen recording and sharing method provided by an embodiment of the present application.
  • Figure 17 is a schematic framework diagram of yet another screen recording and sharing method provided by an embodiment of the present application.
  • Figure 18 is a schematic flowchart of yet another screen recording and sharing method provided by an embodiment of the present application.
  • Figure 19 is a schematic flowchart of yet another screen recording and sharing method provided by an embodiment of the present application.
  • Figure 20 is a schematic flowchart of yet another screen recording and sharing method provided by an embodiment of the present application.
  • Figure 21 is a schematic flowchart of yet another screen recording and sharing method provided by an embodiment of the present application.
  • Figure 22 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • Figure 23 is a schematic structural diagram of a chip system provided by an embodiment of the present application.
  • Android emulators can simulate Android operating systems on non-Android operating systems, so that users can install, run, and uninstall Android applications in non-Android operating systems.
  • the computer is equipped with a non-Android operating system, such as: Etc., after installing the Android emulator on the computer, the user can run the Android emulator on the computer to install, run, and uninstall Android applications on the computer.
  • the computer may display one or more windows.
  • This one or more windows may include Android application windows, the main interface window of the Android operating system (hereinafter referred to as the Android main interface window), non-Android One or more of the main interface windows of the operating system (hereinafter referred to as non-Android main interface windows), non-Android application windows, etc.
  • Android applications can run in the Android operating system simulated by the Android emulator installed on the computer
  • non-Android applications can run in the computer operating system, that is, in non-Android operating systems
  • the window of the non-Android main interface refers to It is the window where the desktop of a non-Android operating system is located. It has only one window, excluding other windows located on the desktop. It will be explained here.
  • the Android emulator 101 is installed on the computer, and the user can start the Android emulator 101 through the computer's input device (such as mouse, keyboard, etc.).
  • the computer displays the main interface 100, and the icon of the Android emulator 101 is displayed on the main interface 100.
  • the computer detects a user's click operation on the icon of the Android emulator 101, and in response to the operation, the computer starts the Android emulator 101.
  • the computer can display the main interface 110 of the Android emulator.
  • the main interface 110 of the Android emulator may include one or more Android applications, such as: Application 1, Application 2, Application 3 etc., users can launch one or more of these Android applications.
  • the computer detects the user's click operation on the icon 111 of Application 1, and in response to the operation, as shown in (3) in Figure 1, the computer can display the running interface 120 of Application 1.
  • a total of three windows are displayed on the computer, namely the window of the non-Android main interface (ie, the main interface 100), the window of the Android main interface (ie, the main interface 110), The window of the Android application (ie, the running interface 120 of application 1).
  • the main interface 100 also includes one or more non-Android applications, such as application 4, application 5, etc.
  • the user can start the window of application 4 through the icon of application 4, start the window of application 5 through the icon of application 5, etc.
  • the computer detects a user's click operation on the icon 102 of application 4, and in response to the operation, the computer starts application 4.
  • the computer can display the running interface 130 of the application 4.
  • the running interface 130 of application 4 is the window of the non-Android application.
  • the user can also launch the window of the Android application through other methods.
  • the computer displays a main interface 200.
  • the main interface 200 displays icons of Android applications (such as Application 1, Application 2, Application 3, etc.) and non-Android applications (such as Application 4, Application 5, etc.) icon.
  • the computer detects, for example, the user's click operation on the icon 201 of Application 1.
  • the computer starts Application 1.
  • the computer displays the running interface 210 of Application 1.
  • the user can also directly start the windows of Android applications such as Application 2 and Application 3 through the icons of Application 2 and Application 3 respectively included in the main interface 200 .
  • the user can also start windows of non-Android applications such as Application 4 and Application 5 through the icons of Application 4 and Application 5 respectively included in the main interface 200 .
  • the computer may also present an interface such as that shown in (3) in Figure 1 and/or (4) in Figure 1 .
  • the screen casting device can project the interface image of the screen casting device to the screen being projected.
  • the screen-casting device can be a device equipped with an Android operating system
  • the screen-casting device can be a device equipped with a non-Android operating system (such as Microsoft, Windows, Linux, etc.).
  • the wireless connection can be a Bluetooth connection, a near field communication (NFC) connection, or a wireless fidelity (WiFi) connection and other various methods of connection.
  • one or more windows may be displayed on the device being projected.
  • the one or more windows may be windows of Android applications, windows of the Android main interface, windows of non-Android main interfaces, or windows of non-Android applications.
  • windows of Android applications may be windows of Android applications, windows of the Android main interface, windows of non-Android main interfaces, or windows of non-Android applications.
  • windows of non-Android applications may be windows of non-Android applications.
  • the mobile phone can project the interface on the phone to the computer for display.
  • the mobile phone displays a main interface 300, which includes one or more Android applications (such as music, sports and health, smart life, video, etc., which are not included here).
  • the computer displays a main interface 310, which includes icons of one or more non-Android applications (such as this computer, email, browser, etc.).
  • the mobile phone can project the currently displayed main interface 300 to the computer for display.
  • the computer receives the main interface 300 projected from the mobile phone, and the computer can display the screen projection interface 320 .
  • users can update the interface projected to the computer through their mobile phone. For example, if the user updates the interface displayed on the mobile phone (or the user opens a new interface display on the mobile phone), then the computer displays The screencasting interface will also be updated accordingly.
  • the mobile phone detects a click operation such as the user's click on the icon 301 of the video application included in the main interface 300 on the mobile phone, and in response to the operation, as in (2) in FIG. 3 or as shown in FIG. As shown in 4, the mobile phone displays the running interface 330 of the video application. At this time, the interface displayed on the mobile phone is updated.
  • the mobile phone can project the new interface, that is, the running interface 330 of the video application, to the computer for display.
  • the screen projection interface displayed on the computer will also be displayed accordingly. of updates.
  • the computer can present an interface such as (2) in Figure 3.
  • only one screen projection interface is displayed on the computer, namely the screen projection interface 340.
  • the screen projection interface can be the interface currently displayed on the mobile phone, such as the running interface 330 of the video application.
  • the computer can also present an interface such as that shown in Figure 4.
  • multiple screen projection interfaces can be displayed on the computer, namely, the screen projection interface 320 and the screen projection interface 340, wherein these multiple screen projection interfaces can be projected by the same mobile phone.
  • the multiple screen projection interfaces may include the interface currently displayed by the mobile phone (such as the running interface 330 of the music application), the interface previously displayed by the mobile phone (such as the main interface 300 of the mobile phone), etc.
  • a total of three windows are displayed on the computer, namely the window of the non-Android main interface (ie, the main interface 310), the window of the Android main interface (ie, the screen projection interface 320), and the window of the Android application. (i.e. screen projection interface 340).
  • the user can update the screen projection interface on the computer through the computer.
  • the user can directly operate the screen projection interface on the computer through the computer's input device (such as mouse, keyboard, etc.) to update the computer.
  • Screencasting interface on the screen As shown in FIG. 5 , the computer detects a user's click operation on the icon 311 of the video application included in the screencasting interface 320 displayed on the computer.
  • the computer may present a display such as (2) in FIG. 3 or as shown in FIG. 4 shows the computer interface.
  • the interface displayed on the mobile phone can be updated.
  • the mobile phone can display the running interface of the video application as shown in (2) in Figure 3 or as shown in Figure 4 330.
  • the interface displayed on the mobile phone may not be updated.
  • the mobile phone still displays the main interface 300 as shown in (1) in Figure 3 or as shown in Figure 5 .
  • the computer can first display the screen casting interface 340, that is, first display an interface such as (2) in Figure 3, and then cast the screen.
  • the interface 340 includes a button 341, which can be used to display a newly opened interface (such as the screen projection interface 340) in a new window.
  • the computer detects the user's click operation on button 341, and in response to the operation, the computer displays the interface shown in Figure 4.
  • the computer determines whether to display a new interface (such as the screen projection interface corresponding to the running interface 330 of the video application), whether to display it in the manner shown in (2) in Figure 3 or to use
  • a new interface such as the screen projection interface corresponding to the running interface 330 of the video application
  • the display mode shown in Figure 4 can be the default of the computer system, or can also be set by the user through the computer and/or mobile phone.
  • a reminder message can be popped up to remind the user that it is Whether to display the new interface in the original window or create a new window, that is, to remind the user whether to display it in the way shown in (2) in Figure 3 or in the way shown in Figure 4, in response to the user's selected way.
  • the computer then displays the interface in a corresponding manner according to the method selected by the user.
  • the user can also launch other windows on the computer, such as application windows on non-Android operating systems.
  • the computer detects a user's click operation on an icon of a non-Android application included in the main interface 310 of the computer such as (1) in Figure 3, and in response to the operation, the computer may display a or multiple non-Android application windows (not shown in the figure).
  • the computer may also present an interface such as (3) in Figure 1 and/or (4) in Figure 1 .
  • Recording means recording the application window contents (images, audio, etc.) into screen recording files (for example, image files, audio files, video files, etc.).
  • Sharing means sharing the window content of an application on one device to another device.
  • the electronic device defaults to the Android main interface.
  • the data of the window is rendered into the surface provided by the Android application, and then the data in the surface is recorded and/or shared.
  • Android application 1 can be any Android application that supports the screen recording function. If the user wants to record the window 700 of the Android application 1, the user will click the recording button 701 of the Android application 1 in an attempt to start recording the window 700 of the Android application 1.
  • the recording button 701 of the Android application 1 can be directly displayed in the window 700 of the Android application 1 ((1) in Figure 7 takes this as an example), or the user can also include it in the window 700 of the Android application 1
  • the recording button 701 can be called up through other function buttons or menu bar, which is not limited in this application.
  • the computer will render the data of the window 710 of the Android main interface to the surface provided by the Android application 1, and then record the data in the surface. That is, as shown in (2) in Figure 7 , the computer will record the window 710 of the Android main interface instead of the window 700 of the Android application 1.
  • the computer responds to the operation of the sharing function such as the window used by the user to launch the Android application.
  • the computer shares the window of the Android main interface, not the Android application. window. In other words, the device side shared by the computer displays the window of the Android main interface, not the window of the Android application.
  • the existing solution cannot realize the function of recording and/or sharing the window of an Android application.
  • non-Android application windows, non-Android main interface windows, etc. cannot be recorded and/or shared. That is to say, in the existing solution, when the recording and/or sharing function is started through the Android application, only the window of the Android main interface can be recorded and/or shared.
  • embodiments of the present application provide a method for screen recording and sharing.
  • windows other than the Android main interface window can also be recorded and/or shared, such as: Android One or more of application windows, non-Android application windows, non-Android operating system main interface windows, etc.
  • the technical solution provided by the embodiments of this application can be applied to an electronic device installed with an Android emulator or an electronic device serving as a device to be screened, or to a system including the electronic device.
  • electronic devices can include personal computers (PCs), laptops, tablets, netbooks, handheld computers, smart home devices (such as smart TVs, smart screens, large screens, smart speakers, etc.), vehicle-mounted computers, etc.
  • PCs personal computers
  • laptops tablets, netbooks, handheld computers
  • smart home devices such as smart TVs, smart screens, large screens, smart speakers, etc.
  • vehicle-mounted computers etc.
  • the embodiments of this application do not impose any limitations on this.
  • the operating system installed on the electronic device includes but is not limited to Or various non-Android operating systems such as other operating systems.
  • the above-mentioned electronic device may include the structure of electronic device 800 as shown in FIG. 8 .
  • the electronic device 800 includes a processor 810, an external memory interface 820, an internal memory 821, a universal serial bus (USB) interface 830, a charging management module 840, a power management module 841, a battery 842, a display screen 850, and an antenna.
  • the processor 810 may include one or more processing units.
  • the processor 810 may include an application processor (Application processor, AP), a graphics processing unit (GPU), an image signal processor (ISP). ), controller, memory, video codec, digital signal processor (digital signal processor, DSP), and/or neural network processor (neural-network processing unit, NPU), etc.
  • application processor Application processor, AP
  • GPU graphics processing unit
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • different processing units can be independent devices or integrated in one or more processors.
  • the controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • the processor 810 may also be provided with a memory for storing instructions and data.
  • the memory in processor 810 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 810 . If the processor 810 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 810 is reduced, thus improving the efficiency of the system.
  • processor 810 may include one or more interfaces.
  • Interfaces may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiver and transmitter (universal asynchronous receiver/transmitter (UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and /or universal serial bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous receiver and transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB universal serial bus
  • the charge management module 840 is used to receive charging input from the charger.
  • the charger can be a wireless charger or a wired charger.
  • the charging management module 840 may receive charging input from the wired charger through the USB interface 830 .
  • the charging management module 840 may receive wireless charging input through the wireless charging coil of the electronic device 800 . While the charging management module 840 charges the battery 842, it can also provide power to the electronic device 800 through the power management module 841.
  • the power management module 841 is used to connect the battery 842, the charging management module 840 and the processor 810.
  • the power management module 841 receives input from the battery 842 and/or the charging management module 840, and supplies power to the processor 810, internal memory 821, external memory, display screen 850, wireless communication module 860, etc.
  • the power management module 841 can also be used to monitor battery capacity, battery cycle times, battery health status (leakage, impedance) and other parameters.
  • the power management module 841 may also be provided in the processor 810.
  • the power management module 841 and the charging management module 840 can also be provided in the same device.
  • the electronic device 800 implements display functions through the GPU, the display screen 850, and the application processor.
  • the GPU is an image processing microprocessor and is connected to the display screen 850 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.
  • Processor 810 may include one or more GPUs that execute program instructions to generate or alter display information.
  • the display screen 850 is used to display images, videos, etc.
  • Display 850 includes a display panel.
  • the display panel can be With liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light emitting diode or active matrix organic light emitting diode (active-matrix organic light emitting diode) , AMOLED), flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (QLED), etc.
  • the display screen 850 is also called a screen.
  • the wireless communication function of the electronic device 800 can be implemented through an antenna, a wireless communication module 860, etc.
  • Antennas are used to transmit and receive electromagnetic wave signals.
  • Each antenna in electronic device 800 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • the wireless communication module 860 can provide applications on the electronic device 800 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (Bluetooth, BT), and global navigation satellites. System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
  • WLAN wireless local area networks
  • WiFi wireless fidelity
  • Bluetooth Bluetooth
  • BT global navigation satellites.
  • GNSS global navigation satellite system
  • frequency modulation frequency modulation, FM
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 860 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 860 receives electromagnetic waves through the antenna, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 810 .
  • the wireless communication module 860 can also receive the signal to be sent from the
  • the antenna of the electronic device 800 is coupled with the wireless communication module 860 so that the electronic device 800 can communicate with the network and other devices through wireless communication technology.
  • Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. For example, when the electronic device 800 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.
  • Video codecs are used to compress or decompress digital video.
  • Electronic device 800 may support one or more video codecs. In this way, the electronic device 800 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
  • MPEG moving picture experts group
  • MPEG2 MPEG2, MPEG3, MPEG4, etc.
  • NPU is a neural network (NN) computing processor.
  • NN neural network
  • Intelligent cognitive applications of the electronic device 800 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
  • the external memory interface 820 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 800.
  • the external memory card communicates with the processor 810 through the external memory interface 820 to implement the data storage function. Such as saving music, videos, etc. files in external memory card.
  • Internal memory 821 may be used to store computer executable program code, which includes instructions.
  • the processor 810 executes instructions stored in the internal memory 821 to execute various functional applications and data processing of the electronic device 800 .
  • the internal memory 821 may include a program storage area and a data storage area.
  • the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.).
  • the storage data area may store data created during use of the electronic device 800 (such as audio data, phone book, etc.).
  • the internal memory 821 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc.
  • the electronic device 800 can implement audio functions through the audio module 870, the speaker 870A, the receiver 870B, the microphone 870C, the headphone interface 870D, and the application processor. Such as music playback, recording, etc.
  • the audio module 870 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 870 may also be used to encode and decode audio signals. In some embodiments, the audio module 870 may be provided in the processor 810 , or some functional modules of the audio module 870 may be provided in the processor 810 .
  • Speaker 870A also known as “speaker” is used to convert audio electrical signals into sound signals.
  • the electronic device 800 can listen to music and the like through the speaker 870A.
  • Receiver 870B also known as “earpiece” is used to convert audio electrical signals into sound signals.
  • Microphone 870C also known as “microphone” and “microphone”, is used to convert sound signals into electrical signals.
  • Headphone interface 870D is used to connect wired headphones.
  • the headphone interface 870D can be a USB interface 830, or a 3.5mm open mobile terminal platform (OMTP) standard interface, or a cellular telecommunications industry association of the USA (CTIA) standard interface. .
  • OMTP open mobile terminal platform
  • CTIA cellular telecommunications industry association of the USA
  • Input device 880 may include a keyboard, mouse, etc.
  • the keyboard is used to input English letters, numbers, punctuation marks, etc. into the electronic device 800, thereby issuing commands to the electronic device 800, inputting data, etc.
  • the mouse is an indicator for positioning the vertical and horizontal coordinates of the display system of the electronic device 800, and is used to input instructions to the electronic device 800, etc.
  • the input device 880 can be connected to the electronic device 800 through a wired connection.
  • the input device 880 can be connected to the electronic device 800 through a GPIO interface, a USB interface, etc.
  • the input device 880 can also connect to the electronic device 800 through wireless means.
  • the input device 880 can connect to the electronic device 800 through Bluetooth, infrared, etc.
  • the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device.
  • the electronic device may include more or less components than shown in the figures, or some components may be combined, some components may be separated, or some components may be arranged differently.
  • the components illustrated may be implemented in hardware, software, or a combination of software and hardware.
  • the screen recording and sharing method provided by the embodiment of the present application can not only record and share the windows of Android applications, but also record and share the windows of non-Android applications and/or the windows of non-Android main interfaces.
  • the screen recording and sharing method provided by the embodiment of the present application will be introduced in detail below with reference to the accompanying drawings.
  • FIG. 9 shows a scenario example of a screen recording method provided by an embodiment of the present application.
  • the window of an Android application can be recorded.
  • four windows are displayed on the computer, namely the window 900 of the Android application 1, the window 910 of the Android main interface, the window 920 of the non-Android main interface, and the window 930 of the non-Android application.
  • Android application 1 can be any Android application that supports the screen recording function.
  • the window 900 of the Android application 1 includes a screen recording button 901, and the user can start recording the window 900 of the Android application 1 through the screen recording button 901.
  • the computer detects the user's operation to start the recording function of the window 900 of the Android application 1, such as the user's click operation on the screen recording button 901.
  • the data of the window 900 of the Android application 1 is rendered to the Android application. 1 in the surface provided, and then obtain the data in the surface for recording (or storage).
  • the computer starts recording the window 900 of the Android application 1.
  • “Video Recording” may be displayed in the window 900 of the Android application 1 Toolbar 902
  • the "Video Recording" toolbar 902 may include one or more of the recording duration, a pause and continue button, an end button, etc.
  • the user can pause the recording of the window 900 of the Android application 1 through the pause and continue button or Continue recording, and use the end button to stop recording in window 900 of Android application 1, etc.
  • FIG. 10 shows a scenario example of yet another screen recording method provided by an embodiment of the present application.
  • windows of non-Android applications and/or windows of non-Android main interfaces As shown in (1) in Figure 10, there are four windows displayed on the computer, namely the window 1000 of Android application 2, the window 1010 of the Android main interface, the window 1020 of the non-Android main interface, and the window 1030 of the non-Android application.
  • the window 1000 of the Android application 2 includes a screen recording button 1001.
  • the user can use the screen recording button 1001 to record a window of a non-Android application or a window of a non-Android main interface.
  • the computer detects a user's click operation on the screen recording button 1001 included in the window 1000 of the Android application 2, and in response to the operation, determines whether the Android application 2 is a default Android application. If it is a default Android application, The application renders the data of the non-Android application window (i.e., the non-Android application window 1030) and/or the data of the non-Android main interface window (i.e., the non-Android main interface window 1020) to the surface provided by the Android application 2, Then obtain the data in the surface for recording. Please refer to the following for the specific process.
  • the computer starts recording the window 1030 of the non-Android application and the window 1020 of the non-Android main interface.
  • the "Video Recording" toolbar 1002 can also be displayed in the window 1020 of the non-Android main interface.
  • the "Video Recording" toolbar 1002 please refer to the "Video Recording” tool shown in (2) in Figure 9 Introduction to column 902.
  • the computer records non-Android application windows and non-Android main interface windows by default ((2) in Figure 10 takes this as an example). It is understandable that multiple non-Android application windows may be displayed on the computer at the same time. In this example, the windows of multiple non-Android applications and the non-Android main interface window can be recorded. In other examples, the computer records one of the windows of a non-Android application and a window of a non-Android main interface by default. Optionally, in this example, the computer can record all non-Android application windows by default, or record the non-Android main interface windows, or select all non-Android application windows and non-Android main interface windows. A window for recording.
  • the computer can also record the windows of non-Android applications and/or the windows of non-Android main interfaces. This application does not impose specific restrictions on this.
  • the user can select the window that needs to be recorded.
  • the computer displays a reminder message 1100.
  • the reminder message 1100 can be used to remind the user to select the window they want to record.
  • the reminder message 1100 includes one or more options for displaying the windows of non-Android applications on the computer, such as: the window of application 4 (ie, the window 1030 of the non-Android application described in (1) in Figure 10 ), and a non-Android main interface window (or a computer main interface window, that is, the non-Android main interface window 1020 described in (1) in Figure 10).
  • the window of application 4 ie, the window 1030 of the non-Android application described in (1) in Figure 10
  • a non-Android main interface window or a computer main interface window, that is, the non-Android main interface window 1020 described in (1) in Figure 10.
  • the user can need to select the window he wants to record. For example: if the user wants to record the window of application 4 at this time, the user selects the window of application 4, and the computer detects the user's operation to select the window of application 4, and responds Following this operation, the computer starts recording the window of application 4 (not shown in the figure).
  • users can also pre-set the windows that need to be recorded, for example: setting the window of an Android application to be recorded first. Or, set the priority order of Android application windows, non-Android application windows, and non-Android main interface windows from high to low, and record according to this priority order. If there is no high-priority window, In this case, the window with lower priority will be recorded again. It can be understood that the foregoing priority order is only an example, and the priority order can also be other orders. Alternatively, the user can also set to record only a certain window, for example: only record the windows of Android applications, or only record the windows of non-Android applications, etc.
  • the display position of the screen recording button, "Video Recording” toolbar, etc. shown in Figure 9 and Figure 10 is only a possible example, and the screen recording button can also be displayed in other locations, such as the menu bar, function Among the buttons, the "Video Recording” toolbar can also be located on other interfaces or locations, and the "Video Recording” toolbar can also include other information or buttons, and this application does not limit this.
  • FIG. 12 shows a scenario example of a screen sharing method provided by the embodiment of the present application.
  • the windows of Android applications can be shared.
  • window 1200 of Android application 3 there are 4 windows displayed on the computer, namely window 1200 of Android application 3, window 1210 of Android main interface, and non-Android window 1200.
  • Android application 3 can be any Android application that supports the screen sharing function.
  • Android application 3 and Android application 1 described in Figure 9 may be the same application, or they may be different applications. In other words, the same application may support both screen recording and sharing functions, or it may support only one of them.
  • the window 1200 of the Android application 3 includes a share screen button 1201, and the user can start sharing the window 1200 of the Android application 3 through the share screen button 1201.
  • the computer detects the user's operation to start the sharing function of the window 1200 of the Android application 3, such as the user's click operation on the share screen button 1201.
  • the data of the window 1200 of the Android application 3 is rendered to the Android application. 3, and then obtain the data in the surface for sharing (or forwarding).
  • the computer starts to share the window 1200 of the Android application 3.
  • a stop sharing button 1202 may also be displayed in the window 1200 of the Android application 3, and the user can stop sharing the window 1200 of the Android application 3 through the stop sharing button 1202.
  • the sharing interface displayed on the side of the device (such as a tablet) shared by the computer is the window 1200 of the Android application 3.
  • FIG. 13 shows a scenario example of yet another screen sharing method provided by an embodiment of the present application.
  • recording of windows of non-Android applications and/or windows of non-Android main interfaces can be achieved.
  • the window 1300 of the Android application 3 there are four windows displayed on the computer, namely the window 1300 of the Android application 3, the window 1310 of the Android main interface, the window 1320 of the non-Android main interface, and the window 1330 of the non-Android application.
  • the window 1300 of the Android application 3 includes a share screen button 1301, through which the user can share a window of a non-Android application or a window of a non-Android main interface.
  • the computer detects a click operation such as the user's click on the share screen button 1301 included in the window 1300 of the Android application 3, and in response to the operation, determines whether the Android application 3 is a default Android application. If it is a default Android application, application, the data of the non-Android application window (i.e., the non-Android application window 1330) and/or the data of the non-Android main interface window (i.e., the non-Android main interface window 1320) is rendered to the surface provided by the Android application 3. , and then obtain the data in the surface for sharing. Please refer to the following for the specific process.
  • a click operation such as the user's click on the share screen button 1301 included in the window 1300 of the Android application 3
  • the computer starts to share the window 1330 of the non-Android application and the window 1320 of the non-Android main interface.
  • a stop sharing button 1302 can also be displayed in the window 1320 of the non-Android main interface.
  • the user can use the stop sharing button 1302 to control the window 1330 of the non-Android application and/or the non-Android main interface. Stop sharing of window 1320, etc.
  • the sharing interface displayed on the side of the computer-shared device is a non-Android application window 1330 and a non-Android main interface window 1320.
  • the computer shares the windows of non-Android applications and the windows of non-Android main interfaces by default (Figure 13 takes this as an example). It is understandable that multiple non-Android application windows may be displayed on the computer at the same time. This example can share the windows of multiple non-Android applications. In other examples, the computer defaults to sharing one of the windows of a non-Android application and a window of a non-Android home screen. Optionally, in this example, the computer can share all non-Android application windows by default, or share the non-Android main interface windows, or select all non-Android application windows and non-Android main interface windows. A window for sharing.
  • the computer can also share the windows of non-Android applications and/or the windows of non-Android main interfaces, and this application does not impose specific restrictions on this.
  • the user can also select the window that needs to be shared.
  • the computer may display the selection interface 1400 in response to a user's click operation on the share screen button 1301 included in the window 1300 of the Android application 3 shown in (1) in FIG. 13 , where , the selection interface 1400 includes one or more non-Android application windows, such as: the window of application 4 (i.e., the non-Android application window 1330 described in (1) in Figure 13), and a non-Android main interface window. , such as the window of the computer's main interface (that is, the window 1320 of the non-Android main interface described in (1) in Figure 13).
  • the user can select the window he wants to share according to his needs. For example, if the user wants to share the window of application 4 at this time, the user selects the window of application 4 and clicks the confirm sharing button 1401. In response to the user's operation, the computer Start sharing the window of application 4.
  • the sharing interface displayed on the side of the computer sharing device (such as a tablet computer) is the window of application 4 (not shown in the figure).
  • the user can also pre-set the windows that need to be shared, for example: setting the priority to share the windows of Android applications, or the priority to share the windows of non-Android applications and/or the windows of non-Android main interfaces. Or, set the priority order of Android application windows, non-Android application windows, and non-Android main interface windows from high to low, and share them according to this priority order, if there is no high-priority window. , and then share windows with low priority. It can be understood that the foregoing priority order is only an example, and the priority order can also be other orders. Alternatively, users can also set up to share only a certain window, for example: only share windows of Android applications, or only share windows of non-Android applications, etc.
  • the screen sharing interface shown in FIG. 12 and/or FIG. 13 may also include the sharing time (not shown in the figure).
  • FIG. 12 and FIG. 13 are only one possible example.
  • the share screen button, stop sharing button, etc. can also be displayed in other positions, or through This application does not limit the display of other function buttons, menu bars, etc.
  • the above scenario example is based on the user activating only one of the screen recording and screen sharing functions at the same time.
  • the user can also activate the screen recording and screen sharing functions at the same time.
  • the window of an Android application can include screen recording. button and share screen button. Users can activate the screen recording and screen sharing functions through the screen recording button and the share screen button respectively.
  • the functions of the screen recording button and the screen sharing button can be implemented through one button or through multiple buttons, and this application does not limit this.
  • the windows of the Android application and the windows of the Android main interface described in Figures 9 to 14 can be opened and displayed on the computer in the Android emulator scenario, or they can be displayed by other devices in the multi-screen scenario.
  • the screen of the device is projected to the display on the computer.
  • the screen recording and/or sharing function when the screen recording and/or sharing function is started through a preset Android application (such as the Changlian application), the recording and/or sharing function of a window of a non-Android application or a window of a non-Android main interface can be implemented. .
  • the screen recording and/or sharing function is started through a non-default Android application, the function of recording and/or sharing the window of the Android application can be implemented.
  • the default Android application can be set by the developer according to actual needs.
  • prompt information (such as voice broadcast prompt information, display screen display prompt information, etc.) can be output first, Remind the user to select the window they want to record and/or share through prompt information.
  • prompt information such as voice broadcast prompt information, display screen display prompt information, etc.
  • prompt information can be output first, Remind the user to select the window they want to record and/or share through prompt information.
  • window options in the prompt information such as: one or more windows of Android applications, one or more windows of non-Android applications. , windows other than the Android main interface, etc.
  • the Android applications included in the prompt information may only include Android applications used to initiate screen recording and/or sharing functions, or may include Android applications other than Android applications used to initiate screen recording and/or sharing functions. , this application does not impose specific restrictions on this.
  • each interface is only a schematic diagram and does not constitute a limitation of the present application. In actual applications, each interface may include more or less content, and may also include more or fewer interfaces, which will be described uniformly here.
  • the Android application runs under the Android operating system, and the Android operating system can run in a non-Android operating system with an Android emulator installed.
  • the non-Android operating system is a Windows system as an example. .
  • the Android operating system can adopt a layered architecture, event-driven architecture, micro-core architecture, micro-service architecture, or cloud architecture.
  • the embodiment of this application uses a layered architecture
  • the system is taken as an example to illustrate the principle of the electronic device recording and/or sharing the window of the Android application.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android operating system includes at least three layers, from top to bottom: application layer, framework layer, and native service layer.
  • the application layer can include a series of Android application packages. These Android application packages can include applications that support the screen recording function (referred to as screen recording applications), applications that support the screen sharing function (referred to as screen sharing applications), and applications that do not support the screen recording function (referred to as non-screen recording applications) , one or more Android applications that do not support the screen sharing function (referred to as non-screen sharing applications), etc.
  • Figure 15 only shows the screen recording application and the screen sharing application.
  • an Android application may support both the screen recording function and the screen sharing function, or it may only support one of the functions, or it may not support both functions.
  • the application corresponding devices included in the application layer An icon is provided, and the icon can be displayed to the user through the display screen so that the user can click on the icon of the application to open the application or perform other operations.
  • a window corresponding to the application will be generated in the Android operating system.
  • the electronic device detects a user's click operation on the icon 111 of Application 1, and starts Application 1.
  • a window corresponding to the application will be generated in the Android operating system.
  • the framework layer of the Android system includes window management service (window manager service, WMS), display management service (display manager service, DMS), multimedia project (media projection) module, etc.
  • WMS can be used for window management (for example, adding windows, deleting windows, modifying windows, etc.).
  • a window corresponds to a surface.
  • surface corresponds to a data buffer.
  • it can be used by applications in the application layer to draw data in it, and put the drawn data into the buffer queue (bufferqueue) to display the application window.
  • it can also be used by the surface composition (SurfaceFlinger) service to draw data (or render data) into it to achieve recording and/or sharing of the application's window.
  • DMS can be used to manage the life cycle of a display.
  • DMS can create a corresponding display for each window and establish a one-to-one correspondence between the window and the display, that is, establish a one-to-one correspondence between the window identity (Window ID) and the display identity (Display ID).
  • display is a display area on the screen of an electronic device. This display area can be called a logical display (logical display) (or logical display device), and the logical display carries the data of the window.
  • the multimedia project module can be used to capture the current screen and record screen videos, etc.
  • the local service layer includes the surface synthesis (SurfaceFlinger) service.
  • the SurfaceFlinger service is used to obtain the surface drawn by the Android application from the buffer queue and synthesize it to display the application window.
  • the SurfaceFlinger service is used to render data in the surface provided by the application layer application to achieve recording and/or sharing of the application window. It can be understood that the SurfaceFlinger service renders the surface, that is, it renders the memory corresponding to the surface.
  • the Android emulator includes an Android application window information module, which can be used to store the correspondence between windows and Display IDs, such as the correspondence between Window IDs and Display IDs. It should be noted that the functions of the Android application window information module in Figure 15 are implemented by the Android emulator; in other embodiments, the functions of the Android application window information module can also be implemented by the Windows system.
  • the user can activate the recording and/or sharing functions of the Android application in the application layer, so that after the recording and/or sharing functions of an Android application are enabled, the Android application will provide a surface to the framework layer ( surface).
  • the framework layer calls the DMS through the MediaProjection module, WMS, etc.
  • DMS uses the createvirtualdisplay function to create a virtual display device (virtual display device) (or virtual display) corresponding to the surface provided by the Android application. It can be understood that the virtual display device can be used to mirror the data in the logical display to achieve recording and/or sharing of the data in the logical display.
  • DMS obtains the Display ID corresponding to the window of the Android application from the Android application window information module. For example, DMS obtains the corresponding relationship between the Window ID and Display ID saved in the Android application window information, and the Window ID of the Android application window. The corresponding Display ID can be determined. Then, DMS binds the virtual display device corresponding to the created Android application to the logical display corresponding to the obtained Display ID.
  • the SurfaceFlinger service renders the data in the logical display corresponding to the Display ID to the surface corresponding to the virtual display device, that is, the surface provided by the Android application in the application layer.
  • the Android application obtains the surface corresponding to the rendered virtual display device to complete recording and/or sharing.
  • Figure 16 shows a schematic flowchart of a method for recording and/or sharing a window of an Android application provided by an embodiment of the present application. As shown in Figure 16, the method Includes the following steps:
  • the electronic device receives user operation.
  • the user operation is used to start the screen recording and/or sharing function of the Android application.
  • the user operation may be a click operation on the screen recording button 1001 included in the window 1000 of application 2 , or, as shown in (1) in FIG. 12 , the The user operation may be a click operation on the share screen button 1201 included in the window 1200 of the application 3, or the like.
  • the user operation may be a user operation on the electronic device.
  • the user operation may be the user's operation on the electronic device (or the device being projected), or it may be the user's operation on the projection device.
  • the screen projection device can also send the user's operation to the screen projection device. This application does not place any restrictions on the user's operations.
  • the Android application in the application layer provides a surface to the framework layer.
  • the Android application is an Android application in which the user activates the screen recording and/or sharing function in step S1601.
  • the application layer and framework layer please refer to Figure 15.
  • the framework layer obtains the display (Display) ID from the Windows system.
  • the Display ID is the Display ID corresponding to the logical display corresponding to the window of the Android application.
  • the framework layer can obtain the Display ID based on the corresponding relationship between Window ID and Display ID, and the Window ID corresponding to the window of the Android application.
  • the Window ID corresponding to the window of the Android application can be determined based on the surface provided by the Android application.
  • the Window system returns the Display ID to the framework layer.
  • the framework layer creates a virtual display device corresponding to the surface.
  • the surface is a surface provided by an Android application in the application layer.
  • the framework layer can create the virtual display device through the createvirtualdisplay function.
  • the framework layer binds the virtual display device to the logical display.
  • the framework layer can determine the corresponding logical display based on the obtained Display ID, and bind the logical display to the virtual display device. It can be understood that the purpose of binding the virtual display device to the logical display is to render the data in the logical display into the surface corresponding to the virtual display device, that is, into the memory of the surface corresponding to the virtual display device.
  • the framework layer can bind the virtual display device to the logical display through one or more functions of addLogicalDisplayLocked, newLogicalDisplay, configureDisplayLocked, etc.
  • the frame layer renders the data in the logical display to the surface.
  • the framework layer renders the data in the logical display to the surface corresponding to the bound virtual display device.
  • This surface is also the surface provided by the Android application of the application layer in step S1602.
  • the Android application obtains Go to the surface corresponding to the rendered virtual display device to complete recording and/or sharing.
  • the framework layer can render the surface provided by the Android application through the setSurfaceLocked function.
  • the Android operating system can run in a non-Android operating system with an Android emulator installed.
  • the non-Android operating system is a Windows system as an example.
  • the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
  • the layers communicate through software interfaces.
  • the Android operating system includes at least three layers, from top to bottom: application layer, framework layer, and local service layer.
  • application layer For an introduction to the application layer, please refer to Figure 15.
  • the framework layer includes multimedia project modules and communication modules.
  • multimedia project module For an introduction to the multimedia project module, please refer to the introduction of the multimedia project module described in Figure 15.
  • the communication module can be used for communication between the Android system and the Android emulator, and/or communication between the framework layer and the local service layer.
  • the local service layer includes the new rendering module and SurfaceFlinger service.
  • the new rendering module is used to cooperate with the SurfaceFlinger service to complete the rendering of the surface.
  • the Android emulator includes a communication module, a Windows window capture module, and a render control module.
  • the communication module is used for communication between the Android system and the Android emulator.
  • the technology used in the communication module can be qemu pipe technology. Since qemu pipe technology is an existing technology, this article will not introduce it in detail.
  • the Windows window capture module is used to obtain data of windows of non-Android applications and/or data of windows of non-Android main interface.
  • the Windows window capture module can use graphics device interface (GDI) technology to obtain data of windows of non-Android applications and/or data of windows of non-Android main interfaces.
  • GDI graphics device interface
  • the Windows window capture module can also use other technologies to obtain data of windows of non-Android applications and/or data of windows of non-Android main interfaces. This application does not limit this.
  • the rendering control module is used to render the surface, that is, to fill data into the memory corresponding to the surface.
  • the functions of the communication module, Windows window grabbing module, and rendering control module in Figure 17 are implemented by the Android emulator; in other embodiments, the functions of the communication module, Windows window grabbing module, rendering control module, etc. One or more functions can also be implemented by Windows systems.
  • the user starts the recording or sharing function of the Android application in the application layer.
  • the user can start Application 2 through the screen recording button 1001 included in the window 1000 of Application 2.
  • the screen recording function; or, as shown in (1) in FIG. 12 the user can start the screen sharing function of Application 3 through the share screen button 1201 included in the window 1200 of Application 3.
  • the Android application will provide a surface to the framework layer.
  • the framework layer receives the surface provided by the Android application through the multimedia project module, and the multimedia project module passes the surface to the new rendering module.
  • the new rendering module can apply for the memory corresponding to the surface from the buffer queue (bufferqueue) through the dequeue function.
  • This memory is called the color buffer (colorbuffer).
  • colorbuffer This memory
  • data transfer between producers and consumers is implemented through buffer queues. For example, producers can apply for a colorbuffer from the buffer queue through the dequeue function and write data to the colorbuffer. After the writing is completed, they can use the queue The function puts the colorbuffer back into the buffer queue, and subsequently, the consumer can read data from the buffer queue.
  • the new rendering module locks the colorbuffer through the lock function to prevent other threads from occupying the colorbuffer. Subsequently, obtain the handle of the colorbuffer and pass the handle to the communication module of the framework layer. It can be understood that the handle is the address index of the colorbuffer, and the colorbuffer can be found through the handle.
  • the communication module of the framework layer passes the obtained handle to the communication module of the Android simulator, and the communication module of the Android simulator can pass the handle to the rendering control module.
  • the Android simulator finds the corresponding colorbuffer through this handle, which is also the colorbuffer corresponding to the surface provided by the Android application in the application layer. After finding it, the communication module in the Android emulator notifies the new rendering module to update the colorbuffer.
  • the new rendering module receives the notification to update the colorbuffer, it can use the unlock function to unlock the colorbuffer and update the colorbuffer.
  • the update After the update is completed, it notifies the Android simulator to render the colorbuffer through the communication module of the framework layer.
  • the communication module in the Android simulator obtains the data in the window of the non-Android application and/or the data in the window of the non-Android main interface through the Windows window grabbing module, and obtains the data.
  • the data is sent to the rendering control module, and the rendering control module renders the acquired data into the colorbuffer corresponding to the handle, and also renders the acquired data into the surface provided by the Android application.
  • the communication module of the Android emulator notifies the new rendering module to perform the queuebuffer operation, and also puts the rendered colorbuffer into the buffer queue.
  • the Windows window capture module can obtain data in the windows of all non-Android applications on the current electronic device. And data in windows other than the Android main interface.
  • the electronic device can determine the need based on the information of the window that needs to be recorded (such as Window ID, etc.) Record or share the window to obtain the data in the corresponding window.
  • the new rendering module after receiving the notification to perform the queuebuffer operation, performs the queuebuffer operation. For example, the new rendering module can put the colorbuffer into the buffer queue through the queue function.
  • the SurfaceFlinger service performs rendering synthesis on the data in the buffer queue, which can record data in windows of non-Android applications and/or windows of non-Android main interfaces.
  • modules or services included in each layer of the layered architecture shown in Figure 15 and Figure 17 are only for illustrative purposes, and they can also be divided in other ways.
  • the surface synthesis (SurfaceFlinger) module can also be located in the application layer, this application does not limit this.
  • Figure 18 shows a schematic flowchart of a method for recording or sharing a window of a non-Android application and/or a window of a non-Android main interface provided by an embodiment of the present application, as follows: As shown in Figure 18, the method includes the following steps:
  • the electronic device receives user operation.
  • step S1601 For an introduction to this step, please refer to the relevant introduction to step S1601 in Figure 16 .
  • the Android application in the application layer provides a surface to the framework layer.
  • the Android application is an Android application in which the user activates the screen recording or sharing function in step S1801.
  • the application layer and framework layer please refer to Figure 17.
  • the frame layer applies for a colorbuffer based on the surface and locks the colorbuffer.
  • the frame layer can apply for the colorbuffer corresponding to the surface from the buffer queue, and then lock the colorbuffer through the lock function.
  • the framework layer sends the handle corresponding to the colorbuffer to the Windows system.
  • the Windows system receives the handle corresponding to the colorbuffer.
  • the Windows system can find the corresponding colorbuffer based on the handle.
  • the Windows system sends the first message to the framework layer.
  • the framework layer receives the first message.
  • the first message is used to instruct the framework layer to update the colorbuffer.
  • the framework layer sends the second message to the Windows system.
  • the Windows system receives the second message.
  • the second message may be used to instruct the Windows system to render the colorbuffer.
  • the Windows system obtains the data in the window of the non-Android application and/or the data in the window of the main interface of the non-Android application, and renders the obtained data into the colorbuffer, that is, fills the data into the colorbuffer.
  • the Windows system sends the third message to the framework layer.
  • the third message is used to instruct the framework layer to put the colorbuffer back into the buffer queue.
  • the framework layer puts the colorbuffer back into the buffer queue.
  • the framework layer performs queuebuffer operations.
  • the framework layer processes the data in the buffer queue.
  • the framework layer performs operations such as rendering and synthesis on the data in the buffer queue, which can achieve recording of windows of non-Android applications and/or windows of non-Android main interfaces.
  • the electronic device can use the package name of the application package of the Android application and the identification of the virtual reality device corresponding to the surface provided by the Android application ( One or more of the display names (name), etc. determine whether the Android application is a default Android application.
  • the electronic device can modify the window and/or window of the non-Android application. Or a window other than the Android main interface for recording and/or sharing, that is, the electronic device can perform the process or method described in Figures 17 and 18.
  • the electronic device can record and/or share the window of the Android application, that is, the electronic device can perform the process or method described in Figures 15 and 16 .
  • Figures 15 to 18 are introduced based on the assumption that both the Android operating system and the Windows operating system are running on electronic devices (such as an Android emulator scenario).
  • the Android operating system and the Windows operating system can also be run on different electronic devices.
  • the methods provided in the embodiments of this application are also applicable.
  • Figure 19 shows a schematic flowchart of a screen recording and sharing method provided by an embodiment of the present application. The method includes the following steps:
  • the electronic device receives the user's target operation in the first window of the electronic device.
  • the first window is the window of the first application.
  • the first application runs in the Android operating system, that is, the first application is an Android application.
  • the target action can be used to initiate screen recording and/or sharing functionality.
  • the target operation may be a triggering operation on a screen recording button, a screen sharing button, etc. included in the first window.
  • the electronic device In response to the target operation, the electronic device records and/or shares the target window of the electronic device.
  • the target window is the first window or the second window
  • the second window is the window of the second application
  • the second application runs in a non-Android operating system.
  • the second application may include one or more non-Android applications
  • the target window may include one or more windows.
  • the non-Android main interface may also be called the second application.
  • the window of the second application includes one or more of a main interface window of a non-Android operating system and a window of an application in a non-Android operating system.
  • the electronic device can obtain the data of the window of the Android application, or obtain the data of the window of the non-Android application and/or the non-Android main interface.
  • Window data enables recording and/or sharing of one or more of Android application windows, non-Android application windows, non-Android main interface windows, etc.
  • the Android operating system and the non-Android operating system can both be installed in electronic devices, or one of the systems can also be installed in devices other than electronic devices, for example: the non-Android operating system is installed in electronic devices. , the Android operating system is installed on other devices in this system.
  • the electronic device can record and/or share the first window through the method shown in Figure 20.
  • the method includes the following steps:
  • the Android operating system obtains the identifier of the first display device corresponding to the first window from the non-Android operating system.
  • the first display device is used to carry data of the first window.
  • the first display device may be a logical display device, and the identifier of the first display device may be the Display ID mentioned above.
  • the non-Android operating system stores the corresponding relationship between the identifier of the first window and the identifier of the first display device.
  • the Android operating system can obtain the corresponding identifier of the first display device based on the identifier of the first window.
  • the Android operating system obtains the data of the first window according to the identification of the first display device.
  • the Android operating system can obtain the data carried by the first display device, that is, the data of the first window, according to the identifier of the first display device.
  • the Android operating system records and/or shares the data in the first window.
  • the Android operating system can render the data of the first window into the memory of the first surface corresponding to the second display device.
  • the second display device is created based on the first surface.
  • the second display device is the logical display device described above.
  • the first surface corresponds to the first application, that is, the first surface is a surface provided by the first application.
  • the Android operating system renders the second display By recording and/or sharing the data in the memory of the first surface corresponding to the display device, the data of the first window can be recorded and/or shared.
  • the window corresponding to the Display ID of 0 (that is, the window of the Android main interface) is recorded by default.
  • the Android operating system can obtain the Display ID corresponding to the window of the Android application from a non-Android operating system, and obtain the data of the window of the Android application based on the Display ID, thereby realizing the window of the Android application. of recording.
  • the electronic device can record and/or share the second window through the method shown in Figure 21.
  • the method includes the following steps:
  • the Android operating system obtains the data of the second window from the non-Android operating system.
  • the non-Android operating system can obtain the data of the second window, and then render the data of the second window into the memory of the second surface.
  • the memory of the second surface is determined by the Android operating system.
  • the Android operating system can apply for the memory of the second surface from the buffer queue.
  • the second surface corresponds to the first application, that is, the second surface is provided by the first application.
  • the non-Android operating system sends the data in the memory of the second surface that has been rendered to the Android operating system.
  • the Android operating system receives the data in the memory of the second surface that has been rendered, that is, it receives the data of the second window. data.
  • the Android operating system can first determine the memory of the second surface, and then send a target handle to the non-Android operating system.
  • the target handle is used to indicate the address of the memory of the second surface.
  • non-Android operating systems can determine the memory of the second surface based on the target handle.
  • the Android operating system records and/or shares the data in the second window.
  • the Android operating system records and/or shares the data in the memory of the second surface after rendering, thereby completing the recording and/or sharing of the data of the second window.
  • the Android operating system can obtain the data of the window of the non-Android application and/or the data of the window of the non-Android main interface from the non-Android operating system, For example: the Android operating system can intercept the surface provided by the Android application and no longer execute the native rendering logic.
  • the native rendering logic is: the Android operating system renders the data of the window with Display ID 0 to the surface by default, but re-renders the data to the surface for Android.
  • the surface provided by the application applies for memory, and then passes the memory address of the surface to the non-Android operating system.
  • the non-Android operating system can render the data of the non-Android application window and/or the data of the non-Android main interface window into the surface. , and then send the rendered surface to the Android operating system, so that the data in the surface can be recorded and/or shared, that is, the windows of non-Android applications and/or the windows of non-Android main interfaces can be recorded and shared. /or share.
  • the electronic device includes corresponding hardware structures and/or software modules that perform each function.
  • the embodiments of this application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is performed in hardware or computer-driven hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solutions of the embodiments of the present application.
  • This application is an embodiment that can divide electronic equipment into functional modules according to the above method examples, for example, Each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing unit.
  • the above-mentioned integrated units can be implemented in the form of hardware or software function modules. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. In actual implementation, there may be other division methods.
  • FIG 22 it is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the electronic device 2200 can be used to implement the methods described in each of the above method embodiments.
  • the electronic device 2200 may specifically include: a processing unit 2201 and a display unit 2202.
  • the processing unit 2201 is configured to support the electronic device 2200 in performing steps S1601 to S1607 in FIG. 16 . And/or, the processing unit 2201 is configured to support the electronic device 2200 in performing steps S1801 to S1812 in FIG. 18 . And/or, the processing unit 2201 is configured to support the electronic device 2200 in performing steps S1901 to S1902 in FIG. 19 . And/or, the processing unit 2201 is configured to support the electronic device 2200 in performing steps S2001 to S2003 in FIG. 20 . And/or, the processing unit 2201 is configured to support the electronic device 2200 in performing steps S2101 to S2102 in FIG. 21 . And/or, the processing unit 2201 is also used to support the electronic device 2200 to perform other steps performed by the electronic device in the embodiment of the present application.
  • the display unit 2202 is used to support the electronic device 2200 to display one or more windows displayed by the computer in Figures 9 to 14. And/or, the display unit 2202 is also used to support the electronic device 2200 to perform other display operations performed by the electronic device in the embodiment of the present application.
  • the electronic device 2200 shown in FIG. 22 may also include a communication unit 2203, which is used to support the electronic device 2200 in performing the steps of communication between the electronic device and other electronic devices in the embodiment of the present application.
  • a communication unit 2203 which is used to support the electronic device 2200 in performing the steps of communication between the electronic device and other electronic devices in the embodiment of the present application.
  • the electronic device 2200 shown in Figure 22 may also include a storage unit (not shown in Figure 22), which stores programs or instructions.
  • a storage unit not shown in Figure 22
  • the processing unit 2201 executes the program or instruction
  • the electronic device 2200 shown in Figure 22 can perform the method shown in any of Figures 16, 18 to 21.
  • the processing unit 2201 involved in the electronic device 2200 shown in FIG. 22 can be implemented by a processor or a processor-related circuit component, and can be a processor or a processing module.
  • the communication unit 2203 can be implemented by a transceiver or a transceiver-related circuit component, and can be a transceiver or a transceiver module.
  • the display unit 2202 may be implemented by display screen related components.
  • the chip system includes at least one processor 2301 and at least one interface circuit 2302.
  • the processor 2301 and the interface circuit 2302 may be interconnected via wires.
  • interface circuitry 2302 may be used to receive signals from other devices.
  • interface circuit 2302 may be used to send signals to other devices (eg, processor 2301).
  • the interface circuit 2302 can read instructions stored in the memory and send the instructions to the processor 2301.
  • the electronic device can be caused to perform various steps performed by the electronic device in the above embodiments.
  • the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
  • processors in the chip system there may be one or more processors in the chip system.
  • the processor can be implemented in hardware or software.
  • the processor may be a logic circuit, an integrated circuit, or the like.
  • the processor may be a general-purpose processor implemented by reading software code stored in memory.
  • the memory may be integrated with the processor or may be provided separately from the processor, which is not limited by this application.
  • the memory can be a non-transient processor, such as a read-only memory ROM, which can be integrated on the same chip as the processor, or can be separately provided on different chips.
  • This application describes the type of memory, and the relationship between the memory and the processor. There is no specific limitation on how the processor is configured.
  • the chip system can be a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), or a system on chip (SoC). It can also be a central processor (central processor unit, CPU), a network processor (network processor, NP), a digital signal processing circuit (digital signal processor, DSP), or a microcontroller (micro controller unit (MCU), or a programmable logic device (PLD) or other integrated chip.
  • FPGA field programmable gate array
  • ASIC application specific integrated circuit
  • SoC system on chip
  • CPU central processor unit
  • NP network processor
  • DSP digital signal processing circuit
  • MCU microcontroller
  • PLD programmable logic device
  • each step in the above method embodiment can be completed by an integrated logic circuit of hardware in the processor or instructions in the form of software.
  • the method steps disclosed in conjunction with the embodiments of this application can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • Embodiments of the present application also provide a computer storage medium.
  • Computer instructions are stored in the computer storage medium.
  • the electronic device causes the electronic device to execute the method described in the above method embodiment.
  • Embodiments of the present application provide a computer program product.
  • the computer program product includes: a computer program or instructions. When the computer program or instructions are run on a computer, the computer is caused to execute the method described in the above method embodiment.
  • the embodiment of the present application also provides a device.
  • This device may be a chip, a component or a module.
  • the device may include a connected processor and a memory.
  • the memory is used to store computer execution instructions. When the device is running, the processing The device can execute computer execution instructions stored in the memory, so that the device executes the methods in each of the above method embodiments.
  • the electronic equipment, computer storage media, computer program products or chips provided in this embodiment are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the corresponding methods provided above. The beneficial effects of the method will not be repeated here.
  • Units described as separate components may or may not be physically separate and shown as separate components.
  • a component can be one physical unit or multiple physical units, that is, it can be located in one place, or it can be distributed in many different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit.
  • the above integrated units can be implemented in the form of hardware or software functional units.
  • Integrated units may be stored in a readable storage medium if they are implemented in the form of software functional units and sold or used as independent products.
  • the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods of various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.

Abstract

一种屏幕录制和共享的方法及电子设备,涉及电子设备技术领域。在诸如安卓模拟器、多屏协同等场景下,能够录制和/或共享除安卓主界面的窗口以外的窗口,比如:安卓应用的窗口、非安卓应用的窗口,非安卓操作系统的主界面的窗口等中的一种或多种。方法可以应用于具有显示屏的电子设备,该方法包括:接收用户在电子设备的第一窗口内的目标操作,第一窗口为第一应用的窗口;响应于目标操作,对电子设备的目标窗口进行录制和/或共享,目标窗口为第一窗口或者第二窗口,第二窗口为第二应用的窗口;其中,第一应用运行在安卓操作系统中,第二应用运行在非安卓操作系统中。

Description

屏幕录制和共享的方法及电子设备
本申请要求于2022年06月29日提交国家知识产权局、申请号为202210753227.8、发明名称为“屏幕录制和共享的方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及电子设备技术领域,尤其涉及一种屏幕录制和共享的方法及电子设备。
背景技术
目前,在安卓模拟器、多屏协同等场景下,一个非安卓操作系统的电子设备(如电脑)上可能显示有安卓应用的窗口、安卓操作系统的主界面的窗口,非安卓应用的窗口,非安卓操作系统的主界面的窗口等多种窗口。其中,安卓模拟器能够在非安卓操作系统(比如:电脑操作系统)上模拟安卓操作系统,实现在电脑上安装、运行、卸载安卓应用,让用户在电脑上也能体验安卓应用。在多屏协同场景中,投屏设备(如手机)和被投屏设备(如电脑)建立连接(如有线连接或无线连接)后,投屏设备可以将投屏设备的界面图像投屏到被投屏设备上显示。
有时,用户存在对电子设备上显示的应用的窗口进行录制(或称录屏)和/或共享的需求,但是在诸如上述安卓模拟器、多屏协同等场景下,仅能实现对电子设备上显示的安卓操作系统的主界面的窗口的录制和/或共享,用户并不能录制和/或共享除安卓主界面的窗口以外的窗口,比如:安卓应用的窗口、非安卓应用的窗口,非安卓操作系统的主界面的窗口等。
发明内容
本申请提供一种屏幕录制和共享的方法及电子设备,在诸如安卓模拟器、多屏协同等场景下,还能够录制和/或共享除安卓主界面的窗口以外的窗口,比如:安卓应用的窗口、非安卓应用的窗口,非安卓操作系统的主界面的窗口等中的一种或多种。
为达到上述目的,本申请采用如下技术方案:
第一方面,本申请提供一种屏幕录制和共享的方法,应用于具有显示屏的电子设备,方法包括:接收用户在电子设备的第一窗口内的目标操作,第一窗口为第一应用的窗口;响应于目标操作,对电子设备的目标窗口进行录制和/或共享,目标窗口为第一窗口或者第二窗口,第二窗口为第二应用的窗口;其中,第一应用运行在安卓操作系统中,第二应用运行在非安卓操作系统中。
该方法中,运行在安卓操作系统内的安卓应用的窗口可以在非安卓操作系统(比如,等)显示。电子设备可以根据用户在安卓应用的窗口的操作,启动对该安卓应用的窗口录制和/或共享,或者,启动对非安卓应用的窗口、非安卓主界面的窗口等中的一种或多种的录制和/或共享。
一种可能的设计中,响应于目标操作,对目标窗口进行录制和/或共享,包括:若第一应用不是预设应用,则响应于目标操作,对第一窗口进行录制和/或共享;若第一应用是预设应用,则响应于目标操作,对第二窗口进行录制和/或共享。基于该设计,电子设备可以根据安卓应用是否为预设应用确定是对安卓应用的窗口进行录制和/或 共享,还是对非安卓应用的窗口和/或非安卓主界面的窗口进行录制和/或共享。
一种可能的设计中,对第一窗口进行录制和/或共享,包括:安卓操作系统从非安卓操作系统获取第一窗口对应的逻辑显示设备的标识,逻辑显示设备用于承载第一窗口的数据;安卓操作系统根据逻辑显示设备的标识获取第一窗口的数据;安卓操作系统对第一窗口的数据进行录制和/或共享。基于该设计,电子设备在获取到用户启动安卓应用的录制和/或共享的功能的操作之后,能够获取安卓应用窗口对应的逻辑显示设备的标识,进而根据该逻辑显示设备的标识获取到安卓应用的窗口的数据,实现对安卓应用的窗口的录制和/或共享。
一种可能的设计中,安卓操作系统对第一窗口的数据进行录制和/或共享,包括:安卓操作系统将第一窗口的数据渲染到虚拟显示设备对应的第一表面surface的内存中,虚拟显示设备根据第一surface创建,第一surface与第一应用对应;安卓操作系统对渲染完成的虚拟显示设备对应的第一surface的内存中的数据进行录制和/或共享。基于该设计,电子设备可以将安卓应用的窗口的数据渲染到虚拟显示设备对应的surface的内存中,然后获取该虚拟显示设备对应的surface的内存中的数据进行录制和/或共享,即可完成对安卓应用的窗口的录制和/或共享。
一种可能的设计中,对第二窗口进行录制和/或共享,包括:安卓操作系统从非安卓操作系统获取第二窗口的数据;安卓操作系统对第二窗口的数据进行录制和/或共享。基于该设计,电子设备可以获取到非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据,实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制和/或共享。
一种可能的设计中,安卓操作系统从非安卓操作系统获取第二窗口的数据,包括:非安卓操作系统获取第二窗口的数据;非安卓操作系统将第二窗口的数据渲染到第二surface的内存中,第二surface的内存由安卓操作系统确定,第二surface与第一应用对应;非安卓操作系统向安卓操作系统发送渲染完成的第二surface的内存中的数据。基于该设计,电子设备可以将获取到的非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据渲染到安卓应用提供的surface中,后续获取该surface中的数据进行录制和/或共享,即可完成对非安卓应用的窗口和/或非安卓主界面的窗口的录制和/或共享。
一种可能的设计中,在非安卓操作系统将第二窗口的数据渲染到第二surface的内存中之前,方法还包括:安卓操作系统确定第二surface的内存;安卓操作系统向非安卓操作系统发送目标句柄,目标句柄用于指示第二surface的内存的地址;非安卓操作系统根据目标句柄确定第二surface的内存。基于该设计,电子设备可以根据surface的句柄确定surface的内存,以便后续向该surface的内存中渲染数据。
一种可能的设计中,安卓操作系统对第二窗口的数据进行录制和/或共享,包括:安卓操作系统对渲染完成的第二surface的内存中的数据进行录制和/或共享。
一种可能的设计中,第二应用的窗口包括非安卓操作系统的主界面的窗口、非安卓操作系统中的应用的窗口中的一种或多种。
一种可能的设计中,目标操作包括对第一窗口内包括的屏幕录制按钮和/或屏幕共享按钮的触发操作。
一种可能的设计中,响应于目标操作,对电子设备的目标窗口进行录制和/或共享,包括:响应于目标操作,显示至少一个窗口的选项,至少一个窗口的选项中包括第一 窗口的选项和/或第二窗口的选项;接收用户对至少一个窗口的选项中目标窗口的选定操作;响应于选定操作,对目标窗口进行录制和/或共享。
第二方面,本申请提供一种电子设备,该电子设备具有实现如上述第一方面及其中任一设计所述的方法的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第三方面,本申请提供一种电子设备,包括:包括处理器、存储器和显示屏,存储器、显示屏与处理器耦合,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令,处理器从存储器中读取计算机指令,以使得电子设备执行如上述第一方面及其中任一设计所述的方法。可选的,该存储器可以与处理器耦合,或者,也可以独立于该处理器。
一种可能的设计中,电子设备还包括通信接口,该通信接口可用于电子设备与其他装置通信。示例性的,该通信接口可以为收发器、输入/输出接口、接口电路、输出电路、输入电路、管脚或相关电路等。
第四方面,本申请提供一种计算机可读存储介质,计算机可读存储介质包括计算机程序或指令,当计算机程序或指令在电子设备上运行的情况下,使得电子设备执行如上述第一方面及其中任一设计所述的方法。
第五方面,本申请提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机可以执行如上述第一方面及其中任一设计所述的方法。
第六方面,本申请提供一种芯片系统,包括至少一个处理器和至少一个接口电路,至少一个接口电路用于执行收发功能,并将指令发送给至少一个处理器,当至少一个处理器执行指令时,至少一个处理器执行如上述第一方面及其中任一设计所述的方法。
需要说明的是,上述第二方面至第六方面中任一设计所带来的技术效果可以参见第一方面中对应设计所带来的技术效果,此处不再赘述。
附图说明
图1为本申请实施例提供的一种安卓模拟器运行场景实例示意图;
图2为本申请实施例提供的又一种安卓模拟器运行场景实例示意图;
图3为本申请实施例提供的一种多屏协同场景实例示意图;
图4为本申请实施例提供的又一种多屏协同场景实例示意图;
图5为本申请实施例提供的又一种多屏协同场景实例示意图;
图6为本申请实施例提供的又一种多屏协同场景实例示意图;
图7为现有的一种屏幕录制方法的场景实例示意图;
图8为本申请实施例提供的一种电子设备的硬件结构示意图;
图9为本申请实施例提供的一种屏幕录制方法的场景实例示意图;
图10为本申请实施例提供的又一种屏幕录制方法的场景实例示意图;
图11为本申请实施例提供的又一种屏幕录制方法的场景实例示意图;
图12为本申请实施例提供的一种屏幕共享方法的场景实例示意图;
图13为本申请实施例提供的又一种屏幕共享方法的场景实例示意图;
图14为本申请实施例提供的又一种屏幕共享方法的场景实例示意图;
图15为本申请实施例提供的一种屏幕录制和共享的方法的框架示意图;
图16为本申请实施例提供的一种屏幕录制和共享的方法的流程示意图;
图17为本申请实施例提供的又一种屏幕录制和共享的方法的框架示意图;
图18为本申请实施例提供的又一种屏幕录制和共享的方法的流程示意图;
图19为本申请实施例提供的又一种屏幕录制和共享的方法的流程示意图;
图20为本申请实施例提供的又一种屏幕录制和共享的方法的流程示意图;
图21为本申请实施例提供的又一种屏幕录制和共享的方法的流程示意图;
图22为本申请实施例提供的一种电子设备的结构示意图;
图23为本申请实施例提供的一种芯片系统的结构示意图。
具体实施方式
下面结合附图对本申请实施例提供的屏幕录制和共享的方法及电子设备进行详尽的描述。
本申请的描述中所提到的术语“包括”和“具有”以及它们的任何变形,意图在于覆盖不排他的包含。例如包含了一系列步骤或单元的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括其他没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。
需要说明的是,本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。
在本申请的描述中,除非另有说明,“多个”的含义是指两个或两个以上。本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。
安卓模拟器能够在非安卓操作系统上模拟安卓操作系统,以使得用户能够在非安卓操作系统中安装、运行、卸载安卓应用。示例性的,电脑上搭载有非安卓操作系统,比如:等,在电脑上安装安卓模拟器后,用户可以在电脑上运行安卓模拟器,实现在电脑上安装、运行、卸载安卓应用。
在安卓模拟器场景下,电脑可能显示一个或多个窗口,这一个或多个窗口可以包括安卓应用的窗口,安卓操作系统的主界面的窗口(以下简称为安卓主界面的窗口),非安卓操作系统的主界面的窗口(以下简称为非安卓主界面的窗口),非安卓应用的窗口等中的一种或多种。可以理解,安卓应用可以运行在电脑上安装的安卓模拟器模拟的安卓操作系统中,非安卓应用可以运行在电脑的操作系统中,也即非安卓操作系统中,非安卓主界面的窗口指的是非安卓操作系统的桌面所在的窗口,其只有一个窗口,不包括位于桌面上的其他窗口,在此统一说明。
在一些可能的示例中,如图1中的(1)所示,电脑上安装有安卓模拟器101,用户可以通过电脑的输入设备(如鼠标、键盘等)启动安卓模拟器101。比如:电脑显示主界面100,在主界面100上显示有安卓模拟器101的图标,电脑检测到诸如用户对安卓模拟器101的图标的点击操作,响应于该操作,电脑启动安卓模拟器101。如图1中的(2)所示,电脑可以显示安卓模拟器的主界面110。可选的,在安卓模拟器的主界面110中可以包括有一个或多个安卓应用程序,比如:应用1、应用2、应用3 等,用户可以启动其中的一个或多个安卓应用程序。比如:电脑检测到诸如用户对应用1的图标111的点击操作,响应于该操作,如图1中的(3)所示,电脑可以显示应用1的运行界面120。
在图1中的(3)所述的示例中,电脑上共显示有3个窗口,分别为非安卓主界面的窗口(即主界面100)、安卓主界面的窗口(即主界面110)、安卓应用的窗口(即应用1的运行界面120)。
当然,用户还可启动电脑上的其他窗口,比如:非安卓应用的窗口。如图1中的(3)所示,在主界面100上还包括有一个或多个非安卓应用,比如:应用4、应用5等。用户可以通过应用4的图标启动应用4的窗口,通过应用5的图标启动应用5的窗口等。比如:电脑检测到诸如用户对应用4的图标102的点击操作,响应于该操作,电脑启动应用4。如图1中的(4)所示,电脑可以显示应用4的运行界面130。应用4的运行界面130即为非安卓应用的窗口。
在另一种可能的示例中,用户也可以通过其他的方式启动安卓应用的窗口。如图2中的(1)所示,电脑显示主界面200,在主界面200上显示有安卓应用(如应用1、应用2、应用3等)的图标以及非安卓应用(如应用4、应用5等)的图标。电脑检测到诸如用户对应用1的图标201的点击操作,响应于该操作,电脑启动应用1,如图2中的(2)所示,电脑显示应用1的运行界面210。同样的,用户也可以直接通过主界面200包括的应用2的图标、应用3的图标分别启动应用2、应用3等安卓应用的窗口。用户还可以通过主界面200包括的应用4的图标、应用5的图标分别启动应用4、应用5等非安卓应用的窗口。在该示例中,电脑也可呈现诸如图1中(3)和/或图1中(4)所示的界面。
在多屏协同场景下,投屏设备(如手机)和被投屏设备(如电脑)建立连接(如有线连接或无线连接)后,投屏设备可以将投屏设备的界面图像投屏到被投屏设备上显示。可选的,投屏设备可以是搭载安卓操作系统的设备,被投屏设备可以是搭载非安卓操作系统(比如:Microsoft、Windows、Linux等)的设备。可选的,无线连接可以为蓝牙连接、近场通信(near field communication,NFC)连接或者无线保真(wireless fidelity,WiFi)连接等各种方式的连接。
多屏协同场景下,被投屏设备上也可能显示一个或多个窗口,这一个或多个窗口可以是安卓应用的窗口,安卓主界面的窗口,非安卓主界面的窗口,非安卓应用的窗口等中的一种或多种。
以投屏设备为手机,被投屏设备为电脑为例,手机可以将手机上的界面投屏到电脑上显示。示例性的,如图3中的(1)所示,手机显示主界面300,其中在主界面300包括一个或多个安卓应用(比如:音乐、运动健康、智慧生活、视频等等,这里不再一一介绍)的图标,电脑显示主界面310,在主界面310中包括一个或多个非安卓应用(比如:此电脑、邮件、浏览器等)的图标。手机可以将当前显示的主界面300投屏到电脑上显示,相应的,电脑接收手机投送过来的主界面300,电脑可以显示投屏界面320。
在一些示例中,用户可以通过手机对投屏到电脑上的界面进行更新。如,若用户更新了手机上显示的界面(或称用户在手机上打开了新的界面显示),则电脑上显示 的投屏界面也会相应的更新。如图3中的(1)所示,手机检测到诸如用户对手机上的主界面300中包括的视频应用的图标301的点击操作,响应于该操作,如图3中(2)或者如图4所示,手机显示视频应用的运行界面330,此时手机上显示的界面发生更新。相应的,手机可将新的界面,即视频应用的运行界面330投屏到电脑上显示,相应的,电脑上接收到手机投送过来的新的界面,电脑上显示的投屏界面也会相应的更新。
可选的,此时电脑可以呈现诸如图3中的(2)所示的界面。该示例中,电脑上仅显示一个投屏界面,即投屏界面340,该投屏界面可以为手机当前显示的界面,如视频应用的运行界面330。或者,电脑也可以呈现诸如图4所示的界面。该示例中,在电脑上可以显示多个投屏界面,即投屏界面320和投屏界面340,其中,这多个投屏界面可以是由同一个手机投屏的。这多个投屏界面可以包括手机当前显示的界面(如音乐应用的运行界面330)、手机之前显示的界面(如手机的主界面300)等。
在图4所示的示例中,电脑上共显示有3个窗口,分别为非安卓主界面的窗口(即主界面310)、安卓主界面的窗口(即投屏界面320)、安卓应用的窗口(即投屏界面340)。
在另一些示例中,用户可以通过电脑对投屏到电脑上的界面进行更新,比如:用户可以通过电脑的输入设备(如鼠标、键盘等)直接操作电脑上的投屏界面,即可更新电脑上的投屏界面。如图5所示,电脑检测到诸如用户对电脑上显示的投屏界面320中包括的视频应用的图标311的点击操作,响应于该操作,电脑可以呈现诸如图3中(2)或者如图4所示的电脑的界面。可选的,该示例中,在电脑上的投屏界面更新之后,手机上显示的界面可以更新,比如:手机可以显示如图3中(2)或者如图4所示的视频应用的运行界面330。或者,手机上显示的界面也可以不更新,比如:手机仍旧显示如图3中(1)或者如图5所述的主界面300。
在一些示例中,如图6所示,在电脑显示如图4所示的界面之前,电脑可以先显示投屏界面340,即先显示诸如图3中(2)所示的界面,在投屏界面340中包括按钮341,按钮341可用于将新打开的界面(如投屏界面340)在新窗口中显示。比如:电脑检测到诸如用户对按钮341的点击操作,响应于该操作,电脑再呈现如图4所示的界面。
可选的,在上述两种示例中,电脑在确定要显示一个新的界面(如视频应用的运行界面330对应的投屏界面)时,采用图3中(2)所示的方式显示还是采用图4所示的方式显示,可以是电脑系统默认的,或者也可以由用户通过电脑和/或手机进行设定。
又或者,在其他可能的示例中,电脑在确定要显示一个新的界面(如视频应用的运行界面330对应的投屏界面)时,在显示该界面之前,可以先弹出提醒消息,提醒用户是将新界面显示在原来的窗口还是新建一个窗口进行显示,也即提醒用户是采用图3中(2)所示的方式显示还是采用图4所示的方式显示,响应于用户的选定的方式,电脑再根据用户选定的方式采用对应的方式显示该界面。
同样的,在该场景下,用户也可启动电脑上的其他窗口,比如:非安卓操作系统上的应用的窗口。示例性的,电脑检测到诸如用户对诸如图3中(1)所示的电脑的主界面310中包括的非安卓应用的图标的点击操作,响应于该操作,电脑可以显示一个 或多个非安卓应用的窗口(图中未示出)。该场景下,电脑也可以呈现诸如图1中(3)和/或图1中(4)所示的界面。
目前,用户有时存在对除安卓主界面的窗口以外的窗口进行录制和/或共享的需求。录制,即将应用的窗口内容(图像、音频等)录制为录屏文件(比如,图像文件、音频文件、视频文件等)。共享,即将一个设备上的应用的窗口内容共享给另一个设备。但是在诸如上文所述的安卓模拟器、多屏协同等场景下,在用户通过电子设备上显示的安卓应用的窗口启动屏幕录制和/或共享的功能时,由于电子设备默认将安卓主界面的窗口的数据渲染到安卓应用提供的表面(surface)中,然后对该surface中的数据进行录制和/或共享,因此仅能实现对安卓主界面的窗口的录制和/或共享,并不能对除安卓主界面的窗口以外的窗口(比如:安卓应用的窗口、非安卓应用的窗口、非安卓主界面的窗口等)进行录制和/或共享。关于surface的详细介绍可参考后文所述。
示例性的,如图7中的(1)所示,电脑上显示有4个窗口,分别为安卓应用1的窗口700,安卓主界面的窗口710,非安卓主界面的窗口720,非安卓应用的窗口740。这些窗口的打开方式可参考上文所述。其中,安卓应用1可以是任何支持屏幕录制功能的安卓应用。若用户想要对安卓应用1的窗口700进行录制,用户会点击安卓应用1的录制按钮701以企图启动对安卓应用1的窗口700的录制。可选的,该安卓应用1的录制按钮701可以直接显示于安卓应用1的窗口700中(图7中的(1)以此为例),或者用户也可以通过安卓应用1的窗口700中包括的其他功能按钮或者菜单栏等调出录制按钮701,本申请对此不作限定。
但是,电脑响应于诸如用户对安卓应用1的录制按钮701的点击操作,会将安卓主界面的窗口710的数据渲染到安卓应用1提供的surface中,然后对该surface中的数据进行录制,也即如图7中(2)所示,电脑会对安卓主界面的窗口710进行录制,而不是对安卓应用1的窗口700进行录制。同理,在用户对安卓应用的窗口进行共享的场景下,电脑响应于诸如用户用于启动安卓应用的窗口的共享功能的操作,电脑进行共享的是安卓主界面的窗口,而不是安卓应用的窗口。也就是说,电脑共享的设备侧显示的是安卓主界面的窗口,而不是安卓应用的窗口。因此,现有方案,不能实现对安卓应用的窗口进行录制和/或共享的功能。同样的,也不能对非安卓应用的窗口、非安卓主界面的窗口等进行录制和/或共享。也即现有方案中,在通过安卓应用启动录制和/或共享功能时,仅能录制和/或共享安卓主界面的窗口。
基于此,本申请实施例提供一种屏幕录制和共享的方法,在诸如安卓模拟器、多屏协同等场景下,还能够录制和/或共享除安卓主界面的窗口以外的窗口,比如:安卓应用的窗口、非安卓应用的窗口,非安卓操作系统的主界面的窗口等中的一种或多种。
本申请实施例提供的技术方案可以应用于安装了安卓模拟器的电子设备或者作为被投屏设备的电子设备,或者应用于包括该电子设备的系统中。比如:电子设备可以包括个人电脑(personal computer,PC)、笔记本电脑、平板电脑、上网本、手持计算机、智能家居设备(比如,智能电视、智慧屏、大屏、智能音箱等)、车载电脑等,本申请实施例对此不做任何限制。可选的,电子设备搭载的操作系统包括但不限于或者其它操作系统等各种非安卓操作系统。
在一种示例中,上述电子设备可以包括如图8所示的电子设备800的结构。
电子设备800包括处理器810,外部存储器接口820,内部存储器821,通用串行总线(universal serial bus,USB)接口830,充电管理模块840,电源管理模块841,电池842,显示屏850,天线,无线通信模块860,音频模块870,扬声器870A,受话器870B,麦克风870C,耳机接口870D,输入装置880等。
处理器810可以包括一个或多个处理单元,例如:处理器810可以包括应用处理器(Application processor,AP),图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。
控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器810中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器810中的存储器为高速缓冲存储器。该存储器可以保存处理器810刚用过或循环使用的指令或数据。如果处理器810需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器810的等待时间,因而提高了系统的效率。
在一些实施例中,处理器810可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。
充电管理模块840用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块840可以通过USB接口830接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块840可以通过电子设备800的无线充电线圈接收无线充电输入。充电管理模块840为电池842充电的同时,还可以通过电源管理模块841为电子设备800供电。
电源管理模块841用于连接电池842,充电管理模块840与处理器810。电源管理模块841接收电池842和/或充电管理模块840的输入,为处理器810,内部存储器821,外部存储器,显示屏850,和无线通信模块860等供电。电源管理模块841还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块841也可以设置于处理器810中。在另一些实施例中,电源管理模块841和充电管理模块840也可以设置于同一个器件中。
电子设备800通过GPU,显示屏850,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏850和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器810可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏850用于显示图像,视频等。显示屏850包括显示面板。显示面板可以采 用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。本申请实施例中,显示屏850也被称为屏幕。
电子设备800的无线通信功能可以通过天线,无线通信模块860等实现。
天线用于发射和接收电磁波信号。电子设备800中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。
无线通信模块860可以提供应用在电子设备800上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块860可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块860经由天线接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器810。无线通信模块860还可以从处理器810接收待发送的信号,对其进行调频,放大,经天线转为电磁波辐射出去。
在一些实施例中,电子设备800的天线和无线通信模块860耦合,使得电子设备800可以通过无线通信技术与网络以及其他设备通信。
数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。例如,当电子设备800在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。
视频编解码器用于对数字视频压缩或解压缩。电子设备800可以支持一种或多种视频编解码器。这样,电子设备800可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备800的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。
外部存储器接口820可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备800的存储能力。外部存储卡通过外部存储器接口820与处理器810通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。
内部存储器821可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器810通过运行存储在内部存储器821的指令,从而执行电子设备800的各种功能应用以及数据处理。内部存储器821可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备800使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器821可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。
电子设备800可以通过音频模块870,扬声器870A,受话器870B,麦克风870C,耳机接口870D,以及应用处理器等实现音频功能。例如音乐播放,录音等。
音频模块870用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块870还可以用于对音频信号编码和解码。在一些实施例中,音频模块870可以设置于处理器810中,或将音频模块870的部分功能模块设置于处理器810中。
扬声器870A,也称“喇叭”,用于将音频电信号转换为声音信号。电子设备800可以通过扬声器870A收听音乐等。
受话器870B,也称“听筒”,用于将音频电信号转换成声音信号。
麦克风870C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。
耳机接口870D用于连接有线耳机。耳机接口870D可以是USB接口830,也可以是3.5mm的开放移动电子设备800平台(open mobile terminal platform,OMTP)标准接口,美国蜂窝电信工业协会(cellular telecommunications industry association of the USA,CTIA)标准接口。
输入装置880可以包括键盘、鼠标等。键盘用于将英文字母、数字、标点符号等输入电子设备800,从而向电子设备800发出命令,输入数据等。鼠标是电子设备800显示系统纵横坐标定位的指示器,用于向电子设备800输入指令等。其中,输入装置880可以通过有线连接方式连接电子设备800,比如,输入装置880通过GPIO接口、USB接口等连接电子设备800。输入装置880还可以通过无线方式连接电子设备800,比如,输入装置880通过蓝牙、红外等方式连接电子设备800。
可以理解的是,本申请实施例示意的结构并不构成对该电子设备的具体限定。在本申请另一些实施例中,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
本申请实施例提供的屏幕录制和共享的方法不仅可以实现对安卓应用的窗口的录制和共享,还可以实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制和共享。下面以电子设备为电脑为例,结合附图对本申请实施例提供的屏幕录制和共享的方法进行详细介绍。
示例性的,图9示出了本申请实施例提供的一种屏幕录制方法的场景实例,该场景下,可以实现对安卓应用的窗口的录制。如图9中的(1)所示,电脑上显示有4个窗口,分别为安卓应用1的窗口900,安卓主界面的窗口910,非安卓主界面的窗口920,非安卓应用的窗口930。其中,安卓应用1可以是任何支持屏幕录制功能的安卓应用。其中,在安卓应用1的窗口900中包括录屏按钮901,用户可以通过录屏按钮901启动对安卓应用1的窗口900的录制。
电脑检测到用户用于启动对安卓应用1的窗口900的录制功能的操作,比如:用户对录屏按钮901的点击操作,响应于该操作,将安卓应用1的窗口900的数据渲染到安卓应用1提供的surface中,然后获取该surface中的数据进行录制(或称存储),关于该具体过程请参考后文所述。也即如图9中的(2)所示,电脑开始对安卓应用1的窗口900进行录制。示例性的,在安卓应用1的窗口900中可以显示“视频录制” 工具栏902,“视频录制”工具栏902中可以包括录制时长、暂停继续按钮、结束按钮等中的一种或多种,用户可以通过暂停继续按钮实现对安卓应用1的窗口900的暂停录制或者继续录制,通过结束按钮实现对安卓应用1的窗口900的停止录制等。
示例性的,图10示出了本申请实施例提供的又一种屏幕录制方法的场景实例,该场景下,可以实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制。如图10中的(1)所示,电脑上显示有4个窗口,分别为安卓应用2的窗口1000,安卓主界面的窗口1010,非安卓主界面的窗口1020,非安卓应用的窗口1030。
其中,在安卓应用2的窗口1000中包括录屏按钮1001,用户可以通过录屏按钮1001实现对非安卓应用的窗口或者非安卓主界面的窗口的录制。
在一些实施例中,电脑检测到诸如用户对安卓应用2的窗口1000中包括的录屏按钮1001的点击操作,响应于该操作,判断安卓应用2是否为预设安卓应用,若为预设安卓应用,将非安卓应用的窗口(即非安卓应用的窗口1030)的数据和/或非安卓主界面的窗口(即非安卓主界面的窗口1020)的数据渲染到安卓应用2提供的surface中,然后获取该surface中的数据进行录制,关于该具体过程也请参考后文所述。也即如图10中的(2)所示,电脑开始对非安卓应用的窗口1030和非安卓主界面的窗口1020进行录制。可选的,在非安卓主界面的窗口1020中也可以显示“视频录制”工具栏1002,关于“视频录制”工具栏1002的介绍可参考图9中(2)所示的“视频录制”工具栏902的介绍。
在一些示例中,电脑默认对非安卓应用的窗口以及非安卓主界面的窗口均进行录制(图10中(2)以此为例)。可以理解,电脑上可能同时显示有多个非安卓应用的窗口,该示例中,可对这多个非安卓应用的窗口以及非安卓主界面的窗口均进行录制。在另一些示例中,电脑默认对非安卓应用的窗口以及非安卓主界面的窗口中的一个进行录制。可选的,该示例中,电脑默认可以对所有非安卓应用的窗口均进行录制,或者对非安卓主界面的窗口进行录制,或者选择所有非安卓应用的窗口以及非安卓主界面的窗口中的一个窗口进行录制。
当然,在安卓应用2不是预设安卓应用的情况下,电脑也可对非安卓应用的窗口和/或非安卓主界面的窗口进行录制,本申请对此不作具体限制。在又一些示例中,可以由用户选定需要进行录制的窗口。示例性的,如图11所示,电脑响应于诸如用户对图10中(1)所示的安卓应用2的窗口1000中包括的录屏按钮1001的点击操作,电脑显示提醒消息1100,提醒消息1100可用于提醒用户选定想要录制的窗口。示例性的,在提醒消息1100中包括一个或多个显示在电脑上的非安卓应用的窗口的选项,如:应用4的窗口(即图10中(1)所述的非安卓应用的窗口1030),以及一个非安卓主界面的窗口(或称电脑主界面的窗口,即图10中(1)所述的非安卓主界面的窗口1020)。
用户可以需求选定想要录制的窗口,比如:若此时若用户想要录制应用4的窗口,用户选定应用4的窗口,电脑检测到用户用于选定应用4的窗口的操作,响应于该操作,电脑开始对应用4的窗口进行录制(图中未示出)。
在又一些示例中,用户也可预先设定需要录制的窗口,比如:设定优先录制安卓应用的窗口。或者,设定安卓应用的窗口、非安卓应用的窗口、非安卓主界面的窗口的优先级顺序为从高到低,按照该优先级顺序进行录制,在不存在优先级高的窗口的 情况下,再录制优先级低的窗口。可以理解,前述优先级顺序仅作为举例说明,该优先级顺序也可是其他的顺序。或者,用户也可设定仅录制某个窗口,比如:仅录制安卓应用的窗口,或者,仅录制非安卓应用的窗口等。
需要说明的是,上述各示例中所述的方法还可结合使用,本申请对于具体录制哪个窗口的实现方式不作任何限制。
可以理解,图9以及图10中所示的录屏按钮、“视频录制”工具栏等的显示位置仅作为一种可能的示例,该录屏按钮也可以显示于其他位置,如菜单栏、功能按钮中,“视频录制”工具栏也可位于其他的界面或者位置,“视频录制”工具栏中也可包括其他的信息或者按钮,本申请对此不作限制。
示例性的,图12示出了本申请实施例提供的一种屏幕共享方法的场景实例。该场景下,可以实现对安卓应用的窗口的共享,如图12中(1)所示,电脑上显示有4个窗口,分别为安卓应用3的窗口1200,安卓主界面的窗口1210,非安卓主界面的窗口1220,非安卓应用的窗口1230。其中,安卓应用3可以是任何支持屏幕共享功能的安卓应用。可选的,安卓应用3与图9所述的安卓应用1可以是同一应用,也可以是不同应用。也就是说,同一应用可能同时支持屏幕录制和共享的功能,也可能仅支持其中的一个功能。其中,在安卓应用3的窗口1200中包括共享屏幕按钮1201,用户可以通过共享屏幕按钮1201启动对安卓应用3的窗口1200的共享。
电脑检测到用户用于启动对安卓应用3的窗口1200的共享功能的操作,比如:用户对共享屏幕按钮1201的点击操作,响应于该操作,将安卓应用3的窗口1200的数据渲染到安卓应用3提供的surface中,然后获取该surface中的数据进行共享(或称转发),关于该具体过程请参考后文所述。也即如图12中的(2)所示,电脑开始对安卓应用3的窗口1200进行共享。可选的,在安卓应用3的窗口1200中还可以显示停止共享按钮1202,用户可以通过停止共享按钮1202实现对安卓应用3的窗口1200的停止共享等。示例性的,如图12中的(3)所示,电脑共享的设备(如平板电脑)一侧显示的共享界面为安卓应用3的窗口1200。
示例性的,图13示出了本申请实施例提供的又一种屏幕共享方法的场景实例,该场景下,可以实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制。如图13中的(1)所示,电脑上显示有4个窗口,分别为安卓应用3的窗口1300,安卓主界面的窗口1310,非安卓主界面的窗口1320,非安卓应用的窗口1330。
其中,在安卓应用3的窗口1300中包括共享屏幕按钮1301,用户可以通过共享屏幕按钮1301实现对非安卓应用的窗口或者非安卓主界面的窗口的共享。
在一些实施例中,电脑检测到诸如用户对安卓应用3的窗口1300中包括的共享屏幕按钮1301的点击操作,响应于该操作,判断安卓应用3是否为预设安卓应用,若为预设安卓应用,则将非安卓应用的窗口(即非安卓应用的窗口1330)的数据和/或非安卓主界面的窗口(即非安卓主界面的窗口1320)的数据渲染到安卓应用3提供的surface中,然后获取该surface中的数据进行共享,关于该具体过程也请参考后文所述。也即如图13中(2)所示,电脑开始对非安卓应用的窗1330和非安卓主界面的窗口1320进行共享。可选的,在非安卓主界面的窗口1320中还可以显示停止共享按钮1302,用户可以通过停止共享按钮1302实现对非安卓应用的窗口1330和/或非安卓主界面的 窗口1320的停止共享等。示例性的,如图13中(3)所示,电脑共享的设备(如平板电脑)一侧显示的共享界面为非安卓应用的窗口1330和非安卓主界面的窗口1320。
在一些示例中,电脑默认对非安卓应用的窗口以及非安卓主界面的窗口均进行共享(图13以此为例)。可以理解,电脑上可能同时显示有多个非安卓应用的窗口,该示例可对这多个非安卓应用的窗口均进行共享。在另一些示例中,电脑默认对非安卓应用的窗口以及非安卓主界面的窗口中的一个进行共享。可选的,该示例中,电脑默认可以对所有非安卓应用的窗口均进行共享,或者对非安卓主界面的窗口进行共享,或者选择所有非安卓应用的窗口以及非安卓主界面的窗口中的一个窗口进行共享。
当然,在安卓应用2不是预设安卓应用的情况下,电脑也可对非安卓应用的窗口和/或非安卓主界面的窗口进行共享,本申请对此也不作具体限制。在又一些示例中,也可以由用户选定需要共享的窗口。示例性的,如图14所示,电脑响应于诸如用户对图13中(1)所示的安卓应用3的窗口1300中包括的共享屏幕按钮1301的点击操作,电脑可以显示选择界面1400,其中,在选择界面1400中包括一个或多个非安卓应用的窗口,如:应用4的窗口(即图13中(1)所述的非安卓应用的窗口1330),以及一个非安卓主界面的窗口,如电脑主界面的窗口(即图13中(1)所述的非安卓主界面的窗口1320)。
用户可以根据需求选定想要共享的窗口,比如:若此时用户想要共享应用4的窗口,用户选定应用4的窗口,并点击确认共享按钮1401,电脑响应于用户的该操作,电脑开始对应用4的窗口进行共享。示例性的,电脑共享的设备(如平板电脑)一侧显示的共享界面为应用4的窗口(图中未示出)。
在又一些示例中,用户也可预先设定需要共享的窗口,比如:设定优先共享安卓应用的窗口,或者,优先共享非安卓应用的窗口和/或非安卓主界面的窗口。或者,设定安卓应用的窗口、非安卓应用的窗口、非安卓主界面的窗口的优先级顺序为从高到低,按照该优先级顺序进行共享,在不存在优先级高的窗口的情况下,再共享优先级低的窗口。可以理解,前述优先级顺序仅作为举例说明,该优先级顺序也可是其他的顺序。或者,用户也可设定仅共享某个窗口,比如:仅共享安卓应用的窗口,或者,仅共享非安卓应用的窗口等。
需要说明的是,上述各示例中所述的方法还可结合使用,本申请对于具体共享哪个窗口的实现方式也不作任何限制。
可选的,在图12和/或图13所示的屏幕共享界面中也可包括共享的时间(图中未示出)。
同样的,图12以及图13中所示的共享屏幕按钮、停止共享按钮等的显示位置也仅作为一种可能的示例,该共享屏幕按钮、停止共享按钮等也可以显示于其他位置,或者通过其他功能按钮、菜单栏等调出显示,本申请对此不作限制。
上述场景实例是以用户同时仅启动屏幕录制以及屏幕共享中的一个功能进行说明的,当然,用户也可同时启动屏幕录制和屏幕共享的功能,比如:在一个安卓应用的窗口中可以包括录屏按钮和共享屏幕按钮,用户可以通过录屏按钮和共享屏幕按钮分别启动屏幕录制和屏幕共享的功能。可选的,录屏按钮和共享屏幕按钮的功能可以通过一个按钮实现,也可通过多个按钮实现,本申请对此不作限制。
可以理解,图9至图14示出的屏幕录制和共享的方法的场景实例是以电脑上显示的非安卓应用的窗口以及安卓应用的窗口均为一个进行说明的,本申请实施例提供的屏幕录制和共享的方法对于显示多个非安卓应用的窗口以及多个安卓应用的窗口的情况同样适用。其中,关于图9至图14中各窗口的打开方式可参考上文所述的安卓模拟器、多屏协同等场景下各种窗口的打开方式,此处不再赘述。需要说明的是,图9至图14中所述的安卓应用的窗口、安卓主界面的窗口可以是在安卓模拟器场景下打开显示在电脑上的,也可以是在多屏场景下,由其他设备投屏到电脑上的显示的。
在一些实施例中,在通过预设安卓应用(如畅联应用)启动屏幕录制和/或共享功能时,可以实现非安卓应用的窗口或者非安卓主界面的窗口的录制和/或共享的功能。在通过非预设安卓应用启动屏幕录制和/或共享功能时,可以实现对安卓应用的窗口的录制和/或共享的功能,该预设安卓应用可以由开发人员根据实际需求设定。
在另一些实施例中,无需预设安卓应用,在通过一个安卓应用启动屏幕录制和/或共享的功能时,可以先输出提示信息(比如:语音播报提示信息、显示屏显示提示信息等),通过提示信息提醒用户选择想要录制和/或共享的窗口,比如:在提示信息中包括一个或多个窗口选项,比如:一个或多个安卓应用的窗口、一个或多个非安卓应用的窗口,非安卓主界面的窗口等。可选的,提示信息包括的安卓应用可以仅包括用于启动屏幕录制和/或共享的功能的安卓应用,也可以包括除用于启动屏幕录制和/或共享的功能的安卓应用以外的安卓应用,本申请对此不作具体限制。
需要说明的是,本申请实施例中,各界面仅仅为示意图,并不构成本申请的限定。在实际应用中,各界面中可以包括更多或者更少的内容,也可以包括更多或者更少的界面,在此统一说明。
下面结合图15和图16对电子设备对安卓应用的窗口进行录制和/或共享的原理进行介绍。
在一些实施例中,安卓应用运行在安卓操作系统下,安卓操作系统可以运行在安装有安卓模拟器的非安卓操作系统中,图15、图16中均以非安卓操作系统为Windows系统为例。
其中,安卓操作系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。如图15所示,本申请实施例以分层架构的系统为例,示例性说明电子设备对安卓应用的窗口进行录制和/或共享的原理。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,如图15所示,安卓操作系统包括至少三层,从上至下分别为应用层,框架(framework)层,本地服务(native)层。
应用层可以包括一系列安卓应用程序包。这些安卓应用程序包可以包括支持录屏功能的应用(简称为录屏应用)、支持屏幕共享功能的应用(简称为屏幕共享应用)、不支持屏幕录制功能的应用(简称为非录屏应用)、不支持屏幕共享功能的应用(简称为非屏幕共享应用)等中的一种或多种安卓应用。图15中仅示出了录屏应用、屏幕共享应用。
可以理解,一个安卓应用可能同时支持屏幕录制功能以及屏幕共享功能,也可能仅支持其中的一个功能,也可能两个功能均不支持。此外应用层所包括的应用对应设 置有图标,图标可以通过显示屏显示给用户,以便用户对应用的图标进行点击操作打开该应用或进行其他操作。
其中,应用层包括的应用在启动之后,会在安卓操作系统内生成该应用对应的窗口。比如:如图1中(2)所示,电子设备检测到诸如用户对应用1的图标111的点击操作,启动应用1。这样,在一个安卓应用被启动之后,会在安卓操作系统内生成该应用对应的窗口。
安卓系统的框架层包括窗口管理服务(window manager service,WMS),显示管理服务(display manager service,DMS)、多媒体项目(media projection)模块等。
WMS可用于窗口管理(比如,新增窗口、删除窗口、修改窗口等)。一个窗口对应一个surface。其中,surface对应一个数据缓冲区,一方面,其可用于应用层的应用在其中绘制数据,并将绘制的数据放入缓冲队列(bufferqueue)中,以实现应用的窗口的显示。另一方面,其还可用于表面合成(SurfaceFlinger)服务向其中绘制数据(或称渲染数据),以实现对应用的窗口的录制和/或共享。
DMS可用于管理显示(display)的生命周期。DMS可以为每个窗口创建对应的display,并建立窗口与display的一一对应关系,即建立窗口标识(window identity,Window ID)与显示标识(display identity,Display ID)的一一对应关系。其中,display为电子设备屏幕上的一块显示区域,该显示区域可以称为逻辑显示(logical display)(或称逻辑显示设备(logical display device)),该逻辑显示中承载有窗口的数据。
多媒体项目模块可用于截取当前屏幕和录制屏幕视频等。
本地服务层包括表面合成(SurfaceFlinger)服务,一方面,SurfaceFlinger服务用于从缓冲队列中获取安卓应用绘制的表面(surface),并对其进行合成,以实现应用的窗口的显示。另一方面,SurfaceFlinger服务用于向应用层的应用提供的surface中渲染数据,以实现对应用的窗口的录制和/或共享。可以理解,SurfaceFlinger服务对surface进行渲染,也即对该surface对应的内存进行渲染。
安卓模拟器中包括安卓应用窗口信息模块,其中可用于存储窗口与Display ID的对应关系,如:Window ID与Display ID的对应关系。需要说明的是,图15中安卓应用窗口信息模块的功能由安卓模拟器实现;在另一些实施例中,安卓应用窗口信息模块的功能也可由Windows系统实现。
在一些实施例中,用户可以启动应用层的安卓应用的录制和/或的功能,这样,在一个安卓应用的录制和/或共享的功能被开启之后,该安卓应用会向框架层提供表面(surface)。
随后,框架层通过MediaProjection模块、WMS等调用到DMS。DMS通过createvirtualdisplay函数创建安卓应用提供的surface对应的虚拟显示设备(virtual display device)(或称虚拟显示(virtual display))。可以理解,虚拟显示设备可用于镜像逻辑显示中的数据,以实现对该逻辑显示中的数据的录制和/或共享。
并且,DMS从安卓应用窗口信息模块中获取到该安卓应用的窗口对应的Display ID,比如:DMS根据安卓应用窗口信息中保存的Window ID和Display ID的对应关系,以及安卓应用的窗口的Window ID即可确定对应的Display ID。然后,DMS将创建的该安卓应用对应的虚拟显示设备与获取到Display ID对应的逻辑显示绑定。
后续,SurfaceFlinger服务将Display ID对应的逻辑显示中的数据渲染到虚拟显示设备对应的surface上,也即应用层的安卓应用提供的surface上。最后,该安卓应用获取到渲染后的该虚拟显示设备对应的surface即可完成录制和/或共享。
示例性的,结合图15所示的架构,图16示出了本申请实施例提供的一种对安卓应用的窗口进行录制和/或共享的方法的流程示意图,如图16所示,该方法包括以下步骤:
S1601、电子设备接收用户操作。
其中,该用户操作用于启动安卓应用的屏幕录制和/或共享的功能。示例性的,如图9中(1)所示,该用户操作可以是诸如对应用2的窗口1000中包括的录屏按钮1001的点击操作,或者,如图12中(1)所示,该用户操作可以是诸如对应用3的窗口1200中包括的共享屏幕按钮1201的点击操作等。
可选的,在诸如安卓模拟器的场景下,该用户操作可以是用户对电子设备的操作。在诸如多屏协同的场景下,该用户操作可以是用户对电子设备(或称被投屏设备)的操作,也可以是用户对投屏设备的操作。可选的,投屏设备还可以将用户的该操作发送给投屏设备。本申请对该用户操作不作任何限制。
S1602、应用层的安卓应用向框架层提供surface。
其中,该安卓应用为步骤S1601中用户启动屏幕录制和/或共享的功能的安卓应用。关于该应用层以及框架层的介绍可参考图15所述。
S1603、框架层从Windows系统获取显示(Display)ID。
其中,该Display ID为该安卓应用的窗口所对应的逻辑显示对应的Display ID。比如:框架层可以根据Window ID和Display ID之间的对应关系、以及该安卓应用的窗口对应的Window ID获取该Display ID。其中,该安卓应用的窗口对应的Window ID可以根据该安卓应用提供的surface确定。
S1604、Window系统向框架层返回Display ID。
S1605、框架层创建surface对应的虚拟显示设备。
其中,该surface为应用层的安卓应用提供的surface。示例性的,框架层可以通过createvirtualdisplay函数创建该虚拟显示设备。
需要说明的是,本申请并不限定上述步骤S1603、步骤S1604与步骤S1605的执行顺序。
S1606、框架层将虚拟显示设备与逻辑显示绑定。
其中,框架层可以根据获取到的Display ID确定对应的逻辑显示,并将该逻辑显示与该虚拟显示设备绑定。可以理解,将虚拟显示设备与逻辑显示绑定的目的在于将该逻辑显示中的数据渲染到该虚拟显示设备对应的surface中,也即该虚拟显示设备对应的surface的内存中。
示例性的,框架层可以通过addLogicalDisplayLocked,newLogicalDisplay,configureDisplayLocked等中的一种或多种函数将虚拟显示设备与逻辑显示绑定。
S1607、框架层将逻辑显示中的数据渲染到surface。
其中,框架层将逻辑显示中的数据渲染到绑定的虚拟显示设备对应的surface中,该surface也即步骤S1602中,由应用层的安卓应用提供的surface,该安卓应用获取 到渲染后的虚拟显示设备对应的surface即可完成录制和/或共享。
示例性的,框架层可以通过setSurfaceLocked函数对该安卓应用提供的surface进行渲染。
下面结合图17和图18对电子设备对非安卓应用的窗口和/或非安卓主界面的窗口进行录制或者共享的原理进行介绍。
在一些实施例中,安卓操作系统可以运行在安装有安卓模拟器的非安卓操作系统中,图17和图18中还是以非安卓操作系统为Windows系统为例。
以分层架构的系统为例,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,如图17所示,安卓操作系统包括至少三层,从上至下分别为应用层,框架层,本地服务层。关于应用层的介绍可参考图15所述。
框架层包括多媒体项目模块、通信模块。关于多媒体项目模块的介绍可参考图15所述的多媒体项目模块的介绍。通信模块可用于安卓系统和安卓模拟器之间的通信,和/或框架层和本地服务层之间的通信。
本地服务层包括新增渲染模块,SurfaceFlinger服务。关于SurfaceFlinger服务的相关介绍可参考图15所述的SurfaceFlinger服务的相关介绍。新增渲染模块用于和SurfaceFlinger服务配合,完成对surface的渲染。
安卓模拟器中包括通信模块、Windows窗口抓取模块、渲染控制(render control)模块。其中,通信模块用于安卓系统和安卓模拟器之间的通信,示例性的,该通信模块采用的技术可以为qemu pipe技术,鉴于qemu pipe技术为现有技术,本文不再详细介绍。Windows窗口抓取模块用于获取非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据。在一些实施例中,Windows窗口抓取模块可采用图形设备接口(graphics device interface,GDI)技术获取非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据,鉴于GDI技术为现有技术,本文也不再详细介绍,当然,Windows窗口抓取模块也可采用其他的技术获取非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据,本申请对此不作限制。渲染控制模块用于对surface进行渲染,也即向surface对应的内存中填充数据。
需要说明的是,图17中通信模块、Windows窗口抓取模块、渲染控制模块的功能由安卓模拟器实现;在另一些实施例中,通信模块、Windows窗口抓取模块、渲染控制模块等中的一种或多种的功能也可由Windows系统实现。
在一些实施例中,用户启动应用层的安卓应用的录制或者共享的功能,比如:如图9中(1)所示,用户可以通过应用2的窗口1000中包括的录屏按钮1001启动应用2的屏幕录制功能;或者,如图12中(1)所示,用户可以通过应用3的窗口1200中包括的共享屏幕按钮1201启动应用3的屏幕共享功能。这样,在一个安卓应用的录制或者共享的功能被开启之后,该安卓应用会向框架层提供surface。
随后,框架层通过多媒体项目模块接收该安卓应用提供的surface,多媒体项目模块将该surface传递到新增渲染模块。
新增渲染模块可以通过dequeue函数从缓冲队列(bufferqueue)中申请该surface对应的内存,该内存称为颜色缓存(colorbuffer)。可以理解,在生产者-消费者模型 中,生产者和消费者之间的数据传递是通过缓冲队列实现的,如:生产者可以通过dequeue函数从缓冲队列中申请colorbuffer,将数据写入到该colorbuffer,写入完成后,可以通过queue函数将该colorbuffer放回到缓冲队列,后续,消费者即可从该缓冲队列中读数据。
然后,新增渲染模块通过lock函数将该colorbuffer锁定,以避免其他的线程占用该colorbuffer。随后,获取该colorbuffer的句柄(handle),并将该handle传递到框架层的通信模块。可以理解,handle为colorbuffer的地址索引,通过该handle即可查找到该colorbuffer。
框架层的通信模块将获取到的handle传递到安卓模拟器的通信模块,安卓模拟器的通信模块可将该handle传递到渲染控制模块。安卓模拟器通过该handle查找到对应的colorbuffer,该colorbuffer也即应用层的安卓应用提供的surface对应的colorbuffer。在查找到之后,安卓模拟器中的通信模块通知新增渲染模块更新colorbuffer。
相应的,新增渲染模块接收到更新colorbuffer的通知之后,可以采用unlock函数将该colorbuffer解锁,并对colorbuffer进行更新,更新完成之后,通过框架层的通信模块通知安卓模拟器渲染colorbuffer。
相应的,安卓模拟器中的通信模块接收到渲染colorbuffer的通知之后,通过Windows窗口抓取模块获取非安卓应用的窗口中的数据和/或非安卓主界面的窗口中的数据,并将该获取的数据发送到渲染控制模块,渲染控制模块将该获取的数据渲染到handle对应的colorbuffer中,也即将获取的数据渲染到安卓应用提供的surface中。然后,安卓模拟器的通信模块通知新增渲染模块执行queuebuffer的操作,也即将渲染完成的colorbuffer放入缓冲队列。
在一些示例中,若电子设备默认对非安卓应用的窗口以及非安卓主界面的窗口均进行录制或者共享,则Windows窗口抓取模块获取可以获取当前电子设备上所有非安卓应用的窗口中的数据以及非安卓主界面的窗口中的数据。在另一些示例中,若电子设备仅对非安卓应用的窗口以及非安卓主界面的窗口中的一部分进行录制或者共享,则电子设备可以根据需要录制的窗口的信息(如Window ID等)确定需要录制或者共享的窗口,以对该对应的窗口中的数据进行获取。
相应的,新增渲染模块接收到执行queuebuffer操作的通知之后,执行queuebuffer的操作,比如:新增渲染模块可以通过queue函数将colorbuffer放入缓冲队列。最后,SurfaceFlinger服务对缓冲队列中的数据执行渲染合成,即可实现对非安卓应用的窗口和/或非安卓主界面的窗口中的数据的录制。
可以理解的,图15和图17所示的分层架构中各层包括的模块或者服务仅作为示例性说明,其也可以有其他的划分方式,比如:表面合成(SurfaceFlinger)模块也可以位于应用层,本申请对此不作限定。
示例性的,结合图17所示的结构,图18示出了本申请实施例提供的一种对非安卓应用的窗口和/或非安卓主界面的窗口进行录制或者共享的方法流程示意图,如图18所示,该方法包括以下步骤:
S1801、电子设备接收用户操作。
关于该步骤的介绍可参考图16中的步骤S1601的相关介绍。
S1802、应用层的安卓应用向框架层提供surface。
其中,该安卓应用为步骤S1801中用户启动屏幕录制或者共享的功能的安卓应用。关于该应用层以及框架层的介绍可参考图17所述。
S1803、框架层根据该surface申请colorbuffer,并锁定该colorbuffer。
例如:框架层可以从缓冲队列中申请该surface对应的colorbuffer,然后通过lock函数锁定该colorbuffer。
S1804、框架层向Windows系统发送colorbuffer对应的handle。相应的,Windows系统接收该colorbuffer对应的handle。
S1805、Windows系统设置handle。
其中,Windows系统可以根据该handle查找到对应的colorbuffer。
S1806、Windows系统向框架层发送第一消息。相应的,框架层接收第一消息。
其中,第一消息用于指示框架层更新colorbuffer。
S1807、框架层解锁、更新colorbuffer。
S1808、框架层向Windows系统发送第二消息。相应的,Windows系统接收第二消息。
其中,第二消息可用于指示Windows系统对该colorbuffer进行渲染。
S1809、Windows系统渲染colorbuffer。
其中,Windows系统获取非安卓应用的窗口中的数据和/或非安卓应用主界面的窗口中的数据,并将获取到的数据渲染到colorbuffer中,也即将数据填充到colorbuffer中。
S1810、Windows系统向框架层发送第三消息。
其中,第三消息用于指示框架层将colorbuffer放回缓冲队列。
S1811、框架层把colorbuffer放回缓冲队列。
也即,框架层执行queuebuffer操作的操作。
S1812、框架层处理缓冲队列中的数据。
其中,框架层对缓冲队列中的数据执行渲染合成等操作,即可实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制。
可以理解的,本申请实施例中,图16、图18所示的方法流程仅作为一种示例,电子设备可以执行图16或者图18中的部分或全部步骤,这些步骤或操作仅是示例,电子设备还可以执行其它操作或者各种操作的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部操作。
在一些实施例中,在用户启动安卓应用的录制和/或共享的功能之后,电子设备可以根据该安卓应用的应用程序包的包名、该安卓应用提供的surface对应的虚拟现实设备的标识(如display名称(name))等中的一种或多种确定该安卓应用是否是预设安卓应用,在确定安卓应用为预设安卓应用的情况下,电子设备可以对非安卓应用的窗口和/或非安卓主界面的窗口进行录制和/或共享,即电子设备可以执行图17、图18所述的过程或方法。在确定该安卓应用为非预设应用的情况下,电子设备可以对该安卓应用的窗口进行录制和/或共享,即电子设备可以执行图15、图16所述的过程或方法。
需要说明的是,图15至图18是以安卓操作系统以及Windows操作系统均运行在电子设备中(如安卓模拟器场景)进行介绍的,安卓操作系统以及Windows操作系统也可运行在不同的电子设备中,如多屏协同场景,本申请实施例提供的方法同样适用。
示例性的,图19示出了本申请实施例提供的一种屏幕录制和共享的方法的流程示意图,该方法包括以下步骤:
S1901、电子设备接收用户在电子设备的第一窗口内的目标操作。
其中,第一窗口为第一应用的窗口。第一应用运行在安卓操作系统中,也即第一应用为安卓应用。
目标操作可用于启动屏幕录制和/或共享的功能。示例性的,目标操作可以是对第一窗口内包括的录屏按钮、共享屏幕按钮等的触发操作。
S1902、响应于目标操作,电子设备对电子设备的目标窗口进行录制和/或共享。
其中,目标窗口为第一窗口或者第二窗口,第二窗口为第二应用的窗口,第二应用运行在非安卓操作系统中。可以理解,第二应用可以包括一个或多个非安卓应用,目标窗口可以包括一个或多个窗口。本申请实施例中,非安卓主界面也可称之为第二应用。
可选的,第二应用的窗口包括非安卓操作系统的主界面的窗口、非安卓操作系统中的应用的窗口中的一种或多种。
基于该方案,电子设备在接收到用户启动安卓应用的录制和/或共享功能的操作之后,能够获取该安卓应用的窗口的数据,或者,获取非安卓应用的窗口和/或非安卓主界面的窗口的数据,实现对安卓应用的窗口、非安卓应用的窗口、非安卓主界面的窗口等中的一种或多种的录制和/或共享。
可选的,该安卓操作系统和非安卓操作系统可以均搭载于电子设备中,或者,其中的某个系统也可以搭载除电子设备以外的设备中,比如:非安卓操作系统搭载于电子设备中,安卓操作系统搭载于该系统中的其他设备中。
在一些实施例中,电子设备可以通过图20所示的方法实现对第一窗口的录制和/或共享,示例性的,如图20所示,该方法包括以下步骤:
S2001、安卓操作系统从非安卓操作系统获取第一窗口对应的第一显示设备的标识。
其中,第一显示设备用于承载第一窗口的数据。示例性的,第一显示设备可以为逻辑显示设备,第一显示设备的标识可以为上文所述的Display ID。比如:在非安卓操作系统中存储有第一窗口的标识与第一显示设备的标识之间的对应关系,安卓操作系统根据第一窗口的标识即可获取对应的第一显示设备的标识。
S2002、安卓操作系统根据第一显示设备的标识获取第一窗口的数据。
其中,安卓操作系统可以根据第一显示设备的标识获取第一显示设备承载的数据,也即第一窗口的数据。
S2003、安卓操作系统对第一窗口的数据进行录制和/或共享。
其中,安卓操作系统可以将第一窗口的数据渲染到第二显示设备对应的第一surface的内存中,关于surface的介绍可参考上文所述。第二显示设备根据第一surface创建,示例性的,第二显示设备为上文所述的逻辑显示设备。第一surface与第一应用对应,也即第一surface为第一应用提供的surface。安卓操作系统对渲染完成的第二显 示设备对应的第一surface的内存中的数据进行录制和/或共享,即可实现对第一窗口的数据进行录制和/或共享。
现有技术中,电子设备在启动安卓应用的屏幕录制和/或共享功能时,默认对Display ID为0对应的窗口(也即安卓主界面的窗口)进行录制。而本申请,基于该方案,安卓操作系统可以从非安卓操作系统获取该安卓应用的窗口对应的Display ID,根据该Display ID即可获取该安卓应用的窗口的数据,实现对该安卓应用的窗口的录制。
在另一些实施例中,电子设备可以通过图21所示的方法实现对第二窗口的录制和/或共享,示例性的,如图21所示,该方法包括以下步骤:
S2101、安卓操作系统从非安卓操作系统获取第二窗口的数据。
具体的,非安卓操作系统可以获取第二窗口的数据,然后将第二窗口的数据渲染到第二surface的内存中。其中,第二surface的内存由安卓操作系统确定,例如:安卓操作系统可以从冲缓冲队列申请第二surface的内存。第二surface与第一应用对应,也即第二surface是由第一应用提供的。最后,非安卓操作系统向安卓操作系统发送渲染完成的第二surface的内存中的数据,相应的,安卓操作系统接收该渲染完成的第二surface的内存中的数据,也即接收第二窗口的数据。
可选的,在该步骤之前,安卓操作系统可以先确定第二surface的内存,然后,向非安卓操作系统发送目标句柄,目标句柄用于指示第二surface的内存的地址。这样,非安卓操作系统根据目标句柄即可确定第二surface的内存。
S2102、安卓操作系统对第二窗口的数据进行录制和/或共享。
其中,安卓操作系统对渲染完成的第二surface的内存中的数据进行录制和/或共享,即可完成对第二窗口的数据进行录制和/或共享。
基于该技术方案,电子设备在启动安卓应用的屏幕录制和/或共享功能时,安卓操作系统可以从非安卓操作系统获取非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据,比如:安卓操作系统可以拦截安卓应用提供的surface,不再执行原生渲染逻辑,该原生渲染逻辑为:安卓操作系统默认将Display ID为0的窗口的数据渲染到该surface中,而是重新为安卓应用提供的surface申请内存,然后将surface的内存地址传递给非安卓操作系统,非安卓操作系统即可将非安卓应用的窗口的数据和/或非安卓主界面的窗口的数据渲染到该surface中,然后将渲染完成的surface发送给安卓操作系统,即可实现对该surface中的数据的录制和/或共享,也即实现对非安卓应用的窗口和/或非安卓主界面的窗口的录制和/或共享。
上述主要是从方法的角度对本申请实施例提供的方案进行了介绍。可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。结合本申请中所公开的实施例描述的各示例的单元及算法步骤,本申请实施例能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以对每个特定的应用来使用不同的方法来实现所描述的功能,但是这种实现不应认为超过本申请实施例的技术方案的范围。
本申请是实施例可以根据上述方法示例对电子设备进行功能模块的划分,例如, 可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理单元中。上述集成的单元既可以采用硬件的形式,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对单元的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
如图22所示,为本申请实施例提供的一种电子设备的结构示意图,该电子设备2200可用于实现以上各个方法实施例中记载的方法。示例性的,该电子设备2200具体可以包括:处理单元2201、显示单元2202。
其中,处理单元2201用于执行支持电子设备2200执行图16中的步骤S1601至S1607。和/或,处理单元2201用于执行支持电子设备2200执行图18中的步骤S1801至S1812。和/或,处理单元2201用于执行支持电子设备2200执行图19中的步骤S1901至S1902。和/或,处理单元2201用于执行支持电子设备2200执行图20中的步骤S2001至S2003。和/或,处理单元2201用于执行支持电子设备2200执行图21中的步骤S2101至S2102。和/或,处理单元2201还用于支持电子设备2200执行本申请实施例中电子设备执行的其他步骤。
显示单元2202用于支持电子设备2200显示图9至14中电脑显示的一个或多个窗口。和/或,显示单元2202还用于支持电子设备2200执行本申请实施例中电子设备执行的其他显示操作。
可选的,图22所示的电子设备2200还可以包括通信单元2203,该通信单元2203,用于支持电子设备2200执行本申请实施例中电子设备与其他电子设备之间通信的步骤。
可选的,图22所示的电子设备2200还可以包括存储单元(图22中未示出),该存储单元存储有程序或指令。当处理单元2201执行该程序或指令时,使得图22所示的电子设备2200可以执行图16、图18至图21中任意图中所示的方法。
图22所示的电子设备2200的技术效果可以参考图16、图18至图21所示的方法的技术效果,此处不再赘述。图22所示的电子设备2200中涉及的处理单元2201可以由处理器或处理器相关电路组件实现,可以为处理器或处理模块。通信单元2203可以由收发器或收发器相关电路组件实现,可以为收发器或收发模块。显示单元2202可以由显示屏相关组件实现。
本申请实施例还提供一种芯片系统,如图23所示,该芯片系统包括至少一个处理器2301和至少一个接口电路2302。处理器2301和接口电路2302可通过线路互联。例如,接口电路2302可用于从其它装置接收信号。又例如,接口电路2302可用于向其它装置(例如处理器2301)发送信号。示例性的,接口电路2302可读取存储器中存储的指令,并将该指令发送给处理器2301。当所述指令被处理器2301执行时,可使得电子设备执行上述实施例中的电子设备执行的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。
可选地,该芯片系统中的处理器可以为一个或多个。该处理器可以通过硬件实现也可以通过软件实现。当通过硬件实现时,该处理器可以是逻辑电路、集成电路等。当通过软件实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现。
可选地,该芯片系统中的存储器也可以为一个或多个。该存储器可以与处理器集成在一起,也可以和处理器分离设置,本申请并不限定。示例性的,存储器可以是非瞬时性处理器,例如只读存储器ROM,其可以与处理器集成在同一块芯片上,也可以分别设置在不同的芯片上,本申请对存储器的类型,以及存储器与处理器的设置方式不作具体限定。
示例性的,该芯片系统可以是现场可编程门阵列(field programmable gate array,FPGA),可以是专用集成芯片(application specific integrated circuit,ASIC),还可以是系统芯片(system on chip,SoC),还可以是中央处理器(central processor unit,CPU),还可以是网络处理器(network processor,NP),还可以是数字信号处理电路(digital signal processor,DSP),还可以是微控制器(micro controller unit,MCU),还可以是可编程控制器(programmable logic device,PLD)或其他集成芯片。
应理解,上述方法实施例中的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
本申请实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述方法实施例所述的方法。
本申请实施例提供一种计算机程序产品,该计算机程序产品包括:计算机程序或指令,当计算机程序或指令在计算机上运行时,使得该计算机执行上述方法实施例所述的方法。
另外,本申请实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使装置执行上述各方法实施例中的方法。
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。各实施例在不冲突的情况下可以相互结合或相互参考。以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的 部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (14)

  1. 一种屏幕录制和共享的方法,其特征在于,应用于具有显示屏的电子设备,所述方法包括:
    接收用户在所述电子设备的第一窗口内的目标操作,所述第一窗口为第一应用的窗口;
    响应于所述目标操作,对所述电子设备的目标窗口进行录制和/或共享,所述目标窗口为所述第一窗口或者第二窗口,所述第二窗口为第二应用的窗口;
    其中,所述第一应用运行在安卓操作系统中,所述第二应用运行在非安卓操作系统中。
  2. 根据权利要求1所述的方法,其特征在于,所述响应于所述目标操作,对目标窗口进行录制和/或共享,包括:
    若所述第一应用不是预设应用,则响应于所述目标操作,对所述第一窗口进行录制和/或共享;
    若所述第一应用是所述预设应用,则响应于所述目标操作,对所述第二窗口进行录制和/或共享。
  3. 根据权利要求2所述的方法,其特征在于,所述对所述第一窗口进行录制和/或共享,包括:
    所述安卓操作系统从所述非安卓操作系统获取所述第一窗口对应的逻辑显示设备的标识,所述逻辑显示设备用于承载所述第一窗口的数据;
    所述安卓操作系统根据所述逻辑显示设备的标识获取所述第一窗口的数据;
    所述安卓操作系统对所述第一窗口的数据进行录制和/或共享。
  4. 根据权利要求3所述的方法,其特征在于,所述安卓操作系统对所述第一窗口的数据进行录制和/或共享,包括:
    所述安卓操作系统将所述第一窗口的数据渲染到虚拟显示设备对应的第一表面surface的内存中,所述虚拟显示设备根据所述第一surface创建,所述第一surface与所述第一应用对应;
    所述安卓操作系统对渲染完成的所述虚拟显示设备对应的第一surface的内存中的数据进行录制和/或共享。
  5. 根据权利要求2所述的方法,其特征在于,所述对所述第二窗口进行录制和/或共享,包括:
    所述安卓操作系统从所述非安卓操作系统获取所述第二窗口的数据;
    所述安卓操作系统对所述第二窗口的数据进行录制和/或共享。
  6. 根据权利要求5所述的方法,其特征在于,所述安卓操作系统从所述非安卓操作系统获取所述第二窗口的数据,包括:
    所述非安卓操作系统获取所述第二窗口的数据;
    所述非安卓操作系统将所述第二窗口的数据渲染到第二surface的内存中,所述第二surface的内存由所述安卓操作系统确定,所述第二surface与所述第一应用对应;
    所述非安卓操作系统向所述安卓操作系统发送渲染完成的所述第二surface的内存中的数据。
  7. 根据权利要求6所述的方法,其特征在于,在所述非安卓操作系统将所述第二窗口的数据渲染到第二surface的内存中之前,所述方法还包括:
    所述安卓操作系统确定所述第二surface的内存;
    所述安卓操作系统向所述非安卓操作系统发送目标句柄,所述目标句柄用于指示所述第二surface的内存的地址;
    所述非安卓操作系统根据所述目标句柄确定所述第二surface的内存。
  8. 根据权利要求6或7所述的方法,其特征在于,所述安卓操作系统对所述第二窗口的数据进行录制和/或共享,包括:
    所述安卓操作系统对所述渲染完成的所述第二surface的内存中的数据进行录制和/或共享。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述第二应用的窗口包括非安卓操作系统的主界面的窗口、非安卓操作系统中的应用的窗口中的一种或多种。
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述目标操作包括对所述第一窗口内包括的屏幕录制按钮和/或屏幕共享按钮的触发操作。
  11. 根据权利要求1-10任一项所述的方法,其特征在于,所述响应于所述目标操作,对所述电子设备的目标窗口进行录制和/或共享,包括:
    响应于所述目标操作,显示至少一个窗口的选项,所述至少一个窗口的选项中包括所述第一窗口的选项和/或所述第二窗口的选项;
    接收用户对所述至少一个窗口的选项中目标窗口的选定操作;
    响应于所述选定操作,对所述目标窗口进行录制和/或共享。
  12. 一种电子设备,其特征在于,包括:包括处理器、存储器和显示屏,所述存储器、所述显示屏与所述处理器耦合,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令,所述处理器从所述存储器中读取所述计算机指令,以使得所述电子设备执行如权利要求1-11中任一项所述的方法。
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括计算机程序或指令,当所述计算机程序或指令在电子设备上运行的情况下,使得所述电子设备执行如权利要求1-11中任一项所述的方法。
  14. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得所述计算机可以执行如权利要求1-11中任一项所述的方法。
PCT/CN2023/100032 2022-06-29 2023-06-13 屏幕录制和共享的方法及电子设备 WO2024001766A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210753227.8A CN117348778A (zh) 2022-06-29 2022-06-29 屏幕录制和共享的方法及电子设备
CN202210753227.8 2022-06-29

Publications (1)

Publication Number Publication Date
WO2024001766A1 true WO2024001766A1 (zh) 2024-01-04

Family

ID=89358157

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/100032 WO2024001766A1 (zh) 2022-06-29 2023-06-13 屏幕录制和共享的方法及电子设备

Country Status (2)

Country Link
CN (1) CN117348778A (zh)
WO (1) WO2024001766A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150373066A1 (en) * 2014-06-23 2015-12-24 Wistron Corp. Methods for screen-sharing and apparatuses using the same
CN114237779A (zh) * 2020-09-09 2022-03-25 华为技术有限公司 一种显示窗口的方法、切换窗口的方法、电子设备和系统
CN114253491A (zh) * 2020-09-10 2022-03-29 华为技术有限公司 显示方法及电子设备
WO2022089122A1 (zh) * 2020-10-31 2022-05-05 华为技术有限公司 一种应用窗口的投屏方法与电子设备
WO2022127661A1 (zh) * 2020-12-18 2022-06-23 华为技术有限公司 应用共享方法、电子设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150373066A1 (en) * 2014-06-23 2015-12-24 Wistron Corp. Methods for screen-sharing and apparatuses using the same
CN114237779A (zh) * 2020-09-09 2022-03-25 华为技术有限公司 一种显示窗口的方法、切换窗口的方法、电子设备和系统
CN114253491A (zh) * 2020-09-10 2022-03-29 华为技术有限公司 显示方法及电子设备
WO2022089122A1 (zh) * 2020-10-31 2022-05-05 华为技术有限公司 一种应用窗口的投屏方法与电子设备
WO2022127661A1 (zh) * 2020-12-18 2022-06-23 华为技术有限公司 应用共享方法、电子设备和存储介质

Also Published As

Publication number Publication date
CN117348778A (zh) 2024-01-05

Similar Documents

Publication Publication Date Title
WO2021115194A1 (zh) 一种应用图标的显示方法及电子设备
WO2022100315A1 (zh) 应用界面的生成方法及相关装置
US10725972B2 (en) Continuous and concurrent device experience in a multi-device ecosystem
WO2021104030A1 (zh) 一种分屏显示方法及电子设备
WO2021121052A1 (zh) 一种多屏协同方法、系统及电子设备
WO2021129253A1 (zh) 显示多窗口的方法、电子设备和系统
KR20150037066A (ko) 전자 장치의 디스플레이 방법 및 그 전자 장치
WO2021233079A1 (zh) 一种跨设备的内容投射方法及电子设备
CN112394895A (zh) 画面跨设备显示方法与装置、电子设备
CN112398855B (zh) 应用内容跨设备流转方法与装置、电子设备
CN112527174B (zh) 一种信息处理方法及电子设备
WO2022037463A1 (zh) 一种功能切换入口的确定方法与电子设备
WO2021169628A1 (zh) 一种增强的视频通话方法和系统、电子设备
WO2021110133A1 (zh) 一种控件的操作方法及电子设备
WO2022127661A1 (zh) 应用共享方法、电子设备和存储介质
US20130104149A1 (en) Selective data processing method between docked terminals and selective data processing system using the same
WO2024041047A1 (zh) 一种屏幕刷新率切换方法及电子设备
CN112004041A (zh) 视频录制方法、装置、终端及存储介质
CN114756359A (zh) 一种图像处理方法和电子设备
WO2021052488A1 (zh) 一种信息处理方法及电子设备
CN115016706A (zh) 一种线程的调度方法及电子设备
JP2023547821A (ja) 制御方法及び装置、及び電子デバイス
WO2023273845A1 (zh) 一种多应用录屏方法及装置
WO2024001766A1 (zh) 屏幕录制和共享的方法及电子设备
WO2022160612A1 (zh) 与车辆的车载系统交互方法、存储介质和移动终端

Legal Events

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

Ref document number: 23829949

Country of ref document: EP

Kind code of ref document: A1