WO2023030057A1 - Screen recording method, electronic device, and computer readable storage medium - Google Patents

Screen recording method, electronic device, and computer readable storage medium Download PDF

Info

Publication number
WO2023030057A1
WO2023030057A1 PCT/CN2022/113756 CN2022113756W WO2023030057A1 WO 2023030057 A1 WO2023030057 A1 WO 2023030057A1 CN 2022113756 W CN2022113756 W CN 2022113756W WO 2023030057 A1 WO2023030057 A1 WO 2023030057A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
application
screen
screen recording
media stream
Prior art date
Application number
PCT/CN2022/113756
Other languages
French (fr)
Chinese (zh)
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 WO2023030057A1 publication Critical patent/WO2023030057A1/en

Links

Images

Classifications

    • 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
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/4363Adapting the video or multiplex stream to a specific local network, e.g. a IEEE 1394 or Bluetooth® network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording

Abstract

Embodiments of the present application relate to the field of terminals, and provide a screen recording method, comprising: in response to a first operation of starting a screen recording function, an electronic device obtaining identification information of an application associated with the first operation, the application associated with the first operation comprising an application running in the background of the electronic device; the electronic device obtaining a media stream of the application according to the identification information; and generating, according to the media stream of the application, a screen recording file corresponding to the application. The embodiments of the present application further provide an electronic device and a computer-readable storage medium. According to the present application, screen recording can be performed on an application running in the background of the electronic device, thereby improving screen recording experience of a user.

Description

一种录屏方法、电子设备及计算机可读存储介质A screen recording method, electronic equipment, and computer-readable storage medium
本申请要求于2021年08月30日提交中国专利局,申请号为202111006119.6、申请名称为“一种录屏方法、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202111006119.6 and the application name "A Screen Recording Method, Electronic Equipment, and Computer-Readable Storage Medium" submitted to the China Patent Office on August 30, 2021, and its entire content Incorporated in this application by reference.
技术领域technical field
本申请涉及终端领域,尤其涉及一种录屏方法、电子设备及计算机可读存储介质。The present application relates to the field of terminals, and in particular to a screen recording method, electronic equipment, and a computer-readable storage medium.
背景技术Background technique
录屏功能是电子设备(如手机、平板电脑等)的一项常用功能。现有的录屏方法是将当前屏幕显示的界面录制下来,进行截图保存或保存为视频文件。然而,现有的录屏方法无法对未在屏幕上显示的应用程序的界面进行录制,降低了用户的使用体验。The screen recording function is a commonly used function of electronic devices (such as mobile phones, tablet computers, etc.). The existing screen recording method is to record the interface displayed on the current screen, and save it as a screenshot or as a video file. However, the existing screen recording method cannot record the interface of the application program not displayed on the screen, which reduces the user experience.
发明内容Contents of the invention
有鉴于此,有必要提供一种录屏方法,其可实现对后台运行的应用程序的界面进行录屏或者本地设备侧对投屏显示在其他电子设备上的应用窗口进行录屏。In view of this, it is necessary to provide a screen recording method, which can realize the screen recording of the interface of the application program running in the background or the local device side to record the screen of the application window displayed on other electronic devices.
本申请实施例第一方面公开了一种录屏方法,应用于第一电子设备,录屏方法包括:响应于启动录屏功能的第一操作,获取与第一操作关联的应用程序的标识信息,其中与所述第一操作关联的应用程序包括处于所述第一电子设备的后台运行的应用程序;根据标识信息获取应用程序的媒体流;根据应用程序的媒体流生成与应用程序对应的录屏文件。The first aspect of the embodiment of the present application discloses a screen recording method, which is applied to a first electronic device. The screen recording method includes: responding to the first operation of starting the screen recording function, acquiring the identification information of the application program associated with the first operation , wherein the application program associated with the first operation includes an application program running in the background of the first electronic device; acquiring the media stream of the application program according to the identification information; generating a recording corresponding to the application program according to the media stream of the application program screen file.
采用该技术方案,通过获取需录屏应用的标识信息,再基于标识信息获取的媒体流生成录屏文件,相比现有仅能对前端显示的界面进行录屏,本申请可实现对电子设备的一个或多个后台应用程序的界面进行录屏。Using this technical solution, by obtaining the identification information of the application that needs to be recorded, and then generating a screen recording file based on the media stream obtained from the identification information, compared with the existing interface that can only record the front-end display, this application can realize electronic equipment to record the screen of one or more background applications.
在一些实施例中,标识信息包括应用程序的进程身份标识号(Identity Document,ID)或应用程序的包名。In some embodiments, the identification information includes a process identification number (Identity Document, ID) of the application program or a package name of the application program.
在一些实施例中,根据标识信息获取应用程序的媒体流,包括:根据标识信息确定与应用程序对应的屏幕数据缓冲区;从屏幕数据缓冲区获取所述应用程序的媒体流。In some embodiments, acquiring the media stream of the application program according to the identification information includes: determining a screen data buffer corresponding to the application program according to the identification information; acquiring the media stream of the application program from the screen data buffer.
采用该技术方案,通过从屏幕数据缓冲区来提取媒体流,而非将当前屏幕显示的界面进行录制,可实现对电子设备的一个或多个应用程序的界面进行录屏,且被录屏的应用程序可运行在电子设备的前台,也可运行在电子设备的后台。With this technical solution, by extracting the media stream from the screen data buffer instead of recording the interface displayed on the current screen, it is possible to record the interface of one or more application programs of the electronic device, and the recorded screen The application program can run in the foreground of the electronic device, and can also run in the background of the electronic device.
在一些实施例中,根据应用程序的媒体流生成与应用程序对应的录屏文件,包括:对应用程序的媒体流进行图像合成,生成与应用程序对应的录屏文件。In some embodiments, generating the screen recording file corresponding to the application program according to the media stream of the application program includes: performing image synthesis on the media stream of the application program to generate the screen recording file corresponding to the application program.
采用该技术方案,电子设备通过调用SurfaceFlinger或直接数字合成(Direct Digital Synthesizer,DDS)算法来实现对应用程序的媒体流进行图像合成,生成录屏文件。Using this technical solution, the electronic device implements image synthesis on the media stream of the application program by calling SurfaceFlinger or Direct Digital Synthesizer (DDS) algorithm to generate a screen recording file.
在一些实施例中,应用程序对应第一屏幕数据缓冲区与第二屏幕数据缓冲区,根据应用程序的媒体流生成与应用程序对应的录屏文件,包括:对从第一屏幕数据缓冲区获取的第一媒体流进行图像合成,生成第一录屏子文件;对从第二屏幕数据缓冲区获取的第二媒 体流进行图像合成,生成第二录屏子文件;将所述第一录屏子文件与所述第二录屏子文件进行拼接,生成与所述应用程序对应的录屏文件。In some embodiments, the application corresponds to the first screen data buffer and the second screen data buffer, and generates a screen recording file corresponding to the application according to the media stream of the application, including: acquiring from the first screen data buffer The first media stream of the first media stream is image synthesized to generate the first screen recording sub-file; the second media stream obtained from the second screen data buffer is image synthesized to generate the second screen recording sub-file; the first screen recording sub-file is generated The sub-file is spliced with the second screen-recording sub-file to generate a screen-recording file corresponding to the application.
采用该技术方案,可以在电子设备侧对分布式显示场景下的两个或两个以上的屏幕显示内容进行录屏,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,同时可以在电子设备侧将多个录屏子文件进行拼接,生成一个录屏文件,使得用户可以在一个录屏文件中观看到多个显示界面的内容。With this technical solution, two or more screen display contents in a distributed display scenario can be recorded on the electronic device side, and multiple screen display contents can be recorded by the same device to ensure that the recording clocks are synchronized. The electronic device side splices multiple screen recording sub-files to generate a screen recording file, so that the user can watch the contents of multiple display interfaces in one screen recording file.
在一些实施例中,将第一录屏子文件与第二录屏子文件进行拼接,包括:根据第一录屏子文件与第二录屏子文件的时间戳对第一录屏子文件与第二录屏子文件进行时间对齐处理;将经过时间对齐处理的第一录屏子文件与第二录屏子文件进行拼接。In some embodiments, splicing the first screen recording sub-file and the second screen recording sub-file includes: combining the first screen recording sub-file and the second screen recording sub-file according to the time stamps of the first screen recording sub-file and the second screen recording sub-file The second screen recording sub-file is time-aligned; and the time-aligned first screen recording sub-file is spliced with the second screen recording sub-file.
采用该技术方案,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,同时可以在电子设备侧基于录屏子文件的时间戳将多个录屏子文件进行拼接得到一个录屏文件,使得用户可以在一个录屏文件中观看到时间同步的多个显示界面的内容。Using this technical solution, the recording of multiple screen display contents by the same device can ensure the synchronization of recording clocks, and at the same time, multiple screen recording sub-files can be spliced on the electronic device side based on the timestamps of the recording sub-files to obtain a screen recording file. It enables users to watch the content of multiple display interfaces with time synchronization in one screen recording file.
在一些实施例中,应用程序对应第一屏幕数据缓冲区与第二屏幕数据缓冲区,根据应用程序的媒体流生成与应用程序对应的录屏文件,包括:从第一屏幕数据缓冲区获取第一媒体流,及从第二屏幕数据缓冲区获取第二媒体流;将第一媒体流与第二媒体流进行图像合成与拼接,生成与应用程序对应的录屏文件。In some embodiments, the application corresponds to the first screen data buffer and the second screen data buffer, and generating a screen recording file corresponding to the application according to the media stream of the application includes: obtaining the first screen data buffer from the first screen data buffer A media stream, and obtain the second media stream from the second screen data buffer; perform image synthesis and splicing on the first media stream and the second media stream, and generate a screen recording file corresponding to the application program.
采用该技术方案,可以在电子设备侧对分布式显示场景下的两个或两个以上的屏幕显示内容进行录屏,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,同时可以在电子设备侧将多个媒体流进行时间对齐,再进行图像合成与拼接,生成一个录屏文件,使得用户可以在一个录屏文件中观看到多个显示界面的内容。With this technical solution, two or more screen display contents in a distributed display scenario can be recorded on the electronic device side, and multiple screen display contents can be recorded by the same device to ensure that the recording clocks are synchronized. The electronic device side aligns multiple media streams in time, and then performs image synthesis and splicing to generate a screen recording file, so that users can watch the contents of multiple display interfaces in one screen recording file.
在一些实施例中,将第一媒体流与第二媒体流进行图像合成与拼接,包括:根据第一媒体流与第二媒体流的时间戳对第一媒体流与第二媒体流进行时间对齐处理;将经过时间对齐处理的第一媒体流与第二媒体流进行图像合成与拼接。In some embodiments, the image synthesis and splicing of the first media stream and the second media stream includes: time-aligning the first media stream and the second media stream according to the time stamps of the first media stream and the second media stream Processing: performing image synthesis and stitching on the first media stream and the second media stream that have undergone time-alignment processing.
采用该技术方案,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,同时可以在电子设备侧基于媒体流的时间戳将多个媒体流进行时间对齐,再进行图像合成与拼接得到一个录屏文件,使得用户可以在一个录屏文件中观看到时间同步的多个显示界面的内容。Using this technical solution, recording multiple screen display contents by the same device can ensure the synchronization of recording clocks. At the same time, multiple media streams can be time-aligned based on the timestamp of the media stream on the electronic device side, and then image synthesis and splicing are performed to obtain a Screen recording files allow users to watch the content of multiple display interfaces synchronized in time in one screen recording file.
在一些实施例中,录屏文件包括第一界面及第二界面,第一界面与第二界面呈左右分屏显示,或第一界面与第二界面呈上下分屏显示,或第一界面的部分区域或全部区域悬浮显示于第二界面上。In some embodiments, the screen recording file includes a first interface and a second interface, and the first interface and the second interface are displayed in left and right split screens, or the first interface and the second interface are displayed in up and down split screens, or the first interface A part of the area or the entire area is suspended and displayed on the second interface.
采用该技术方案,可以用户实际需求将录屏文件中的多个界面设置为上下分屏显示、左右分屏显示、或以悬浮窗的形式显示,提升用户使用体验。By adopting this technical solution, multiple interfaces in the screen recording file can be set to be displayed in the upper and lower split screens, the left and right split screens, or displayed in the form of a floating window according to the actual needs of the user, so as to improve the user experience.
在一些实施例中,录屏方法还包括:响应于第二电子设备发送的录屏指令,获取与录屏指令关联的应用程序的标识信息。In some embodiments, the screen recording method further includes: in response to the screen recording instruction sent by the second electronic device, acquiring identification information of an application program associated with the screen recording instruction.
采用该技术方案,对于投屏场景,用户可以在源端设备侧或者目的设备侧进行录屏选择操作,指定源端设备进行录屏的应用。With this technical solution, for screen projection scenarios, the user can select the screen recording operation on the source device side or the destination device side, and designate the source device for screen recording applications.
在一些实施例中,其中与第一操作关联的应用程序还包括投屏显示至第二电子设备上的应用程序。In some embodiments, the application program associated with the first operation further includes screen projection to an application program on the second electronic device.
采用该技术方案,可以实现在第一电子设备侧对投屏显示至第二电子设备的应用进行录屏,该投屏的应用可以运行在第一电子设备的前台或者后台。By adopting this technical solution, it is possible to realize screen recording of an application projected to a second electronic device on the side of the first electronic device, and the screen projected application may run in the foreground or background of the first electronic device.
第二方面,本申请实施例提供一种录屏方法,应用第二电子设备,第一电子设备将一个或多个应用程序窗口投屏在第二电子设备上显示,录屏方法包括:接收第一电子设备发送的媒体流;响应于启动录屏功能的第一操作,获取与第一操作关联的应用程序窗口的标识信息;从接收到的媒体流中获取与第一操作关联的应用程序窗口的标识信息对应的媒体流;根据获取到的媒体流生成录屏文件。In the second aspect, the embodiment of the present application provides a screen recording method, using the second electronic device, the first electronic device projects one or more application program windows on the second electronic device for display, the screen recording method includes: receiving the second electronic device A media stream sent by an electronic device; in response to the first operation of starting the screen recording function, obtaining the identification information of the application window associated with the first operation; obtaining the application window associated with the first operation from the received media stream The media stream corresponding to the identification information; generate a screen recording file according to the obtained media stream.
采用该技术方案,通过获取需录屏应用窗口的标识信息,再基于标识信息从接收到的媒体流中提取与标识信息对应的媒体流生成录屏文件,可以实现在第二电子设备侧对其投屏显示的应用程序界面进行录屏。With this technical solution, by obtaining the identification information of the application window to be recorded, and then extracting the media stream corresponding to the identification information from the received media stream based on the identification information to generate a screen recording file, it can be realized on the second electronic device side. Record the screen of the application interface displayed on the screen.
在一些实施例中,标识信息包括应用程序窗口的进程ID及第一电子设备的设备ID。In some embodiments, the identification information includes a process ID of the application window and a device ID of the first electronic device.
采用该技术方案,可以通过应用程序窗口的进程ID及第一电子设备的设备ID作为在第二电子设备侧进行录屏的应用窗口的唯一标识。With this technical solution, the process ID of the application window and the device ID of the first electronic device can be used as the unique identifier of the application window for screen recording on the second electronic device side.
第三方面,本申请实施例提供一种计算机可读存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如第一方面或第二方面所述的录屏方法。In a third aspect, an embodiment of the present application provides a computer-readable storage medium, including computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the screen recording method as described in the first aspect or the second aspect.
第四方面,本申请实施例提供一种电子设备,电子设备包括处理器和存储器,存储器用于存储指令,处理器用于调用存储器中的指令,使得电子设备执行如第一方面或第二方面所述的录屏方法。In a fourth aspect, an embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the instructions described in the first aspect or the second aspect. screen recording method described above.
第五方面,本申请实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面或第二方面所述的录屏方法。In the fifth aspect, the embodiment of the present application provides a computer program product, which, when the computer program product is run on a computer, causes the computer to execute the screen recording method as described in the first aspect or the second aspect.
第六方面,提供一种装置,该装置具有实现上述第一方面或第二方面所提供的方法中第一电子设备行为的功能。功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。硬件或软件包括一个或多个与上述功能相对应的模块。According to a sixth aspect, an apparatus is provided, and the apparatus has a function of realizing the behavior of the first electronic device in the method provided in the first aspect or the second aspect. The functions may be implemented by hardware, or may be implemented by executing corresponding software through hardware. Hardware or software includes one or more modules corresponding to the above-mentioned functions.
可以理解地,上述提供的第三方面所述的计算机可读存储介质,第四方面所述的电子设备,第五方面所述的计算机程序产品,第六方面所述的装置均与上述第一方面或第二方面的方法对应,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。It can be understood that the computer-readable storage medium described in the third aspect, the electronic device described in the fourth aspect, the computer program product described in the fifth aspect, and the device described in the sixth aspect are all related to the above-mentioned first aspect. The method of the aspect or the second aspect is corresponding, therefore, the beneficial effect that it can achieve can refer to the beneficial effect in the corresponding method provided above, and will not be repeated here.
附图说明Description of drawings
图1为本申请一实施例提供的一种电子设备的结构示意图;FIG. 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
图2为本申请一实施例提供的一种电子设备的软件结构示意图;FIG. 2 is a schematic diagram of a software structure of an electronic device provided by an embodiment of the present application;
图3为本申请一实施例提供的录屏方法的应用场景示意图;FIG. 3 is a schematic diagram of an application scenario of a screen recording method provided by an embodiment of the present application;
图4为本申请另一实施例提供的录屏方法的应用场景示意图;FIG. 4 is a schematic diagram of an application scenario of a screen recording method provided by another embodiment of the present application;
图5为本申请又一实施例提供的录屏方法的应用场景示意图;FIG. 5 is a schematic diagram of an application scenario of a screen recording method provided by another embodiment of the present application;
图6为本申请一实施例提供的录屏方法的流程示意图;FIG. 6 is a schematic flowchart of a screen recording method provided by an embodiment of the present application;
图7为本申请另一实施例提供的录屏方法的流程示意图;FIG. 7 is a schematic flowchart of a screen recording method provided in another embodiment of the present application;
图8为本申请实施例提供的一种可能的第一电子设备的结构示意图。FIG. 8 is a schematic structural diagram of a possible first electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
需要说明的是,本申请中“至少一个”是指一个或者多个,“多个”是指两个或多于两个。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B可以表示:单独存在A,同时存在A和B,单独存在B的情况,其中A,B可以是单数或者 复数。本申请的说明书和权利要求书及附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不是用于描述特定的顺序或先后次序。It should be noted that in this application, "at least one" means one or more, and "multiple" means two or more than two. "And/or" describes the association relationship of associated objects, indicating that there can be three types of relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and B exists alone, where A, B Can be singular or plural. The terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the drawings are used to distinguish similar objects, not to Describe a specific order or sequence.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
为了便于理解,示例性的给出了部分与本申请实施例相关概念的说明以供参考。In order to facilitate understanding, some descriptions of concepts related to the embodiments of the present application are provided as examples for reference.
多个电子设备可通过通信网络组成超级终端,超级终端可以定义为将多个电子设备呈现为一个统一的整体,在使用体验上将多个电子设备进行有机融合,提升多电子设备使用环境下的用户体验。每个电子设备为超级终端的一个组成部分,某个电子设备的后台应用程序,可能在超级终端内的其他电子设备上被使用,或者可以在某个电子设备上查看超级终端内的其他电子设备的一些运行信息。Multiple electronic devices can form a hyper terminal through a communication network. A hyper terminal can be defined as presenting multiple electronic devices as a unified whole, organically integrating multiple electronic devices in terms of user experience, and improving the user experience of multiple electronic devices in the environment. user experience. Each electronic device is a part of the HyperTerminal, and the background application of a certain electronic device may be used on other electronic devices in the HyperTerminal, or other electronic devices in the HyperTerminal can be viewed on a certain electronic device some running information.
电子设备可以手机、可折叠电子设备、平板电脑、个人电脑(personal computer,PC)、膝上型计算机、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)设备、虚拟现实(virtual reality,VR)设备、人工智能(artificial intelligence,AI)设备、可穿戴式设备、车载设备、智能家居设备、或智慧城市设备中的至少一种,本申请实施例对电子设备的具体类型不作特殊限制。通信网络可以是有线网络,也可以是无线网络。例如,通信网络可以是局域网(local area networks,LAN),也可以是广域网(wide area networks,WAN),例如互联网。当该通信网络为局域网时,示例性的,该通信网络可以是wifi热点网络、wifi P2P网络、蓝牙网络、zigbee网络或近场通信(near field communication,NFC)网络等近距离通信网络。当该通信网络为广域网时,示例性的,该通信网络可以是第三代移动通信技术(3rd-generation wireless telephone technology,3G)网络、第四代移动通信技术(the 4th generation mobile communication technology,4G)网络、第五代移动通信技术(5th-generation mobile communication technology,5G)网络、未来演进的公共陆地移动网络(public land mobile network,PLMN)或因特网等。Electronic devices can be mobile phones, foldable electronic devices, tablet computers, personal computers (PC), laptop computers, handheld computers, notebook computers, ultra-mobile personal computers (UMPC), netbooks, cellular Telephone, personal digital assistant (PDA), augmented reality (augmented reality, AR) device, virtual reality (virtual reality, VR) device, artificial intelligence (artificial intelligence, AI) device, wearable device, vehicle-mounted device , smart home equipment, or at least one of smart city equipment, the embodiment of the present application does not specifically limit the specific type of electronic equipment. The communication network may be a wired network or a wireless network. For example, the communication network may be a local area network (local area networks, LAN), or a wide area network (wide area networks, WAN), such as the Internet. When the communication network is a local area network, exemplary, the communication network may be a short distance communication network such as a wifi hotspot network, a wifi P2P network, a bluetooth network, a zigbee network or a near field communication (near field communication, NFC) network. When the communication network is a wide area network, exemplary, the communication network may be a third-generation mobile communication technology (3rd-generation wireless telephone technology, 3G) network, a fourth-generation mobile communication technology (the 4th generation mobile communication technology, 4G ) network, the fifth-generation mobile communication technology (5th-generation mobile communication technology, 5G) network, the future evolution of the public land mobile network (public land mobile network, PLMN) or the Internet, etc.
电子设备可以安装一个或多个应用程序。应用程序可以简称应用,为能够实现某项或多项特定功能的软件程序。例如,即时通讯类应用、视频类应用、音频类应用、图像拍摄类应用、云桌面类应用等等。其中,即时通信类应用,例如可以包括短信应用、
Figure PCTCN2022113756-appb-000001
Figure PCTCN2022113756-appb-000002
Figure PCTCN2022113756-appb-000003
等。图像拍摄类应用,例如可以包括相机应用(系统相机或第三方相机应用)。视频类应用,例如可以包括
Figure PCTCN2022113756-appb-000004
等等。音频类应用,例如可以包括
Figure PCTCN2022113756-appb-000005
等等。以下实施例中提到的应用,可以是电子设备出厂时已安装的系统应用,也可以是用户在使用电子设备的过程中从网络下载或其他电子设备获取的第三方应用。
An electronic device may have one or more application programs installed. An application program may be referred to as an application, and is a software program capable of realizing one or more specific functions. For example, instant messaging applications, video applications, audio applications, image capture applications, cloud desktop applications, and so on. Among them, instant messaging applications, for example, may include SMS applications,
Figure PCTCN2022113756-appb-000001
Figure PCTCN2022113756-appb-000002
Figure PCTCN2022113756-appb-000003
wait. The image capturing application may include, for example, a camera application (system camera or third-party camera application). Video applications, for example, can include
Figure PCTCN2022113756-appb-000004
etc. Audio applications, for example may include
Figure PCTCN2022113756-appb-000005
etc. The applications mentioned in the following embodiments may be system applications installed on the electronic device when it leaves the factory, or third-party applications downloaded by the user from the Internet or obtained from other electronic devices during the use of the electronic device.
电子设备包括但不限于搭载
Figure PCTCN2022113756-appb-000006
Figure PCTCN2022113756-appb-000007
或其他操作系统。
Electronic equipment including but not limited to carrying
Figure PCTCN2022113756-appb-000006
Figure PCTCN2022113756-appb-000007
or other operating systems.
图1示意了一种电子设备10的结构示意图。FIG. 1 shows a schematic structural diagram of an electronic device 10 .
电子设备10可以包括处理器110,外部存储器接口120,内部存储器121,天线1,天线2,移动通信模块130,无线通信模块140,音频模块150,传感器模块160,摄像 模组170,显示屏180等。The electronic device 10 may include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 130, a wireless communication module 140, an audio module 150, a sensor module 160, a camera module 170, and a display screen 180 wait.
可以理解的是,本申请实施例示意的结构并不构成对电子设备10的具体限定。在本申请另一些实施例中,电子设备10可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 10 . In other embodiments of the present application, the electronic device 10 may include more or fewer components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), controller, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
处理器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The processor can generate an operation control signal according to the instruction opcode and the timing signal, and complete the control of fetching and executing the instruction.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器可以为高速缓冲存储器。该存储器可以保存处理器110用过或使用频率较高的指令或数据。如果处理器110需要使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in processor 110 may be a cache memory. The memory may store instructions or data used by the processor 110 or used frequently. If the processor 110 needs to use the instruction or data, it can be called directly from the memory. Repeated access is avoided, and the waiting time of the processor 110 is reduced, thereby improving the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(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)接口等。处理器110可以通过以上至少一种接口连接音频模块、无线通信模块、显示器、摄像头等模块。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and /or universal serial bus (universal serial bus, USB) interface, etc. The processor 110 may be connected to modules such as an audio module, a wireless communication module, a display, and a camera through at least one of the above interfaces.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备10的结构限定。在本申请另一些实施例中,电子设备10也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in the embodiment of the present application is only a schematic illustration, and does not constitute a structural limitation of the electronic device 10 . In other embodiments of the present application, the electronic device 10 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
电子设备10的无线通信功能可以通过天线1,天线2,移动通信模块130,无线通信模块140,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 10 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 130 , the wireless communication module 140 , a modem processor, a baseband processor, and the like.
天线1和天线2用于发射和接收电磁波信号。电子设备10中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。 Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 10 may be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
移动通信模块130可以提供应用在电子设备10上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块130可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块130可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块130还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块130的至少部分功能模块可以被设置于处理器110中。在一些 实施例中,移动通信模块130的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 130 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 10 . The mobile communication module 130 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. The mobile communication module 130 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation. The mobile communication module 130 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves through the antenna 1 for radiation. In some embodiments, at least part of the functional modules of the mobile communication module 130 may be set in the processor 110 . In some embodiments, at least part of the functional modules of the mobile communication module 130 and at least part of the modules of the processor 110 may be set in the same device.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏180显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块130或其他功能模块设置在同一个器件中。A modem processor may include a modulator and a demodulator. Wherein, the modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator sends the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is passed to the application processor after being processed by the baseband processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 180 . In some embodiments, the modem processor may be a stand-alone device. In some other embodiments, the modem processor may be independent from the processor 110, and be set in the same device as the mobile communication module 130 or other functional modules.
无线通信模块140可以提供应用在电子设备10上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),蓝牙低功耗(bluetooth low energy,BLE),超宽带(ultra wide band,UWB),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块140可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块140经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块140还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 140 can provide applications on the electronic device 10 including wireless local area networks (wireless local area networks, WLAN) (such as wireless fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), Bluetooth low power consumption (bluetooth low energy, BLE), ultra wide band (UWB), global navigation satellite 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. The wireless communication module 140 may be one or more devices integrating at least one communication processing module. The wireless communication module 140 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 140 can also receive the signal to be sent from the processor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备10的天线1和移动通信模块130耦合,天线2和无线通信模块140耦合,使得电子设备10可以通过无线通信技术与网络和其他电子设备通信。该无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(code division multiple access,CDMA),宽带码分多址(wideband code division multiple access,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。该GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidou navigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellite system,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 10 is coupled to the mobile communication module 130, and the antenna 2 is coupled to the wireless communication module 140, so that the electronic device 10 can communicate with the network and other electronic devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. The GNSS can include global positioning system (global positioning system, GPS), global navigation satellite system (global navigation satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite system, BDS), quasi-zenith satellite system (quasi- zenith satellite system (QZSS) and/or satellite based augmentation systems (SBAS).
电子设备10可以通过GPU,显示屏180,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏180和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 10 may implement a display function through a GPU, a display screen 180, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 180 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
传感器模组包括触摸传感器、压力传感器、指纹传感器等。摄像模组170包括摄像头。显示屏180用于显示图像,视频等。显示屏180包括显示面板。显示面板可以采用液晶显示屏(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)等。在一些实施例中,电子设备10可以包括1个或多个显示屏180。Sensor modules include touch sensors, pressure sensors, fingerprint sensors, etc. The camera module 170 includes a camera. The display screen 180 is used to display images, videos and the like. The display screen 180 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light emitting diode or an active matrix organic light emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diodes (quantum dot light emitting diodes, QLED), etc. In some embodiments, the electronic device 10 may include one or more display screens 180 .
电子设备10可以通过摄像模组170,ISP,视频编解码器,GPU,显示屏180以及应用处理器AP、神经网络处理器NPU等实现摄像功能。The electronic device 10 can realize the camera function through the camera module 170, ISP, video codec, GPU, display screen 180, application processor AP, neural network processor NPU, and the like.
数字信号处理器用于处理数字信号,还可以处理其他数字信号。例如,当电子设备10在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。Digital signal processors are used to process digital signals and can also process other digital signals. For example, when the electronic device 10 selects a frequency point, the digital signal processor is used to perform Fourier transform on the energy of the frequency point.
视频编解码器用于对数字视频压缩或解压缩。电子设备10可以支持一种或多种视频编解码器。这样,电子设备10可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. Electronic device 10 may support one or more video codecs. In this way, the electronic device 10 can play or record videos in various encoding formats, for example: moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备10的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 10 can be implemented through the NPU, such as image recognition, face recognition, voice recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备10的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。或将音乐,视频等文件从电子设备传输至外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card. Or transfer music, video and other files from electronic devices to external memory cards.
内部存储器121可以用于存储计算机可执行程序代码,该可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备10使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备10的各种功能方法或数据处理。The internal memory 121 may be used to store computer-executable program codes including instructions. The internal memory 121 may include an area for storing programs and an area for storing data. Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data created during the use of the electronic device 10 (such as audio data, phonebook, etc.) and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like. The processor 110 executes various functional methods or data processing of the electronic device 10 by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
音频模块150用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块150还可以用于对音频信号编码和解码。在一些实施例中,音频模块150可以设置于处理器110中,或将音频模块150的部分功能模块设置于处理器110中。The audio module 150 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signal. The audio module 150 may also be used to encode and decode audio signals. In some embodiments, the audio module 150 may be set in the processor 110 , or some functional modules of the audio module 150 may be set in the processor 110 .
电子设备10的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的Android系统为例,示例性说明电子设备10的软件结构。The software system of the electronic device 10 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 10 .
图2是本申请实施例的电子设备10的软件结构框图。FIG. 2 is a block diagram of the software structure of the electronic device 10 according to the embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为五层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime,ART)和原生C/C++库,硬件抽象层(Hardware Abstract Layer,HAL)以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system is divided into five layers, which are application program layer, application program framework layer, Android runtime (Android runtime, ART) and native C/C++ library, hardware abstraction layer (Hardware Abstract Layer, HAL) and the kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.
如图2所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。As shown in Figure 2, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.
如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,资源管理器,通知管理器,活动管理器,输入管理器等。As shown in Figure 2, the application framework layer may include window managers, content providers, view systems, resource managers, notification managers, activity managers, input managers, and so on.
窗口管理器提供窗口管理服务(Window Manager Service,WMS),WMS可以用于窗口管理、窗口动画管理、surface管理以及作为输入系统的中转站。The window manager provides window management service (Window Manager Service, WMS). WMS can be used for window management, window animation management, surface management and as a transfer station for input systems.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。该数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make it accessible to applications. This data can include videos, images, audio, calls made and received, browsing history and bookmarks, phonebook, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. The view system can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify the download completion, message reminder, etc. The notification manager can also be a notification that appears on the top status bar of the system in the form of a chart or scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window. For example, prompting text information in the status bar, issuing a prompt sound, vibrating the electronic device, and flashing the indicator light, etc.
活动管理器可以提供活动管理服务(Activity Manager Service,AMS),AMS可以用于系统组件(例如活动、服务、内容提供者、广播接收器)的启动、切换、调度以及应用进程的管理和调度工作。The activity manager can provide activity management service (Activity Manager Service, AMS), AMS can be used for system components (such as activities, services, content providers, broadcast receivers) to start, switch, schedule, and manage and schedule application processes .
输入管理器可以提供输入管理服务(Input Manager Service,IMS),IMS可以用于管理系统的输入,例如触摸屏输入、按键输入、传感器输入等。IMS从输入设备节点取出事件,通过和WMS的交互,将事件分配至合适的窗口。The input manager can provide input management service (Input Manager Service, IMS), and IMS can be used to manage the input of the system, such as touch screen input, key input, sensor input, etc. IMS fetches events from input device nodes, and distributes events to appropriate windows through interaction with WMS.
安卓运行时包括核心库和安卓运行时。安卓运行时负责将源代码转换为机器码。安卓运行时主要包括采用提前(ahead or time,AOT)编译技术和及时(just in time,JIT)编译技术。The Android runtime includes the core library and the Android runtime. The Android runtime is responsible for converting source code into machine code. The Android runtime mainly includes the use of ahead of time (ahead or time, AOT) compilation technology and just in time (just in time, JIT) compilation technology.
核心库主要用于提供基本的Java类库的功能,例如基础数据结构、数学、IO、工具、数据库、网络等库。核心库为用户进行安卓应用开发提供了API。The core library is mainly used to provide basic Java class library functions, such as basic data structure, mathematics, IO, tools, database, network and other libraries. The core library provides APIs for users to develop Android applications.
原生C/C++库可以包括多个功能模块。例如:表面管理器(surface manager),媒体框架(Media Framework),libc,OpenGL ES、SQLite、Webkit等。A native C/C++ library can include multiple functional modules. For example: surface manager (surface manager), media framework (Media Framework), libc, OpenGL ES, SQLite, Webkit, etc.
其中,表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体框架支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。OpenGL ES提供应用程序中2D图形和3D图形的绘制和操作。SQLite为电子设备10的应用程序提供轻量级关系型数据库。Among them, the surface manager is used to manage the display subsystem, and provides the fusion of 2D and 3D layers for multiple applications. The media framework supports playback and recording of various commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. OpenGL ES provides the drawing and manipulation of 2D graphics and 3D graphics in applications. SQLite provides a lightweight relational database for applications of the electronic device 10 .
硬件抽象层运行于用户空间(user space),对内核层驱动进行封装,向上层提供调用接口。The hardware abstraction layer runs in user space, encapsulates the kernel layer driver, and provides a call interface to the upper layer.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer includes at least a display driver, a camera driver, an audio driver, and a sensor driver.
下面结合捕获拍照场景,示例性说明电子设备10软件以及硬件的工作流程。The workflow of the software and hardware of the electronic device 10 will be exemplarily described below in conjunction with capturing and photographing scenes.
当显示屏接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工 成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别该输入事件所对应的控件。以该触摸操作是触摸单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用框架层的接口,启动相机应用,进而通过调用内核层启动摄像头驱动,通过摄像头捕获静态图像或视频。When the display screen receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes touch operations into original input events (including touch coordinates, time stamps of touch operations, and other information). Raw input events are stored at the kernel level. The application framework layer obtains the original input event from the kernel layer, and identifies the control corresponding to the input event. Take the touch operation as a touch click operation, and the control corresponding to the click operation is the control of the camera application icon as an example. The camera application calls the interface of the application framework layer to start the camera application, and then starts the camera driver by calling the kernel layer. Cameras capture still images or video.
下面结合图3示例性的介绍本发明一实施例提供的录屏方法的应用场景示意图。A schematic diagram of an application scenario of a screen recording method provided by an embodiment of the present invention is exemplarily introduced below with reference to FIG. 3 .
该实施例可以包括两个电子设备(例如如图1所示的电子设备10)。为了便于区分描述,该两个电子设备以下称为第一电子设备100与第二电子设备200。第一电子设备100与第二电子设备200可以处于同一局域网下,例如第一电子设备100与第二电子设备200通过Wi-Fi建立通信连接,第一电子设备100包括第一显示屏1001,第二电子设备200包括第二显示屏2001。第一电子设备100为源端设备,第二电子设备200为目的设备,第一电子设备100上运行的某一应用可以投屏在第二电子设备200上显示,该程序可以是桌面应用、图库应用、通话应用、地图应用、音乐应用、视频应用等。This embodiment may include two electronic devices (such as the electronic device 10 shown in FIG. 1 ). For ease of description, the two electronic devices are referred to as the first electronic device 100 and the second electronic device 200 hereinafter. The first electronic device 100 and the second electronic device 200 may be under the same local area network. For example, the first electronic device 100 and the second electronic device 200 establish a communication connection through Wi-Fi. The first electronic device 100 includes a first display screen 1001. The second electronic device 200 includes a second display screen 2001 . The first electronic device 100 is the source device, and the second electronic device 200 is the destination device. An application running on the first electronic device 100 can be projected and displayed on the second electronic device 200. The program can be a desktop application, a gallery apps, calling apps, maps apps, music apps, video apps, etc.
第一电子设备100、第二电子设备200包括但不限于手机、平板电脑、PC、笔记本电脑等设备。以下以第一电子设备100为手机、第二电子设备200为笔记本电脑为例进行说明。The first electronic device 100 and the second electronic device 200 include but are not limited to devices such as mobile phones, tablet computers, PCs, and notebook computers. The following description will be made by taking the first electronic device 100 as a mobile phone and the second electronic device 200 as a notebook computer as an example.
第一电子设备100可以开启n个应用APP 1~APP n,n为正整数。当第一电子设备100将m个应用APP 1~APP m投屏至第二电子设备200,第二电子设备200可以通过现有的分布式显示技术生成与m个应用APP 1~APP m对应的m个应用窗口,m为正整数。例如多个应用APP 1~APP m运行时通过SurfaceFlinger输出的帧数据可分别通过视频编码器进行编码和压缩,生成与多个应用APP 1~APP m的应用窗口对应的编码数据,例如,YUV格式的数据。第一电子设备100可以将视频编码器实时输出的多个应用APP 1~APP m的编码数据发送给第二电子设备200,第二电子设备200可以按照该编码数据解码后绘制出多个应用APP 1~APP m的应用窗口。 The first electronic device 100 can open n applications APP 1 -APP n , where n is a positive integer. When the first electronic device 100 projects m applications APP 1 to APP m to the second electronic device 200, the second electronic device 200 can use the existing distributed display technology to generate images corresponding to the m applications APP 1 to APP m . m application windows, m is a positive integer. For example, when multiple applications APP 1 ~ APP m are running, the frame data output by SurfaceFlinger can be encoded and compressed by the video encoder respectively to generate encoded data corresponding to the application windows of multiple applications APP 1 ~ APP m , for example, in YUV format The data. The first electronic device 100 can send the encoded data of multiple applications APP 1 to APP m output by the video encoder in real time to the second electronic device 200, and the second electronic device 200 can decode the encoded data and draw multiple application APPs. 1 ~ Application window of APP m .
用户可以在第二电子设备侧对投屏显示的一个或多个应用APP 1~APP m进行控制操作,例如用户可以通过第二电子设备200的鼠标、键盘对应用APP 1~APP m进行控制操作。 The user can control and operate one or more applications APP 1 -APP m displayed on the projected screen at the side of the second electronic device, for example, the user can control and operate the applications APP 1 -APP m through the mouse and keyboard of the second electronic device 200 .
举例而言,第一电子设备100开启有计算器应用APP 1、图库应用APP 2及聊天应用APP 3。用户可以在图库应用APP 2的界面上进行触控操控,唤起投屏功能图标。当用户点击投屏功能图标时,弹出可以进行投屏的设备列表,设备列表可以包括设备身份标识(identity document,ID)或设备名称等信息。当用户在设备列表中选择第二电子设备200作为目的设备,第一电子设备100可以将图库应用APP 2的应用窗口投屏至第二电子设备200,第二电子设备200可以生成与图库应用APP 2对应的应用窗口。用户可以在第一电子设备100侧采用与图库应用APP 2类似的投屏操作方式,将聊天应用APP 3的应用窗口投屏至第二电子设备200。 For example, the first electronic device 100 is opened with a calculator application APP 1 , a gallery application APP 2 and a chat application APP 3 . The user can perform touch control on the interface of the gallery application APP 2 to evoke the screen projection function icon. When the user clicks the screen projection function icon, a list of devices that can perform screen projection is popped up, and the device list may include information such as device identity (identity document, ID) or device name. When the user selects the second electronic device 200 as the destination device in the device list, the first electronic device 100 can project the application window of the gallery application APP 2 to the second electronic device 200, and the second electronic device 200 can generate a 2 corresponding to the application window. The user can project the application window of the chat application APP 3 to the second electronic device 200 by adopting a screen projection operation method similar to that of the gallery application APP 2 on the side of the first electronic device 100 .
如图3所示,计算器应用APP 1处于第一电子设备100的前台显示,图库应用APP 2与聊天应用APP 3处于第一电子设备100的后台运行,且图库应用APP 2与聊天应用APP 3投屏显示在第二电子设备200上。 As shown in FIG. 3 , the calculator application APP 1 is displayed in the foreground of the first electronic device 100, the gallery application APP 2 and the chat application APP 3 are running in the background of the first electronic device 100, and the gallery application APP 2 and the chat application APP 3 are running in the background of the first electronic device 100. The projected screen is displayed on the second electronic device 200 .
当需要在第一电子设备100上进行录屏时,用户可以在第一电子设备100或第二电子设备200选定需要进行录屏的应用。例如,第一电子设备100的操作系统自带录屏功能,用户可以在第一电子设备100上点击录屏图标,开启录屏功能。当用户点击录屏图 标时,操作系统可以获取第一电子设备100当前开启的应用信息,弹出可以进行录屏选择的应用列表,应用列表可显示应用的名称或缩略图。当用户在应用列表中选择一个或多个应用时,第一电子设备100可以根据用户的操作获取该一个或多个应用的标识信息,标识信息可以是指应用的进程ID或应用的包名,第一电子设备100可以根据应用的标识信息启动对该一个或多个应用进行录屏。进程ID是设备操作系统的内核用于唯一标识应用的进程的一个数值。When it is necessary to record the screen on the first electronic device 100 , the user can select an application that needs to record the screen on the first electronic device 100 or the second electronic device 200 . For example, the operating system of the first electronic device 100 has a built-in screen recording function, and the user can click the screen recording icon on the first electronic device 100 to start the screen recording function. When the user clicks on the screen recording icon, the operating system can obtain the application information currently opened by the first electronic device 100, and pop up a list of applications that can be selected for screen recording. The application list can display the name or thumbnail of the application. When the user selects one or more applications in the application list, the first electronic device 100 may obtain the identification information of the one or more applications according to the user's operation, the identification information may refer to the process ID of the application or the package name of the application, The first electronic device 100 may start recording the screen of the one or more applications according to the identification information of the applications. The process ID is a numerical value used by the kernel of the operating system of the device to uniquely identify the process of the application.
在一些实施例中,电子设备上运行的每个应用具有唯一的进程ID和包名,每台电子设备具有唯一的设备ID,因此可以通过进程ID和设备ID唯一确定某个电子设备内的某个进程,作为该应用的唯一标识信息。例如,电子设备的设备ID为国际移动设备识别码,电子设备安装的应用包括
Figure PCTCN2022113756-appb-000008
电子设备的设备ID、每个应用的进程ID和包名如下表1所示:
In some embodiments, each application running on the electronic device has a unique process ID and package name, and each electronic device has a unique device ID, so a certain application in a certain electronic device can be uniquely determined through the process ID and device ID. process as the unique identification information of the application. For example, the device ID of the electronic device is the International Mobile Equipment Identity, and the applications installed on the electronic device include
Figure PCTCN2022113756-appb-000008
The device ID of the electronic device, the process ID and package name of each application are shown in Table 1 below:
表1Table 1
Figure PCTCN2022113756-appb-000009
Figure PCTCN2022113756-appb-000009
在一些实施例中,当录屏场景只包括第一电子设备100时,第一电子设备100对前台应用或后台应用进行录屏时,可以只使用应用的进程ID或包名作为该应用的唯一标识信息。当录屏场景包括多个电子设备,如第一电子设备100的应用投屏在第二电子设备200显示的场景,第一电子设备100对前台应用或后台应用进行录屏时,同样可以只使用应用的进程ID或包名作为该应用的唯一标识信息。第二电子设备200对投屏应用进行录屏时,可以使用进程ID和第一电子设备100的设备ID作为该投屏应用的唯一标识信息。In some embodiments, when the screen recording scene only includes the first electronic device 100, when the first electronic device 100 records the screen of the foreground application or the background application, only the process ID or package name of the application can be used as the unique Identification information. When the screen recording scene includes multiple electronic devices, such as the scene where the application screen of the first electronic device 100 is projected on the second electronic device 200, and the first electronic device 100 records the screen of the foreground application or the background application, it can also only use The process ID or package name of the application is used as the unique identification information of the application. When the second electronic device 200 records the screen of the screen projection application, it may use the process ID and the device ID of the first electronic device 100 as the unique identification information of the screen projection application.
第一电子设备100也可以安装有第三方录屏应用或在出厂时预安装有录屏应用,第一电子设备100可以开启录屏应用。录屏应用可以获取第一电子设备100当前开启的应用信息,当用户在第一电子设备100的录屏应用中选择一个或多个应用进行录屏时,第一电子设备100可以根据用户的操作获取该一个或多个应用的标识信息,第一电子设备100可以根据应用的标识信息启动对该一个或多个应用进行录屏。The first electronic device 100 may also be installed with a third-party screen recording application or pre-installed with a screen recording application when leaving the factory, and the first electronic device 100 may start the screen recording application. The screen recording application can obtain the application information currently opened by the first electronic device 100. When the user selects one or more applications in the screen recording application of the first electronic device 100 to record the screen, the first electronic device 100 can record the screen according to the user's operation. After acquiring the identification information of the one or more applications, the first electronic device 100 may start recording the screen of the one or more applications according to the identification information of the applications.
在一些实施例中,用户还可以在第二电子设备200上指定需要录屏的投屏应用(如图库应用APP 2与聊天应用APP 3),具体录屏操作由第一电子设备100执行。例如,第二电子设备200可以响应用户的操作生成录屏指令,第二电子设备200可以通过Wi-Fi通道将录屏指令发送给第一电子设备100,使得第一电子设备100对用户指定的应用进行录屏。例如,第二电子设备200安装有录屏应用,第二电子设备200的录屏应用可以获取第二电子设备200当前投屏显示的第一电子设备100的应用信息。当用户在第二电子设备200的录屏应用中选择一个或多个应用进行录屏时,第二电子设备200可以响应用户操作生成与该一个或多个应用关联的录屏指令,录屏指令可以包括应用的标识信息。第二电子设备200可以将录屏指令发送给第一电子设备100,实现控制第一电子设备100启动对用户选择的一个或多个应用进行录屏。 In some embodiments, the user can also designate a screen-casting application (such as a gallery application APP 2 and a chat application APP 3 ) that needs to be recorded on the second electronic device 200 , and the specific screen recording operation is performed by the first electronic device 100 . For example, the second electronic device 200 can generate a screen recording instruction in response to the user's operation, and the second electronic device 200 can send the screen recording instruction to the first electronic device 100 through a Wi-Fi channel, so that the first electronic device 100 can record the screen instruction specified by the user. app to record screen. For example, the second electronic device 200 is installed with a screen recording application, and the screen recording application of the second electronic device 200 may obtain the application information of the first electronic device 100 currently displayed on the screen of the second electronic device 200 . When the user selects one or more applications in the screen recording application of the second electronic device 200 to record the screen, the second electronic device 200 may generate a screen recording instruction associated with the one or more applications in response to the user operation, the screen recording instruction Can include identifying information for the application. The second electronic device 200 may send a screen recording instruction to the first electronic device 100, so as to control the first electronic device 100 to start recording the screen of one or more applications selected by the user.
当第一电子设备100开启某个应用时,该应用的进程可以请求WMS为应用窗口创建 一个Surface。多个的应用的进程可以对应多个Surface。Surface可以是指屏幕数据消费者提供给屏幕数据生产者的一块数据缓冲区,屏幕数据生产者可以在Surface上进行图像内容的生产,屏幕数据消费者们可以把生产出来的数据在屏幕上绘制出来或者是转换成其所需的数据。例如,在第一电子设备100的录屏场景中,屏幕数据生产者,如虚拟显示器(VirtualDisplay)可以在Surface产生数据,屏幕数据消费者,如多媒体记录器(MediaRecoder)可以从Surface获取数据,多媒体记录器在获取到数据后可以利用诸如动态图像专家组(fast forward moving Picture expert group,FFMPEG)等编码方式将数据编码成视频。When the first electronic device 100 starts an application, the process of the application can request the WMS to create a Surface for the application window. Multiple application processes can correspond to multiple Surfaces. Surface can refer to a data buffer provided by screen data consumers to screen data producers. Screen data producers can produce image content on Surface, and screen data consumers can draw the produced data on the screen. Or convert to the data it needs. For example, in the screen recording scene of the first electronic device 100, a screen data producer, such as a virtual display (VirtualDisplay), can generate data on Surface, and a screen data consumer, such as a multimedia recorder (MediaRecoder), can obtain data from Surface. After the recorder acquires the data, it can encode the data into a video using a coding method such as fast forward moving picture expert group (FFMPEG).
假设第一电子设备100开启了计算器应用APP 1、图库应用APP 2与聊天应用APP 3,计算器应用APP 1处于第一电子设备100的前台显示,图库应用APP 2与聊天应用APP 3处于第一电子设备100的后台运行,用户选择对图库应用APP 2与聊天应用APP 3进行录屏。第一电子设备100可以根据用户的录屏操作获取图库应用APP 2的标识信息及聊天应用APP 3的标识信息。第一电子设备100根据图库应用APP 2的标识信息从对应的Surface中获取图库应用APP 2的媒体流,第一电子设备100可以根据图库应用APP 2的媒体流生成与图库应用APP 2对应的录屏文件f1。例如,第一电子设备100可以调用SurfaceFlinger或直接数字合成(Direct Digital Synthesizer,DDS)算法对图库应用APP 2的媒体流进行图像合成,生成录屏文件f1。 Assuming that the first electronic device 100 has opened the calculator application APP 1 , the gallery application APP 2 and the chat application APP 3 , the calculator application APP 1 is displayed in the foreground of the first electronic device 100, and the gallery application APP 2 and the chat application APP 3 are in the first display. An electronic device 100 is running in the background, and the user chooses to record the screen of the gallery application APP 2 and the chat application APP 3 . The first electronic device 100 may acquire the identification information of the gallery application APP 2 and the identification information of the chat application APP 3 according to the user's screen recording operation. The first electronic device 100 obtains the media stream of the gallery application APP 2 from the corresponding Surface according to the identification information of the gallery application APP 2 , and the first electronic device 100 may generate a recording corresponding to the gallery application APP 2 according to the media stream of the gallery application APP 2 . screen file f1. For example, the first electronic device 100 may call SurfaceFlinger or a direct digital synthesis (Direct Digital Synthesizer, DDS) algorithm to perform image synthesis on the media stream of the gallery application APP 2 to generate the screen recording file f1.
同理,第一电子设备100可以根据聊天应用APP 3的标识信息从对应的Surface中获取聊天应用APP 3的媒体流,第一电子设备100可以根据聊天应用APP 3的媒体流生成与聊天应用APP 3对应的录屏文件f2。 Similarly, the first electronic device 100 can obtain the media stream of the chat application APP 3 from the corresponding Surface according to the identification information of the chat application APP 3 , and the first electronic device 100 can generate and communicate with the chat application APP 3 according to the media stream of the chat application APP 3. 3 corresponds to the screen recording file f2.
在一些实施例中,第一电子设备100可以在Surface中的媒体流发送给第二电子设备200过程中或之前,对Surface上的媒体流进行编码形成录屏文件。In some embodiments, the first electronic device 100 may encode the media stream on the Surface to form a screen recording file during or before the media stream on the Surface is sent to the second electronic device 200 .
假设用户选择对计算器应用APP 1进行录屏。第一电子设备100可以根据用户的录屏操作获取计算器应用APP 1的标识信息。第一电子设备100可以根据计算器应用APP 1的标识信息从对应的Surface中获取计算器应用APP 1的媒体流,第一电子设备100可以根据计算器应用APP 1的媒体流生成与计算器应用APP 1对应的录屏文件f3。例如,第一电子设备100调用SurfaceFlinger或DDS算法对计算器应用APP 1的媒体流进行图像合成,生成录屏文件f3。 Assume that the user chooses to record the screen of the calculator application APP 1 . The first electronic device 100 may acquire the identification information of the calculator application APP 1 according to the user's screen recording operation. The first electronic device 100 can obtain the media stream of the calculator application APP 1 from the corresponding Surface according to the identification information of the calculator application APP 1 , and the first electronic device 100 can generate and communicate with the calculator application APP 1 according to the media stream of the calculator application APP 1. Screen recording file f3 corresponding to APP 1 . For example, the first electronic device 100 invokes the SurfaceFlinger or DDS algorithm to perform image synthesis on the media stream of the computer application APP 1 to generate the screen recording file f3.
在一些实施例中,第二电子设备200也可以对投屏应用(如图库应用APP 2与聊天应用APP 3)进行录屏。例如,第二电子设备200的操作系统自带录屏功能,用户可以在第二电子设备200上点击录屏图标,开启录屏功能。当用户点击录屏图标时,操作系统可以获取第二电子设备200当前投屏显示的应用信息,弹出可以进行录屏选择的应用列表,应用列表可显示应用的名称或缩略图。当用户在应用列表中选择一个或多个应用时,第二电子设备200可以根据用户的操作获取该一个或多个应用的标识信息,第二电子设备200可以根据应用的标识信息实现对该一个或多个应用进行录屏。 In some embodiments, the second electronic device 200 can also record the screen of the screen-casting application (such as the gallery application APP 2 and the chat application APP 3 ). For example, the operating system of the second electronic device 200 has a built-in screen recording function, and the user can click the screen recording icon on the second electronic device 200 to start the screen recording function. When the user clicks the screen recording icon, the operating system can obtain the application information currently displayed on the screen of the second electronic device 200, and pop up a list of applications that can be selected for screen recording. The application list can display the name or thumbnail of the application. When the user selects one or more applications in the application list, the second electronic device 200 can obtain the identification information of the one or more applications according to the user's operation, and the second electronic device 200 can implement the identification information of one or more applications according to the identification information of the applications. or multiple apps for screen recording.
在投屏显示场景中,第一电子设备100将图库应用APP 2的媒体流与聊天应用APP 3的媒体流发送给第二电子设备200,第二电子设备200对接收到的媒体流进行解码送显,实现在第二显示屏2001上显示图库应用APP2与聊天应用APP 3In the screen projection display scenario, the first electronic device 100 sends the media stream of the gallery application APP 2 and the media stream of the chat application APP 3 to the second electronic device 200, and the second electronic device 200 decodes the received media stream and sends it to the second electronic device 200. display, realizing displaying the gallery application APP2 and the chat application APP3 on the second display screen 2001.
第二电子设备200可以根据聊天应用APP 3的标识信息从接收到的媒体流中获取聊天应用APP 3的媒体流,标识信息可以包括进程ID与设备ID(通过设备ID确定媒体流是 由第一电子设备100发送的),第二电子设备200可以调用SurfaceFlinger或DDS算法对聊天应用APP 3的媒体流进行图像合成,生成与聊天应用APP 3对应的录屏文件。例如,第二电子设备200可以在将聊天应用APP 3的媒体流送显之前,对聊天应用APP 3的媒体流进行图像合成。 The second electronic device 200 can obtain the media stream of the chat application APP 3 from the received media stream according to the identification information of the chat application APP 3 , and the identification information can include a process ID and a device ID (determined by the device ID that the media stream is generated by the first sent by the electronic device 100), the second electronic device 200 can call SurfaceFlinger or DDS algorithm to perform image synthesis on the media stream of the chat application APP 3 , and generate a screen recording file corresponding to the chat application APP 3 . For example, the second electronic device 200 may perform image synthesis on the media stream of the chat application APP 3 before sending the media stream of the chat application APP 3 for display.
第二电子设备200同样可以根据图片应用APP 2的标识信息从接收到的媒体流中获取图片应用APP 2的媒体流,第二电子设备200可以调用SurfaceFlinger或DDS算法对图片应用APP 2的媒体流进行图像合成,生成与图片应用APP 2对应的录屏文件。 The second electronic device 200 can also obtain the media stream of the picture application APP 2 from the received media stream according to the identification information of the picture application APP 2 , and the second electronic device 200 can invoke the SurfaceFlinger or DDS algorithm to apply the media stream of the picture application APP 2 Perform image synthesis to generate a screen recording file corresponding to the image application APP 2 .
下面结合图4示例性的介绍本发明另一实施例提供的录屏方法的应用场景示意图。A schematic diagram of an application scenario of a screen recording method provided by another embodiment of the present invention is exemplarily introduced below with reference to FIG. 4 .
该实施例包括第一电子设备100与第二电子设备200。以下以第一电子设备100为手机、第二电子设备200为车机设备为例进行说明。第一电子设备100可以通过蓝牙与第二电子设备200建立通信连接,第一电子设备100与第二电子设备200通过车载手机映射方案,在手机与汽车之间建立通信管道,实现把手机的应用和服务延展到汽车。车载手机映射方案包括但不限于HiCar、CarPlay、或CarLife等。This embodiment includes a first electronic device 100 and a second electronic device 200 . The following description will be made by taking the first electronic device 100 as a mobile phone and the second electronic device 200 as an in-vehicle device as an example. The first electronic device 100 can establish a communication connection with the second electronic device 200 through Bluetooth, and the first electronic device 100 and the second electronic device 200 can establish a communication channel between the mobile phone and the car through the vehicle-mounted mobile phone mapping scheme to realize the application of the mobile phone. And the service extends to cars. Car phone mapping solutions include but are not limited to HiCar, CarPlay, or CarLife, etc.
如图4所示,第一电子设备100将地图应用APP 11、电话应用APP 12、音乐应用APP 13投屏在第二电子设备200上显示。在现有车载投屏场景中,当手机上的某一应用投屏在车机设备的屏幕上时,该应用处于手机的后台运行,手机无法再打开该应用,手机也无法将该应用切到前台进行录屏。由于车机设备一般也不支持录屏功能,导致用户无法在手机侧或者车机侧对投屏应用进行录屏。 As shown in FIG. 4 , the first electronic device 100 projects the map application APP 11 , the phone application APP 12 , and the music application APP 13 on the second electronic device 200 for display. In the existing in-vehicle projection scenario, when an application on the mobile phone is projected on the screen of the in-vehicle device, the application is running in the background of the mobile phone, and the mobile phone can no longer open the application, and the mobile phone cannot switch the application to Screen recording in the foreground. Since the car equipment generally does not support the screen recording function, users cannot record the screen projection application on the mobile phone side or the car side.
在本申请中,为了实现在车载投屏场景中对投屏应用进行录屏,第一电子设备100可以根据用户的录屏操作(在第一电子设备100侧的操作)获取需进行录屏的应用的标识信息,标识信息可以是指应用的进程ID或应用的包名。第一电子设备100可以根据应用的标识信息从对应的Surface中获取该应用的媒体流,第一电子设备100可以根据该应用的媒体流生成与该应用对应的录屏文件。例如,第一电子设备100调用SurfaceFlinger或DDS算法对该应用的媒体流进行图像合成,生成录屏文件。In this application, in order to realize the screen recording of the screen projection application in the vehicle screen projection scene, the first electronic device 100 can obtain the screen recording information to be recorded according to the user's screen recording operation (operation on the first electronic device 100 side). Identification information of the application, where the identification information may refer to a process ID of the application or a package name of the application. The first electronic device 100 may acquire the media stream of the application from the corresponding Surface according to the identification information of the application, and the first electronic device 100 may generate a screen recording file corresponding to the application according to the media stream of the application. For example, the first electronic device 100 invokes the SurfaceFlinger or DDS algorithm to perform image synthesis on the media stream of the application to generate a screen recording file.
当第一电子设备100开启地图应用APP 11、电话应用APP 12及音乐应用APP 13时,地图应用APP 11的进程可以请求WMS为其应用窗口创建一个Surface,电话应用APP 12的进程可以请求WMS为其应用窗口创建一个Surface,音乐应用APP 13的进程可以请求WMS为其应用窗口创建一个Surface。以下以对地图应用APP 11与电话应用APP 12进行录屏为例。假设第一电子设备100的操作系统自带录屏功能,用户可以在第一电子设备100上点击录屏图标,开启录屏功能。当用户点击录屏图标时,操作系统可以获取第一电子设备100当前开启的应用信息,弹出可以进行录屏选择的应用列表,例如应用列表可显示应用的名称。当用户在应用列表中选择地图应用APP 11与电话应用APP 12的名称时,第一电子设备100可以获取地图应用APP 11与电话应用APP 12的标识信息,第一电子设备100根据地图应用APP 11的标识信息从对应的Surface中获取地图应用APP 11的媒体流,第一电子设备100对地图应用APP 11的媒体流进行图像合成,生成与地图应用APP 11对应的录屏文件。第一电子设备100还可以根据电话应用APP 12的标识信息从对应的Surface中获取电话应用APP 12的媒体流,第一电子设备100对电话应用APP 12的媒体流进行图像合成,生成与电话应用APP 12对应的录屏文件。 When the first electronic device 100 starts the map application APP 11, the phone application APP 12 and the music application APP 13 , the process of the map application APP 11 can request the WMS to create a Surface for its application window, and the process of the phone application APP 12 can request the WMS to create a surface for the application window. Its application window creates a Surface, and the process of the music application APP 13 can request the WMS to create a Surface for its application window. The following takes the screen recording of the map application APP 11 and the phone application APP 12 as an example. Assuming that the operating system of the first electronic device 100 has a built-in screen recording function, the user can click the screen recording icon on the first electronic device 100 to start the screen recording function. When the user clicks the screen recording icon, the operating system can obtain information about applications currently opened by the first electronic device 100, and pop up a list of applications that can be selected for screen recording. For example, the application list can display the name of the application. When the user selects the names of the map application APP 11 and the phone application APP 12 in the application list, the first electronic device 100 can obtain the identification information of the map application APP 11 and the phone application APP 12 , and the first electronic device 100 can obtain the identification information of the map application APP 11 and the phone application APP 12 . The identification information of the map application APP 11 is obtained from the corresponding Surface, and the first electronic device 100 performs image synthesis on the media stream of the map application APP 11 to generate a screen recording file corresponding to the map application APP 11 . The first electronic device 100 can also obtain the media stream of the phone application APP 12 from the corresponding Surface according to the identification information of the phone application APP 12 , and the first electronic device 100 performs image synthesis on the media stream of the phone application APP 12 to generate a The screen recording file corresponding to APP 12 .
在一些实施例中,第一电子设备100也可以安装有第三方录屏应用或在出厂时预安装有录屏应用,用户还可以在车载投屏场景中开启录屏应用进行录屏。当第一电子设备 100开启录屏应用之后,录屏应用可以获取第一电子设备100当前开启的应用信息,当用户在录屏应用中选择对地图应用APP 11与电话应用APP 12进行录屏时,第一电子设备100可以根据用户的操作获取地图应用APP 11与电话应用APP 12的标识信息,第一电子设备100可以根据地图应用APP 11与电话应用APP 12的标识信息获取地图应用APP 11与电话应用APP 12的媒体流,第一电子设备100再分别对地图应用APP 11的媒体流、电话应用APP 12的媒体流进行图像合成,生成与地图应用APP 11对应的录屏文件及与电话应用APP 12对应的录屏文件。 In some embodiments, the first electronic device 100 may also be installed with a third-party screen recording application or pre-installed with a screen recording application at the factory, and the user may also start the screen recording application in the vehicle screen projection scene to record the screen. After the first electronic device 100 starts the screen recording application, the screen recording application can obtain the application information currently opened by the first electronic device 100, when the user chooses to record the map application APP 11 and the phone application APP 12 in the screen recording application The first electronic device 100 can obtain the identification information of the map application APP 11 and the phone application APP 12 according to the user's operation, and the first electronic device 100 can obtain the identification information of the map application APP 11 and the phone application APP 12 according to the identification information of the map application APP 11 and the phone application APP 12 . For the media stream of the phone application APP 12 , the first electronic device 100 performs image synthesis on the media stream of the map application APP 11 and the media stream of the phone application APP 12 respectively, and generates a screen recording file corresponding to the map application APP 11 and a screen recording file corresponding to the phone application APP 11. The screen recording file corresponding to APP 12 .
下面结合图5示例性的介绍本发明又一实施例提供的录屏方法的应用场景示意图。A schematic diagram of an application scenario of a screen recording method provided by another embodiment of the present invention is exemplarily introduced below with reference to FIG. 5 .
该实施例包括第一电子设备100与第二电子设备200。第一电子设备100可以是手机、平板等小屏终端设备,第二电子设备200可以为大屏显示设备(如电视、智慧屏等)。以下以第一电子设备100为手机、第二电子设备200为电视为例进行说明。第一电子设备100可以通过Wi-Fi与第二电子设备200建立通信连接。在分布式游戏场景下,第一电子设备100可以作为操作手柄,第二电子设备200可以作为显示端,显示第一电子设备100投屏的游戏画面。This embodiment includes a first electronic device 100 and a second electronic device 200 . The first electronic device 100 may be a small-screen terminal device such as a mobile phone or a tablet, and the second electronic device 200 may be a large-screen display device (such as a TV, a smart screen, etc.). Hereinafter, the first electronic device 100 is a mobile phone and the second electronic device 200 is a television as an example for description. The first electronic device 100 can establish a communication connection with the second electronic device 200 through Wi-Fi. In a distributed game scenario, the first electronic device 100 can be used as an operating handle, and the second electronic device 200 can be used as a display terminal to display the game screen projected by the first electronic device 100 .
现有的分布式游戏场景下的录屏,在第一电子设备100侧对第一电子设备100的屏幕显示内容进行录屏,在第二电子设备200侧对第二电子设备200的屏幕显示内容进行录屏,无法实现同时录制两侧的屏幕显示内容,当前只能在两侧进行分别录制,再将两侧录屏文件进行拼接。由于网络时延的存在,两侧设备的时钟不一定能精准同步,拼接的录屏文件存在时间差。For the screen recording in the existing distributed game scene, the screen display content of the first electronic device 100 is recorded on the first electronic device 100 side, and the screen display content of the second electronic device 200 is recorded on the second electronic device 200 side. For screen recording, it is impossible to record the screen display content on both sides at the same time. Currently, you can only record on both sides separately, and then splicing the screen recording files on both sides. Due to the existence of network delay, the clocks of the devices on both sides may not be accurately synchronized, and there is a time difference in the spliced screen recording files.
在本申请中,为了实现在分布式游戏场景中对两侧屏幕显示内容进行同步(时钟同步)录屏,在第一电子设备100侧对第一电子设备100与第二电子设备200的屏幕显示内容进行录屏。如图5所示的分布式游戏场景,手机作为游戏操控端,电视作为游戏显示端,两个设备(手机与电视)的设备ID不同,由于两个设备运行的游戏应用属于同一个游戏开发商,采用相同的包名命名,即两个设备的游戏应用的包名相同。不同设备的操作系统的内核生成用于唯一标识其上运行的应用的进程的数值不同,即两个设备的游戏应用的进程ID不相同。In this application, in order to achieve synchronous (clock synchronization) recording of screen display content on both sides of the screen in a distributed game scene, the screen display of the first electronic device 100 and the second electronic device 200 on the side of the first electronic device 100 screen recording content. In the distributed game scene shown in Figure 5, the mobile phone is used as the game control terminal, and the TV is used as the game display terminal. The device IDs of the two devices (mobile phone and TV) are different, because the game applications run by the two devices belong to the same game developer. , use the same package name, that is, the package names of the game applications on the two devices are the same. The kernels of the operating systems of different devices generate different values for uniquely identifying the processes of the applications running on them, that is, the process IDs of the game applications of the two devices are different.
在分布式游戏场景中,当第一电子设备100将游戏应用投屏至第二电子设备200时,第一电子设备100可以自动开启游戏操控控件,此时第一电子设备100显示游戏操控界面,第二电子设备200显示游戏画面。用户可以自定义游戏操控界面中的按键的位置、大小。WMS为第一电子设备100内的游戏应用的进程创建两个相互独立的Surface。两个相互独立的Surface可以对应同一个进程ID,屏幕数据生产者可以在一个Surface上进行游戏操控界面内容的生产,在另一个Surface上进行游戏画面内容的生产。In a distributed game scenario, when the first electronic device 100 projects the game application to the second electronic device 200, the first electronic device 100 can automatically enable the game control control, and at this time the first electronic device 100 displays the game control interface, The second electronic device 200 displays a game screen. The user can customize the position and size of the buttons in the game control interface. The WMS creates two mutually independent Surfaces for the process of the game application in the first electronic device 100 . Two mutually independent Surfaces can correspond to the same process ID, and screen data producers can produce game control interface content on one Surface, and produce game screen content on the other Surface.
在一些实施例中,当第一电子设备100将游戏应用投屏至第二电子设备200时,第一电子设备100可以显示手柄功能图标。当用户点击手柄功能图标时,第一电子设备100进入“手柄模式”,第一电子设备100显示游戏操控界面。In some embodiments, when the first electronic device 100 casts the screen of the game application to the second electronic device 200, the first electronic device 100 may display a handle function icon. When the user clicks on the handle function icon, the first electronic device 100 enters a "handle mode", and the first electronic device 100 displays a game control interface.
第一电子设备100可以响应用户的录屏操作,从两个Surface中获取媒体流,第一电子设备100可以根据两个媒体流的时间戳对两个媒体流进行时间对齐,再对经过时间对齐处理的两个媒体流进行图像合成与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏,提升用户使用体验。例如,拼接处理可以是指录屏文件中的游戏操作界面与游戏画面界面 成上下分屏排布,或者成左右分屏排布。The first electronic device 100 can respond to the user's screen recording operation and obtain media streams from the two Surfaces. The first electronic device 100 can time-align the two media streams according to the timestamps of the two media streams, and then align the elapsed time. The processed two media streams are image synthesized and spliced to generate a screen recording file including the game operation interface and the game screen interface, and then the user can watch the screen recording of the time-synchronized game operation interface and the game screen interface, improving the user experience . For example, splicing processing may mean that the game operation interface and the game screen interface in the screen recording file are arranged in a top-bottom split screen, or in a left-right split screen arrangement.
在一些实施例中,录屏文件中的游戏操作界面也可以悬浮显示在游戏画面界面的某个指定区域,该区域的位置可以由用户进行自定义。例如,用户在第一电子设备100上进行录屏操作时,录屏操作包括将游戏操作界面设置为悬浮显示在游戏画面界面的左下角区域,或右下角区域。In some embodiments, the game operation interface in the screen recording file can also be suspended and displayed in a designated area of the game screen interface, and the position of this area can be customized by the user. For example, when the user performs a screen recording operation on the first electronic device 100 , the screen recording operation includes setting the game operation interface to be displayed in a floating area in the lower left corner or the lower right corner of the game screen interface.
在一些实施例中,第一电子设备100还可以响应用户的录屏操作,从两个Surface中获取媒体流,第一电子设备100可以分别对两个媒体流进行图像合成,生成对应于游戏操作界面的第一录屏子文件及对应于游戏画面界面的第二录屏子文件。第一电子设备100可以再根据第一录屏子文件的时间戳与第二录屏子文件的时间戳对第一录屏子文件与第二录屏子文件进行时间对齐处理与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏。In some embodiments, the first electronic device 100 can also obtain media streams from the two Surfaces in response to the user's screen recording operation, and the first electronic device 100 can respectively perform image synthesis on the two media streams to generate an image corresponding to the game operation. The first screen recording sub-file of the interface and the second screen recording sub-file corresponding to the game screen interface. The first electronic device 100 may then perform time alignment and splicing processing on the first screen recording sub-file and the second screen recording sub-file according to the timestamp of the first screen recording sub-file and the time stamp of the second screen recording sub-file to generate Including the screen recording files of the game operation interface and the game screen interface, and then the user can watch the time-synchronized screen recording of the game operation interface and the game screen interface.
假设第一电子设备100的操作系统自带录屏功能,用户可以在第一电子设备100上点击录屏图标,开启录屏功能。当用户点击录屏图标时,操作系统可以获取第一电子设备100当前开启的游戏应用信息,第一电子设备100根据游戏应用的标识信息从对应的Surface中获取游戏应用的媒体流,例如游戏应用的标识信息包括游戏应用的进程ID,第一电子设备100可以根据游戏应用的进程ID确定与其对应的两个Surface。第一电子设备100可以从两个Surface中获取媒体流,第一电子设备100可以根据两个媒体流的时间戳对两个媒体流进行时间对齐,再对经过时间对齐处理的两个媒体流进行图像合成与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件。Assuming that the operating system of the first electronic device 100 has a built-in screen recording function, the user can click the screen recording icon on the first electronic device 100 to start the screen recording function. When the user clicks the screen recording icon, the operating system can obtain information about the game application currently opened by the first electronic device 100, and the first electronic device 100 obtains the media stream of the game application from the corresponding Surface according to the identification information of the game application, such as the game application The identification information of the game application includes the process ID of the game application, and the first electronic device 100 can determine the two corresponding Surfaces according to the process ID of the game application. The first electronic device 100 can obtain media streams from the two Surfaces, and the first electronic device 100 can time-align the two media streams according to the time stamps of the two media streams, and then perform time-alignment on the two media streams that have undergone time-aligned processing. Image synthesis and splicing processing, generating screen recording files including game operation interface and game screen interface.
参照图6所示,本申请实施例提供一种录屏方法,应用于第一电子设备100。本实施例中,录屏方法可以包括:Referring to FIG. 6 , the embodiment of the present application provides a method for recording a screen, which is applied to the first electronic device 100 . In this embodiment, the screen recording method may include:
61、响应于启动录屏功能的第一操作,获取与第一操作关联的应用的标识信息。61. In response to the first operation of starting the screen recording function, acquire identification information of an application associated with the first operation.
在一些实施例中,当用户希望进行录屏时,用户可以启动第一电子设备100的录屏功能,例如执行第一操作来启动第一电子设备100的录屏功能。其中,第一操作例如可以是用户按压物理按键的操作(例如:同时按住电源键和音量加键)、用户执行预定义的手势(例如:在屏幕上三指下滑、指关节敲击屏幕、摇晃手机)、用户在屏幕上操作相应按钮(点击通知栏中的录屏控件)、用户输入语音命令、用户在录屏应用上进行操作等中任一种。本申请实施例对录屏操作不做具体限定。In some embodiments, when the user wishes to record the screen, the user may start the screen recording function of the first electronic device 100 , for example, perform a first operation to start the screen recording function of the first electronic device 100 . Wherein, the first operation may be, for example, an operation in which the user presses a physical button (for example: press and hold the power button and the volume up button at the same time), the user performs a predefined gesture (for example: slide three fingers down on the screen, tap the knuckle on the screen, Shake the mobile phone), the user operates the corresponding button on the screen (click the screen recording control in the notification bar), the user enters a voice command, the user performs any operation on the screen recording application, etc. The embodiment of the present application does not specifically limit the screen recording operation.
在一些实施例中,与第一操作关联的应用可以包括一个或多个应用,该一个或多个应用程序可以处于第一电子设备100的前台运行,或后台运行,或部分处于前台运行、部分处于后台运行。标识信息可以是指可唯一标识应用的信息,例如标识信息可以包括应用的进程ID或应用的包名。在其他实施例中,标识信息还可以包括应用的进程ID及运行该应用的设备ID,或者应用的包名及运行该应用的设备ID。In some embodiments, the applications associated with the first operation may include one or more applications, and the one or more application programs may run in the foreground of the first electronic device 100, or run in the background, or run partly in the foreground, partly running in the background. The identification information may refer to information that can uniquely identify the application, for example, the identification information may include a process ID of the application or a package name of the application. In other embodiments, the identification information may also include the process ID of the application and the ID of the device running the application, or the package name of the application and the ID of the device running the application.
在一些实施例中,在投屏场景下,第一电子设备100上运行的一个或多个应用投屏在第二电子设备200上显示时,用户还可以在第二电子设备200上指定需要录屏的投屏应用,具体录屏操作由第一电子设备100执行。第一电子设备100还可以响应于第二电子设备200发送的录屏指令,获取与录屏指令关联的应用的标识信息。例如,第二电子设备200可以响应用户操作生成与一个或多个应用关联的录屏指令,录屏指令可以包括应用的标识信息。第二电子设备200可以将录屏指令发送给第一电子设备100,进而第一电子设备100可以获取需录屏的应用的标识信息。In some embodiments, in the screen projection scenario, when one or more applications running on the first electronic device 100 are projected to be displayed on the second electronic device 200, the user can also specify on the second electronic device 200 that the screen needs to be recorded. The screen-casting application of the screen, and the specific screen-recording operation is performed by the first electronic device 100 . The first electronic device 100 may also, in response to the screen recording instruction sent by the second electronic device 200, obtain identification information of an application associated with the screen recording instruction. For example, the second electronic device 200 may generate a screen recording instruction associated with one or more applications in response to a user operation, and the screen recording instruction may include identification information of the application. The second electronic device 200 may send the screen recording instruction to the first electronic device 100, and then the first electronic device 100 may acquire the identification information of the application that needs to record the screen.
62、根据标识信息获取应用的媒体流。62. Acquire the media stream of the application according to the identification information.
在一些实施例中,当第一电子设备100开启某个应用时,该应用的进程可以请求WMS为应用窗口创建一个Surface。每个的应用的进程可以对应至少一个Surface。Surface可以是指屏幕数据消费者提供给屏幕数据生产者的一块数据缓冲区,屏幕数据生产者可以在Surface上进行图像内容的生产,屏幕数据消费者们可以把生产出来的数据消费到屏幕上面(绘制出来)或者是转换成其所需的数据。第一电子设备100可以根据应用的标识信息确定与该应用对应的Surface,第一电子设备100可以从该应用对应的Surface中获取该应用的媒体流。In some embodiments, when the first electronic device 100 starts an application, the process of the application may request the WMS to create a Surface for the application window. Each application process can correspond to at least one Surface. Surface can refer to a data buffer provided by screen data consumers to screen data producers. Screen data producers can produce image content on Surface, and screen data consumers can consume the produced data to the screen ( drawn) or converted into the required data. The first electronic device 100 may determine the Surface corresponding to the application according to the identification information of the application, and the first electronic device 100 may acquire the media stream of the application from the Surface corresponding to the application.
63、根据应用的媒体流生成与应用对应的录屏文件。63. Generate a screen recording file corresponding to the application according to the media stream of the application.
在一些实施例中,当第一电子设备100获取到应用的媒体流时,第一电子设备100可以调用SurfaceFlinger或DDS算法对该应用的媒体流进行图像合成,生成与该应用对应的录屏文件。In some embodiments, when the first electronic device 100 obtains the media stream of the application, the first electronic device 100 can invoke the SurfaceFlinger or DDS algorithm to perform image synthesis on the media stream of the application, and generate a screen recording file corresponding to the application .
在一些实施例中,在某些应用场景下,第一电子设备100可能可以根据某一应用的标识信息获取到两个媒体流,例如在分布式游戏场景中,当第一电子设备100将游戏应用投屏至第二电子设备200时,第一电子设备100可以自动开启游戏操控控件,此时第一电子设备100显示游戏操控界面,第二电子设备200显示游戏画面。WMS为第一电子设备100内的游戏应用的进程创建两个相互独立的Surface(例如第一Surface与第二Surface)。两个相互独立的Surface可以对应同一个进程ID,屏幕数据生产者可以在第一Surface上进行游戏操控界面内容的生产,在第二Surface上进行游戏画面内容的生产。In some embodiments, in some application scenarios, the first electronic device 100 may be able to obtain two media streams according to the identification information of a certain application. For example, in a distributed game scenario, when the first electronic device 100 uses the game When the application screen is projected to the second electronic device 200, the first electronic device 100 can automatically turn on the game control control, at this time the first electronic device 100 displays the game control interface, and the second electronic device 200 displays the game screen. The WMS creates two mutually independent Surfaces (for example, the first Surface and the second Surface) for the process of the game application in the first electronic device 100 . Two mutually independent Surfaces can correspond to the same process ID, and screen data producers can produce game control interface content on the first Surface, and produce game screen content on the second Surface.
第一电子设备100可以响应用户的录屏操作,从第一Surface与第二Surface中获取媒体流,第一电子设备100可以根据两个媒体流的时间戳对两个媒体流进行时间对齐,再对经过时间对齐处理的两个媒体流进行图像合成与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏,提升用户使用体验。例如,拼接处理可以是指录屏文件中的游戏操作界面与游戏画面界面成上下分屏排布,或者成左右分屏排布。The first electronic device 100 can respond to the user's screen recording operation to obtain media streams from the first Surface and the second Surface, and the first electronic device 100 can time-align the two media streams according to the time stamps of the two media streams, and then Perform image synthesis and splicing processing on the two media streams that have been time-aligned to generate a screen recording file including the game operation interface and the game screen interface, and then the user can watch the time-synchronized screen recording of the game operation interface and the game screen interface, Improve user experience. For example, splicing processing may mean that the game operation interface and the game screen interface in the screen recording file are arranged in a vertical split screen, or in a left and right split screen arrangement.
在一些实施例中,录屏文件中的游戏操作界面也可以悬浮显示在游戏画面界面的某个指定区域,该区域的位置可以由用户进行自定义。例如,用户在第一电子设备100上进行录屏操作时,录屏操作包括将游戏操作界面设置为悬浮显示在游戏画面界面的左下角区域,或右下角区域。In some embodiments, the game operation interface in the screen recording file can also be suspended and displayed in a designated area of the game screen interface, and the position of this area can be customized by the user. For example, when the user performs a screen recording operation on the first electronic device 100 , the screen recording operation includes setting the game operation interface to be displayed in a floating area in the lower left corner or the lower right corner of the game screen interface.
在一些实施例中,第一电子设备100还可以响应用户的录屏操作,从第一Surface与第二Surface中获取媒体流,第一电子设备100可以分别对两个媒体流进行图像合成,生成对应于游戏操作界面的第一录屏子文件及对应于游戏画面界面的第二录屏子文件。第一电子设备100可以再根据第一录屏子文件的时间戳与第二录屏子文件的时间戳对第一录屏子文件与第二录屏子文件进行时间对齐处理与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏。In some embodiments, the first electronic device 100 can also obtain media streams from the first Surface and the second Surface in response to the user's screen recording operation, and the first electronic device 100 can respectively perform image synthesis on the two media streams to generate The first screen recording sub-file corresponding to the game operation interface and the second screen recording sub-file corresponding to the game screen interface. The first electronic device 100 may then perform time alignment and splicing processing on the first screen recording sub-file and the second screen recording sub-file according to the timestamp of the first screen recording sub-file and the time stamp of the second screen recording sub-file to generate Including the screen recording files of the game operation interface and the game screen interface, and then the user can watch the time-synchronized screen recording of the game operation interface and the game screen interface.
上述录屏方法,通过获取需录屏应用的标识信息,再基于标识信息获取的媒体流生成录屏文件,相比现有对本地桌面进行录屏,本申请可实现仅对电子设备的一个或多个应用的界面进行录屏,且被录屏的应用可运行在电子设备的前台,也可运行在电子设备的后台,同时可以在本地电子设备侧对分布式显示场景下的两个或两个以上的屏幕显示内容进行录 屏,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,且可使得用户在一个录屏文件中观看到时间同步的多个显示界面的内容。The above screen recording method obtains the identification information of the application to be recorded, and then generates a screen recording file based on the media stream obtained from the identification information. Compared with the existing screen recording of the local desktop, this application can realize only one or Multiple application interfaces are used to record the screen, and the recorded application can run in the foreground of the electronic device or in the background of the electronic device. At the same time, two or two applications in the distributed display scenario can be viewed on the local electronic device side. More than one screen display content can be recorded. Recording multiple screen display contents by the same device can ensure that the recording clock is synchronized, and allows users to watch the content of multiple display interfaces with time synchronization in one screen recording file.
参照图7所示,本申请实施例提供一种录屏方法,应用于第一电子设备100。第一电子设备100与第二电子设备200可以处于同一局域网下,例如第一电子设备100与第二电子设备200通过Wi-Fi或蓝牙建立通信连接,第一电子设备100包括第一显示屏1001,第二电子设备200包括第二显示屏2001。第一电子设备100为源端设备,第二电子设备200为目的设备,第一电子设备100上运行的一个或多个应用可以投屏在第二电子设备200上显示。本实施例中,录屏方法可以包括:Referring to FIG. 7 , the embodiment of the present application provides a screen recording method, which is applied to the first electronic device 100 . The first electronic device 100 and the second electronic device 200 may be under the same local area network, for example, the first electronic device 100 and the second electronic device 200 establish a communication connection through Wi-Fi or Bluetooth, and the first electronic device 100 includes a first display screen 1001 , the second electronic device 200 includes a second display screen 2001 . The first electronic device 100 is a source device, and the second electronic device 200 is a destination device. One or more applications running on the first electronic device 100 can be displayed on the second electronic device 200 through projection. In this embodiment, the screen recording method may include:
71、当第一电子设备100检测到用于启动录屏功能的第一操作时,第一电子设备100获取与第一操作关联的应用的标识信息,其中与第一操作关联的应用包括投屏至第二电子设备的应用。71. When the first electronic device 100 detects the first operation for starting the screen recording function, the first electronic device 100 acquires the identification information of the application associated with the first operation, wherein the application associated with the first operation includes screen projection to the application of the second electronic device.
在一些实施例中,在投屏场景下,当用户希望进行录屏时,用户可以启动第一电子设备100的录屏功能,例如执行第一操作来启动第一电子设备100的录屏功能。其中,第一操作例如可以是用户按压物理按键的操作、用户执行预定义的手势、用户在屏幕上操作相应按钮、用户输入语音命令、用户在录屏应用上进行操作等中任一种。本申请实施例对录屏操作不做具体限定。In some embodiments, in the screen casting scenario, when the user wishes to record the screen, the user can start the screen recording function of the first electronic device 100 , for example, perform a first operation to start the screen recording function of the first electronic device 100 . Wherein, the first operation may be, for example, an operation of pressing a physical button by the user, performing a predefined gesture by the user, operating a corresponding button on the screen by the user, inputting a voice command by the user, or performing an operation by the user on a screen recording application. The embodiment of the present application does not specifically limit the screen recording operation.
在一些实施例中,与第一操作关联的应用可以包括一个或多个应用,该一个或多个应用程序可以处于第一电子设备100的前台运行,或后台运行(例如投屏在第二电子设备200),或部分处于前台运行、部分处于后台运行(例如投屏在第二电子设备200)。标识信息可以是指可唯一标识应用的信息,例如标识信息可以包括应用的进程ID或应用的包名。在其他实施例中,标识信息还可以包括运行该应用的设备ID。In some embodiments, the applications associated with the first operation may include one or more applications, and the one or more applications may run in the foreground of the first electronic device 100, or run in the background (such as projecting a screen on the second electronic device 100). device 200), or partly running in the foreground and partly running in the background (for example, projecting a screen on the second electronic device 200). The identification information may refer to information that can uniquely identify the application, for example, the identification information may include a process ID of the application or a package name of the application. In other embodiments, the identification information may also include the ID of the device running the application.
72、当第一电子设备100接收到第二电子设备200发送的录屏指令时,第一电子设备100获取与录屏指令关联的应用的标识信息,其中与录屏指令关联的应用包括投屏至第二电子设备的应用。72. When the first electronic device 100 receives the screen recording instruction sent by the second electronic device 200, the first electronic device 100 obtains the identification information of the application associated with the screen recording instruction, wherein the application associated with the screen recording instruction includes screen projection to the application of the second electronic device.
在一些实施例中,用户还可以在第二电子设备200上指定需要录屏的投屏应用,具体录屏操作由第一电子设备100执行。当第一电子设备100接收到第二电子设备200发送的录屏指令时,第一电子设备100获取与录屏指令关联的应用的标识信息。例如,第二电子设备200可以响应用户操作生成与一个或多个应用关联的录屏指令,录屏指令可以包括应用的标识信息。第二电子设备200可以将录屏指令发送给第一电子设备100,进而第一电子设备100可以获取需录屏的应用的标识信息。In some embodiments, the user can also designate a screen-casting application that needs to be recorded on the second electronic device 200 , and the specific screen recording operation is performed by the first electronic device 100 . When the first electronic device 100 receives the screen recording instruction sent by the second electronic device 200, the first electronic device 100 acquires the identification information of the application associated with the screen recording instruction. For example, the second electronic device 200 may generate a screen recording instruction associated with one or more applications in response to a user operation, and the screen recording instruction may include identification information of the application. The second electronic device 200 may send the screen recording instruction to the first electronic device 100, and then the first electronic device 100 may acquire the identification information of the application that needs to record the screen.
在一些实施例中,第一电子设备100可以选择执行步骤71,或者选择执行步骤72。In some embodiments, the first electronic device 100 may choose to execute step 71 or choose to execute step 72 .
73、第一电子设备100根据标识信息获取应用的媒体流。73. The first electronic device 100 acquires the media stream of the application according to the identification information.
在一些实施例中,第一电子设备100可以根据应用的标识信息确定与该应用对应的Surface,第一电子设备100可以从该应用对应的Surface中获取该应用的媒体流。In some embodiments, the first electronic device 100 may determine the Surface corresponding to the application according to the identification information of the application, and the first electronic device 100 may acquire the media stream of the application from the Surface corresponding to the application.
74、第一电子设备100根据应用的媒体流生成与应用对应的录屏文件。74. The first electronic device 100 generates a screen recording file corresponding to the application according to the media stream of the application.
在一些实施例中,当第一电子设备100获取到应用的媒体流时,第一电子设备100可以调用SurfaceFlinger或DDS算法对该应用的媒体流进行图像合成,生成与该应用对应的录屏文件。In some embodiments, when the first electronic device 100 obtains the media stream of the application, the first electronic device 100 can invoke the SurfaceFlinger or DDS algorithm to perform image synthesis on the media stream of the application, and generate a screen recording file corresponding to the application .
在一些实施例中,在某些应用场景下,第一电子设备100可能可以根据某一应用的标识信息获取到两个媒体流,例如在分布式游戏场景中,第一电子设备100显示游戏操 控界面,第二电子设备200显示游戏画面。WMS为第一电子设备100内的游戏应用的进程创建两个相互独立的Surface(例如第一Surface与第二Surface)。两个相互独立的Surface可以对应同一个进程ID,屏幕数据生产者可以在第一Surface上进行游戏操控界面内容的生产,在第二Surface上进行游戏画面内容的生产。In some embodiments, in some application scenarios, the first electronic device 100 may be able to obtain two media streams according to the identification information of a certain application. For example, in a distributed game scenario, the first electronic device 100 displays the game control interface, the second electronic device 200 displays a game screen. The WMS creates two mutually independent Surfaces (for example, the first Surface and the second Surface) for the process of the game application in the first electronic device 100 . Two mutually independent Surfaces can correspond to the same process ID, and screen data producers can produce game control interface content on the first Surface, and produce game screen content on the second Surface.
第一电子设备100可以响应用户的录屏操作,从第一Surface与第二Surface中获取媒体流,第一电子设备100可以根据两个媒体流的时间戳对两个媒体流进行时间对齐,再对经过时间对齐处理的两个媒体流进行图像合成与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏,提升用户使用体验。例如,拼接处理可以是指录屏文件中的游戏操作界面与游戏画面界面成上下分屏排布,或者成左右分屏排布。The first electronic device 100 can respond to the user's screen recording operation to obtain media streams from the first Surface and the second Surface, and the first electronic device 100 can time-align the two media streams according to the time stamps of the two media streams, and then Perform image synthesis and splicing processing on the two media streams that have been time-aligned to generate a screen recording file including the game operation interface and the game screen interface, and then the user can watch the time-synchronized screen recording of the game operation interface and the game screen interface, Improve user experience. For example, splicing processing may mean that the game operation interface and the game screen interface in the screen recording file are arranged in a vertical split screen, or in a left and right split screen arrangement.
在一些实施例中,录屏文件中的游戏操作界面也可以悬浮显示在游戏画面界面的某个指定区域,该区域的位置可以由用户进行自定义。例如,用户在第一电子设备100上进行录屏操作时,录屏操作包括将游戏操作界面设置为悬浮显示在游戏画面界面的左下角区域,或右下角区域。In some embodiments, the game operation interface in the screen recording file can also be suspended and displayed in a designated area of the game screen interface, and the position of this area can be customized by the user. For example, when the user performs a screen recording operation on the first electronic device 100 , the screen recording operation includes setting the game operation interface to be displayed in a floating area in the lower left corner or the lower right corner of the game screen interface.
在一些实施例中,第一电子设备100还可以响应用户的录屏操作,从第一Surface与第二Surface中获取媒体流,第一电子设备100可以分别对两个媒体流进行图像合成,生成对应于游戏操作界面的第一录屏子文件及对应于游戏画面界面的第二录屏子文件。第一电子设备100可以再根据第一录屏子文件的时间戳与第二录屏子文件的时间戳对第一录屏子文件与第二录屏子文件进行时间对齐处理与拼接处理,生成包括游戏操作界面与游戏画面界面的录屏文件,进而用户可以观看到时间同步的游戏操作界面与游戏画面界面的录屏。In some embodiments, the first electronic device 100 can also obtain media streams from the first Surface and the second Surface in response to the user's screen recording operation, and the first electronic device 100 can respectively perform image synthesis on the two media streams to generate The first screen recording sub-file corresponding to the game operation interface and the second screen recording sub-file corresponding to the game screen interface. The first electronic device 100 may then perform time alignment and splicing processing on the first screen recording sub-file and the second screen recording sub-file according to the timestamp of the first screen recording sub-file and the time stamp of the second screen recording sub-file to generate Including the screen recording files of the game operation interface and the game screen interface, and then the user can watch the time-synchronized screen recording of the game operation interface and the game screen interface.
在一些实施例中,第二电子设备200也可以对投屏应用进行录屏。在现有的投屏显示场景中,第二电子设备200可以接收第一电子设备100发送的媒体流,并对接收到的媒体流进行解码送显。当用户希望在第二电子设备200侧进行录屏时,用户可以启动第二电子设备200的录屏功能,例如执行第二操作来启动第二电子设备200的录屏功能。其中,第二操作例如可以是用户按压物理按键的操作、用户执行预定义的手势、用户在屏幕上操作相应按钮、用户输入语音命令、用户在录屏应用上进行操作等中任一种。本申请实施例对录屏操作不做具体限定。In some embodiments, the second electronic device 200 may also record the screen of the screen-casting application. In an existing screen projection display scenario, the second electronic device 200 may receive the media stream sent by the first electronic device 100, decode the received media stream and send it for display. When the user wishes to record the screen on the side of the second electronic device 200 , the user can start the screen recording function of the second electronic device 200 , for example, perform a second operation to start the screen recording function of the second electronic device 200 . Wherein, the second operation may be, for example, an operation in which the user presses a physical button, the user performs a predefined gesture, the user operates a corresponding button on the screen, the user enters a voice command, or the user performs an operation on a screen recording application. The embodiment of the present application does not specifically limit the screen recording operation.
当第二电子设备200检测到用于启动录屏功能的第二操作时,第二电子设备200获取与第二操作关联的应用程序的标识信息,其中与第二操作关联的应用程序的标识信息可以包括应用程序的进程ID及第一电子设备100的设备ID(通过第一电子设备100的设备ID确定媒体流确实来源于第一电子设备100)。第二电子设备200可以从接收到的媒体流中获取与第二操作关联的应用程序的标识信息对应的媒体流,第二电子设备200根据获取的媒体流生成录屏文件。例如,第二电子设备200可以在将接收到的媒体流送显之前,对媒体流进行图像合成生成录屏文件。When the second electronic device 200 detects the second operation for starting the screen recording function, the second electronic device 200 obtains the identification information of the application program associated with the second operation, wherein the identification information of the application program associated with the second operation It may include the process ID of the application program and the device ID of the first electronic device 100 (the device ID of the first electronic device 100 determines that the media stream really originates from the first electronic device 100). The second electronic device 200 may acquire the media stream corresponding to the identification information of the application program associated with the second operation from the received media stream, and the second electronic device 200 generates a screen recording file according to the acquired media stream. For example, the second electronic device 200 may perform image synthesis on the media stream to generate a screen recording file before sending the received media stream for display.
上述录屏方法,通过获取需录屏应用的标识信息,再基于标识信息获取的媒体流生成录屏文件,相比现有无法对投屏应用进行录屏,本申请可实现对电子设备的后台应用或投屏至其他电子设备的投屏应用进行录屏,同时可以在本地电子设备侧对分布式显示场景下的两个或两个以上的屏幕显示内容进行录屏,由同一台设备录制多个屏幕显示内容可保证录制时钟同步,且可使得用户在一个录屏文件中观看到时间同步的多个显示界面的内容。The above-mentioned screen recording method obtains the identification information of the application to be recorded, and then generates a screen recording file based on the media stream obtained from the identification information. Compared with the existing inability to record the screen of the screen projection application, this application can realize the backend of the electronic device The application or screen projection to other electronic devices can be used to record the screen, and at the same time, the local electronic device can record the screen content of two or more screens in the distributed display scene, and the same device can record multiple The content displayed on one screen can ensure the synchronization of the recording clock, and enable the user to watch the content of multiple display interfaces with time synchronization in one screen recording file.
参考图8,为本申请实施例提供的第一电子设备100的硬件结构示意图。如图8所示,第一电子设备100可以包括第一显示屏1001、第一处理器1002、第一存储器1003及第一通信总线1004。第一存储器1003用于存储一个或多个第一计算机程序1005。一个或多个第一计算机程序1005被配置为被该第一处理器1002执行。该一个或多个第一计算机程序1005包括指令,上述指令可以用于实现在第一电子设备100中执行如图6或图7所述的录屏方法。Referring to FIG. 8 , it is a schematic diagram of a hardware structure of the first electronic device 100 provided in the embodiment of the present application. As shown in FIG. 8 , the first electronic device 100 may include a first display screen 1001 , a first processor 1002 , a first memory 1003 and a first communication bus 1004 . The first memory 1003 is used to store one or more first computer programs 1005 . One or more first computer programs 1005 are configured to be executed by the first processor 1002 . The one or more first computer programs 1005 include instructions, and the above instructions can be used to implement the screen recording method as described in FIG. 6 or FIG. 7 in the first electronic device 100 .
可以理解的是,本实施例示意的结构并不构成对第一电子设备100的具体限定。在另一些实施例中,第一电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。It can be understood that, the structure illustrated in this embodiment does not constitute a specific limitation on the first electronic device 100 . In other embodiments, the first electronic device 100 may include more or fewer components than shown in the illustration, or combine some components, or separate some components, or arrange different components.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的录屏方法。This embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device, the electronic device is made to perform the above related method steps to implement the screen recording method in the above embodiment.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的录屏方法。This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps, so as to realize the screen recording method in the above embodiment.
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的录屏方法。In addition, an embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein the memory is used to store computer-executable instructions, and when the device is running, The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the screen recording methods in the above method embodiments.
其中,本实施例提供的第一电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the first electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the above provided The beneficial effects of the corresponding method will not be repeated here.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and brevity of the description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated according to needs It is completed by different functional modules, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例是示意性的,例如,该模块或单元的划分,为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are schematic. For example, the division of the modules or units is a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be combined or may be integrated into another device, or some features may be ignored, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
该作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The unit described as a separate component may or may not be physically separated, and a component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
该集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介 质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, 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 Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disc and other media that can store program codes. .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。The above is only a specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application should be covered within the protection scope of the application .

Claims (15)

  1. 一种录屏方法,应用于第一电子设备,其特征在于,所述录屏方法包括:A screen recording method applied to a first electronic device, characterized in that the screen recording method comprises:
    响应于启动录屏功能的第一操作,获取与所述第一操作关联的应用程序的标识信息,其中与所述第一操作关联的应用程序包括处于所述第一电子设备的后台运行的应用程序;Responding to the first operation of starting the screen recording function, acquiring identification information of an application associated with the first operation, wherein the application associated with the first operation includes an application running in the background of the first electronic device program;
    根据所述标识信息获取所述应用程序的媒体流;Acquire the media stream of the application program according to the identification information;
    根据所述应用程序的媒体流生成与所述应用程序对应的录屏文件。A screen recording file corresponding to the application is generated according to the media stream of the application.
  2. 如权利要求1所述的录屏方法,其特征在于,所述标识信息包括所述应用程序的进程身份标识号ID或所述应用程序的包名。The screen recording method according to claim 1, wherein the identification information includes a process ID number (ID) of the application program or a package name of the application program.
  3. 如权利要求1或2所述的录屏方法,其特征在于,所述根据所述标识信息获取所述应用程序的媒体流,包括:The screen recording method according to claim 1 or 2, wherein said obtaining the media stream of said application program according to said identification information comprises:
    根据所述标识信息确定与所述应用程序对应的屏幕数据缓冲区;determining a screen data buffer corresponding to the application program according to the identification information;
    从所述屏幕数据缓冲区获取所述应用程序的媒体流。Obtain the media stream of the application program from the screen data buffer.
  4. 如权利要求1至3中任意一项所述的录屏方法,其特征在于,所述根据所述应用程序的媒体流生成与所述应用程序对应的录屏文件,包括:The screen recording method according to any one of claims 1 to 3, wherein the generating a screen recording file corresponding to the application program according to the media stream of the application program includes:
    对所述应用程序的媒体流进行图像合成,生成与所述应用程序对应的录屏文件。Image synthesis is performed on the media stream of the application program to generate a screen recording file corresponding to the application program.
  5. 如权利要求1至3中任意一项所述的录屏方法,其特征在于,所述应用程序对应第一屏幕数据缓冲区与第二屏幕数据缓冲区,所述根据所述应用程序的媒体流生成与所述应用程序对应的录屏文件,包括:The screen recording method according to any one of claims 1 to 3, wherein the application corresponds to the first screen data buffer and the second screen data buffer, and the media stream according to the application Generate a screen recording file corresponding to the application, including:
    对从所述第一屏幕数据缓冲区获取的第一媒体流进行图像合成,生成第一录屏子文件;Performing image synthesis on the first media stream obtained from the first screen data buffer to generate the first screen recording sub-file;
    对从所述第二屏幕数据缓冲区获取的第二媒体流进行图像合成,生成第二录屏子文件;performing image synthesis on the second media stream obtained from the second screen data buffer to generate a second screen recording sub-file;
    将所述第一录屏子文件与所述第二录屏子文件进行拼接,生成与所述应用程序对应的录屏文件。Splicing the first screen recording sub-file and the second screen recording sub-file to generate a screen recording file corresponding to the application.
  6. 如权利要求5所述的录屏方法,其特征在于,所述将所述第一录屏子文件与所述第二录屏子文件进行拼接,包括:The screen recording method according to claim 5, wherein the splicing the first screen recording sub-file and the second screen recording sub-file comprises:
    根据所述第一录屏子文件与所述第二录屏子文件的时间戳对所述第一录屏子文件与所述第二录屏子文件进行时间对齐处理;performing time alignment processing on the first screen recording subfile and the second screen recording subfile according to the timestamps of the first screen recording subfile and the second screen recording subfile;
    将经过时间对齐处理的所述第一录屏子文件与所述第二录屏子文件进行拼接。Splicing the first screen-recording sub-file and the second screen-recording sub-file that have been time-aligned.
  7. 如权利要求1至3中任意一项所述的录屏方法,其特征在于,所述应用程序对应第一屏幕数据缓冲区与第二屏幕数据缓冲区,所述根据所述应用程序的媒体流生成与所述应用程序对应的录屏文件,包括:The screen recording method according to any one of claims 1 to 3, wherein the application corresponds to the first screen data buffer and the second screen data buffer, and the media stream according to the application Generate a screen recording file corresponding to the application, including:
    从所述第一屏幕数据缓冲区获取第一媒体流,及从所述第二屏幕数据缓冲区获取第二媒体流;obtaining a first media stream from the first screen data buffer, and obtaining a second media stream from the second screen data buffer;
    将所述第一媒体流与所述第二媒体流进行图像合成与拼接,生成与所述应用程序对应的录屏文件。Image synthesis and splicing are performed on the first media stream and the second media stream to generate a screen recording file corresponding to the application program.
  8. 如权利要求7所述的录屏方法,其特征在于,所述将所述第一媒体流与所述第二媒体流进行图像合成与拼接,包括:The screen recording method according to claim 7, wherein said performing image synthesis and splicing of said first media stream and said second media stream comprises:
    根据所述第一媒体流与所述第二媒体流的时间戳对所述第一媒体流与所述第二媒体流进行时间对齐处理;performing time alignment processing on the first media stream and the second media stream according to the timestamps of the first media stream and the second media stream;
    将经过时间对齐处理的所述第一媒体流与所述第二媒体流进行图像合成与拼接。Image synthesis and splicing are performed on the first media stream and the second media stream that have been time-aligned.
  9. 如权利要求5至8中任意一项所述的录屏方法,其特征在于,所述录屏文件包括第一界面及第二界面,所述第一界面与所述第二界面呈左右分屏显示,或所述第一界面与所述第二界面呈上下分屏显示,或所述第一界面的部分区域或全部区域悬浮显示于所述第二界面上。The screen recording method according to any one of claims 5 to 8, wherein the screen recording file includes a first interface and a second interface, and the first interface and the second interface are left and right split screens display, or the first interface and the second interface are displayed in a split screen up and down, or part or all of the first interface is displayed in a floating manner on the second interface.
  10. 如权利要求1至9中任意一项所述的录屏方法,其特征在于,所述录屏方法还包括:The screen recording method according to any one of claims 1 to 9, wherein the screen recording method further comprises:
    响应于第二电子设备发送的录屏指令,获取与所述录屏指令关联的应用程序的标识信息。In response to the screen recording instruction sent by the second electronic device, the identification information of the application program associated with the screen recording instruction is acquired.
  11. 如权利要求1至9中任意一项所述的录屏方法,其特征在于,其中与所述第一操作关联的应用程序还包括投屏显示至第二电子设备上的应用程序。The screen recording method according to any one of claims 1 to 9, wherein the application program associated with the first operation further includes an application program for projecting a screen display to a second electronic device.
  12. 一种录屏方法,应用于第二电子设备,第一电子设备将一个或多个应用程序窗口投屏在所述第二电子设备上显示,其特征在于,所述录屏方法包括:A screen recording method, applied to a second electronic device, the first electronic device projects one or more application program windows on the second electronic device for display, wherein the screen recording method includes:
    接收所述第一电子设备发送的媒体流;receiving the media stream sent by the first electronic device;
    响应于启动录屏功能的第一操作,获取与所述第一操作关联的应用程序窗口的标识信息;Responding to a first operation of starting a screen recording function, acquiring identification information of an application window associated with the first operation;
    从接收到的媒体流中获取与所述第一操作关联的应用程序窗口的标识信息对应的媒体流;Acquire a media stream corresponding to the identification information of the application window associated with the first operation from the received media stream;
    根据获取到的媒体流生成录屏文件。Generate a screen recording file based on the obtained media stream.
  13. 如权利要求12所述的录屏方法,其特征在于,所述标识信息包括所述应用程序窗口的进程ID及所述第一电子设备的设备ID。The screen recording method according to claim 12, wherein the identification information includes a process ID of the application window and a device ID of the first electronic device.
  14. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1至权利要求13中任一项所述的录屏方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and when the computer instructions are run on an electronic device, the electronic device executes the electronic device according to claims 1 to 13. The screen recording method described in any one.
  15. 一种电子设备,其特征在于,所述电子设备包括处理器和存储器,所述存储器用于存储指令,所述处理器用于调用所述存储器中的指令,使得所述电子设备执行如权利要求1至权利要求13中任一项所述的录屏方法。An electronic device, characterized in that the electronic device includes a processor and a memory, the memory is used to store instructions, and the processor is used to call the instructions in the memory, so that the electronic device executes the method described in claim 1. To the screen recording method described in any one of claim 13.
PCT/CN2022/113756 2021-08-30 2022-08-19 Screen recording method, electronic device, and computer readable storage medium WO2023030057A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111006119.6A CN115734021A (en) 2021-08-30 2021-08-30 Screen recording method, electronic equipment and computer readable storage medium
CN202111006119.6 2021-08-30

Publications (1)

Publication Number Publication Date
WO2023030057A1 true WO2023030057A1 (en) 2023-03-09

Family

ID=85291003

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/113756 WO2023030057A1 (en) 2021-08-30 2022-08-19 Screen recording method, electronic device, and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN115734021A (en)
WO (1) WO2023030057A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140164102A1 (en) * 2012-12-12 2014-06-12 Rocklive Pte Ltd Digital Advertising System and Method
CN107977436A (en) * 2017-12-05 2018-05-01 广东欧珀移动通信有限公司 Filename generation method, device, terminal and the storage medium of record screen file
CN108550040A (en) * 2018-03-09 2018-09-18 福州米鱼信息科技有限公司 A kind of electronic evidence acquisition method and system based on throwing screen display
CN111182235A (en) * 2019-12-05 2020-05-19 浙江大华技术股份有限公司 Method, device, computer device and storage medium for recording spliced screen pictures
CN112153436A (en) * 2020-09-03 2020-12-29 Oppo广东移动通信有限公司 Screen recording method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140164102A1 (en) * 2012-12-12 2014-06-12 Rocklive Pte Ltd Digital Advertising System and Method
CN107977436A (en) * 2017-12-05 2018-05-01 广东欧珀移动通信有限公司 Filename generation method, device, terminal and the storage medium of record screen file
CN108550040A (en) * 2018-03-09 2018-09-18 福州米鱼信息科技有限公司 A kind of electronic evidence acquisition method and system based on throwing screen display
CN111182235A (en) * 2019-12-05 2020-05-19 浙江大华技术股份有限公司 Method, device, computer device and storage medium for recording spliced screen pictures
CN112153436A (en) * 2020-09-03 2020-12-29 Oppo广东移动通信有限公司 Screen recording method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN115734021A (en) 2023-03-03

Similar Documents

Publication Publication Date Title
WO2020244495A1 (en) Screen projection display method and electronic device
WO2020221039A1 (en) Screen projection method, electronic device and screen projection system
WO2020244492A1 (en) Screen projection display method and electronic device
WO2020253719A1 (en) Screen recording method and electronic device
WO2022258024A1 (en) Image processing method and electronic device
WO2021121052A1 (en) Multi-screen cooperation method and system, and electronic device
CN114040242B (en) Screen projection method, electronic equipment and storage medium
WO2023065916A1 (en) Notification processing method, chip, electronic device, and computer readable storage medium
WO2020119464A1 (en) Video splitting method and electronic device
WO2020155875A1 (en) Display method for electronic device, graphic user interface and electronic device
WO2023030099A1 (en) Cross-device interaction method and apparatus, and screen projection system and terminal
WO2022143082A1 (en) Image processing method and electronic device
CN115016697A (en) Screen projection method, computer device, readable storage medium, and program product
US20230350629A1 (en) Double-Channel Screen Mirroring Method and Electronic Device
WO2023005711A1 (en) Service recommendation method and electronic device
WO2023030057A1 (en) Screen recording method, electronic device, and computer readable storage medium
WO2023283941A1 (en) Screen projection image processing method and apparatus
WO2023169276A1 (en) Screen projection method, terminal device, and computer-readable storage medium
US20240086035A1 (en) Display Method and Electronic Device
EP4296845A1 (en) Screen projection method and system, and related apparatus
CN115016871B (en) Multimedia editing method, electronic device and storage medium
CN116055613B (en) Screen projection method and device
WO2023020528A1 (en) Mirroring method, device, storage medium, and computer program product
WO2023020339A1 (en) Interface display method and electronic device
WO2023273460A1 (en) Screen projection display method and electronic device

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: 22863196

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE