[go: up one dir, main page]

CN114157903B - Redirection method, device, apparatus, storage medium and program product - Google Patents

Redirection method, device, apparatus, storage medium and program product Download PDF

Info

Publication number
CN114157903B
CN114157903B CN202111461661.0A CN202111461661A CN114157903B CN 114157903 B CN114157903 B CN 114157903B CN 202111461661 A CN202111461661 A CN 202111461661A CN 114157903 B CN114157903 B CN 114157903B
Authority
CN
China
Prior art keywords
redirection
source
destination
redirector
video
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN202111461661.0A
Other languages
Chinese (zh)
Other versions
CN114157903A (en
Inventor
何�轩
杨俊拯
钟江
张子煜
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202111461661.0A priority Critical patent/CN114157903B/en
Publication of CN114157903A publication Critical patent/CN114157903A/en
Application granted granted Critical
Publication of CN114157903B publication Critical patent/CN114157903B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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 stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43637Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • 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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43076Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of the same content streams on multiple devices, e.g. when family members are watching the same movie on different devices
    • 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 stream to a specific local network, e.g. a Bluetooth® network
    • H04N21/43632Adapting the video stream to a specific local network, e.g. a Bluetooth® network involving a wired protocol, e.g. IEEE 1394
    • 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/439Processing of audio elementary streams
    • 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 or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本申请实施例公开了一种重定向方法、装置、设备、存储介质及程序产品,属于投屏技术领域。该方法包括:基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目标重定向对象标识用于表征目标重定向对象;在同一源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成源端重定向实例对应的重定向数据,目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到;向目的端设备传输重定向数据,以便目的端设备基于重定向数据,通过目标屏幕对目标重定向对象进行展示。采用本申请实施例提供的方案能够减小源端设备与目的端设备间进行数据传输产生的编码以及解码开销。

The embodiments of the present application disclose a redirection method, apparatus, device, storage medium and program product, which belong to the field of screen projection technology. The method includes: creating a source redirection instance based on a source device identifier and a target redirection object identifier, the target redirection object identifier is used to characterize the target redirection object; when the same source redirection instance corresponds to at least two destination redirection instances, the redirection data corresponding to the source redirection instance is generated by a multiplexing redirection data generator, and the destination redirection instance is created based on the destination device identifier and the target screen identifier; transmitting the redirection data to the destination device so that the destination device displays the target redirection object through the target screen based on the redirection data. The scheme provided by the embodiments of the present application can reduce the encoding and decoding overhead generated by data transmission between the source device and the destination device.

Description

重定向方法、装置、设备、存储介质及程序产品Redirection method, device, equipment, storage medium and program product

技术领域Technical Field

本申请实施例涉及投屏技术领域,特别涉及一种重定向方法、装置、设备、存储介质及程序产品。The embodiments of the present application relate to the field of screen projection technology, and in particular to a redirection method, device, equipment, storage medium and program product.

背景技术Background Art

重定向(redirect)是指将某种能力由一端设备流转至另一端设备的技术,流转的能力包括视频、音频和控制等等。日常生活中常见的重定向技术包括设备投屏。Redirection refers to the technology of transferring certain capabilities from one device to another. The capabilities transferred include video, audio, control, etc. Common redirection technologies in daily life include device screen projection.

借助投屏功能,源端设备可以将当前显示的画面投射到目的端设备上,从而达到更好的显示效果。相关技术提供的投屏方案,适用于简单投屏场景,比如实现一对一投屏场景或者多对一投屏场景。然而,随着投屏场景的复杂度提高,比如多对多投屏场景,源端设备和目的端设备之间的数据流增多,因而导致编码、解码开销增大。With the help of the screen projection function, the source device can project the currently displayed image onto the destination device to achieve a better display effect. The screen projection solution provided by the relevant technology is suitable for simple screen projection scenarios, such as one-to-one screen projection scenarios or many-to-one screen projection scenarios. However, as the complexity of the screen projection scenario increases, such as many-to-many screen projection scenarios, the data flow between the source device and the destination device increases, resulting in increased encoding and decoding overhead.

发明内容Summary of the invention

本申请实施例提供了一种重定向方法、装置、设备、存储介质及程序产品。所述技术方案如下:The embodiments of the present application provide a redirection method, apparatus, device, storage medium and program product. The technical solution is as follows:

一方面,本申请实施例提供了一种重定向方法,所述方法用于源端设备,所述方法包括:On the one hand, an embodiment of the present application provides a redirection method, which is used for a source device, and the method includes:

基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;Creating a source redirection instance based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,所述目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到,所述目的端设备标识用于表征目的端设备,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;In the case where the same source-end redirection instance corresponds to at least two destination-end redirection instances, the redirection data corresponding to the source-end redirection instance is generated by a multiplexing redirection data generator, and the destination-end redirection instance is created based on a destination-end device identifier and a target screen identifier, wherein the destination-end device identifier is used to characterize the destination-end device, and the target screen identifier is used to characterize the target screen of the destination-end device;

向所述目的端设备传输所述重定向数据,以便所述目的端设备基于所述重定向数据,通过所述目标屏幕对所述目标重定向对象进行展示。The redirection data is transmitted to the target device, so that the target device displays the target redirection object through the target screen based on the redirection data.

另一方面,本申请实施例提供了一种重定向方法,所述方法用于目的端设备,所述方法包括:On the other hand, an embodiment of the present application provides a redirection method, which is used for a destination device, and the method includes:

基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;Creating a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device;

接收源端设备传输的源端重定向实例对应的重定向数据,所述源端重定向实例基于源端设备标识以及目标重定向对象标识创建得到,所述目标重定向对象标识用于表征目标重定向对象;Receiving redirection data corresponding to a source redirection instance transmitted by a source device, wherein the source redirection instance is created based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;In the case that there are at least two destination redirection instances corresponding to the same source redirection instance, parsing the redirection data by using a multiplexing redirection data parser;

基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。Based on the parsing result of the redirection data, the target redirection object is displayed through the target screen.

另一方面,本申请实施例提供了一种重定向装置,所述装置包括:On the other hand, an embodiment of the present application provides a redirection device, the device comprising:

创建模块,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;A creation module, used to create a source redirection instance based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

复用模块,用于在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,所述目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到,所述目的端设备标识用于表征目的端设备,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;a multiplexing module, configured to generate redirection data corresponding to the source redirection instance by a multiplexing redirection data generator when the same source redirection instance corresponds to at least two destination redirection instances, wherein the destination redirection instance is created based on a destination device identifier and a target screen identifier, wherein the destination device identifier is used to characterize the destination device, and the target screen identifier is used to characterize the target screen of the destination device;

第一传输模块,用于向所述目的端设备传输所述重定向数据,以便所述目的端设备基于所述重定向数据,通过所述目标屏幕对所述目标重定向对象进行展示。The first transmission module is used to transmit the redirection data to the target device, so that the target device displays the target redirection object through the target screen based on the redirection data.

另一方面,本申请实施例提供了一种重定向装置,所述装置包括:On the other hand, an embodiment of the present application provides a redirection device, the device comprising:

创建模块,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;A creation module, used to create a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device;

第一接收模块,用于接收源端设备传输的源端重定向实例对应的重定向数据,所述源端重定向实例基于源端设备标识以及目标重定向对象标识创建得到,所述目标重定向对象标识用于表征目标重定向对象;A first receiving module, configured to receive redirection data corresponding to a source redirection instance transmitted by a source device, wherein the source redirection instance is created based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

解析模块,用于在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;A parsing module, configured to parse the redirection data by using a multiplexing redirection data parser when at least two destination redirection instances correspond to the same source redirection instance;

展示模块,用于基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。A display module is used to display the target redirection object through the target screen based on the parsing result of the redirection data.

另一方面,本申请实施例提供了一种重定向系统,所述重定向系统包括:至少一个源端设备和至少一个目的端设备;On the other hand, an embodiment of the present application provides a redirection system, the redirection system comprising: at least one source device and at least one destination device;

所述源端设备,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据;向目的端设备传输所述重定向数据,以便所述目的端设备基于所述重定向数据,通过所述目标屏幕对所述目标重定向对象进行展示;The source-end device is used to create a source-end redirection instance based on a source-end device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to characterize a target redirection object; when the same source-end redirection instance corresponds to at least two target-end redirection instances, generate redirection data corresponding to the source-end redirection instance by using a multiplexing redirection data generator; and transmit the redirection data to the target-end device so that the target redirection object is displayed on the target screen by the target-end device based on the redirection data;

所述目的端设备,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;接收所述源端设备传输的所述源端重定向实例对应的重定向数据;在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。The destination device is used to create a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device; receive redirection data corresponding to the source redirection instance transmitted by the source device; when there are at least two destination redirection instances corresponding to the same source redirection instance, parse the redirection data by a multiplexing redirection data parser; and based on the parsing result of the redirection data, display the target redirection object through the target screen.

另一方面,本申请实施例提供了一种计算机设备,所述计算机设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如上述方面所述的重定向方法。On the other hand, an embodiment of the present application provides a computer device, which includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the redirection method described in the above aspect.

另一方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如上述方面所述的重定向方法。On the other hand, an embodiment of the present application provides a computer-readable storage medium, in which at least one program code is stored, and the program code is loaded and executed by a processor to implement the redirection method as described in the above aspects.

另一方面,本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的重定向方法。On the other hand, an embodiment of the present application provides a computer program product or a computer program, the computer program product or the computer program includes a computer instruction, the computer instruction is stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the redirection method provided in various optional implementations of the above aspects.

重定向过程中,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目的端设备基于目的端设备标识以及目标屏幕标识,创建与源端重定向实例对应的目的端重定向实例,在同一源端重定向实例对应至少两个目的端重实例的情况下,源端设备通过复用重定向数据生成器生成重定向数据并向目的端设备传输,目的端设备接收到该重定向器数据,通过复用重定向数据解析器解析重定向数据,并通过目的端重定向实例所指示的目标屏幕对目标重定向对象进行展示;采用本申请实施例提供的方案,通过复用重定向数据生成器以及重定向数据解析器,减少了源端设备与目的端设备间数据流传输过程中源端设备的编码开销以及目的端设备的解码开销,提高复杂重定向场景的数据传输性能。During the redirection process, the source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, and the destination device creates a destination redirection instance corresponding to the source redirection instance based on the destination device identifier and the target screen identifier. When the same source redirection instance corresponds to at least two destination instances, the source device generates redirection data through a multiplexing redirection data generator and transmits it to the destination device. The destination device receives the redirector data, parses the redirection data through a multiplexing redirection data parser, and displays the target redirection object through the target screen indicated by the destination redirection instance. The solution provided in the embodiment of the present application is adopted, and the encoding overhead of the source device and the decoding overhead of the destination device are reduced during the data stream transmission between the source device and the destination device by multiplexing the redirection data generator and the redirection data parser, thereby improving the data transmission performance in complex redirection scenarios.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

图1是本申请一个示例性实施例提供的实施环境的示意图;FIG1 is a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

图2是本申请一个示例性实施例提供的编码、传输以及解码过程的实施示意图;FIG2 is a schematic diagram of an implementation of the encoding, transmission and decoding process provided by an exemplary embodiment of the present application;

图3是本申请另一个示例性实施例提供的编码、传输以及解码过程的实施示意图;FIG3 is a schematic diagram of an implementation of the encoding, transmission and decoding process provided by another exemplary embodiment of the present application;

图4是本申请一个示例性实施例提供的重定向方法的流程图;FIG4 is a flow chart of a redirection method provided by an exemplary embodiment of the present application;

图5是本申请一个示例性实施例示出的重定向模块的层级架构的示意图;FIG5 is a schematic diagram of a hierarchical architecture of a redirection module according to an exemplary embodiment of the present application;

图6是本申请另一个示例性实施例示出的重定向模块的层级架构的示意图;FIG6 is a schematic diagram of a hierarchical architecture of a redirection module according to another exemplary embodiment of the present application;

图7是本申请另一个示例性实施例提供的重定向方法的流程图;FIG7 is a flowchart of a redirection method provided by another exemplary embodiment of the present application;

图8是本申请一个示例性实施例示出的视频编解码以及传输过程的流程图;FIG8 is a flowchart of a video encoding, decoding and transmission process shown in an exemplary embodiment of the present application;

图9是本申请一个示例性实施例示出的分流补帧方法的实施流程图;FIG9 is a flowchart of an exemplary embodiment of the present application showing a method for splitting and supplementing frames;

图10是本申请一个示例性实施例示出的异步接入时重定向方法的流程图;FIG10 is a flowchart of a redirection method for asynchronous access shown in an exemplary embodiment of the present application;

图11是本申请一个示例性实施例示出的并发接入时重定向方法的流程图;FIG11 is a flowchart of a concurrent access redirection method shown in an exemplary embodiment of the present application;

图12是本申请一个示例性实施例示出的并发接入时重定向方法的实施示意图;FIG12 is a schematic diagram of an implementation of a concurrent access redirection method according to an exemplary embodiment of the present application;

图13是本申请一个实施例提供的重定向装置的结构框图;FIG13 is a structural block diagram of a redirection device provided by an embodiment of the present application;

图14是本申请另一个实施例提供的重定向装置的结构框图;FIG14 is a structural block diagram of a redirection device provided by another embodiment of the present application;

图15是本申请一个实施例提供的重定向系统的系统架构图;FIG15 is a system architecture diagram of a redirection system provided by an embodiment of the present application;

图16是本申请一个示例性实施例提供的计算机设备的结构方框图。FIG. 16 is a structural block diagram of a computer device provided by an exemplary embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application more clear, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

图1示出了本申请一个示例性实施例提供的实施环境的示意图。该实施环境可以包括:至少一个源端设备110以及至少一个目的端设备120。Fig. 1 shows a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application. The implementation environment may include: at least one source device 110 and at least one destination device 120.

源端设备110是具有重定向需求的电子设备,其可以是智能手机、平板电脑、个人计算机等移动终端。图1中以源端设备110包括平板电脑111以及智能手机112为例进行说明。The source device 110 is an electronic device with redirection requirements, which may be a mobile terminal such as a smart phone, a tablet computer, a personal computer, etc. In FIG1 , the source device 110 includes a tablet computer 111 and a smart phone 112 as an example for illustration.

源端设备110中具有重定向需求的对象被称为重定向对象,该重定向对象可以是屏幕镜像或者重定向应用,且重定向对象的重定向内容可以包括视频、音频以及控制中的至少一种。该重定向应用可以为导航应用、视频类应用、游戏类应用等等,本申请实施例并不对投屏应用的具体类型进行限定。可选的,当重定向对象为应用时,重定向过程中该应用可以处于后台运行状态。The object with redirection requirements in the source device 110 is called a redirection object, which can be a screen mirror or a redirection application, and the redirection content of the redirection object can include at least one of video, audio, and control. The redirection application can be a navigation application, a video application, a game application, etc. The embodiment of the present application does not limit the specific type of the screen projection application. Optionally, when the redirection object is an application, the application can be in the background running state during the redirection process.

本申请实施例中,同一源端设备可以同时对至少两个重定向对象进行重定向。比如,可以同时对屏幕镜像以及视频类应用进行投屏,也可以同时对视频类应用以及导航类应用进行投屏。其中,源端设备支持同时重定向的重定向对象的数量具有上限,且该上限与源端设备的处理性能相关。In an embodiment of the present application, the same source device can redirect at least two redirection objects at the same time. For example, screen mirroring and video applications can be cast at the same time, or video applications and navigation applications can be cast at the same time. Among them, the number of redirection objects that the source device supports to redirect simultaneously has an upper limit, and the upper limit is related to the processing performance of the source device.

目的端设备120是用于进行重定向结果展示的电子设备,其可以是智能手机、平板电脑、个人计算机、智能电视或者车载终端(比如车机)等等。图1中以目的端设备120包括第一车载终端121和第二车载终端122为例进行说明,其中,第一车载终端121和第二车载终端122设置在同一车辆中,且第一车载终端121和第二车载终端122分别由不同的SoC(Systemon Chip,系统级芯片)控制。比如,第一车载终端121为设置在车辆前排的车载终端,第二车载终端122为设置在车辆后排的车载终端。The destination device 120 is an electronic device for displaying redirection results, which may be a smart phone, a tablet computer, a personal computer, a smart TV, or a vehicle-mounted terminal (such as a vehicle computer), etc. FIG1 is taken as an example in which the destination device 120 includes a first vehicle-mounted terminal 121 and a second vehicle-mounted terminal 122, wherein the first vehicle-mounted terminal 121 and the second vehicle-mounted terminal 122 are arranged in the same vehicle, and the first vehicle-mounted terminal 121 and the second vehicle-mounted terminal 122 are respectively controlled by different SoCs (System on Chip). For example, the first vehicle-mounted terminal 121 is a vehicle-mounted terminal arranged in the front row of the vehicle, and the second vehicle-mounted terminal 122 is a vehicle-mounted terminal arranged in the back row of the vehicle.

可选的,目的端设备120具有至少一块屏幕。如图1所示,第一车载终端121具有第一屏幕1211以及第二屏幕1212(均由第一车载终端121的第一SoC 1213控制),第二车载终端122具有第三屏幕1221和第四屏幕1222(均由第二车载终端122的第二SoC 1223控制)。Optionally, the destination device 120 has at least one screen. As shown in FIG1 , the first vehicle terminal 121 has a first screen 1211 and a second screen 1212 (both controlled by the first SoC 1213 of the first vehicle terminal 121), and the second vehicle terminal 122 has a third screen 1221 and a fourth screen 1222 (both controlled by the second SoC 1223 of the second vehicle terminal 122).

在一些实施例中,当目的端设备120具有至少两块屏幕时,至少两块屏幕可以同时显示不同的投屏内容,或者,相同投屏内容,且各块屏幕中显示的投屏内容可以为单一投屏对象,也可以为多个投屏对象(分屏显示多个投屏对象)。In some embodiments, when the destination device 120 has at least two screens, at least two screens can display different projection contents at the same time, or the same projection contents, and the projection contents displayed on each screen can be a single projection object or multiple projection objects (displaying multiple projection objects in split screen).

目的端设备120除了具备投屏内容显示功能外,还可以具有音频播放功能,投屏过程中播放的音频即为投屏对象的音频。In addition to the function of displaying the projected content, the destination device 120 may also have an audio playback function. The audio played during the screen projection process is the audio of the projected object.

除了音视频播放功能外,目的端设备120还可以通过输入输出组件实现对投屏内容的反向控制功能。可选的,该输入输出组件可以是目的端设备120的触控式屏幕,目的端设备120的外接控制设备,比如手柄、键盘、鼠标或者触控板等等,本实施例对此不作限定。In addition to the audio and video playback function, the destination device 120 can also realize the reverse control function of the screen projection content through the input and output components. Optionally, the input and output components can be a touch screen of the destination device 120, an external control device of the destination device 120, such as a handle, keyboard, mouse or touchpad, etc., which is not limited in this embodiment.

本申请实施例中的多对多重定向体现在多源端设备(多个源端设备参与重定向)、多重定向对象(同一源端设备中的多个重定向对象参与重定向)、多目的端设备(多个目的端设备参与重定向)以及多屏幕(同一目的端设备的多个屏幕参与重定向)。在一种可能的多对多投屏场景下,如图1所示,平板电脑111中的视频应用被投屏至第一车载终端121的第一屏幕1211;第一游戏应用则被投屏至第一车载终端121的第二屏幕1212。智能手机112中的导航应用被投屏至第一车载终端121的第一屏幕1211,并与视频应用分屏显示;智能手机112中的第二游戏应用被投屏至第二车载终端122的第三屏幕1221和第四屏幕1222,即第三屏幕1221和第四屏幕1222显示相同投屏内容。此外,由于第一车载终端121和第二车载终端122的各块屏幕均具有触控功能,因此用户可以在屏幕上对投屏应用进行操作,从而实现对投屏应用的反向控制。The many-to-many redirection in the embodiment of the present application is embodied in multiple source devices (multiple source devices participate in redirection), multiple redirection objects (multiple redirection objects in the same source device participate in redirection), multiple destination devices (multiple destination devices participate in redirection) and multiple screens (multiple screens of the same destination device participate in redirection). In a possible many-to-many screen projection scenario, as shown in FIG1 , the video application in the tablet computer 111 is projected to the first screen 1211 of the first vehicle terminal 121; the first game application is projected to the second screen 1212 of the first vehicle terminal 121. The navigation application in the smartphone 112 is projected to the first screen 1211 of the first vehicle terminal 121 and is displayed in split screen with the video application; the second game application in the smartphone 112 is projected to the third screen 1221 and the fourth screen 1222 of the second vehicle terminal 122, that is, the third screen 1221 and the fourth screen 1222 display the same projection content. In addition, since each screen of the first vehicle-mounted terminal 121 and the second vehicle-mounted terminal 122 has a touch function, the user can operate the projection application on the screen, thereby achieving reverse control of the projection application.

需要说明的是,源端设备110和目的端设备120之间采用的连接方式可以包括WlANAP(Wireless Local Area Network Access Point,无线局域网接入点)模式、WiFi-P2P(Wireless Fidelity-Peer to Peer,无线直连)、USB(Universal Serial Bus,通用串行总线)有线连接、移动数据网络中的至少一种,本申请实施例对此并不进行限定。It should be noted that the connection method used between the source device 110 and the destination device 120 may include at least one of WlANAP (Wireless Local Area Network Access Point) mode, WiFi-P2P (Wireless Fidelity-Peer to Peer), USB (Universal Serial Bus) wired connection, and mobile data network, and the embodiments of the present application are not limited to this.

此外,上述实施例仅以移动终端向车载终端投屏为例进行(即车机场景)示意性的说明,本申请实施例提供的方案可以应用于其他多对多重定向场景,本实施例并不对具体的应用场景构成限定。In addition, the above embodiment is only schematically explained using the example of screen projection from a mobile terminal to a vehicle-mounted terminal (i.e., the vehicle-mounted terminal scenario). The solution provided in the embodiment of the present application can be applied to other many-to-many redirection scenarios, and this embodiment does not limit the specific application scenario.

在本申请实施例中,向目的端设备传输重定向数据前,源端设备需要对重定向对象进行采集,并通过重定向数据生成器对采集的内容进行编码,生成重定向数据,这个过程中会产生编码开销。对应的,目的端设备接收到重定向数据,需要利用重定向数据解析器对重定向数据进行解析,从而还原重定向对象,在这个过程中会产生解码开销。以重定向对象为视频为例,源端设备需要先对视频画面进行采集,然后通过视频编码器对采集到的画面进行视频编码得到视频数据流,这个过程中产生编码开销,对应的,目的端设备接收到视频数据流后,需要通过视频解码器进行解码,从而还原出视频画面,这个过程中会产生解码开销。In an embodiment of the present application, before transmitting redirection data to the destination device, the source device needs to collect the redirection object and encode the collected content through the redirection data generator to generate redirection data. This process will generate encoding overhead. Correspondingly, after the destination device receives the redirection data, it needs to use the redirection data parser to parse the redirection data to restore the redirection object. This process will generate decoding overhead. Taking the redirection object as a video as an example, the source device needs to collect the video screen first, and then use the video encoder to encode the collected screen to obtain a video data stream. This process generates encoding overhead. Correspondingly, after the destination device receives the video data stream, it needs to decode it through a video decoder to restore the video screen. This process will generate decoding overhead.

在一种可能的投屏场景下,源端设备中的同一投屏对象需要被投屏至不同的目的端设备,或者,被投屏至同一目的端设备的不同屏幕。相关技术中采用如图2所示的方式,即当需要将源端设备中的投屏应用同时投屏至目的端设备1的屏幕1和屏幕2,以及目的端设备2的屏幕3时,通过视频编码器1、2、3分别进行视频编码,通过视频解码器1、2、3分别进行视频解码,以及分三路进行视频数据流传输会产生三倍编码、解码开销。In a possible screen projection scenario, the same projection object in the source device needs to be projected to different destination devices, or to different screens of the same destination device. The related technology adopts the method shown in Figure 2, that is, when the projection application in the source device needs to be simultaneously projected to screen 1 and screen 2 of destination device 1, and screen 3 of destination device 2, video encoding is performed by video encoders 1, 2, and 3 respectively, video decoding is performed by video decoders 1, 2, and 3 respectively, and video data stream transmission in three paths will generate three times the encoding and decoding overhead.

而在本申请实施例中,源端设备与目的端设备可以采用复用策略,即源端设备通过复用重定向数据生成器对重定向对象进行编码生成重定向数据,目的端设备通过复用重定向数据解析器对重定向数据进行解析,还原出重定向对象。相比于相关技术,源端设备与目的端设备分别采用复用策略,减少了编码、解码开销。如图3所示,同样当需要将源端设备中的投屏应用同时投屏至目的端设备1的屏幕1和屏幕2,以及目的端设备2的屏幕3时,源端设备复用视频编码器1进行视频编码,得到视频数据流,目的端设备1接收到视频数据流后,通过复用视频解码器1进行视频解码,从而通过屏幕1和屏幕2对解码得到的画面进行显示,目的端设备2接收到视频数据流后,通过视频解码器2进行视频解码,从而通过屏幕3对解码得到的画面进行显示。相比于相关技术,源端设备与目的端设备分别采用复用策略编码器及解码器,使得编码开销降低了2倍,解码开销降低了1倍。下面对本申请实施例提供的方案进行介绍。In the embodiment of the present application, the source device and the destination device can adopt a multiplexing strategy, that is, the source device encodes the redirection object by a multiplexing redirection data generator to generate redirection data, and the destination device parses the redirection data by a multiplexing redirection data parser to restore the redirection object. Compared with the related art, the source device and the destination device respectively adopt a multiplexing strategy to reduce the encoding and decoding overhead. As shown in Figure 3, when it is necessary to simultaneously project the screen projection application in the source device to screen 1 and screen 2 of the destination device 1, and screen 3 of the destination device 2, the source device multiplexes the video encoder 1 to perform video encoding to obtain a video data stream. After the destination device 1 receives the video data stream, it performs video decoding by multiplexing the video decoder 1, so that the decoded picture is displayed through screen 1 and screen 2. After the destination device 2 receives the video data stream, it performs video decoding by video decoder 2, so that the decoded picture is displayed through screen 3. Compared with the related art, the source device and the destination device respectively adopt a multiplexing strategy encoder and decoder, which reduces the encoding overhead by 2 times and the decoding overhead by 1 times. The solution provided by the embodiments of the present application is introduced below.

请参考图4,其示出了本申请一个示例性实施例提供的重定向方法的流程图,本申请实施例以该方法应用于图1所示的实施环境为例进行说明,该方法包括:Please refer to FIG. 4 , which shows a flowchart of a redirection method provided by an exemplary embodiment of the present application. The present application embodiment takes the method applied to the implementation environment shown in FIG. 1 as an example for explanation. The method includes:

步骤401,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目标重定向对象标识用于表征目标重定向对象。Step 401: The source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, where the target redirection object identifier is used to represent the target redirection object.

其中,该重定向对象的类型包括屏幕镜像或重定向应用中的至少一种,且重定向对象的重定向内容的类型包括音频、视频以及控制中的至少一种。The type of the redirection object includes at least one of screen mirroring or redirection application, and the type of redirection content of the redirection object includes at least one of audio, video and control.

当需要通过源端设备进行重定向时,源端设备基于源端设备标识(即自身设备标识)以及待重定向的目标重定向对象的目标重定向对象标识,创建源端重定向实例,即以“源端设备+重定向对象”为单位形成源端重定向实例。When redirection is required through the source device, the source device creates a source redirection instance based on the source device identifier (i.e., its own device identifier) and the target redirection object identifier of the target redirection object to be redirected, that is, the source redirection instance is formed in the unit of "source device + redirection object".

其中,当不同源端设备对同一重定向对象进行重定向时(比如不同源端设备对同一应用进行重定向),不同源端设备创建的源端重定向实例不同;当同一源端设备需要对不同重定向对象进行重定向时,同一源端设备基于不同重定向对象创建的源端重定向实例也不同。Among them, when different source-end devices redirect the same redirection object (for example, different source-end devices redirect the same application), the source-end redirection instances created by different source-end devices are different; when the same source-end device needs to redirect different redirection objects, the source-end redirection instances created by the same source-end device based on different redirection objects are also different.

可选的,源端设备在接收到重定向操作时创建源端重定向实例,或者,源端设备接收到第三方设备的重定向指令时创建源端重定向实例,即通过源端设备进行重定向可以在源端设备侧触发,也可以由第三方设备触发,其中,该第三方设备与源端设备处于同一调度域中,比如,第三方设备与源端设备登陆有相同用户帐号。Optionally, the source device creates a source redirection instance when receiving a redirection operation, or creates a source redirection instance when the source device receives a redirection instruction from a third-party device, that is, redirection through the source device can be triggered on the source device side or by a third-party device, wherein the third-party device and the source device are in the same scheduling domain, for example, the third-party device and the source device have the same user account for logging in.

关于源端设备重定向的具体内容,在一些实施例中,源端设备可以对屏幕镜像进行重定向,也可以对安装并运行的应用程序(即重定向应用)进行重定向。对应的,当目标重定向对象为屏幕镜像时,目标重定向对象标识为镜像标识;当目标重定向对象为重定向应用时,目标重定向对象标识为重定向应用的应用标识。Regarding the specific content of the source device redirection, in some embodiments, the source device can redirect the screen image or the installed and running application (i.e., the redirected application). Correspondingly, when the target redirection object is the screen image, the target redirection object identifier is the image identifier; when the target redirection object is the redirected application, the target redirection object identifier is the application identifier of the redirected application.

步骤402,目的端设备基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,目标屏幕标识用于表征目的端设备的目标屏幕。Step 402: The destination device creates a destination redirection instance based on the destination device identifier and the target screen identifier, where the target screen identifier is used to represent the target screen of the destination device.

与源端设备相对应的,进行展示的目的端设备需要创建与源端重定向实例对应的目的端重定向实例。其中,目的端设备基于目的端设备标识(即自身设备标识)以及进行展示的目标屏幕的目标屏幕标识,创建目的端重定向实例,即以“目的端设备+目标屏幕”为单位形成目的端重定向实例。Corresponding to the source device, the destination device for display needs to create a destination redirection instance corresponding to the source redirection instance. The destination device creates the destination redirection instance based on the destination device identifier (i.e., its own device identifier) and the target screen identifier of the target screen for display, i.e., the destination redirection instance is formed in the unit of "destination device + target screen".

本申请实施例中,目的端设备具有至少一块屏幕,不同屏幕对应不同的屏幕标识,且不同屏幕由目的端设备中的同一SoC进行控制。比如,目的端设备为车载终端,该车载终端具有主驾屏幕和副驾屏幕。In the embodiment of the present application, the destination device has at least one screen, different screens correspond to different screen identifiers, and different screens are controlled by the same SoC in the destination device. For example, the destination device is a vehicle-mounted terminal, which has a main driver's screen and a co-driver's screen.

其中,当不同目的端设备对同一重定向对象进行展示时,不同目的端设备创建的目的端重定向实例不同;当同一目的端设备通过不同屏幕进行展示时,同一目的端设备基于不同屏幕创建的目的端重定向实例也不同。When different destination devices display the same redirection object, the destination redirection instances created by the different destination devices are different; when the same destination device displays through different screens, the destination redirection instances created by the same destination device based on different screens are also different.

可选的,目的端设备在接收到源端设备发送的重定向请求时创建目的端重定向实例,或者,目的端设备接收到第三方设备的重定向指令时创建目的端重定向实例,其中,该第三方设备与目的端设备处于同一调度域中,比如,第三方设备与目的端设备登陆有相同用户帐号。Optionally, the destination device creates a destination redirection instance when it receives a redirection request sent by the source device, or the destination device creates a destination redirection instance when it receives a redirection instruction from a third-party device, where the third-party device and the destination device are in the same scheduling domain, for example, the third-party device and the destination device have the same user account to log in.

步骤403,在同一源端重定向实例对应至少两个目的端重定向实例的情况下,源端设备通过复用重定向数据生成器生成源端重定向实例对应的重定向数据。Step 403: When the same source-end redirection instance corresponds to at least two destination-end redirection instances, the source-end device generates redirection data corresponding to the source-end redirection instance by using a multiplexing redirection data generator.

在一种可能的实施方式中,同一源端重定向实例对应至少两个目的端重定向实例可以是同一源端设备的同一重定向对象被重定向至同一目的端设备的至少两个目标屏幕。示例性的,如图3所示,同一源端设备的投屏应用被投屏至目的端设备1的屏幕1以及屏幕2。In a possible implementation, the same source redirection instance corresponds to at least two destination redirection instances, which means that the same redirection object of the same source device is redirected to at least two target screens of the same destination device. For example, as shown in FIG3 , the screen projection application of the same source device is projected to screen 1 and screen 2 of destination device 1.

在另一种可能的实施方式中,同一源端重定向实例对应至少两个目的端重定向实例是指同一源端设备的同一重定向对象被重定向至不同目的端设备的目标屏幕。示例性的,如图3所示,同一源端设备的投屏应用被投屏至目的端设备1的屏幕1、屏幕2以及目的端设备2的屏幕3。In another possible implementation, the same source redirection instance corresponds to at least two destination redirection instances, which means that the same redirection object of the same source device is redirected to the target screens of different destination devices. For example, as shown in FIG3 , the screen projection application of the same source device is projected to screen 1 and screen 2 of destination device 1 and screen 3 of destination device 2.

在前述情况下,源端设备完成源端重定向实例创建后,为了减小源端设备的编码开销,源端设备采用复用策略,即复用重定向数据生成器将重定向对象转换为重定向数据。其中,重定向数据生成器的类型与目标重定向对象对应的媒体类型相关。在本申请实施例中,目标重定向对象对应的媒体类型包括视频、音频、以及控制中的至少一种。In the above case, after the source device completes the creation of the source redirection instance, in order to reduce the encoding overhead of the source device, the source device adopts a multiplexing strategy, that is, a multiplexing redirection data generator converts the redirection object into redirection data. The type of the redirection data generator is related to the media type corresponding to the target redirection object. In the embodiment of the present application, the media type corresponding to the target redirection object includes at least one of video, audio, and control.

可选地,当目标重定向对象的媒体类型为视频时,重定向数据生成器为视频编码器;当目标重定向对象的媒体类型为音频时,重定向数据生成器为音频编码器,当目标重定向对象的媒体类型为控制时,重定向数据生成器为控制编码器。Optionally, when the media type of the target redirection object is video, the redirection data generator is a video encoder; when the media type of the target redirection object is audio, the redirection data generator is an audio encoder; when the media type of the target redirection object is control, the redirection data generator is a control encoder.

另外,该重定向数据至少包含视频数据流,还可以包含音频数据流以及控制数据流中的至少一种。In addition, the redirection data includes at least a video data stream, and may also include at least one of an audio data stream and a control data stream.

在一些实施例中,源端设备对目标重定向对象的画面进行视频编码,得到视频数据流,其中,源端设备可以采用H264、H265等视频编码格式进行编码,本申请实施例对此不作限定;重定向数据包括音频数据流时,源端设备对目标重定向对象的声音进行音频编码,得到音频数据流,其中,源端设备可以采用AAC等音频编码格式进行编码,本申请实施例对此不作限定;当重定向数据包括控制数据流时,源端设备可以按照约定的指令格式对控制指令进行编码,得到控制数据流。In some embodiments, the source device performs video encoding on the screen of the target redirection object to obtain a video data stream, wherein the source device can use video encoding formats such as H264 and H265 for encoding, which is not limited to this embodiment of the present application; when the redirection data includes an audio data stream, the source device performs audio encoding on the sound of the target redirection object to obtain an audio data stream, wherein the source device can use audio encoding formats such as AAC for encoding, which is not limited to this embodiment of the present application; when the redirection data includes a control data stream, the source device can encode the control instructions in an agreed instruction format to obtain a control data stream.

步骤404,源端设备向目的端设备传输重定向数据。Step 404: The source device transmits redirection data to the destination device.

关于重定向数据的传输方式,可选的,源端设备可以通过无线方式传输重定向数据,比如,Wlan AP、WiFi-P2P或移动数据网络;也可以通过有线方式传输重定向数据,比如,USB有线连接;也可以通过有线无线混合方式传输重定向数据,本申请实施例对此不作限定。Regarding the transmission method of redirected data, optionally, the source device can transmit the redirected data wirelessly, such as Wlan AP, WiFi-P2P or mobile data network; it can also transmit the redirected data by wired means, such as USB wired connection; it can also transmit the redirected data by a hybrid wired and wireless method, which is not limited to the embodiments of the present application.

步骤405,目的端设备接收源端设备传输的重定向数据。Step 405: The destination device receives the redirection data transmitted by the source device.

在一种可能的实施方式中,同一目的端设备接收同一源端设备传输的重定向数据。In a possible implementation manner, the same destination device receives redirected data transmitted by the same source device.

在另一种可能的实施方式中,不同的目的端设备接收同一源端设备传输的重定向数据。In another possible implementation, different destination devices receive redirected data transmitted by the same source device.

步骤406,在存在至少两个目的端重定向实例对应同一源端重定向实例的情况下,目的端设备通过复用重定向数据解析器解析重定向数据。Step 406: When there are at least two destination redirection instances corresponding to the same source redirection instance, the destination device parses the redirection data by using the multiplexing redirection data parser.

在一种可能的实施方式中,至少两个目的端重定向实例对应同一源端定向实例可以是不同的目的端设备对同一源端设备的同一重定向对象进行展示;在另一种可能的实施方式中,也可以是同一目的端设备通过不同的屏幕对同一源端设备的同一重定向对象进行展示。In one possible implementation, at least two destination redirection instances corresponding to the same source redirection instance may be different destination devices displaying the same redirection object of the same source device; in another possible implementation, the same destination device may display the same redirection object of the same source device through different screens.

此时为了减少目的端设备的解码开销,目的端设备采用复用策略,即复用重定向数据解析器解析重定向数据。At this time, in order to reduce the decoding overhead of the destination device, the destination device adopts a multiplexing strategy, that is, multiplexing the redirection data parser to parse the redirection data.

其中,重定向数据解析器的类型与目标重定向对象对应的媒体类型相关。可选地,当目标重定向对象的媒体类型为视频时,重定向数据解析器为视频解码器、当目标重定向对象的媒体类型为音频时,重定向数据解析器为音频解码播放器。当目标重定向对象的媒体类型为控制时,重定向数据解析器为控制解码器。The type of the redirection data parser is related to the media type corresponding to the target redirection object. Optionally, when the media type of the target redirection object is video, the redirection data parser is a video decoder, and when the media type of the target redirection object is audio, the redirection data parser is an audio decoding player. When the media type of the target redirection object is control, the redirection data parser is a control decoder.

在一些实施例中,当重定向数据中包括视频数据流时,目的端设备通过视频解码器对视频数据流进行解析,当重定向数据中包括音频数据流时,目的端设备通过音频解码播放器对音频数据流进行解析,当重定向数据中包括控制数据流时,目的端设备通过控制解码器对控制数据流进行解析。In some embodiments, when the redirected data includes a video data stream, the destination device parses the video data stream through a video decoder; when the redirected data includes an audio data stream, the destination device parses the audio data stream through an audio decoding player; when the redirected data includes a control data stream, the destination device parses the control data stream through a control decoder.

步骤407,目的端设备基于重定向数据的解析结果,通过目标屏幕对目标重定向对象进行展示。Step 407: The destination device displays the target redirection object through the target screen based on the parsing result of the redirection data.

进一步的,目的端设备确定目的端重定向实例所指示的目标屏幕,从而通过目标屏幕对目标重定向对象进行展示。Furthermore, the destination device determines the target screen indicated by the destination redirection instance, so as to display the target redirection object through the target screen.

在一些实施例中,目的端设备对视频数据流进行解析后,通过视频播放组件进行播放目标重定向对象的画面;目的端设备对音频数据流进行解析后,通过音频播放组件进行播放目标重定向对象的声音。In some embodiments, after the destination device parses the video data stream, it plays the image of the target redirection object through the video playback component; after the destination device parses the audio data stream, it plays the sound of the target redirection object through the audio playback component.

综上所述,本申请实施例中,重定向过程中,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目的端设备基于目的端设备标识以及目标屏幕标识,创建与源端重定向实例对应的目的端重定向实例,在同一源端重定向实例对应至少两个目的端重实例的情况下,源端设备通过复用重定向数据生成器生成重定向数据并向目的端设备传输,目的端设备接收到该重定向器数据,通过复用重定向数据解析器解析重定向数据,并通过目的端重定向实例所指示的目标屏幕对目标重定向对象进行展示;采用本申请实施例提供的方案,通过复用重定向数据生成器以及重定向数据解析器,减少了源端设备与目的端设备间数据流传输过程中源端设备的编码开销以及目的端设备的解码开销,提高复杂重定向场景的数据传输性能。To summarize, in an embodiment of the present application, during the redirection process, the source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, and the destination device creates a destination redirection instance corresponding to the source redirection instance based on the destination device identifier and the target screen identifier. When the same source redirection instance corresponds to at least two destination instances, the source device generates redirection data through a multiplexing redirection data generator and transmits it to the destination device. The destination device receives the redirector data, parses the redirection data through a multiplexing redirection data parser, and displays the target redirection object through the target screen indicated by the destination redirection instance. By adopting the solution provided in the embodiment of the present application, the encoding overhead of the source device and the decoding overhead of the destination device during the data stream transmission between the source device and the destination device are reduced by multiplexing the redirection data generator and the redirection data parser, thereby improving the data transmission performance in complex redirection scenarios.

为了实现多层级的多对多重定向,源端设备以及目的端设备的重定向模块进行分层设计。如图5所示,重定向模块的层级结构包括:In order to achieve multi-level many-to-many redirection, the redirection modules of the source device and the destination device are designed in layers. As shown in Figure 5, the hierarchical structure of the redirection module includes:

设备层:包括多路投屏服务,用于对外提供设备的投屏API(ApplicationProgramming Interface,应用程序接口)。Device layer: includes multi-channel screen projection services, which are used to provide the device's screen projection API (Application Programming Interface) to the outside world.

投屏应用层:包括由投屏管理器创建的源端重定向实例(作为源端设备时)或目的端重定向实例(作为目的端设备时)。Screen projection application layer: includes the source redirection instance (when acting as a source device) or the destination redirection instance (when acting as a destination device) created by the screen projection manager.

流媒体处理层:包括视频处理模块、音频处理模块以及控制处理模块,用于处理源端或目的端重定向实例中特定媒体类型的数据。Streaming media processing layer: includes video processing module, audio processing module and control processing module, which are used to process data of specific media types in the redirection instance of the source or destination.

重定向实例层:作为源端设备时,包括源端视频重定向器、源端音频重定向器以及源端控制重定向器;作为目的端设备时,包括目的端视频重定向器、目的端音频重定向器以及目的端控制重定向器。特定媒体类型的源端重定向器以及目的端重定向器之间的传输链路即用于传输特定媒体类型的重定向数据。Redirection instance layer: When used as a source device, it includes a source video redirector, a source audio redirector, and a source control redirector; when used as a destination device, it includes a destination video redirector, a destination audio redirector, and a destination control redirector. The transmission link between the source redirector and the destination redirector of a specific media type is used to transmit redirected data of a specific media type.

显示层:包括投屏窗体应用,且不同投屏窗体应用对应目的端设备的不同屏幕。Display layer: includes projection window applications, and different projection window applications correspond to different screens of the destination device.

在本申请实施例中,源端设备和目的端设备采用复用策略,通过复用重定向模块中的结构,减小源端设备与目的端设备在数据流传输过程中的编码以及解码开销。下面结合如图6所示的重定向模块更细致的层级结构对源端设备和目的端设备的复用策略进行说明。In the embodiment of the present application, the source device and the destination device adopt a multiplexing strategy, and reduce the encoding and decoding overhead of the source device and the destination device during data stream transmission by multiplexing the structure in the redirection module. The multiplexing strategy of the source device and the destination device is described below in conjunction with a more detailed hierarchical structure of the redirection module as shown in FIG6.

1.源端投屏实例:同一个重定向对象复用,负责在源端管理该投屏应用之下各种类型的媒体处理模块和重定向器。1. Source-side screen projection instance: The same redirection object is reused and is responsible for managing various types of media processing modules and redirectors under the screen projection application at the source end.

2.目的端投屏实例:同一个源端设备+重定向对象复用,负责在目的端管理该投屏应用之下各种类型的重定向器。2. Target-side screen projection instance: The same source device + redirection object is reused, responsible for managing various types of redirectors under the screen projection application on the target side.

3.重定向上下文:同一个重定向对象复用,维护该重定向对象的上下文数据及状态转换。3. Redirection context: The same redirection object is reused to maintain the context data and state transition of the redirection object.

4.源端视频处理模块:源端投屏实例下同一种媒体类型复用,负责维护和统一处理某种媒体类型的业务逻辑。4. Source-side video processing module: reuses the same media type under the source-side screen projection instance, and is responsible for maintaining and uniformly processing the business logic of a certain media type.

5.视频编码器:源端投屏实例下视频媒体类型复用,保证同一个重定向对象只会进行一路编码,负责分发给下层多条投屏链路。5. Video encoder: The video media type is reused under the source screen projection instance to ensure that the same redirection object will only be encoded once and is responsible for distributing it to multiple screen projection links at the lower level.

6.源端视频重定向器:对应源端每一个具体的投屏实例及其物理通道,负责接收目的端的投屏请求并向其输送媒体流,无复用。6. Source video redirector: corresponds to each specific screen projection instance and its physical channel on the source side, is responsible for receiving the screen projection request from the destination side and transmitting the media stream to it without multiplexing.

7.目的端视频重定向器:对应目的端每一个具体的投屏实例及其物理通道,负责向源端发起投屏请求并向其接收处理媒体流。同一个源端设备+重定向对象下的复用,为多个显示屏提供统一的媒体流接收和处理。7. Destination video redirector: Corresponding to each specific screen projection instance and its physical channel on the destination, it is responsible for initiating screen projection requests to the source and receiving and processing media streams from it. The same source device + multiplexing under the redirection object provides unified media stream reception and processing for multiple displays.

8.视频解码器:同一个源端设备+重定向对象复用,确保同一个重定向对象只会进行一路解码,为多个显示屏提供解码后的画面。8. Video decoder: The same source device + redirection object is reused to ensure that the same redirection object will only be decoded one way and provide decoded images for multiple displays.

9.目的端投屏窗体应用:跟目的端显示屏一一对应,来自同一个显示屏的多路媒体流复用。负责该显示屏上多路视频画面的显示。9. Target screen projection window application: corresponds to the target display screen one by one, and multiplexes multiple media streams from the same display screen. Responsible for displaying multiple video images on the display screen.

10.音频采集编码器:设备级的音频采集编码器为整个源端设备复用。应用级的音频采集编码器则是某一个投屏应用级别进行复用。统一进行音频录制和编码,为多条音频链路提供数据。10. Audio capture encoder: The device-level audio capture encoder is reused by the entire source device. The application-level audio capture encoder is reused at the level of a certain screen projection application. Audio recording and encoding are performed uniformly to provide data for multiple audio links.

11.音频解码播放器:设备级音频以每个源端设备为单位复用,应用级音频以每个源端设备+重定向对象为单位复用。11. Audio decoding player: Device-level audio is multiplexed per source device, and application-level audio is multiplexed per source device + redirection object.

下面结合上述层级结构,对源端设备以及目的端设备的复用策略以及重定向过程进行进一步说明。In combination with the above hierarchical structure, the reuse strategy and redirection process of the source device and the destination device are further explained below.

请参考图7,其示出了本申请另一个示例性实施例提供的重定向方法的流程图,本申请实施例以该方法应用于图1所示的实施环境为例进行说明,该方法包括:Please refer to FIG. 7 , which shows a flowchart of a redirection method provided by another exemplary embodiment of the present application. The present application embodiment takes the method applied to the implementation environment shown in FIG. 1 as an example for explanation. The method includes:

步骤701,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目标重定向对象标识用于表征目标重定向对象。Step 701: The source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, where the target redirection object identifier is used to represent the target redirection object.

本步骤的实施方式可以参考上述步骤401,本实施例在此不作赘述。The implementation of this step may refer to the above step 401, and this embodiment will not be described in detail here.

步骤702,目的端设备基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,目标屏幕标识用于表征目的端设备的目标屏幕。Step 702: The destination device creates a destination redirection instance based on the destination device identifier and the target screen identifier, where the target screen identifier is used to represent the target screen of the destination device.

本步骤的实施方式可以参考上述步骤402,本申请实施例在此不作赘述。The implementation of this step can refer to the above-mentioned step 402, and the embodiment of the present application will not be described in detail here.

步骤703,在同一源端重定向实例对应至少两个目的端重定向实例的情况下,源端设备通过复用重定向数据生成器生成源端重定向实例对应的重定向数据。Step 703: When the same source-end redirection instance corresponds to at least two destination-end redirection instances, the source-end device generates redirection data corresponding to the source-end redirection instance by using a multiplexing redirection data generator.

本步骤的实施方式可以参考上述步骤403,本申请实施例在此不作赘述。The implementation of this step can refer to the above-mentioned step 403, and the embodiment of the present application will not be described in detail here.

步骤704,在至少两个目的端重定向实例对应同一目的端设备的情况下,源端设备创建一个源端重定向器,或,在至少两个目的端重定向实例对应至少两个目的端设备的情况下,源端设备创建至少两个源端重定向器。Step 704: When at least two destination redirection instances correspond to the same destination device, the source device creates a source redirector; or, when at least two destination redirection instances correspond to at least two destination devices, the source device creates at least two source redirectors.

在一种可能的实施方式中,源端设备创建出源端重定向实例后,进一步基于源端重定向实例创建源端重定向器,该源端重定向器即用于传输源端重定向实例对应的重定向数据。可选的,源端设备基于源端重定向实例以及目的端设备标识创建源端重定向器。In a possible implementation, after the source device creates the source redirection instance, it further creates a source redirector based on the source redirection instance, and the source redirector is used to transmit the redirection data corresponding to the source redirection instance. Optionally, the source device creates the source redirector based on the source redirection instance and the destination device identifier.

在一种可能的实施方式中,当同一源端设备向目的端设备的多个屏幕投屏同一重定向对象时,源端设备创建一个源端重定向器。比如,当需要向第一目的端设备的第一屏幕以及第二屏幕同时投屏游戏应用时,源端设备基于源端设备标识、第一目的端标识以及游戏应用标识创建一个源端重定向器。In a possible implementation, when the same source device projects the same redirection object to multiple screens of a destination device, the source device creates a source redirector. For example, when a game application needs to be simultaneously projected to the first screen and the second screen of the first destination device, the source device creates a source redirector based on the source device identifier, the first destination identifier, and the game application identifier.

在另一种可能的实施方式中,当同一源端设备向不同目的端设备的屏幕投屏同一重定向对象时,源端设备创建多个源端重定向器。比如,当需要向第一目的端设备以及第二目的端设备投屏游戏应用时,源端设备基于源端设备标识、第一目的端标识以及游戏应用标识创建第一源端重定向器,基于源端设备标识、第二目的端标识以及游戏应用标识创建第二源端重定向器。In another possible implementation, when the same source device projects the same redirection object to the screens of different destination devices, the source device creates multiple source redirectors. For example, when a game application needs to be projected to the first destination device and the second destination device, the source device creates a first source redirector based on the source device identifier, the first destination identifier, and the game application identifier, and creates a second source redirector based on the source device identifier, the second destination identifier, and the game application identifier.

可选的,在进行重定向时,可以设置重定向对象的媒体类型(可以由用户手动设置,也可以由源端设备基于目的端设备的能力自动设置),该媒体类型包括视频、音频以及控制中的至少一种。当源端重定向实例的媒体类型包括视频时,目的端设备可以通过屏幕显示目标重定向对象;当源端重定向实例的媒体类型包括音频时,目的端设备可以通过音频播放组件播放目标重定向对象的声音;当源端重定向实例的媒体类型包括控制时,目的端设备可以对目标重定向对象进行反向控制。Optionally, when redirecting, the media type of the redirection object can be set (can be set manually by the user, or can be automatically set by the source device based on the capabilities of the destination device), and the media type includes at least one of video, audio, and control. When the media type of the source redirection instance includes video, the destination device can display the target redirection object through the screen; when the media type of the source redirection instance includes audio, the destination device can play the sound of the target redirection object through the audio playback component; when the media type of the source redirection instance includes control, the destination device can reversely control the target redirection object.

相应的,源端设备需要根据目标重定向对象对应的媒体类型,分别创建不同媒体类型对应的源端重定向器。在另一种可能的实施方式中,源端设备基于源端重定向实例、目的端设备标识以及目标重定向对象对应的媒体类型,创建至少一个源端重定向器,其中,不同的源端重定向器对应不同的媒体类型。Accordingly, the source-end device needs to create source-end redirectors corresponding to different media types according to the media type corresponding to the target redirection object. In another possible implementation, the source-end device creates at least one source-end redirector based on the source-end redirection instance, the destination-end device identifier, and the media type corresponding to the target redirection object, wherein different source-end redirectors correspond to different media types.

示例性的,当目标重定向对象对应的媒体类型包括视频时,源端设备创建源端视频重定向器,该源端视频重定向器用于重定向目标重定向对象的视频数据流;当目标重定向对象对应的媒体类型包括音频时,源端设备创建源端音频重定向器,该源端音频重定向器用于重定向目标重定向对象的音频数据流;当目标重定向对象对应的媒体类型包括控制,源端设备创建源端控制重定向器,该源端控制重定向器用于重定向目标重定向对象的控制数据流。Exemplarily, when the media type corresponding to the target redirection object includes video, the source-end device creates a source-end video redirector, which is used to redirect the video data stream of the target redirection object; when the media type corresponding to the target redirection object includes audio, the source-end device creates a source-end audio redirector, which is used to redirect the audio data stream of the target redirection object; when the media type corresponding to the target redirection object includes control, the source-end device creates a source-end control redirector, which is used to redirect the control data stream of the target redirection object.

比如,当需要向第一目的端设备投屏游戏应用,且第一目的端设备支持显示游戏应用画面、播放游戏应用声音以及反向控制游戏应用时,源端设备基于源端设备标识、第一目的端标识、游戏应用标识以及视频类型创建源端视频重定向器,基于源端设备标识、第一目的端标识、游戏应用标识以及音频类型创建源端音频重定向器;基于源端设备标识、第一目的端标识、游戏应用标识以及控制类型创建源端控制重定向器。For example, when it is necessary to project a game application to the first destination device, and the first destination device supports displaying the game application screen, playing the game application sound, and reverse controlling the game application, the source device creates a source video redirector based on the source device identifier, the first destination identifier, the game application identifier, and the video type, and creates a source audio redirector based on the source device identifier, the first destination identifier, the game application identifier, and the audio type; and creates a source control redirector based on the source device identifier, the first destination identifier, the game application identifier, and the control type.

步骤705,目的端设备创建目的端重定向器,目的端重定向器被至少两个目的端重定向实例复用。Step 705: The destination device creates a destination redirector, and the destination redirector is multiplexed by at least two destination redirection instances.

与源端设备相对应的,目的端设备需要创建与源端重定向器对应的目的端重定向,以便后续通过源端重定向器与目的端重定向器之间的链路传输源端重定向实例对应的重定向数据。Corresponding to the source device, the destination device needs to create a destination redirection corresponding to the source redirector, so as to subsequently transmit the redirection data corresponding to the source redirection instance through the link between the source redirector and the destination redirector.

关于创建目的端重定向器的方式,在一种可能的实施方式中,目的端设备知悉源端设备以及目标重定向对象,从而基于源端设备标识、目标重定向对象标识以及目的端设备标识创建目的端重定向器。Regarding the method of creating a destination redirector, in a possible implementation, the destination device knows the source device and the target redirection object, and thus creates the destination redirector based on the source device identifier, the target redirection object identifier, and the destination device identifier.

在一种可能的实施方式中,当源端设备的同一重定向对象向不同目的端设备投屏时,不同的目的端设备创建不同的目的端重定向器。比如,当源端设备向第一目的端设备以及第二目的端设备投屏游戏应用时,第一目的端设备基于源端设备标识、第一目的端标识以及游戏应用标识创建第一目的端重定向器,第二目的端设备基于源端设备标识、第二目的端标识以及游戏应用标识创建第二目的端重定向器。In a possible implementation, when the same redirection object of the source device is projected to different destination devices, different destination devices create different destination redirectors. For example, when the source device projects a game application to the first destination device and the second destination device, the first destination device creates a first destination redirector based on the source device identifier, the first destination identifier, and the game application identifier, and the second destination device creates a second destination redirector based on the source device identifier, the second destination identifier, and the game application identifier.

在另一种可能的实施方式中,当源端设备的目的端设备的多个屏幕投屏同一个重定向对象时,目的端设备创建单个目的端重定向器,此时多个目的端重定向实例标识复用同一目的端重定向器。比如,当源端设备向第一目的端设备的第一屏幕以及第二屏幕同时投屏游戏应用时,第一目的端设备基于源端设备标识、第一目的端标识以及游戏应用标识创建第一目的端重定向器,此时基于第一目的端设备标识以及第一屏幕标识创建的第一目的端重定向实例以及基于第一目的端设备标识以及第二屏幕标识创建的第二目的端重定向实例复用第一目的端重定向器。In another possible implementation, when multiple screens of a destination device of a source device are projected onto the same redirection object, the destination device creates a single destination redirector, and multiple destination redirection instance identifiers reuse the same destination redirector. For example, when the source device projects a game application to the first screen and the second screen of a first destination device at the same time, the first destination device creates a first destination redirector based on the source device identifier, the first destination identifier, and the game application identifier. At this time, the first destination redirection instance created based on the first destination device identifier and the first screen identifier and the second destination redirection instance created based on the first destination device identifier and the second screen identifier reuse the first destination redirector.

可选的,当用户在重定向过程中设置了源端重定向实例的媒体类型时,源端设备会针对不同媒体类型创建不同源端重定向器,而目的端设备则需要对应针对不同媒体类型的目的端重定向器。Optionally, when the user sets the media type of the source redirection instance during the redirection process, the source device will create different source redirectors for different media types, and the destination device needs to correspond to the destination redirectors for different media types.

在另一种可能的实施方式中,目的端设备基于源端重定向实例、目的端设备标识以及目标重定向对象对应的媒体类型,创建至少一个目的端重定向器,其中,不同的目的端重定向器对应不同的媒体类型。In another possible implementation, the destination device creates at least one destination redirector based on the source redirection instance, the destination device identifier, and the media type corresponding to the target redirection object, wherein different destination redirectors correspond to different media types.

示例性的,当目标重定向对象对应的媒体类型包括视频时,目的端设备创建目的端视频重定向器,用于接收源端视频重定向器传输的视频数据流;当目标重定向对象对应的媒体类型包括音频时,目的端设备创建目的端音频重定向器,用于接收源端音频重定向器传输的音频数据流;当目标重定向对象对应的媒体类型包括控制,目的端设备创建目的端控制重定向器,用于向源端控制重定向器传输控制数据流。Exemplarily, when the media type corresponding to the target redirection object includes video, the destination device creates a destination video redirector for receiving the video data stream transmitted by the source video redirector; when the media type corresponding to the target redirection object includes audio, the destination device creates a destination audio redirector for receiving the audio data stream transmitted by the source audio redirector; when the media type corresponding to the target redirection object includes control, the destination device creates a destination control redirector for transmitting the control data stream to the source control redirector.

比如,当源端设备向第一目的端设备投屏游戏应用,且第一目的端设备支持显示游戏应用画面、播放游戏应用声音以及反向控制游戏应用时,目的端设备基于源端设备标识、第一目的端标识、游戏应用标识以及视频类型创建目的端视频重定向器,基于源端设备标识、第一目的端标识、游戏应用标识以及音频类型创建目的端音频重定向器;基于源端设备标识、第一目的端标识、游戏应用标识以及控制类型创建目的端控制重定向器。For example, when the source device projects a game application to the first destination device, and the first destination device supports displaying the game application screen, playing the game application sound, and reverse controlling the game application, the destination device creates a destination video redirector based on the source device identifier, the first destination identifier, the game application identifier, and the video type; creates a destination audio redirector based on the source device identifier, the first destination identifier, the game application identifier, and the audio type; and creates a destination control redirector based on the source device identifier, the first destination identifier, the game application identifier, and the control type.

步骤706,通过源端重定向器与目的端重定向器之间的链路,源端设备向目的端设备传输重定向数据。Step 706: The source-end device transmits redirection data to the destination-end device through the link between the source-end redirector and the destination-end redirector.

完成重定向器创建后,源端设备即通过源端重定向器,向对应的目的端重定向器(目的端重定向器与源端重定向器对应同一源端重定向实例)传输重定向数据。After the redirector is created, the source device transmits the redirection data to the corresponding destination redirector (the destination redirector and the source redirector correspond to the same source redirection instance) through the source redirector.

在一种可能的实施方式中,当源端设备和目的端设备针对不同媒体类型创建不同重定向器时,源端设备通过至少一个源端重定向器与一个目的端重定向器之间的至少一条链路,向目的端设备传输至少一种媒体类型的重定向数据,其中,不同源端重定向器与目的端重定向器之间的链路用于传输不同媒体类型的重定向数据。In one possible implementation, when a source device and a destination device create different redirectors for different media types, the source device transmits redirection data of at least one media type to the destination device through at least one link between at least one source redirector and one destination redirector, wherein the links between different source redirectors and destination redirectors are used to transmit redirection data of different media types.

比如,当源端设备向目的端设备投屏游戏应用,且目的端设备支持显示游戏应用画面以及播放游戏应用声音时,源端设备通过源端视频重定向器向目的端设备的目的端视频重定向器传输视频数据流,通过源端音频重定向器向目的端设备的目的端音频重定向器传输音频数据流。For example, when the source device projects a game application to the destination device, and the destination device supports displaying the game application screen and playing the game application sound, the source device transmits the video data stream to the destination video redirector of the destination device through the source video redirector, and transmits the audio data stream to the destination audio redirector of the destination device through the source audio redirector.

步骤707,通过目的端重定向器与源端重定向器之间的链路,目的端设备接收源端设备传输的重定向数据。Step 707: The destination device receives the redirection data transmitted by the source device through the link between the destination redirector and the source redirector.

在一种可能的实施方式中,目的端设备通过至少一个目的端重定向器与至少一个源端重定向器之间的至少一条链路,接收源端设备传输的至少一种媒体类型的重定向数据。In a possible implementation manner, the destination device receives redirection data of at least one media type transmitted by the source device through at least one link between at least one destination redirector and at least one source redirector.

步骤708,在存在至少两个目的端重定向实例对应同一源端重定向实例的情况下,目的端设备通过复用重定向数据解析器解析重定向数据。Step 708: When there are at least two destination redirection instances corresponding to the same source redirection instance, the destination device parses the redirection data by using the multiplexing redirection data parser.

本步骤的实施方式可以参考上述步骤406,本申请实施例对此不作赘述。The implementation of this step can refer to the above-mentioned step 406, and this embodiment of the present application will not be described in detail.

步骤709,目的端设备基于重定向数据的解析结果,通过目标屏幕对目标重定向对象进行展示。Step 709: The destination device displays the target redirection object through the target screen based on the parsing result of the redirection data.

在一种可能的实施方式中,当目的端设备具有至少两块屏幕时,目的端设备根据目的端重定向实例中的目标屏幕标识确定目标屏幕,进而通过目标屏幕进行展示。In a possible implementation, when the destination device has at least two screens, the destination device determines the target screen according to the target screen identifier in the destination redirection instance, and then displays through the target screen.

在一些可能应用场景中,多路投屏(来自同一源端设备或不同源端设备)需要同时显示在目的端设备中的同一块屏幕(同屏多显);多路投屏需要显示在目的端设备中的不同屏幕(多屏异显);源端设备的同一投屏对象需要同时显示在目的端设备的不同屏幕(多屏同显)。In some possible application scenarios, multiple screen projections (from the same source device or different source devices) need to be displayed on the same screen of the destination device at the same time (multiple displays on the same screen); multiple screen projections need to be displayed on different screens of the destination device (different displays on multiple screens); the same projection object of the source device needs to be displayed on different screens of the destination device at the same time (same display on multiple screens).

为了保证投屏显示的准确性,在一些实施例中,目的端设备的各个屏幕分别对应各自的投屏窗体应用,接收到重定向数据后,目的端设备即通过目标屏幕对应的目标投屏窗体应用进行展示。以安卓系统为例,投屏窗体应用可以为Activity(活动)组件。In order to ensure the accuracy of the screen projection display, in some embodiments, each screen of the target device corresponds to its own screen projection window application. After receiving the redirection data, the target device displays it through the target screen projection window application corresponding to the target screen. Taking the Android system as an example, the screen projection window application can be an Activity component.

可选的,投屏窗体应用对应设置有窗体应用代理,用于对投屏窗体应用的生命周期进行控制。Optionally, a window application agent is set up corresponding to the projection window application to control the life cycle of the projection window application.

并且,针对同屏多显场景,目的端设备需要复用投屏窗体应用,在同一屏幕中对多个重定向对象进行分屏显示。In addition, for the scenario of multiple displays on the same screen, the destination device needs to reuse the projection window application to display multiple redirected objects in split screens on the same screen.

在一种可能的实施方式中,目的端设备接收到重定向数据后进行展示可以包括如下两种可能的情况。In a possible implementation manner, the destination device may display the redirection data after receiving the redirection data in the following two possible situations.

1、响应于目标屏幕对应的目标投屏窗体应用处于未启动状态,启动目标投屏窗体应用;通过目标投屏窗体应用对目标重定向对象进行展示。1. In response to the target projection window application corresponding to the target screen being in an unstarted state, start the target projection window application; and display the target redirection object through the target projection window application.

可选的,确定出展示的目标屏幕后,目的端设备检测该目标屏幕对应的目标投屏窗体应用是否处于启动状态,若处于未启动状态,表明当前没有其他投屏对象通过目标屏幕进行展示,从而启动目标投屏窗体应用,进而通过目标投屏窗体应用进行展示,此时,目标屏幕仅显示目标重定向对象的画面。Optionally, after determining the target screen to be displayed, the destination device detects whether the target projection window application corresponding to the target screen is in an activated state. If it is in an unactivated state, it indicates that there is currently no other projection object being displayed through the target screen, thereby starting the target projection window application, and then displaying it through the target projection window application. At this time, the target screen only displays the screen of the target redirection object.

2、响应于目标投屏窗体应用处于启动状态,通过复用目标投屏窗体应用对目标重定向对象进行展示,其中,复用目标投屏窗体应用后,各个投屏对象分屏显示在目标屏幕中。2. In response to the target projection window application being in the startup state, the target redirection object is displayed by reusing the target projection window application, wherein after reusing the target projection window application, each projection object is displayed in split screen on the target screen.

可选的,当检测到目标投屏窗体应用处于启动状态时,表明目标屏幕当前正在展示其他投屏对象。目的端设备需要复用目标投屏窗体应用(即多个源端重定向实例复用同一投屏窗体应用),进而对目标屏幕当前展示的其他投屏对象以及目标重定向对象进行分屏显示。其中,目的端设备可以基于各个投屏对象的投屏方向(横屏或竖屏)以及投屏对象的数量进行分屏控制,本申请实施例对此不作限定。Optionally, when it is detected that the target projection window application is in the startup state, it indicates that the target screen is currently displaying other projection objects. The destination device needs to reuse the target projection window application (that is, multiple source redirection instances reuse the same projection window application), and then perform split-screen display of other projection objects currently displayed on the target screen and the target redirection object. Among them, the destination device can perform split-screen control based on the projection direction (horizontal or vertical) of each projection object and the number of projection objects, which is not limited in the embodiments of the present application.

在一些实施例中,当投屏窗体应用内的各个源端重定向实例均退出时,目的端设备结束投屏窗体应用的生命周期,即销毁投屏窗体应用。In some embodiments, when all source-end redirection instances within the projection window application exit, the destination-end device ends the life cycle of the projection window application, that is, destroys the projection window application.

在本申请实施例中,源端设备通过复用重定向数据生成器生成重定向数据,目的端设备通过复用重定向数据解析器解析重定向数据,减小了源端设备以及目的端设备的编码以及解码开销,另外源端设备以及目的端设备分别创建源端重定向器以及目的端重定向器,并通过重定向器之间的链路进行重定向数据传输,保证重定向数据的准确传输。In an embodiment of the present application, the source device generates redirection data by a multiplexing redirection data generator, and the destination device parses the redirection data by a multiplexing redirection data parser, thereby reducing the encoding and decoding overhead of the source device and the destination device. In addition, the source device and the destination device respectively create a source redirector and a destination redirector, and transmit the redirection data through the link between the redirectors to ensure the accurate transmission of the redirection data.

在本申请实施例中,以目标重定向对象的媒体类型为视频为例,对源端设备以及目的端设备采取的复用策略进行说明,如图8所示,视频的编解码以及传输过程可以包括如下步骤。In an embodiment of the present application, taking the media type of the target redirection object as video as an example, the multiplexing strategy adopted by the source device and the destination device is explained. As shown in Figure 8, the video encoding, decoding and transmission process may include the following steps.

步骤801,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目标重定向对象标识用于表征目标重定向对象。Step 801: A source-end device creates a source-end redirection instance based on a source-end device identifier and a target redirection object identifier, where the target redirection object identifier is used to represent a target redirection object.

本步骤的实施方式可以参考上述步骤401,本实施例在此不作赘述。The implementation of this step may refer to the above step 401, and this embodiment will not be described in detail here.

步骤802,目的端设备基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,目标屏幕标识用于表征目的端设备的目标屏幕。Step 802: The destination device creates a destination redirection instance based on the destination device identifier and the target screen identifier, where the target screen identifier is used to represent the target screen of the destination device.

本步骤的实施方式可以参考上述步骤402,本申请实施例在此不作赘述。The implementation of this step can refer to the above-mentioned step 402, and the embodiment of the present application will not be described in detail here.

步骤803,源端设备通过复用视频编码器对同一源端重定向实例对应的画面进行视频编码,生成视频数据流。Step 803: The source device performs video encoding on the pictures corresponding to the same source redirection instance by using a multiplexed video encoder to generate a video data stream.

可选的,当需要将同一源端设备的同一重定向对象投屏至同一目的端设备的不同屏幕或者不同目的端设备的不同屏幕时,源端设备将复用视频编码器对该源端重定向实例的画面进行视频编码,得到视频数据流,而非根据屏幕数量采用多个视频编码器分别进行视频编码。Optionally, when the same redirected object of the same source device needs to be projected to different screens of the same destination device or different screens of different destination devices, the source device will reuse the video encoder to encode the picture of the source redirection instance to obtain a video data stream, rather than using multiple video encoders to perform video encoding separately according to the number of screens.

示意性的,如图3所示,当需要将源端设备中的投屏应用同时投屏至目的端设备1的屏幕1和屏幕2,以及目的端设备2的屏幕3时,源端设备复用视频编码器1进行视频编码,得到视频数据流。Schematically, as shown in Figure 3, when the screen projection application in the source device needs to be simultaneously projected to screen 1 and screen 2 of destination device 1, and screen 3 of destination device 2, the source device multiplexes video encoder 1 for video encoding to obtain a video data stream.

步骤804,在至少两个目的端重定向实例对应同一目的端设备的情况下,源端设备创建一个源端视频重定向器,或,在至少两个目的端重定向实例对应至少两个目的端设备的情况下,源端设备创建至少两个源端视频重定向器。Step 804, when at least two destination redirection instances correspond to the same destination device, the source device creates a source video redirector, or, when at least two destination redirection instances correspond to at least two destination devices, the source device creates at least two source video redirectors.

示例性的,如图3所示,当需要将源端设备中的投屏应用投屏至目的端设备1的屏幕1和屏幕2,源端设备创建一个源端视频重定向器,当需要将源端设备中的投屏应用同时投屏至目的端设备1和目的端设备2时,源端设备创建两个源端视频重定向器。Exemplarily, as shown in Figure 3, when the screen projection application in the source device needs to be projected to screen 1 and screen 2 of destination device 1, the source device creates a source video redirector. When the screen projection application in the source device needs to be projected to destination device 1 and destination device 2 at the same time, the source device creates two source video redirectors.

步骤805,目的端设备创建目的端视频重定向器。Step 805: The destination device creates a destination video redirector.

示例性的,如图3所示,当需要将源端设备中的投屏应用投屏至目的端设备1的屏幕1和屏幕2,目的端设备创建一个目的端视频重定向器,当需要将源端设备中的投屏应用同时投屏至目的端设备1的屏幕1和屏幕2,目的端设备2的屏幕3时,目的端设备创建针对目的端设备1的第一目的端视频重定向器以及针对目的端设备2的第二目的端视频重定向器。Exemplarily, as shown in Figure 3, when the screen projection application in the source device needs to be projected to screen 1 and screen 2 of destination device 1, the destination device creates a destination video redirector. When the screen projection application in the source device needs to be projected to screen 1 and screen 2 of destination device 1 and screen 3 of destination device 2 at the same time, the destination device creates a first destination video redirector for destination device 1 and a second destination video redirector for destination device 2.

步骤806,源端设备通过源端视频重定向器与目的端视频重定向器之间的链路,向目的端设备传输视频数据流。Step 806: The source device transmits the video data stream to the destination device via the link between the source video redirector and the destination video redirector.

示意性的,如图3所示,由于投屏应用需要被投屏至目的端设备1和目的端设备2,因此源端设备需要创建针对目的端设备1的第一源端视频重定向器,以及针对目的端设备2的第二源端视频重定向器,并将编码得到的视频数据流传输至第一源端视频重定向器和第二源端视频重定向器,进而通过第一源端视频重定向器和第一目的端视频重定向器将视频数据流传输至目的端设备1,通过第二源端视频重定向器和第二目的端视频重定向器将视频数据流传输至目的端设备2。Schematically, as shown in Figure 3, since the screen projection application needs to be projected to destination device 1 and destination device 2, the source device needs to create a first source video redirector for destination device 1 and a second source video redirector for destination device 2, and transmit the encoded video data stream to the first source video redirector and the second source video redirector, and then transmit the video data stream to destination device 1 through the first source video redirector and the first destination video redirector, and transmit the video data stream to destination device 2 through the second source video redirector and the second destination video redirector.

步骤807,通过目的端视频重定向器与源端视频重定向器之间的链路,目的端设备接收源端设备传输的视频数据流。Step 807: The destination device receives the video data stream transmitted by the source device through the link between the destination video redirector and the source video redirector.

示意性的,如图3所示,源端设备的投屏应用被投屏至目的端设备1和目的端设备2,目的端设备1通过第一目的端视频重定向器与第一源端视频重定向器之间的链路接收视频数据流,目的端设备2通过第二目的端视频重定向器与第二源端视频重定向器之间的链路接收视频数据流。Schematically, as shown in Figure 3, the screen projection application of the source device is projected to the destination device 1 and the destination device 2, the destination device 1 receives the video data stream through the link between the first destination video redirector and the first source video redirector, and the destination device 2 receives the video data stream through the link between the second destination video redirector and the second source video redirector.

步骤808,在存在至少两个目的端重定向实例对应同一源端重定向实例的情况下,目的端设备通过复用视频解码器对视频数据流进行视频解码,得到源端重定向实例对应的画面。Step 808: When there are at least two destination redirection instances corresponding to the same source redirection instance, the destination device decodes the video data stream by using a multiplexed video decoder to obtain a picture corresponding to the source redirection instance.

可选的,当需要将同一重定向对象投屏至同一目的端设备的至少两个屏幕时,目的端设备将复用视频解码器对该源端重定向实例的视频数据流进行视频解码,得到视频画面,而非根据屏幕数量采用多个视频解码器分别进行视频解码。Optionally, when the same redirected object needs to be projected to at least two screens of the same destination device, the destination device will reuse the video decoder to decode the video data stream of the source redirection instance to obtain a video picture, rather than using multiple video decoders to perform video decoding separately according to the number of screens.

示意性的,如图3所示,目的端设备1接收到视频数据流后,复用视频解码器1进行视频解码,从而通过屏幕1和屏幕2对解码得到的画面进行显示。Schematically, as shown in FIG. 3 , after receiving the video data stream, the destination device 1 multiplexes the video decoder 1 to perform video decoding, thereby displaying the decoded images through the screen 1 and the screen 2 .

步骤809,目的端设备基于重定向数据的解析结果,通过目标屏幕对目标重定向对象进行展示。Step 809: The destination device displays the target redirection object through the target screen based on the parsing result of the redirection data.

示意性的,如图3所示,目标设备1通过屏幕1以及屏幕2对视频进行展示,目标设备2通过屏幕3对视频进行展示。Schematically, as shown in FIG. 3 , target device 1 displays the video through screen 1 and screen 2 , and target device 2 displays the video through screen 3 .

在本申请实施例中,源端设备通过复用视频编码器,目的端设备通过复用视频解码器从而减小了源端设备与目的端设备间视频数据流传输的过程中的编码以及解码开销。In the embodiment of the present application, the source device multiplexes the video encoder, and the destination device multiplexes the video decoder, thereby reducing the encoding and decoding overhead in the process of video data stream transmission between the source device and the destination device.

当目标重定向对象对应的媒体类型为音频时,可以参照上述步骤执行,下面对其进行简略介绍。When the media type corresponding to the target redirection object is audio, you can refer to the above steps, which are briefly introduced below.

在另一种可能的场景下,当目标重定向对象对应的媒体类型包括音频时,源端设备需要对重定向对象进行音频采集,并对采集到的音频进行编码,得到音频数据流,从而将该音频数据流传输至目的端设备,以供目的端设备进行解析播放。在一种可能的实施方式,当目标重定向对象的类型为屏幕镜像时,源端设备通过复用设备级音频采集编码器进行音频采集及编码,得到音频数据流,其中,该设备级音频采集编码器用于采集设备的音频并编码;当目标重定向对象的类型为重定向应用时,源端设备通过复用应用级音频采集编码器进行音频采集及编码,得到音频数据流,其中,该应用级音频采集编码器用于采集重定向应用的音频并编码。In another possible scenario, when the media type corresponding to the target redirection object includes audio, the source device needs to collect audio from the redirection object and encode the collected audio to obtain an audio data stream, thereby transmitting the audio data stream to the destination device for parsing and playback by the destination device. In a possible implementation, when the type of the target redirection object is screen mirroring, the source device collects and encodes audio by multiplexing a device-level audio acquisition encoder to obtain an audio data stream, wherein the device-level audio acquisition encoder is used to collect and encode the audio of the device; when the type of the target redirection object is a redirection application, the source device collects and encodes audio by multiplexing an application-level audio acquisition encoder to obtain an audio data stream, wherein the application-level audio acquisition encoder is used to collect and encode the audio of the redirection application.

进一步的,源端设备通过源端音频重定向器与目的端音频重定向器之间的链路,向目的端设备传输音频数据流。目的端设备创建音频重定向器,并通过目的端音频重定向器与源端音频重定向器之间的链路,接收源端设备传输的音频数据流。目的端设备接收音频数据流后,通过复用音频解码器对音频数据流进行音频解码,得到源端重定向实例对应的音频。在本申请实施例中,源端设备通过复用音频采集编码器,目的端设备通过复用音频解码器减小了源端设备与目的端设备间音频数据流传输过程中的编码以及解码开销。Furthermore, the source device transmits an audio data stream to the destination device via a link between the source audio redirector and the destination audio redirector. The destination device creates an audio redirector and receives the audio data stream transmitted by the source device via a link between the destination audio redirector and the source audio redirector. After receiving the audio data stream, the destination device performs audio decoding on the audio data stream through a multiplexed audio decoder to obtain the audio corresponding to the source redirection instance. In an embodiment of the present application, the source device reduces the encoding and decoding overhead during the transmission of the audio data stream between the source device and the destination device by multiplexing the audio acquisition encoder and the destination device by multiplexing the audio decoder.

在一种可能的实施方式中,当目的端设备为至少两个时,源端设备通过至少两个源端重定向器与至少两个目的端重定向器之间的至少两条链路,向至少两个目的端设备分流传输重定向数据。示例性的,如图3所示,由于投屏应用需要被投屏至目的端设备1和目的端设备2,因此源端设备需要创建针对目的端设备1的第一源端视频重定向器,以及针对目的端设备2的第二源端视频重定向器,并将编码得到的视频数据流分流至第一源端视频重定向器和第二源端视频重定向器,进而通过第一源端视频重定向器和第一目的端视频重定向器将视频数据流传输至目的端设备1,通过第二源端视频重定向器和第二目的端视频重定向器将视频数据流传输至目的端设备2,实现视频数据流的分流传输。由于采用分流策略,因此降低了源端设备以及目的端设备数据流传输的IO开销。In a possible implementation, when there are at least two destination devices, the source device transmits redirected data to at least two destination devices through at least two links between at least two source redirectors and at least two destination redirectors. Exemplarily, as shown in FIG3, since the screen projection application needs to be projected to destination device 1 and destination device 2, the source device needs to create a first source video redirector for destination device 1 and a second source video redirector for destination device 2, and shunt the encoded video data stream to the first source video redirector and the second source video redirector, and then transmit the video data stream to destination device 1 through the first source video redirector and the first destination video redirector, and transmit the video data stream to destination device 2 through the second source video redirector and the second destination video redirector, thereby realizing the shunt transmission of the video data stream. Due to the adoption of the shunt strategy, the IO overhead of the data stream transmission of the source device and the destination device is reduced.

在一种可能的实施方式中,第一目的端设备和第二目的端设备异步向源端设备发送投屏请求,源端设备先后通过第一源端视频重定向器与第一目的端视频重定向器之间的链路、第二源端视频重定向器与第二目的端视频重定向器之间的链路,将视频数据流分流传输至第一目的端设备以及第二目的端设备。但是在此过程中,由于第一目的端设备的第一路投屏以及第二目的端设备的第二路投屏接入时间不同,容易导致出现花屏等异常情况。In a possible implementation, the first destination device and the second destination device asynchronously send screen projection requests to the source device, and the source device successively transmits the video data stream to the first destination device and the second destination device through the link between the first source video redirector and the first destination video redirector, and the link between the second source video redirector and the second destination video redirector. However, in this process, due to the different access times of the first screen projection of the first destination device and the second screen projection of the second destination device, abnormal situations such as screen distortion may occur.

首先以安卓系统MediaCodec编码模块为例对视频编码的过程进行简单的介绍。First, we take the Android system MediaCodec encoding module as an example to briefly introduce the video encoding process.

在本申请实施例中,目标重定向对象的媒体类型为视频,源端设备的MediaCodec编码模块以一定频率采样视频画面并编码成多个I(Intra-coded picture,帧内编码图像)帧以及多个P(Predictive-coded picture,前向预测编码图像)帧。I帧即关键帧,是一种带有完成显示信息的独立帧,其包含全量数据,无需依赖其他帧可独立解码,且会作为其他帧的基准值。P帧为非关键帧,存储的是本帧与相邻的前一帧(I帧和P帧)的差值,需要参考前向帧才能成像。如果该P帧之前的一个I帧以及多个P帧有任一帧数据丢失或者出错,都会导致后续一段时间内的画面花屏,直到下一个I帧恢复。In an embodiment of the present application, the media type of the target redirection object is video, and the MediaCodec encoding module of the source device samples the video screen at a certain frequency and encodes it into multiple I (Intra-coded picture) frames and multiple P (Predictive-coded picture) frames. The I frame is a key frame, which is an independent frame with complete display information. It contains full data and can be decoded independently without relying on other frames, and will serve as a reference value for other frames. The P frame is a non-key frame, which stores the difference between the current frame and the adjacent previous frame (I frame and P frame), and requires reference to the forward frame to form an image. If any frame data of an I frame and multiple P frames before the P frame is lost or erroneous, it will cause the screen to be distorted for a period of time until the next I frame is restored.

除此之外,MediaCodec编码模块在对视频画面进行编码过程中还会生成配置(Confing)帧,即视频流的头部信息,会记录当前视频流编码的相关参数,并保存在SPS(Sequence Paramater Set,序列参数集)和PPS(Picture Paramater Set,图像参数集)串中。另外,其包含了初始化视频解码器所需要的信息参数,例如编码的Profile、level、图像的宽度等。In addition, the MediaCodec encoding module will also generate a configuration frame during the encoding process of the video screen, that is, the header information of the video stream, which will record the relevant parameters of the current video stream encoding and save them in the SPS (Sequence Parameter Set) and PPS (Picture Parameter Set) strings. In addition, it contains the information parameters required to initialize the video decoder, such as the encoded profile, level, image width, etc.

进一步,结合上述视频编码过程对第一目的端设备以及第二目的端设备异步接入时产生的花屏等异常情况进行说明。示例性的,如图9所示,第一目的端设备第一路投屏接入时,源端设备会触发视频编码器,视频编码器生成的配置帧、I帧、P帧都会发送至第一源端视频重定向器,因此第一路视频流中包含完整的配置帧、I帧以及P帧。由于第二目的端设备在第一目的端设备之后接入,因此第二路投屏接入的时通常在某个P帧,此时第二源端视频重定向器按照该视频帧接收的话,将缺失配置帧以及I帧,则会导致目的端设备显示异常。在一种可能的实施方式中,若缺失配置帧会导致目的端设备解码器无法解码;在另一种可能的实施方式中,若缺失I帧以及I帧之后的P帧会导致目的端设备显示画面花屏。因此在本申请实施例中通过对第二路投屏采用分流补帧方法以解决上述问题。下面以第一目的端设备以及第二目的端设备为例对分流补帧方法进行介绍。另外需要说明的是,在本申请实施例中至少存在两个目的端设备,本申请实施例仅以第一目的端设备和第二目的端设备为例进行说明,且第一目的端设备在第二目的端设备之前接入。请参考图10,其示出了本申请一个示例性实施例提供的异步接入时重定向方法的流程图。Further, in combination with the above-mentioned video encoding process, the abnormal conditions such as screen distortion generated when the first destination device and the second destination device are asynchronously connected are explained. For example, as shown in Figure 9, when the first projection screen of the first destination device is connected, the source device triggers the video encoder, and the configuration frame, I frame, and P frame generated by the video encoder are all sent to the first source video redirector, so the first video stream contains complete configuration frames, I frames, and P frames. Since the second destination device is connected after the first destination device, the second projection screen is usually connected at a certain P frame. At this time, if the second source video redirector receives the video frame, the configuration frame and I frame will be missing, which will cause the destination device to display abnormally. In one possible implementation, if the configuration frame is missing, the destination device decoder cannot decode; in another possible implementation, if the I frame and the P frame after the I frame are missing, the destination device will display a screen distortion. Therefore, in the embodiment of the present application, the second projection screen is used to adopt a shunt frame supplement method to solve the above problem. The following introduces the shunt frame supplement method using the first destination device and the second destination device as examples. In addition, it should be noted that in the embodiment of the present application, there are at least two destination devices, and the embodiment of the present application only takes the first destination device and the second destination device as examples for explanation, and the first destination device is accessed before the second destination device. Please refer to Figure 10, which shows a flowchart of the redirection method during asynchronous access provided by an exemplary embodiment of the present application.

步骤1001,第二目的端设备通过第二目的端视频重定向器与第二源端视频重定向器之间的链路,向源端设备发送投屏请求。Step 1001: The second destination device sends a screen projection request to the source device through the link between the second destination video redirector and the second source video redirector.

在一种可能的实施方式中,第一目的端设备在第二目的端设备之前接入,也就是说第一目的端设备通过第一目的端视频重定向器与第一源端视频重定向器之间的链路,向源端设备发送第一投屏请求后,第二目的端设备才通过第第二目的端视频重定向器与第二源端视频重定向器之间的链路,向源端设备发送第二投屏请求。In one possible implementation, the first destination device is accessed before the second destination device, that is, after the first destination device sends a first screen projection request to the source device through the link between the first destination video redirector and the first source video redirector, the second destination device sends a second screen projection request to the source device through the link between the second destination video redirector and the second source video redirector.

步骤1002,响应于第二目的端设备的投屏请求,源端设备通过第二源端视频重定向器从源端重定向实例的重定向上下文中获取配置帧。Step 1002, in response to the screen projection request of the second destination device, the source device obtains a configuration frame from the redirection context of the source redirection instance through the second source video redirector.

在本申请实施例中,第一目的端设备先向源端设备发送投屏请求,源端设备接收到第一目的端设备发送的投屏请求后,启动视频编码器,并将视频编码器生成的配置帧同步上报给重定向上下文,并将所有帧即配置帧、I帧、P帧发送至第一源端视频重定向器。进而源端设备通过第一源端视频重定向器与第一目的端视频重定向器之间的链路,向第一目的端视频重定向器传输视频数据流。In an embodiment of the present application, the first destination device first sends a screen projection request to the source device. After receiving the screen projection request sent by the first destination device, the source device starts the video encoder, and synchronously reports the configuration frame generated by the video encoder to the redirection context, and sends all frames, namely the configuration frame, I frame, and P frame, to the first source video redirector. Then, the source device transmits the video data stream to the first destination video redirector through the link between the first source video redirector and the first destination video redirector.

源端设备通过复用重定向上下文维护每一路投屏的关键数据以及状态。其中,关键数据可以包括各种视频帧、源端设备投屏参数、目的端设备投屏参数等,本申请实施例对此不作限定。状态用于表明目的端设备与源端设备的连接状态,如接入状态、投屏状态、退出状态等,本申请实施例对此不作限定。The source device maintains the key data and status of each screen projection by reusing the redirection context. Among them, the key data may include various video frames, source device projection parameters, destination device projection parameters, etc., which are not limited in this embodiment of the present application. The status is used to indicate the connection status between the destination device and the source device, such as access status, projection status, exit status, etc., which are not limited in this embodiment of the present application.

当第二目的端设备向源端设备发送投屏请求时,源端设备接收到第二目的端设备发送的投屏请求后,第二源端视频重定向器判断出其不是第一路投屏,因此源端设备通过第二源端视频重定向器从重定向上下文中获取配置帧,该配置帧由第一路投屏时视频编码器产生。When the second destination device sends a screen projection request to the source device, after the source device receives the screen projection request sent by the second destination device, the second source video redirector determines that it is not the first screen projection. Therefore, the source device obtains the configuration frame from the redirection context through the second source video redirector. The configuration frame is generated by the video encoder during the first screen projection.

步骤1003,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备传输配置帧。Step 1003: The source device transmits a configuration frame to the second destination device through the link between the second source video redirector and the second destination video redirector.

进一步,源端设备获取配置帧后,单独通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备的第二目的端视频重定向器传输配置帧。Furthermore, after the source device obtains the configuration frame, it transmits the configuration frame to the second destination video redirector of the second destination device solely through the link between the second source video redirector and the second destination video redirector.

步骤1004,第二目的端设备接收源端设备传输的配置帧。Step 1004: The second destination device receives the configuration frame transmitted by the source device.

进一步,第二目的端设备通过第二目的端视频重定向器接收该配置帧。Further, the second destination device receives the configuration frame through the second destination video redirector.

步骤1005,第二目的端设备基于配置帧进行视频解码配置。Step 1005: The second destination device performs video decoding configuration based on the configuration frame.

进一步,第二目的端设备的视频解码器通过配置帧配置视频解码器的解码参数。其中,解码参数可以是图像的宽高等。Furthermore, the video decoder of the second destination device configures decoding parameters of the video decoder by configuring the frame, wherein the decoding parameters may be the width and height of the image.

步骤1006,响应于第二目的端设备的投屏请求,源端设备通过第二源端视频重定向器从重定向上下文中获取旋转帧。Step 1006, in response to the screen projection request of the second destination device, the source device obtains the rotated frame from the redirection context through the second source video redirector.

在一种可能的实施方式中,由于视频画面投屏的过程中可能会出现横竖屏旋转,因此在视频编码器在对视频画面进行编码过程中还会生成旋转(Rotate)帧。由于第二目的端设备在第一目的端设备之后接入,因此第二路投屏接入时,通常在某个P帧,此时第二源端视频重定向器按照该视频帧接收的话,将缺失旋转帧,则会导致目的端设备画面显示方向以及源端设备画面显示方向不一致,可能相差90°、180°或者270°。In a possible implementation, since the video screen may rotate horizontally or vertically during projection, a rotation frame is generated during the video encoder encoding the video screen. Since the second destination device is connected after the first destination device, when the second projection is connected, usually in a certain P frame, if the second source video redirector receives the video frame, the rotation frame will be missing, which will cause the display direction of the destination device screen to be inconsistent with the display direction of the source device screen, which may differ by 90°, 180° or 270°.

在本申请实施例中,第一目的端设备先向源端设备发送投屏请求,源端设备接收到第一目的端设备发送的投屏请求,启动视频编码器,并将视频编码器生成的旋转帧同步上报给重定向上下文,并将所有帧即配置帧、I帧、P帧以及旋转帧发送至第一源端视频重定向器。In an embodiment of the present application, the first destination device first sends a screen projection request to the source device. The source device receives the screen projection request sent by the first destination device, starts the video encoder, and synchronously reports the rotated frames generated by the video encoder to the redirection context, and sends all frames, namely configuration frames, I frames, P frames and rotated frames, to the first source video redirector.

当第二目的端设备向源端设备发送投屏请求时,源端设备接收到第二目的端设备发送的投屏请求后,第二源端视频重定向器判断出其不是第一路投屏,因此源端设备通过第二源端视频重定向器从重定向上下文中获取旋转帧,该旋转帧由第一路投屏时视频编码器产生。When the second destination device sends a screen projection request to the source device, after the source device receives the screen projection request sent by the second destination device, the second source video redirector determines that it is not the first screen projection. Therefore, the source device obtains the rotated frame from the redirection context through the second source video redirector. The rotated frame is generated by the video encoder during the first screen projection.

步骤1007,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备传输旋转帧。Step 1007: The source device transmits the rotated frame to the second destination device via the link between the second source video redirector and the second destination video redirector.

进一步,源端设备获取旋转帧后,单独通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备传输旋转帧。Furthermore, after the source-end device obtains the rotated frame, it transmits the rotated frame to the second destination-end device solely through the link between the second source-end video redirector and the second destination-end video redirector.

步骤1008,第二目的端设备接收源端设备传输的旋转帧。Step 1008: The second destination device receives the rotated frame transmitted by the source device.

进一步,第二目的端设备通过第二目的端视频重定向器接收该旋转帧。Further, the second destination device receives the rotated frame through a second destination video redirector.

步骤1009,第二目的端设备基于旋转帧配置画面显示方向。Step 1009: The second destination device configures the screen display direction based on the rotation frame.

第二目的端设备的视频解码器通过旋转帧配置目的端设备画面的显示方向,其与源端设备画面的显示方向一致。The video decoder of the second destination device configures the display direction of the destination device screen by rotating the frame, which is consistent with the display direction of the source device screen.

步骤1010,以异步接入请求后的第一个关键帧为起点,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备传输视频数据流。Step 1010, starting from the first key frame after the asynchronous access request, the source device transmits the video data stream to the second destination device through the link between the second source video redirector and the second destination video redirector.

在一种可能的实施方式中,源端设备向视频编码器发送RequesKeyFrame请求,请求第二目的端设备异步接入请求后的第一I帧到来,当该I帧到来之前,P帧都会被跳过,直到I帧到来,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备传输视频数据流。In one possible implementation, the source device sends a RequesKeyFrame request to the video encoder, requesting the arrival of the first I frame after the asynchronous access request of the second destination device. Before the I frame arrives, the P frames will be skipped until the I frame arrives. The source device transmits the video data stream to the second destination device through the link between the second source video redirector and the second destination video redirector.

在另一种可能的实施方式中,源端设备无需向视频编码器发送请求,第二目的端设备异步接入请求后的第一I帧未到来,则等待I帧到来,该I帧到来之前,P帧都会被跳过,直到I帧到来,源端设备通过第二源端视频重定向器与第二目的端重定向器之间的链路,向第二目的端设备传输视频数据流。In another possible implementation, the source device does not need to send a request to the video encoder. If the first I frame after the asynchronous access request of the second destination device has not arrived, it waits for the I frame to arrive. Before the I frame arrives, all P frames will be skipped. Until the I frame arrives, the source device transmits the video data stream to the second destination device through the link between the second source video redirector and the second destination redirector.

步骤1011,第二目的端设备接收源端设备传输的视频数据流。Step 1011: The second destination device receives the video data stream transmitted by the source device.

进一步,第二目的端设备通过第二目的端视频重定向器接收源端设备传输的视频数据流。Furthermore, the second destination device receives the video data stream transmitted by the source device through the second destination video redirector.

示例性的,结合图10,对上述分流补帧的方法进行示意性说明。第一目的端设备的第一路投屏先接入,源端设备触发视频编码器产生配置帧、I帧、P帧以及旋转帧,同时将配置帧以及旋转帧同步上报给重定向上下文。进一步,将所有帧发送至第一源端视频重定向器,进而源端设备通过第一源视频端重定向器与第一目的端视频重定向器之间的链路,传输视频数据流。Exemplarily, in conjunction with Figure 10, the above-mentioned method of splitting and supplementing frames is schematically illustrated. The first screen projection of the first destination device is first connected, and the source device triggers the video encoder to generate configuration frames, I frames, P frames and rotation frames, and simultaneously reports the configuration frames and rotation frames to the redirection context. Further, all frames are sent to the first source video redirector, and then the source device transmits the video data stream through the link between the first source video redirector and the first destination video redirector.

第二目的端设备的第二路投屏在某个P帧接入,此时源端设备的第二源端视频重定向器直接从重定向上下文中获取配置帧以及旋转帧,并单独通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端传输配置帧以及旋转帧。进一步,源端设备向视频编码器发送RequestKeyFrame请求,请求下一个I帧尽快到来,当I帧到来之前,P帧都会被跳过,直到I帧到来,进而源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备发送视频数据流。The second projection of the second destination device is accessed at a certain P frame. At this time, the second source video redirector of the source device directly obtains the configuration frame and the rotation frame from the redirection context, and transmits the configuration frame and the rotation frame to the second destination separately through the link between the second source video redirector and the second destination video redirector. Further, the source device sends a RequestKeyFrame request to the video encoder, requesting the next I frame to arrive as soon as possible. Before the I frame arrives, the P frame will be skipped until the I frame arrives. Then the source device sends the video data stream to the second destination device through the link between the second source video redirector and the second destination video redirector.

本申请实施例中,第一目的端设备与第二目的端设备异步接入时,通过对第二目的端设备的第二路投屏采用分流补帧的方法,即通过第二源端视频重定向器从重定向上下文中获取配置帧以及旋转帧,将其传输至第二目的端视频重定向器,源端设备等到第二目的端设备异步接入请求后的第一个关键帧为起点,向第二目的端设备发送视频数据流,避免目的端设备显示画面出现花屏等异常情况。In an embodiment of the present application, when the first destination device is asynchronously connected to the second destination device, a method of splitting and supplementing frames is adopted for the second screen projection of the second destination device, that is, the configuration frame and the rotation frame are obtained from the redirection context by the second source video redirector, and transmitted to the second destination video redirector. The source device waits until the first key frame after the asynchronous access request of the second destination device is used as the starting point, and sends the video data stream to the second destination device to avoid abnormal situations such as screen distortion on the display of the destination device.

在另一种可能的实施方式中,第一目的端设备与第二目的端设备同步向源端设备发送投屏请求,此时第一目的端设备与第二目的端设备并发接入,因此二者共享的数据以及状态会出现竞争同时修改的情况,进而影响投屏质量。在本申请实施例中,通过以第一路投屏作为主要协商对象进行投屏参数的协商以解决上述问题。请参考图11,以第一目的端设备和第二目的端设备为例对并发接入时重定向方法进行介绍,需要说明的是,在本申请实施例中至少存在两个目的端设备,本申请实施例仅以第一目的端设备和第二目的端设备为例进行说明。其中第一目的端设备为第一路接入,第二目的端设备为第二路接入。In another possible implementation, the first destination device and the second destination device synchronously send a screen projection request to the source device. At this time, the first destination device and the second destination device are accessed concurrently, so the data and status shared by the two will compete and be modified at the same time, thereby affecting the quality of the screen projection. In an embodiment of the present application, the above-mentioned problem is solved by negotiating the screen projection parameters with the first screen projection as the main negotiation object. Please refer to Figure 11, and take the first destination device and the second destination device as an example to introduce the redirection method during concurrent access. It should be noted that in the embodiment of the present application, there are at least two destination devices. The embodiment of the present application only takes the first destination device and the second destination device as an example for explanation. Among them, the first destination device is the first access, and the second destination device is the second access.

步骤1101,第二目的端设备通过第二目的端视频重定向器与第二源端视频重定向器之间的链路,向源端设备发送接入请求。Step 1101: The second destination device sends an access request to the source device through the link between the second destination video redirector and the second source video redirector.

其中,接入请求用于第二目的端视频重定向器与第二源端视频重定向器之间建立连接,创建数据流通道。The access request is used to establish a connection between the second destination-end video redirector and the second source-end video redirector to create a data stream channel.

步骤1102,响应于第二目的端设备的接入请求,源端设备通过第二源端视频重定向器从源端重定向实例的重定向上下文中获取实例标识。Step 1102: In response to the access request of the second destination device, the source device obtains the instance identifier from the redirection context of the source redirection instance through the second source video redirector.

在本申请实施例中,作为第一路接入的目的端设备通过第一目的端视频重定向器与第一源端视频重定向器的链路,向源端设备发送接入请求,进一步源端设备接收到第一路接入请求,第一源端视频重定向器创建实例标识,并将该实例标识同步上报至重定向上下文。同时源端设备通过第一源端视频重定向器与第一目的端视频重定向器之间的链路,将实例标识发送给第一目的端设备。源端设备通过复用重定向上下文管理每一路视频流的关键数据以及状态。In an embodiment of the present application, the destination device as the first access sends an access request to the source device through the link between the first destination video redirector and the first source video redirector. Further, the source device receives the first access request, and the first source video redirector creates an instance identifier and synchronously reports the instance identifier to the redirection context. At the same time, the source device sends the instance identifier to the first destination device through the link between the first source video redirector and the first destination video redirector. The source device manages the key data and status of each video stream by multiplexing the redirection context.

因此当源端设备接收到作为第二路的第二目的端设备发送的接入请求后,源端设备通过第二源端视频重定向器直接从重定向上下文中获取实例标识。Therefore, when the source-end device receives the access request sent by the second destination-end device as the second path, the source-end device directly obtains the instance identifier from the redirection context through the second source-end video redirector.

其中,实例标识基于源端设备标识以及待重定向的目标重定向对象的目标重定向对象标识确定。The instance identifier is determined based on the source device identifier and the target redirection object identifier of the target redirection object to be redirected.

步骤1103,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向第二目的端设备发送实例标识。Step 1103: The source device sends an instance identifier to the second destination device through a link between the second source video redirector and the second destination video redirector.

进一步,源端设备获取实例标识后,通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,第二源端视频重定向器向第二目的端视频重定向器发送实例标识。Further, after the source device obtains the instance identifier, the second source-end video redirector sends the instance identifier to the second destination-end video redirector through the link between the second source-end video redirector and the second destination-end video redirector.

步骤1104,第二目的端设备接收源端设备发送的源端重定向实例的实例标识。Step 1104: The second destination device receives the instance identifier of the source redirection instance sent by the source device.

进一步,第二目的端视频重定向器接收到该实例标识,基于设备标识确定源端设备,基于目标重定向对象标识确认目的端设备显示的内容,进一步的初始化目的窗体应用。Further, the second destination video redirector receives the instance identifier, determines the source device based on the device identifier, confirms the content displayed by the destination device based on the target redirection object identifier, and further initializes the destination window application.

在一种可能的实施方式中,若第一路接入的第一目的端设备已经初始化目的窗体应用,则第二目的端设备直接复用该目的端窗体应用,无需通过第二目的端视频重定向器再次初始化目的端窗体应用。In a possible implementation, if the first destination device of the first access has initialized the destination window application, the second destination device directly reuses the destination window application without reinitializing the destination window application through the second destination video redirector.

在另一种可能的实施方式中,如第一路接入的第一目的端设备未初始化目的端窗体应用或目的端窗体应用已销毁,则第二目的端设备需通过第二目的端视频重定向器初始化目的端窗体应用,其后接入的其他目的端设备可直接复用该目的端窗体应用。In another possible implementation, if the first destination device accessed through the first path has not initialized the destination window application or the destination window application has been destroyed, the second destination device needs to initialize the destination window application through the second destination video redirector, and other destination devices accessed thereafter can directly reuse the destination window application.

步骤1105,第二目的端设备通过第二目的端视频重定向器与第二源端视频重定向器之间的链路,向源端设备发送参数获取请求。Step 1105: The second destination device sends a parameter acquisition request to the source device through the link between the second destination video redirector and the second source video redirector.

进一步地,第二目的端设备向源端设备发送参数获取请求,用于能力协商。Furthermore, the second destination device sends a parameter acquisition request to the source device for capability negotiation.

步骤1106,响应于第二目的端设备的参数获取请求,源端设备通过第二源端视频重定向器从源端重定向实例的重定向上下文中获取目标投屏参数。Step 1106, in response to the parameter acquisition request of the second destination device, the source device obtains the target screen projection parameters from the redirection context of the source redirection instance through the second source video redirector.

在本申请实施例中,源端设备的源端视频重定向器(包括第一源端视频重定向器以及第二源端视频重定向器)接收到目的端设备的参数获取请求,判定是第一路接入的第一目的端设备还是第二路接入的第二目的端设备。在一种可能的实施方式中,若为第一路接入的第一目的端设备,第一源端视频重定向器基于源端投屏参数和第一目的端投屏参数确定目标投屏参数,并同步上报至重定向上下文。In an embodiment of the present application, a source-end video redirector (including a first source-end video redirector and a second source-end video redirector) of a source-end device receives a parameter acquisition request from a destination-end device, and determines whether it is a first destination-end device accessed through a first path or a second destination-end device accessed through a second path. In a possible implementation, if it is a first destination-end device accessed through a first path, the first source-end video redirector determines the target screen projection parameters based on the source screen projection parameters and the first destination screen projection parameters, and synchronously reports them to the redirection context.

在另一种可能的实施方式中,若为第二路接入的第二目的端设备,第二源端视频重定向器直接从重投屏上下文中获取目标投屏参数。In another possible implementation, if it is a second destination device accessed through a second path, the second source-end video redirector directly obtains the target screen projection parameters from the re-projection screen context.

另外,需要说明的是,在另一种可能的实施方式中,目标投屏参数也可以是根据源端投屏参数和当前的目的端投屏参数实时确定。例如,若为第一路接入的第一目的端设备,第一源端视频重定向器基于源端投屏参数和第一目的端投屏参数确定目标投屏参数,若为第二路接入的第二目的端设备,第二源端视频重定向器基于源端投屏参数和第二目的端投屏参数确定目标投屏参数。In addition, it should be noted that, in another possible implementation, the target screen projection parameters can also be determined in real time based on the source screen projection parameters and the current destination screen projection parameters. For example, if it is a first destination device accessed through the first path, the first source video redirector determines the target screen projection parameters based on the source screen projection parameters and the first destination screen projection parameters; if it is a second destination device accessed through the second path, the second source video redirector determines the target screen projection parameters based on the source screen projection parameters and the second destination screen projection parameters.

其中,投屏参数可以是屏幕分辨率、刷新率、延时等,本申请实施例对此不作限定。Among them, the screen projection parameters may be screen resolution, refresh rate, delay, etc., which are not limited in the embodiments of the present application.

步骤1107,源端设备通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,源端设备向第二目的端设备发送目标投屏参数。Step 1107: The source device sends target screen projection parameters to the second destination device through the link between the second source video redirector and the second destination video redirector.

进一步,源端设备将最终确定的目标投屏参数通过第二源端视频重定向器与第二目标端视频重定向器之间的链路发送至第二目的端设备。Further, the source-end device sends the finally determined target screen projection parameters to the second destination-end device through the link between the second source-end video redirector and the second target-end video redirector.

步骤1108,第二目的端设备接收源端设备发送的目标投屏参数。Step 1108: The second destination device receives the target screen projection parameters sent by the source device.

进一步,第二目的端设备的第二目的端视频重定向器接收目标投屏参数。Further, the second destination video redirector of the second destination device receives the target screen projection parameters.

步骤1109,第二目的端设备基于目标投屏参数初始化视频解码器。Step 1109: The second destination device initializes the video decoder based on the target screen projection parameters.

进一步,第二目的端视频重定向器收到该目标投屏参数后,按照目标投屏参数初始化视频解码器,向源端设备发送投屏请求。Further, after receiving the target screen projection parameters, the second destination video redirector initializes the video decoder according to the target screen projection parameters and sends a screen projection request to the source device.

示例性的,结合图12,对上述过程进行说明。Exemplarily, the above process is described in conjunction with FIG. 12 .

第二目的端设备向源端设备发送接入请求,第二目的端视频重定向器向第二源端视频重定向器建立连接,创建视频数据流通道。进一步,第二源端视频重定向器通过复用重定向上下文获取实例标识,并通知第二目的端视频重定向器用于绑定实例标识。第二目的端视频重定向器获取到该实例标识并请求初始化目的端窗体应用,若该目的端窗体应用已存在,则直接复用。进一步,第二目的端视频重定向器向第二源端视频重定向器发送获取参数请求,第二源端视频重定向器接收到该参数请求后,判断是作为第一路接入的第一目的端设备,还是作为第二路接入的第二目的端设备,若为第一路接入的目的端设备,则结合源端投屏参数以及第一目的端投屏参数确定目标投屏参数,并同步上报至重定向上下文。若为第二路接入的第二目的端设备,第二源端视频重定向器直接从重定向上下文中获取该目标投屏参数,并将该目标投屏参数发送至第二目的端视频重定向器。进一步,第二目的端视频重定向器接收到目标投屏参数,按照参数初始化视频解码器,视频解码器初始化完成之后,向第二源端视频重定向器发送投屏请求。若为第一路接入的第一目的端设备发送投屏请求,则源端设备创建视频编码器,将视频编码器生成的配置帧、I帧、P帧以及旋转帧发送至第一源端视频重定向器,并将配置帧以及旋转帧同步上报至重定向上下文。进一步,源端设备通过第一源端视频重定向器向第一目的端视频重定向器发送视频数据流。若为第二路接入的第二目的端设备发送投屏请求,则第二源端视频重定向器直接从重定向上下文中获取配置帧以及旋转帧,进一步,源端设备通过第二源端视频重定向器向第二目的端视频重定向器发送视频数据流,第二目的端视频重定向器接收到该视频数据流后,通过视频解码器解析该视频数据流并送去渲染。The second destination device sends an access request to the source device, and the second destination video redirector establishes a connection with the second source video redirector to create a video data stream channel. Further, the second source video redirector obtains the instance identifier by reusing the redirection context, and notifies the second destination video redirector to bind the instance identifier. The second destination video redirector obtains the instance identifier and requests to initialize the destination window application. If the destination window application already exists, it is directly reused. Further, the second destination video redirector sends a parameter acquisition request to the second source video redirector. After receiving the parameter request, the second source video redirector determines whether it is the first destination device accessed as the first route or the second destination device accessed as the second route. If it is the destination device accessed by the first route, the target screen projection parameters are determined by combining the source screen projection parameters and the first destination screen projection parameters, and are synchronously reported to the redirection context. If it is the second destination device accessed by the second route, the second source video redirector directly obtains the target screen projection parameters from the redirection context and sends the target screen projection parameters to the second destination video redirector. Further, the second destination-end video redirector receives the target screen projection parameters, initializes the video decoder according to the parameters, and after the video decoder is initialized, sends a screen projection request to the second source-end video redirector. If the screen projection request is sent to the first destination-end device connected by the first channel, the source-end device creates a video encoder, sends the configuration frame, I frame, P frame and rotation frame generated by the video encoder to the first source-end video redirector, and synchronously reports the configuration frame and the rotation frame to the redirection context. Further, the source-end device sends a video data stream to the first destination-end video redirector through the first source-end video redirector. If the screen projection request is sent to the second destination-end device connected by the second channel, the second source-end video redirector directly obtains the configuration frame and the rotation frame from the redirection context. Further, the source-end device sends a video data stream to the second destination-end video redirector through the second source-end video redirector. After receiving the video data stream, the second destination-end video redirector parses the video data stream through the video decoder and sends it for rendering.

在本申请实施例中,第一目的端设备与第二目标端设备并发接入时,第二目的端设备通过从重定向上下文中获取已经基于源端投屏参数与第一目的端投屏参数确定的目标投屏参数,进而初始化视频解码器,避免第一目的端设备与第二目的端设备并发接入时对共享数据的修改,提高显示画面的质量。In an embodiment of the present application, when the first destination device and the second destination device are concurrently connected, the second destination device obtains the target screen projection parameters that have been determined based on the source screen projection parameters and the first destination screen projection parameters from the redirection context, and then initializes the video decoder, thereby avoiding modification of shared data when the first destination device and the second destination device are concurrently connected, thereby improving the quality of the displayed image.

需要说明的是,上述实施例中以源端设备与目的端设备在重定向过程中的交互流程为例进行说明,其中,以源端设备为执行主体的步骤可以单独实现成为源端设备侧的重定向方法,以目的端设备为执行主体的步骤可以单独实现成为目的端设备侧的重定向方法,本申请实施例在此不作赘述。It should be noted that the above embodiments are described by taking the interaction process between the source device and the destination device during the redirection process as an example, wherein the steps with the source device as the execution subject can be independently implemented as a redirection method on the source device side, and the steps with the destination device as the execution subject can be independently implemented as a redirection method on the destination device side, which will not be elaborated in the embodiments of the present application.

下述为本申请装置实施例,可以用于执行本申请方法实施例。对于本申请装置实施例中未披露的细节,请参照本申请方法实施例。The following are device embodiments of the present application, which can be used to execute the method embodiments of the present application. For details not disclosed in the device embodiments of the present application, please refer to the method embodiments of the present application.

请参考图13,其示出了本申请一个实施例提供的重定向装置的结构框图。该装置可以包括:Please refer to Figure 13, which shows a structural block diagram of a redirection device provided by an embodiment of the present application. The device may include:

创建模块1301,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;A creation module 1301, configured to create a source redirection instance based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

复用模块1302,用于在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,所述目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到,所述目的端设备标识用于表征目的端设备,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;A multiplexing module 1302 is used to generate redirection data corresponding to the source redirection instance by a multiplexing redirection data generator when the same source redirection instance corresponds to at least two destination redirection instances, wherein the destination redirection instance is created based on a destination device identifier and a target screen identifier, wherein the destination device identifier is used to characterize the destination device, and the target screen identifier is used to characterize the target screen of the destination device;

第一传输模块1303,用于向所述目的端设备传输所述重定向数据,以便所述目的端设备基于所述重定向数据,通过所述目标屏幕对所述目标重定向对象进行展示。The first transmission module 1303 is used to transmit the redirection data to the target device, so that the target device displays the target redirection object through the target screen based on the redirection data.

可选地,所述第一传输模块1303,包括:Optionally, the first transmission module 1303 includes:

创建单元,用于在至少两个所述目的端重定向实例对应同一目的端设备的情况下,创建一个源端重定向器,或,在至少两个所述目的端重定向实例对应至少两个目的端设备的情况下,创建至少两个所述源端重定向器;a creating unit, configured to create a source-end redirector when at least two of the destination-end redirection instances correspond to the same destination-end device, or to create at least two of the source-end redirectors when at least two of the destination-end redirection instances correspond to at least two destination-end devices;

传输单元,用于通过所述源端重定向器与目的端重定向器之间的链路,向所述目的端设备传输所述重定向数据,所述目的端重定向器由所述目的端设备创建得到。A transmission unit is used to transmit the redirection data to the destination device through a link between the source redirector and the destination redirector, and the destination redirector is created by the destination device.

可选地,所述目的端设备为至少两个;Optionally, there are at least two destination devices;

所述传输单元,还用于:The transmission unit is further used for:

通过至少两个所述源端重定向器与至少两个所述目的端重定向器之间的至少两条链路,向至少两个所述目的端设备分流传输所述重定向数据。The redirection data is transmitted to at least two destination devices through at least two links between at least two source-end redirectors and at least two destination-end redirectors.

可选地,所述目标重定向对象对应的媒体类型为视频;Optionally, the media type corresponding to the target redirection object is video;

所述复用模块1302,还用于:The multiplexing module 1302 is further used for:

通过复用视频编码器对同一所述源端重定向实例对应的画面进行视频编码,生成视频数据流;Performing video encoding on the pictures corresponding to the same source end redirection instance by using a multiplexing video encoder to generate a video data stream;

所述传输单元,还用于:The transmission unit is further used for:

通过所述源端视频重定向器与目的端视频重定向器之间的链路,向所述目的端设备传输所述视频数据流。The video data stream is transmitted to the destination device through a link between the source video redirector and the destination video redirector.

可选地,至少两个所述目的端设备包括第一目的端设备和第二目的端设备;Optionally, the at least two destination devices include a first destination device and a second destination device;

所述传输单元,还用于:The transmission unit is further used for:

通过第一源端视频重定向器与第一目的端视频重定向器之间的链路,向所述第一目的端设备传输所述视频数据流;Transmitting the video data stream to the first destination device via a link between the first source-end video redirector and the first destination-end video redirector;

通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述视频数据流。The video data stream is transmitted to the second destination device via a link between the second source-end video redirector and the second destination-end video redirector.

可选地,所述第一目的端设备和所述第二目的端设备异步接入,且所述第一目的端设备在所述第二目的端设备之前接入;Optionally, the first destination device and the second destination device are accessed asynchronously, and the first destination device is accessed before the second destination device;

所述装置还包括:The device also includes:

第一获取模块,用于响应于所述第二目的端设备的投屏请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取配置帧,所述配置帧由所述视频编码器上报至所述重定向上下文;A first acquisition module, configured to respond to a screen projection request of the second destination device, and to acquire a configuration frame from a redirection context of the source redirection instance through the second source video redirector, wherein the configuration frame is reported by the video encoder to the redirection context;

第二传输模块,用于通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述配置帧,以便所述第二目的端设备基于所述配置帧进行视频解码配置。The second transmission module is used to transmit the configuration frame to the second destination device through the link between the second source video redirector and the second destination video redirector, so that the second destination device performs video decoding configuration based on the configuration frame.

可选地,所述传输单元,还用于:Optionally, the transmission unit is further used for:

以所述异步接入请求后的第一个关键帧为起点,通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述视频数据流。Taking the first key frame after the asynchronous access request as the starting point, the video data stream is transmitted to the second destination device through the link between the second source video redirector and the second destination video redirector.

可选地,所述装置还包括:Optionally, the device further comprises:

第二获取模块,用于响应于所述投屏请求,通过所述第二源端视频重定向器从所述重定向上下文中获取旋转帧,所述旋转帧由所述视频编码器在所述源端设备旋转时上报至所述重定向上下文;A second acquisition module, configured to obtain a rotated frame from the redirection context through the second source-end video redirector in response to the screen projection request, wherein the rotated frame is reported to the redirection context by the video encoder when the source-end device is rotated;

第三传输模块,用于通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述旋转帧,以便所述第二目的端设备基于所述旋转帧配置画面显示方向。The third transmission module is used to transmit the rotated frame to the second destination device through the link between the second source video redirector and the second destination video redirector, so that the second destination device configures the screen display direction based on the rotated frame.

可选地,所述第一目的端设备和所述第二目的端设备并发接入,且所述第一目的端设备为第一路接入,所述第二目的端设备为第二路接入;Optionally, the first destination device and the second destination device are accessed concurrently, and the first destination device is accessed via a first path, and the second destination device is accessed via a second path;

所述装置还包括:The device also includes:

第三获取模块,用于响应于所述第二目的端设备的接入请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取实例标识;A third acquisition module, configured to obtain, in response to an access request from the second destination device, an instance identifier from a redirection context of the source redirection instance through the second source video redirector;

第一发送模块,用于通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备发送所述实例标识;A first sending module, configured to send the instance identifier to the second destination device through a link between the second source-end video redirector and the second destination-end video redirector;

第四获取模块,用于响应于所述第二目的端设备的参数获取请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取目标投屏参数,所述目标投屏参数由所述第一源端视频重定向器基于源端投屏参数和所述第一目的端设备的目的端投屏参数确定,并上报至所述重定向上下文;a fourth acquisition module, configured to respond to a parameter acquisition request of the second destination device, and to obtain target screen projection parameters from a redirection context of the source redirection instance through the second source video redirector, wherein the target screen projection parameters are determined by the first source video redirector based on the source screen projection parameters and the destination screen projection parameters of the first destination device, and reported to the redirection context;

第二发送模块,用于通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备发送所述目标投屏参数。The second sending module is used to send the target screen projection parameters to the second destination device through the link between the second source video redirector and the second destination video redirector.

可选地,所述目标重定向对象对应的媒体类型为音频;Optionally, the media type corresponding to the target redirection object is audio;

复用模块1302,还用于:The multiplexing module 1302 is further used for:

在所述目标重定向对象的类型为屏幕镜像的情况下,通过复用设备级音频采集编码器进行音频采集及编码,得到音频数据流;When the type of the target redirection object is screen mirroring, audio acquisition and encoding are performed by multiplexing a device-level audio acquisition encoder to obtain an audio data stream;

在所述目标重定向对象的类型为应用的情况下,通过复用应用级音频采集编码器进行音频采集及编码,得到音频数据流;When the type of the target redirection object is an application, audio acquisition and encoding are performed by multiplexing an application-level audio acquisition encoder to obtain an audio data stream;

所述传输单元,还用于:The transmission unit is further used for:

通过所述源端音频重定向器与目的端音频重定向器之间的链路,向所述目的端设备传输所述音频数据流。The audio data stream is transmitted to the destination device via a link between the source audio redirector and the destination audio redirector.

综上所述,在本申请实施例中,重定向过程中,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目的端设备基于目的端设备标识以及目标屏幕标识,创建与源端重定向实例对应的目的端重定向实例,在同一源端重定向实例对应至少两个目的端重实例的情况下,源端设备通过复用重定向数据生成器生成重定向数据并向目的端设备传输,目的端设备接收到该重定向器数据,通过复用重定向数据解析器解析重定向数据,并通过目的端重定向实例所指示的目标屏幕对目标重定向对象进行展示;采用本申请实施例提供的方案,通过复用重定向数据生成器以及重定向数据解析器,减少了源端设备与目的端设备间数据流传输过程中源端设备的编码开销以及目的端设备的解码开销,提高复杂重定向场景的数据传输性能。To summarize, in an embodiment of the present application, during the redirection process, the source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, and the destination device creates a destination redirection instance corresponding to the source redirection instance based on the destination device identifier and the target screen identifier. When the same source redirection instance corresponds to at least two destination instances, the source device generates redirection data through a multiplexing redirection data generator and transmits it to the destination device. The destination device receives the redirector data, parses the redirection data through a multiplexing redirection data parser, and displays the target redirection object through the target screen indicated by the destination redirection instance. By adopting the solution provided in the embodiment of the present application, the encoding overhead of the source device and the decoding overhead of the destination device during the data stream transmission between the source device and the destination device are reduced by multiplexing the redirection data generator and the redirection data parser, thereby improving the data transmission performance in complex redirection scenarios.

请参考图14,其示出了本申请另一个实施例提供的重定向装置的结构框图。该装置可以包括:Please refer to FIG14, which shows a structural block diagram of a redirection device provided by another embodiment of the present application. The device may include:

创建模块1401,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;A creation module 1401 is used to create a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device;

第一接收模块1402,用于接收源端设备传输的源端重定向实例对应的重定向数据,所述源端重定向实例基于源端设备标识以及目标重定向对象标识创建得到,所述目标重定向对象标识用于表征目标重定向对象;A first receiving module 1402 is configured to receive redirection data corresponding to a source redirection instance transmitted by a source device, wherein the source redirection instance is created based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object;

复用模块1403,用于在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;A multiplexing module 1403, configured to parse the redirection data by using a multiplexing redirection data parser when at least two destination redirection instances correspond to the same source redirection instance;

展示模块1404,用于基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。The display module 1404 is used to display the target redirection object through the target screen based on the parsing result of the redirection data.

可选地,所述第一接收模块1402,包括:Optionally, the first receiving module 1402 includes:

创建单元,用于创建目的端重定向器,所述目的端重定向器被至少两个所述目的端重定向实例复用;A creating unit, configured to create a destination redirector, wherein the destination redirector is multiplexed by at least two destination redirection instances;

接收单元,用于通过所述目的端重定向器与源端重定向器之间的链路,接收所述源端设备传输的所述重定向数据,所述源端重定向器由所述源端设备创建得到。The receiving unit is used to receive the redirection data transmitted by the source-end device through a link between the destination-end redirector and the source-end redirector, wherein the source-end redirector is created by the source-end device.

可选地,所述目标重定向对象对应的媒体类型为视频;Optionally, the media type corresponding to the target redirection object is video;

所述创建单元,还用于:The creation unit is further used for:

创建目的端视频重定向器;Create a destination video redirector;

所述接收单元,还用于:The receiving unit is further used for:

通过所述目的端视频重定向器与源端视频重定向器之间的链路,接收所述源端设备传输的视频数据流;Receiving the video data stream transmitted by the source device through the link between the destination video redirector and the source video redirector;

所述复用模块1403,还用于:The multiplexing module 1403 is further used for:

通过复用视频解码器对所述视频数据流进行视频解码,得到所述源端重定向实例对应的画面。The video data stream is decoded by a multiplexing video decoder to obtain a picture corresponding to the source end redirection instance.

可选地,所述装置还包括:Optionally, the device further comprises:

第一发送模块,用于通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送投屏请求;A first sending module, configured to send a screen projection request to the source device through a link between the destination video redirector and the source video redirector;

第二接收模块,用于接收所述源端设备传输的配置帧,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述配置帧由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;A second receiving module is used to receive a configuration frame transmitted by the source device, wherein, in the case where other destination devices are connected before the destination device, the configuration frame is obtained by the source video redirector from the redirection context of the source redirection instance;

第一配置模块,用于基于所述配置帧进行视频解码配置。The first configuration module is used to perform video decoding configuration based on the configuration frame.

可选地,所述装置还包括:Optionally, the device further comprises:

第三接收模块,用于接收所述源端设备传输的旋转帧,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述旋转帧由所述源端视频重定向器从所述重定向上下文中获取得到,且所述旋转帧由所述视频编码器在所述源端设备旋转时上报至所述重定向上下文;a third receiving module, configured to receive a rotated frame transmitted by the source device, wherein, in the case where other destination devices are connected before the destination device, the rotated frame is obtained by the source video redirector from the redirection context, and the rotated frame is reported to the redirection context by the video encoder when the source device is rotated;

第二配置模块,用于基于所述旋转帧配置画面显示方向。The second configuration module is used to configure the picture display direction based on the rotation frame.

可选地,所述装置还包括:Optionally, the device further comprises:

第二发送模块,用于通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送接入请求;A second sending module, used for sending an access request to the source device through a link between the destination video redirector and the source video redirector;

第四接收模块,用于接收所述源端设备发送的所述源端重定向实例的实例标识,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述实例标识由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;a fourth receiving module, configured to receive an instance identifier of the source redirection instance sent by the source device, wherein, in the case where other destination devices are connected before the destination device, the instance identifier is obtained by the source video redirector from the redirection context of the source redirection instance;

第三发送模块,用于通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送参数获取请求;A third sending module, configured to send a parameter acquisition request to the source device through a link between the destination video redirector and the source video redirector;

第五接收模块,用于接收所述源端设备发送的目标投屏参数,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述目标投屏参数由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;a fifth receiving module, configured to receive target screen projection parameters sent by the source-end device, wherein, in the case where other destination-end devices are connected before the destination-end device, the target screen projection parameters are obtained by the source-end video redirector from the redirection context of the source-end redirection instance;

初始化模块,用于基于所述目标投屏参数初始化所述视频解码器。An initialization module is used to initialize the video decoder based on the target screen projection parameters.

可选地,所述目标重定向对象对应的媒体类型为音频;Optionally, the media type corresponding to the target redirection object is audio;

所述创建单元,还用于:The creation unit is further used for:

创建目的端音频重定向器;Create a destination audio redirector;

所述接收单元,还用于:The receiving unit is further used for:

通过所述目的端视频重定向器与源端视频重定向器之间的链路,接收所述源端设备传输的音频数据流;Receiving the audio data stream transmitted by the source device through the link between the destination video redirector and the source video redirector;

所述复用模块1403,用于:The multiplexing module 1403 is used to:

通过复用音频解码器对所述音频数据流进行音频解码,得到所述源端重定向实例对应的音频。The audio data stream is decoded by a multiplexing audio decoder to obtain audio corresponding to the source end redirection instance.

综上所述,在本申请实施例中,重定向过程中,源端设备基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目的端设备基于目的端设备标识以及目标屏幕标识,创建与源端重定向实例对应的目的端重定向实例,在同一源端重定向实例对应至少两个目的端重实例的情况下,源端设备通过复用重定向数据生成器生成重定向数据并向目的端设备传输,目的端设备接收到该重定向器数据,通过复用重定向数据解析器解析重定向数据,并通过目的端重定向实例所指示的目标屏幕对目标重定向对象进行展示;采用本申请实施例提供的方案,通过复用重定向数据生成器以及重定向数据解析器,减少了源端设备与目的端设备间数据流传输过程中源端设备的编码开销以及目的端设备的解码开销,提高复杂重定向场景的数据传输性能。To summarize, in an embodiment of the present application, during the redirection process, the source device creates a source redirection instance based on the source device identifier and the target redirection object identifier, and the destination device creates a destination redirection instance corresponding to the source redirection instance based on the destination device identifier and the target screen identifier. When the same source redirection instance corresponds to at least two destination instances, the source device generates redirection data through a multiplexing redirection data generator and transmits it to the destination device. The destination device receives the redirector data, parses the redirection data through a multiplexing redirection data parser, and displays the target redirection object through the target screen indicated by the destination redirection instance. By adopting the solution provided in the embodiment of the present application, the encoding overhead of the source device and the decoding overhead of the destination device during the data stream transmission between the source device and the destination device are reduced by multiplexing the redirection data generator and the redirection data parser, thereby improving the data transmission performance in complex redirection scenarios.

请参考图15,其示出了本申请一个实施例提供的重定向系统的系统架构框图。该系统中包括:至少一个源端设备1510和至少一个目的端设备1520。Please refer to FIG15 , which shows a system architecture block diagram of a redirection system provided by an embodiment of the present application. The system includes: at least one source device 1510 and at least one destination device 1520 .

源端设备1510,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,目标重定向对象标识用于表征目标重定向对象;在同一源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成源端重定向实例对应的重定向数据;向目的端设备传输重定向数据,以便目的端设备基于重定向数据,通过目标屏幕对目标重定向对象进行展示;The source device 1510 is configured to create a source redirection instance based on a source device identifier and a target redirection object identifier, where the target redirection object identifier is used to represent a target redirection object; when the same source redirection instance corresponds to at least two target redirection instances, generate redirection data corresponding to the source redirection instance by using a multiplexing redirection data generator; and transmit the redirection data to the target device so that the target device displays the target redirection object on a target screen based on the redirection data.

目的端设备1520,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,目标屏幕标识用于表征目的端设备的目标屏幕;接收源端设备传输的源端重定向实例对应的重定向数据;在存在至少两个目的端重定向实例对应同一源端重定向实例的情况下,通过复用重定向数据解析器解析重定向数据;基于重定向数据的解析结果,通过目标屏幕对目标重定向对象进行展示。The destination device 1520 is used to create a destination redirection instance based on the destination device identifier and the target screen identifier, where the target screen identifier is used to represent the target screen of the destination device; receive redirection data corresponding to the source redirection instance transmitted by the source device; when there are at least two destination redirection instances corresponding to the same source redirection instance, parse the redirection data by a multiplexing redirection data parser; and display the target redirection object through the target screen based on the parsed result of the redirection data.

需要说明的是,源端设备1510与目的端设备1520进行重定向的具体过程可以参见上述方法实施例,本申请实施例在此不作赘述。It should be noted that the specific process of redirection between the source device 1510 and the destination device 1520 can be found in the above method embodiment, and the embodiment of the present application will not be repeated here.

请参考图16,其示出了本申请一个示例性实施例提供的计算机设备的结构方框图。该计算机设备1600可以实现成为上述各个实施例中的源端设备或目的端设备。计算机设备1600可以包括一个或多个如下部件:处理器1610和存储器1620。Please refer to Figure 16, which shows a block diagram of a computer device provided by an exemplary embodiment of the present application. The computer device 1600 can be implemented as a source device or a destination device in the above-mentioned embodiments. The computer device 1600 may include one or more of the following components: a processor 1610 and a memory 1620.

处理器1610可以包括一个或者多个处理核心。处理器1610利用各种接口和线路连接整个计算机设备1600内的各个部分,通过运行或执行存储在存储器1620内的指令、程序、代码集或指令集,以及调用存储在存储器1620内的数据,执行计算机设备1600的各种功能和处理数据。可选地,处理器1610可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器1610可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network Processing Unit,NPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责触摸显示屏所需要显示的内容的渲染和绘制;NPU用于实现人工智能(Artificial Intelligence,AI)功能;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器1610中,单独通过一块芯片进行实现。The processor 1610 may include one or more processing cores. The processor 1610 uses various interfaces and lines to connect the various parts of the entire computer device 1600, and executes various functions and processes data of the computer device 1600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 1620, and calling data stored in the memory 1620. Optionally, the processor 1610 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 1610 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a neural network processor (NPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the touch display; the NPU is used to implement artificial intelligence (AI) functions; and the modem is used to process wireless communications. It is understandable that the above-mentioned modem may not be integrated into the processor 1610, but may be implemented by a separate chip.

存储器1620可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory,ROM)。可选地,该存储器1620包括非瞬时性计算机可读介质(non-transitory computer-readable storage medium)。存储器1620可用于存储指令、程序、代码、代码集或指令集。存储器1620可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等;存储数据区可存储根据计算机设备1600的使用所创建的数据(比如音频数据、电话本)等。The memory 1620 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 1620 includes a non-transitory computer-readable storage medium. The memory 1620 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1620 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.; the data storage area may store data (such as audio data, a phone book), etc., created according to the use of the computer device 1600.

除此之外,本领域技术人员可以理解,上述附图所示出的计算机设备1600的结构并不构成对计算机设备的限定,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。比如,计算机设备1600中还包括显示屏、摄像组件、麦克风、扬声器、射频电路、输入单元、传感器(比如加速度传感器、角速度传感器、光线传感器等等)、音频电路、WiFi模块、电源、蓝牙模块等部件,在此不再赘述。In addition, those skilled in the art can understand that the structure of the computer device 1600 shown in the above drawings does not constitute a limitation on the computer device, and the computer device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. For example, the computer device 1600 also includes a display screen, a camera assembly, a microphone, a speaker, a radio frequency circuit, an input unit, a sensor (such as an acceleration sensor, an angular velocity sensor, a light sensor, etc.), an audio circuit, a WiFi module, a power supply, a Bluetooth module and other components, which will not be described in detail here.

本申请实施例还提供了一种计算机可读存储介质,该计算机可读存储介质存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如上各个实施例所述的重定向方法。An embodiment of the present application further provides a computer-readable storage medium, which stores at least one program code, and the program code is loaded and executed by a processor to implement the redirection method described in the above embodiments.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述方面的各种可选实现方式中提供的重定向方法。The embodiment of the present application provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the redirection method provided in various optional implementations of the above aspects.

应当理解的是,在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。另外,本文中描述的步骤编号,仅示例性示出了步骤间的一种可能的执行先后顺序,在一些其它实施例中,上述步骤也可以不按照编号顺序来执行,如两个不同编号的步骤同时执行,或者两个不同编号的步骤按照与图示相反的顺序执行,本申请实施例对此不作限定。It should be understood that the "multiple" mentioned in this article refers to two or more than two. "And/or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and/or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the previous and subsequent associated objects are in an "or" relationship. In addition, the step numbers described in this article only illustrate a possible execution sequence between the steps. In some other embodiments, the above steps may not be executed in the order of the numbers, such as two steps with different numbers are executed at the same time, or two steps with different numbers are executed in the opposite order to the diagram. The embodiments of the present application are not limited to this.

以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims (23)

1.一种重定向方法,其特征在于,所述方法用于源端设备,所述方法包括:1. A redirection method, characterized in that the method is used for a source device, and the method comprises: 基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;Creating a source redirection instance based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object; 在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,所述目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到,所述目的端设备标识用于表征目的端设备,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;In the case where the same source redirection instance corresponds to at least two destination redirection instances, the redirection data corresponding to the source redirection instance is generated by a multiplexing redirection data generator, and the destination redirection instance is created based on a destination device identifier and a target screen identifier, wherein the destination device identifier is used to characterize the destination device, and the target screen identifier is used to characterize the target screen of the destination device; 向所述目的端设备传输所述重定向数据,以便所述目的端设备通过复用重定向数据解析器解析所述重定向数据,并且通过所述目标屏幕对所述目标重定向对象进行展示。The redirection data is transmitted to the target device, so that the target device parses the redirection data through a multiplexing redirection data parser and displays the target redirection object through the target screen. 2.根据权利要求1所述的方法,其特征在于,所述向所述目的端设备传输所述重定向数据,包括:2. The method according to claim 1, wherein transmitting the redirection data to the destination device comprises: 在至少两个所述目的端重定向实例对应同一目的端设备的情况下,创建一个源端重定向器,或,在至少两个所述目的端重定向实例对应至少两个目的端设备的情况下,创建至少两个所述源端重定向器;In the case where at least two of the destination redirection instances correspond to the same destination device, creating a source redirector, or, in the case where at least two of the destination redirection instances correspond to at least two destination devices, creating at least two of the source redirectors; 通过所述源端重定向器与目的端重定向器之间的链路,向所述目的端设备传输所述重定向数据,所述目的端重定向器由所述目的端设备创建得到。The redirection data is transmitted to the destination device via a link between the source redirector and the destination redirector, and the destination redirector is created by the destination device. 3.根据权利要求2所述的方法,其特征在于,所述目的端设备为至少两个;3. The method according to claim 2, characterized in that there are at least two destination devices; 所述通过所述源端重定向器与目的端重定向器之间的链路,向所述目的端设备传输所述重定向数据,包括:The transmitting the redirection data to the destination device through the link between the source redirector and the destination redirector comprises: 通过至少两个所述源端重定向器与至少两个所述目的端重定向器之间的至少两条链路,向至少两个所述目的端设备分流传输所述重定向数据。The redirection data is transmitted to at least two destination devices through at least two links between at least two source-end redirectors and at least two destination-end redirectors. 4.根据权利要求2所述的方法,其特征在于,所述目标重定向对象对应的媒体类型为视频;4. The method according to claim 2, characterized in that the media type corresponding to the target redirection object is video; 所述通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,包括:The step of generating the redirection data corresponding to the source end redirection instance by multiplexing the redirection data generator includes: 通过复用视频编码器对同一所述源端重定向实例对应的画面进行视频编码,生成视频数据流;Performing video encoding on the pictures corresponding to the same source end redirection instance by using a multiplexing video encoder to generate a video data stream; 所述通过所述源端重定向器与目的端重定向器之间的链路,向所述目的端设备传输所述重定向数据,包括:The transmitting the redirection data to the destination device through the link between the source redirector and the destination redirector comprises: 通过所述源端视频重定向器与目的端视频重定向器之间的链路,向所述目的端设备传输所述视频数据流。The video data stream is transmitted to the destination device through a link between the source video redirector and the destination video redirector. 5.根据权利要求4所述的方法,其特征在于,至少两个所述目的端设备包括第一目的端设备和第二目的端设备;5. The method according to claim 4, characterized in that the at least two destination devices include a first destination device and a second destination device; 所述通过所述源端视频重定向器与目的端视频重定向器之间的链路,向所述目的端设备传输所述视频数据流,包括:The transmitting the video data stream to the destination device through a link between the source video redirector and the destination video redirector comprises: 通过第一源端视频重定向器与第一目的端视频重定向器之间的链路,向所述第一目的端设备传输所述视频数据流;Transmitting the video data stream to the first destination device via a link between the first source-end video redirector and the first destination-end video redirector; 通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述视频数据流。The video data stream is transmitted to the second destination device via a link between the second source-end video redirector and the second destination-end video redirector. 6.根据权利要求5所述的方法,其特征在于,所述第一目的端设备和所述第二目的端设备异步接入,且所述第一目的端设备在所述第二目的端设备之前接入;6. The method according to claim 5, characterized in that the first destination device and the second destination device are accessed asynchronously, and the first destination device is accessed before the second destination device; 所述方法还包括:The method further comprises: 响应于所述第二目的端设备的投屏请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取配置帧,所述配置帧由所述视频编码器上报至所述重定向上下文;In response to the screen projection request of the second destination device, obtaining a configuration frame from the redirection context of the source redirection instance through the second source video redirector, and the configuration frame is reported to the redirection context by the video encoder; 通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述配置帧,以便所述第二目的端设备基于所述配置帧进行视频解码配置。The configuration frame is transmitted to the second destination device through a link between the second source-end video redirector and the second destination-end video redirector, so that the second destination device performs video decoding configuration based on the configuration frame. 7.根据权利要求6所述的方法,其特征在于,所述通过第二源端视频重定向器与第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述视频数据流,包括:7. The method according to claim 6, wherein the transmitting the video data stream to the second destination device through a link between the second source video redirector and the second destination video redirector comprises: 以异步接入请求后的第一个关键帧为起点,通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述视频数据流。Taking the first key frame after the asynchronous access request as the starting point, the video data stream is transmitted to the second destination device through the link between the second source video redirector and the second destination video redirector. 8.根据权利要求6所述的方法,其特征在于,所述方法还包括:8. The method according to claim 6, characterized in that the method further comprises: 响应于所述投屏请求,通过所述第二源端视频重定向器从所述重定向上下文中获取旋转帧,所述旋转帧由所述视频编码器在所述源端设备旋转时上报至所述重定向上下文;In response to the screen projection request, obtaining a rotated frame from the redirection context through the second source-end video redirector, wherein the rotated frame is reported to the redirection context by the video encoder when the source-end device is rotated; 通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备传输所述旋转帧,以便所述第二目的端设备基于所述旋转帧配置画面显示方向。The rotated frame is transmitted to the second destination device via a link between the second source-end video redirector and the second destination-end video redirector, so that the second destination device configures a screen display direction based on the rotated frame. 9.根据权利要求5所述的方法,其特征在于,所述第一目的端设备和所述第二目的端设备并发接入,且所述第一目的端设备为第一路接入,所述第二目的端设备为第二路接入;9. The method according to claim 5, characterized in that the first destination device and the second destination device are accessed concurrently, and the first destination device is accessed by a first path, and the second destination device is accessed by a second path; 所述方法还包括:The method further comprises: 响应于所述第二目的端设备的接入请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取实例标识;In response to the access request of the second destination device, obtaining, by the second source-end video redirector, an instance identifier from a redirection context of the source-end redirection instance; 通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备发送所述实例标识;Sending the instance identifier to the second destination device via a link between the second source-end video redirector and the second destination-end video redirector; 响应于所述第二目的端设备的参数获取请求,通过所述第二源端视频重定向器从所述源端重定向实例的重定向上下文中获取目标投屏参数,所述目标投屏参数由所述第一源端视频重定向器基于源端投屏参数和所述第一目的端设备的目的端投屏参数确定,并上报至所述重定向上下文;In response to a parameter acquisition request of the second destination device, the target screen projection parameters are acquired from the redirection context of the source redirection instance by the second source video redirector, and the target screen projection parameters are determined by the first source video redirector based on the source screen projection parameters and the destination screen projection parameters of the first destination device, and reported to the redirection context; 通过所述第二源端视频重定向器与所述第二目的端视频重定向器之间的链路,向所述第二目的端设备发送所述目标投屏参数。The target screen projection parameters are sent to the second destination device through the link between the second source video redirector and the second destination video redirector. 10.根据权利要求2所述的方法,其特征在于,所述目标重定向对象对应的媒体类型为音频;10. The method according to claim 2, characterized in that the media type corresponding to the target redirection object is audio; 所述通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,包括:The step of generating the redirection data corresponding to the source end redirection instance by multiplexing the redirection data generator includes: 在所述目标重定向对象的类型为屏幕镜像的情况下,通过复用设备级音频采集编码器进行音频采集及编码,得到音频数据流;When the type of the target redirection object is screen mirroring, audio acquisition and encoding are performed by multiplexing a device-level audio acquisition encoder to obtain an audio data stream; 在所述目标重定向对象的类型为应用的情况下,通过复用应用级音频采集编码器进行音频采集及编码,得到音频数据流;When the type of the target redirection object is an application, audio acquisition and encoding are performed by multiplexing an application-level audio acquisition encoder to obtain an audio data stream; 所述通过所述源端重定向器与目的端重定向器之间的链路,向所述目的端设备传输所述重定向数据,包括:The transmitting the redirection data to the destination device through the link between the source redirector and the destination redirector comprises: 通过所述源端音频重定向器与目的端音频重定向器之间的链路,向所述目的端设备传输所述音频数据流。The audio data stream is transmitted to the destination device via a link between the source audio redirector and the destination audio redirector. 11.一种重定向方法,其特征在于,所述方法用于目的端设备,所述方法包括:11. A redirection method, characterized in that the method is used for a destination device, and the method comprises: 基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;Creating a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device; 接收源端设备传输的源端重定向实例对应的重定向数据,所述源端重定向实例基于源端设备标识以及目标重定向对象标识创建得到,所述目标重定向对象标识用于表征目标重定向对象;Receiving redirection data corresponding to a source redirection instance transmitted by a source device, wherein the source redirection instance is created based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object; 在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;In the case that there are at least two destination redirection instances corresponding to the same source redirection instance, parsing the redirection data by using a multiplexing redirection data parser; 基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。Based on the parsing result of the redirection data, the target redirection object is displayed through the target screen. 12.根据权利要求11所述的方法,其特征在于,所述接收源端设备传输的源端重定向实例对应的重定向数据,包括:12. The method according to claim 11, characterized in that the receiving of redirection data corresponding to the source redirection instance transmitted by the source device comprises: 创建目的端重定向器,所述目的端重定向器被至少两个所述目的端重定向实例复用;Creating a destination redirector, where the destination redirector is multiplexed by at least two of the destination redirection instances; 通过所述目的端重定向器与源端重定向器之间的链路,接收所述源端设备传输的所述重定向数据,所述源端重定向器由所述源端设备创建得到。The redirection data transmitted by the source-end device is received through a link between the destination-end redirector and the source-end redirector, and the source-end redirector is created by the source-end device. 13.根据权利要求12所述的方法,其特征在于,所述目标重定向对象对应的媒体类型为视频;13. The method according to claim 12, characterized in that the media type corresponding to the target redirection object is video; 所述创建目的端重定向器,包括:The step of creating a destination redirector includes: 创建目的端视频重定向器;Create a destination video redirector; 所述通过所述目的端重定向器与源端重定向器之间的链路,接收所述源端设备传输的所述重定向数据,包括:The receiving the redirection data transmitted by the source-end device through a link between the destination-end redirector and the source-end redirector comprises: 通过所述目的端视频重定向器与源端视频重定向器之间的链路,接收所述源端设备传输的视频数据流;Receiving the video data stream transmitted by the source device through the link between the destination video redirector and the source video redirector; 所述通过复用重定向数据解析器解析所述重定向数据,包括:The step of parsing the redirection data by multiplexing the redirection data parser comprises: 通过复用视频解码器对所述视频数据流进行视频解码,得到所述源端重定向实例对应的画面。The video data stream is decoded by a multiplexing video decoder to obtain a picture corresponding to the source end redirection instance. 14.根据权利要求13所述的方法,其特征在于,所述接收所述源端设备传输的视频数据流之前,所述方法还包括:14. The method according to claim 13, characterized in that before receiving the video data stream transmitted by the source device, the method further comprises: 通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送投屏请求;Sending a screen projection request to the source device through a link between the destination video redirector and the source video redirector; 接收所述源端设备传输的配置帧,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述配置帧由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;Receiving a configuration frame transmitted by the source device, wherein, in the case where other destination devices are connected before the destination device, the configuration frame is obtained by the source video redirector from the redirection context of the source redirection instance; 基于所述配置帧进行视频解码配置。Video decoding configuration is performed based on the configuration frame. 15.根据权利要求14所述的方法,其特征在于,所述方法还包括:15. The method according to claim 14, characterized in that the method further comprises: 接收所述源端设备传输的旋转帧,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述旋转帧由所述源端视频重定向器从所述重定向上下文中获取得到,且所述旋转帧由视频编码器在所述源端设备旋转时上报至所述重定向上下文;Receiving a rotated frame transmitted by the source device, wherein, in the case where there is another destination device connected before the destination device, the rotated frame is obtained by the source video redirector from the redirection context, and the rotated frame is reported to the redirection context by the video encoder when the source device is rotated; 基于所述旋转帧配置画面显示方向。The screen display direction is configured based on the rotation frame. 16.根据权利要求13所述的方法,其特征在于,所述方法还包括:16. The method according to claim 13, characterized in that the method further comprises: 通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送接入请求;Sending an access request to the source device via a link between the destination video redirector and the source video redirector; 接收所述源端设备发送的所述源端重定向实例的实例标识,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述实例标识由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;Receiving an instance identifier of the source redirection instance sent by the source device, wherein, in the case where other destination devices are connected before the destination device, the instance identifier is obtained by the source video redirector from the redirection context of the source redirection instance; 通过所述目的端视频重定向器与源端视频重定向器之间的链路,向所述源端设备发送参数获取请求;Sending a parameter acquisition request to the source device through a link between the destination video redirector and the source video redirector; 接收所述源端设备发送的目标投屏参数,其中,在所述目的端设备之前存在其他目的端设备接入的情况下,所述目标投屏参数由所述源端视频重定向器从所述源端重定向实例的重定向上下文中获取得到;Receiving target screen projection parameters sent by the source device, wherein, in the case where other target devices are connected before the target device, the target screen projection parameters are obtained by the source video redirector from the redirection context of the source redirection instance; 基于所述目标投屏参数初始化所述视频解码器。Initialize the video decoder based on the target screen projection parameters. 17.根据权利要求12所述的方法,其特征在于,所述目标重定向对象对应的媒体类型为音频;17. The method according to claim 12, characterized in that the media type corresponding to the target redirection object is audio; 所述创建目的端重定向器,包括:The step of creating a destination redirector includes: 创建目的端音频重定向器;Create a destination audio redirector; 所述通过所述目的端重定向器与源端重定向器之间的链路,接收所述源端设备传输的所述重定向数据,包括:The receiving the redirection data transmitted by the source-end device through a link between the destination-end redirector and the source-end redirector comprises: 通过所述目的端视频重定向器与源端视频重定向器之间的链路,接收所述源端设备传输的音频数据流;Receiving the audio data stream transmitted by the source device through the link between the destination video redirector and the source video redirector; 所述通过复用重定向数据解析器解析所述重定向数据,包括:The step of parsing the redirection data by multiplexing the redirection data parser comprises: 通过复用音频解码器对所述音频数据流进行音频解码,得到所述源端重定向实例对应的音频。The audio data stream is decoded by a multiplexing audio decoder to obtain audio corresponding to the source end redirection instance. 18.一种重定向装置,其特征在于,所述装置用于源端设备,所述装置包括:18. A redirection device, characterized in that the device is used for a source device, and the device comprises: 创建模块,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;A creation module, used to create a source redirection instance based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object; 复用模块,用于在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据,所述目的端重定向实例基于目的端设备标识以及目标屏幕标识创建得到,所述目的端设备标识用于表征目的端设备,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;a multiplexing module, configured to generate redirection data corresponding to the source redirection instance by a multiplexing redirection data generator when the same source redirection instance corresponds to at least two destination redirection instances, wherein the destination redirection instance is created based on a destination device identifier and a target screen identifier, wherein the destination device identifier is used to characterize the destination device, and the target screen identifier is used to characterize the target screen of the destination device; 第一传输模块,用于向所述目的端设备传输所述重定向数据,以便所述目的端设备通过复用重定向数据解析器解析所述重定向数据,并且通过所述目标屏幕对所述目标重定向对象进行展示。The first transmission module is used to transmit the redirection data to the target device, so that the target device parses the redirection data through a multiplexing redirection data parser and displays the target redirection object through the target screen. 19.一种重定向装置,其特征在于,所述装置用于目的端设备,所述装置包括:19. A redirection device, characterized in that the device is used for a destination device, and the device comprises: 创建模块,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;A creation module, used to create a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device; 第一接收模块,用于接收源端设备传输的源端重定向实例对应的重定向数据,所述源端重定向实例基于源端设备标识以及目标重定向对象标识创建得到,所述目标重定向对象标识用于表征目标重定向对象;A first receiving module, configured to receive redirection data corresponding to a source redirection instance transmitted by a source device, wherein the source redirection instance is created based on a source device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to represent a target redirection object; 复用模块,用于在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;a multiplexing module, configured to parse the redirection data by a multiplexing redirection data parser when at least two destination redirection instances correspond to the same source redirection instance; 展示模块,用于基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。A display module is used to display the target redirection object through the target screen based on the parsing result of the redirection data. 20.一种重定向系统,其特征在于,所述重定向系统包括:至少一个源端设备和至少一个目的端设备;20. A redirection system, characterized in that the redirection system comprises: at least one source device and at least one destination device; 所述源端设备,用于基于源端设备标识以及目标重定向对象标识创建源端重定向实例,所述目标重定向对象标识用于表征目标重定向对象;在同一所述源端重定向实例对应至少两个目的端重定向实例的情况下,通过复用重定向数据生成器生成所述源端重定向实例对应的重定向数据;向目的端设备传输所述重定向数据,以便所述目的端设备通过复用重定向数据解析器解析所述重定向数据,并且通过目标屏幕对所述目标重定向对象进行展示;The source-end device is used to create a source-end redirection instance based on a source-end device identifier and a target redirection object identifier, wherein the target redirection object identifier is used to characterize a target redirection object; when the same source-end redirection instance corresponds to at least two target-end redirection instances, generate redirection data corresponding to the source-end redirection instance by a multiplexing redirection data generator; transmit the redirection data to a target-end device, so that the target-end device parses the redirection data by a multiplexing redirection data parser, and displays the target redirection object by a target screen; 所述目的端设备,用于基于目的端设备标识以及目标屏幕标识创建目的端重定向实例,所述目标屏幕标识用于表征所述目的端设备的目标屏幕;接收所述源端设备传输的所述源端重定向实例对应的重定向数据;在存在至少两个所述目的端重定向实例对应同一所述源端重定向实例的情况下,通过复用重定向数据解析器解析所述重定向数据;基于所述重定向数据的解析结果,通过所述目标屏幕对所述目标重定向对象进行展示。The destination device is used to create a destination redirection instance based on a destination device identifier and a target screen identifier, wherein the target screen identifier is used to represent a target screen of the destination device; receive redirection data corresponding to the source redirection instance transmitted by the source device; when there are at least two destination redirection instances corresponding to the same source redirection instance, parse the redirection data by a multiplexing redirection data parser; and based on the parsing result of the redirection data, display the target redirection object through the target screen. 21.一种计算机设备,其特征在于,所述计算机设备包括处理器和存储器;所述存储器存储有至少一条指令,所述至少一条指令用于被所述处理器执行以实现如权利要求1至10任一所述的重定向方法,或,实现如权利要求11至17任一所述的重定向方法。21. A computer device, characterized in that the computer device includes a processor and a memory; the memory stores at least one instruction, and the at least one instruction is used to be executed by the processor to implement the redirection method as described in any one of claims 1 to 10, or to implement the redirection method as described in any one of claims 11 to 17. 22.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有至少一条程序代码,所述程序代码由处理器加载并执行以实现如权利要求1至10任一所述的重定向方法,或,实现如权利要求11至17任一所述的重定向方法。22. A computer-readable storage medium, characterized in that at least one program code is stored in the computer-readable storage medium, and the program code is loaded and executed by a processor to implement the redirection method as described in any one of claims 1 to 10, or to implement the redirection method as described in any one of claims 11 to 17. 23.一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机指令,所述计算机指令存储在计算机可读存储介质中;计算机设备的处理器从所述计算机可读存储介质读取所述计算机指令,所述处理器执行所述计算机指令,使得所述计算机设备执行如权利要求1至10任一所述的重定向方法,或,如权利要求11至17任一所述的重定向方法。23. A computer program product, characterized in that the computer program product includes computer instructions, which are stored in a computer-readable storage medium; a processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the redirection method as described in any one of claims 1 to 10, or the redirection method as described in any one of claims 11 to 17.
CN202111461661.0A 2021-12-02 2021-12-02 Redirection method, device, apparatus, storage medium and program product Active CN114157903B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111461661.0A CN114157903B (en) 2021-12-02 2021-12-02 Redirection method, device, apparatus, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111461661.0A CN114157903B (en) 2021-12-02 2021-12-02 Redirection method, device, apparatus, storage medium and program product

Publications (2)

Publication Number Publication Date
CN114157903A CN114157903A (en) 2022-03-08
CN114157903B true CN114157903B (en) 2024-09-24

Family

ID=80456107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111461661.0A Active CN114157903B (en) 2021-12-02 2021-12-02 Redirection method, device, apparatus, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114157903B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979899B (en) * 2022-04-20 2024-11-29 Oppo广东移动通信有限公司 Audio redirection method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383803A (en) * 2020-11-16 2021-02-19 Oppo广东移动通信有限公司 Information processing method and related device
CN113329240A (en) * 2021-05-10 2021-08-31 西安万像电子科技有限公司 Screen projection method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109618220B (en) * 2018-12-25 2021-03-19 三星电子(中国)研发中心 Wireless screen projection method and wireless screen projection system
CN111324327B (en) * 2020-02-20 2022-03-25 华为技术有限公司 Screen projection method and terminal equipment
CN112653913A (en) * 2020-12-25 2021-04-13 深圳市网旭科技有限公司 Screen projection method and device, client device and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112383803A (en) * 2020-11-16 2021-02-19 Oppo广东移动通信有限公司 Information processing method and related device
CN113329240A (en) * 2021-05-10 2021-08-31 西安万像电子科技有限公司 Screen projection method and device

Also Published As

Publication number Publication date
CN114157903A (en) 2022-03-08

Similar Documents

Publication Publication Date Title
CN113992966B (en) Redirection method, device, apparatus, storage medium and program product
JP6427692B2 (en) Method and apparatus for providing multi-view streaming service
CN108932948B (en) Audio data processing method and device, computer equipment and computer readable storage medium
CN104685873B (en) Encoding controller and coding control method
US11128739B2 (en) Network-edge-deployed transcoding methods and systems for just-in-time transcoding of media data
JP2009284282A (en) Content server, information processing apparatus, network device, content distribution method, information processing method, and content distribution system
WO2021031739A1 (en) Cloud desktop video playback method, server, terminal, and storage medium
CN107770600A (en) Streaming media data transmission method, device, equipment and storage medium
CN115462078B (en) Video transmission method, device and system
US20240364623A1 (en) Method, apparatus, device, storage medium and program for data transmission
CN103856809A (en) Method, system and terminal equipment for multipoint at the same screen
CN113316013B (en) Video screen projection method and system
CN114554277B (en) Multimedia processing method, device, server and computer readable storage medium
CN114157903B (en) Redirection method, device, apparatus, storage medium and program product
WO2023216798A1 (en) Audio and video transcoding apparatus and method, and device, medium and product
WO2024060719A1 (en) Data transmission methods, apparatus, electronic device, and storage medium
US9838463B2 (en) System and method for encoding control commands
CN114339349A (en) Display device, data transmission method and storage medium
WO2025087083A1 (en) Video transmission method, video display method, and device
CN114189727B (en) Synchronous playing method, device, system, electronic equipment and readable storage medium
CN116456138A (en) Mirror image screen projection system and method
CN114979899A (en) Audio redirection method, device, equipment and storage medium
WO2016107174A1 (en) Method and system for processing multimedia file data, player and client
CN116266858A (en) Audio and video recording method, device, equipment and medium
CN112135163A (en) Method and device for starting video

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant