Disclosure of Invention
The invention aims to provide a combined split-screen projection method of a mobile terminal and a computer terminal, which is convenient to operate and high in driving operation safety, and the mobile terminal does not need to be frequently switched when the mobile terminal starts a plurality of applications for projecting screens.
In order to achieve the purpose, the combined split-screen projection method of the mobile terminal and the computer terminal comprises the following steps: s100, establishing an interconnection channel between a mobile terminal and a computer terminal, and starting a screen projection service by the mobile terminal; s200, acquiring display information of a mobile terminal and a computer terminal, and creating a virtual screen; the computer terminal transmits the resolution information of the display screen to the mobile phone through the interconnection channel; according to the resolution of a display screen of a computer terminal, creating a virtual screen in equal proportion to the resolution of the display screen of the mobile terminal, wherein the virtual screen displays an application interface started by the mobile terminal, and each started application on the mobile terminal corresponds to one virtual screen; s300, combining display interfaces to obtain virtual screen pictures, and combining the virtual screen pictures into an interface suitable for being displayed by a computer terminal; s400, encoding and transmitting, namely encoding the display picture of the virtual screen into a video stream, and transmitting the video stream to a computer terminal through an interconnection channel; s500, decoding and displaying the video, wherein the video decoder decodes the video stream and displays the video stream on the computer terminal.
Further, thestep 200 comprises the following steps: s210, determining the size of a virtual screen; s220 creates a virtual screen.
Further, in step S210, the determining the size of the virtual screen is: when the card width > card height, the virtual screen size is calculated as follows: virtualheight = carHeight; virtualWidth = phoneWidth car height/phonehight, and when car width is not greater than car height, the virtual screen size is calculated as follows: virtualWidth = carWidth/n; virtualHeight = phonehight/n/phoneWidth; wherein, phoneWidth is the width of the mobile terminal screen; phonehight is the height of the screen of the mobile terminal; the card width is the width of a computer terminal screen; carHeight is the height of a screen of the computer terminal; virtualWidth is the width of the virtual screen; virtualHeight is the virtual screen height; n is a positive integer.
Further, when the card width > card height, the combination method in step S300 is: and aligning and combining the virtual screen pictures from left to right according to the sequence of the application instant operation of the mobile terminal.
Further, when the carWidth is not greater than carHeight, step S210 specifically includes: when the number of applications started by the mobile terminal is less than 3, n =1 in a virtual screen size calculation formula; when the number of the applications started by the mobile terminal is larger than or equal to 3, n =2 in the virtual screen size calculation formula.
Further, when carWidth is not greater than carHeight, the combination method in step S300 is as follows: when the number of the applications started by the mobile terminal is less than 3, aligning the combined virtual screen pictures from top to bottom according to the sequence of the instant operation of the applications of the mobile terminal; when the number of the applications started by the mobile terminal is more than or equal to 3, sequentially aligning and combining the upper left, the upper right, the lower left and the lower right of the virtual screen picture according to the sequence of the immediate operation of the applications of the mobile terminal
Further, when the combined display interface is smaller than the screen area of the computer terminal, the vacant area is filled with black.
Further, when the combined display interface is larger than the screen area of the computer type terminal, the area beyond the screen of the computer type terminal is viewed by sliding leftwards or upwards.
Further, when the card width > card height, the area beyond the screen of the computer-like terminal is viewed by sliding to the left; when the carWidth is less than or equal to the carHeight, the area beyond the screen of the computer-class terminal is checked by sliding upwards.
Further, in step S200: calling a CreateVirtualDisplay interface by using an API in the android system to create a virtual screen; the virtual screen is created in the IOS system by using an API call [ [ UIWindow alloc ] initWithFrame [ [ UISCREENScreen ]. bound ] interface.
When the mobile terminal starts a plurality of applications, the invention creates a plurality of virtual screens to display the application interfaces started by the mobile terminal, and combines the interfaces of the virtual screens to the computer terminal for display. When the mobile terminal starts a plurality of applications to project screens and switches the applications, the mobile terminal does not need to be frequently switched, the operation is convenient, and the driving operation safety is improved.
Detailed Description
According to the combined split screen projection method of the mobile terminal and the computer terminal, when the mobile terminal starts a plurality of applications to project screens and switches the applications, the mobile terminal does not need to be frequently switched, the operation is convenient, and the driving operation safety is improved. The invention is described in further detail below with reference to the following figures and specific examples:
a combined split-screen projection method of a mobile terminal and a computer terminal comprises the following steps:
s100, establishing an interconnection channel between a mobile terminal and a computer terminal, and starting a screen projection service by the mobile terminal;
the interconnection mode is USB, Wifi or Bluetooth (BT)
S200, acquiring display information of a mobile terminal and a computer terminal, and creating a virtual screen;
the computer terminal transmits the resolution information of the display screen to the mobile phone through the interconnection channel; according to the resolution of a display screen of a computer terminal, creating a virtual screen in equal proportion to the resolution of the display screen of the mobile terminal, wherein the virtual screen displays an application interface started by the mobile terminal, and each started application on the mobile terminal corresponds to one virtual screen;
s300 Combined display interface
Acquiring virtual screen pictures, and combining the virtual screen pictures into an interface suitable for being displayed by a computer terminal;
s400 coded transmission
Encoding the picture data displayed by the virtual screen into a video stream, and transmitting the video stream to a computer terminal through an interconnection channel;
s500 video decoding display
The video decoder decodes the video stream and displays it on a computer-like terminal.
In the step S200: calling a CreateVirtualDisplay interface by using an API in the android system to create a virtual screen; the virtual screen is created in the IOS system using an API call [ [ UIWindow alloc ] initWithFrame [ [ UIScreen mainScreen ]. bound ] interface.
Referring to fig. 2, further, thestep 200 includes the following steps:
s210, determining the size of a virtual screen;
s220 creates a virtual screen.
Further, in step S210, the virtual screen size is determined as:
when the card width > card height, that is, when the computer class terminal is a landscape screen, the virtual screen size is calculated according to the following formula:
virtualHeigh= carHeight
virtualWidth = phoneWidth*carHeight/phoneHeight ;
when the carWidth is less than or equal to the carHeight, namely the computer terminal is a vertical screen, the size of the virtual screen is calculated according to the following formula:
virtualWidth= carWidth/n
virtualHeight = phoneHeight*carWidth/n/phoneWidth
wherein, phoneWidth is the width of the mobile phone screen; phonehight is the height of the mobile phone screen; the card width is the width of a computer terminal screen; carHeight is the height of a screen of the computer terminal; virtualWidth is the width of the virtual screen; virtualHeight is the virtual screen height; n is a positive integer. For example:
for example: when the computer-based terminal is a landscape screen, the width-high resolution is 1280-720, and the width-high resolution of the mobile terminal is 1080-1920, the virtual screen height virtualheight = carHeight = 720; virtual screen width virtualWidth = phonWidth _ car height/phonehight = 1080 × 720/1920 = 405, resolution ratio (width/height) of the virtual screen is that 405/720=0.5625 mobile phone end resolution ratio (width/height) is that 1080/1920=0.5625 virtual screen resolution is in equal proportion to mobile terminal display screen resolution, and the excess part of the virtual screen can be viewed in a sliding mode towards the left.
For example: 720 x 1280 resolution when the computer-like terminal is a vertical screen (width x height). When the resolution of the handset is 1080 (width) 1920, virtual screen height virtualHeight = phonehight/2/phonevidth = 1920/720/2/1080 = 640, and virtual screen width virtualWidth = carWidth/2=720/2= 360.
Resolution ratio (width/height) of virtual screen: (720/2)/640=0.5625
Handset side resolution ratio (width/height): 1080/1920=0.5625
The number of final interface displays is 2 x 2, and the excess part can be upwards slid and viewed.
As an embodiment of the present invention, when the card width > card height, that is, when the computer terminal is a landscape screen, that is, the computer terminal is a landscape screen, the combination method in step S300 is: and aligning and combining the virtual screen pictures from left to right according to the sequence of the application instant operation of the mobile terminal. As shown in fig. 3, when the combined display interface is smaller than the screen area of the computer-like terminal, the vacant area is filled with black. As shown in fig. 4, when the combined display interface is smaller than the screen area of the computer-like terminal, the area beyond the screen of the computer-like terminal is viewed by sliding to the left.
As a second embodiment of the present invention, when the card width is not greater than the card height, that is, when the computer terminal is a vertical screen, step S210 specifically includes:
when the number of applications opened by the mobile terminal is less than 3, n =1 in the virtual screen size calculation formula. As shown in fig. 5 to 7, when the mobile terminal starts 1 or 2 applications, n =1 in the virtual screen size calculation formula. At this time, the combination method in step S300 is: and when the number of the applications started by the mobile terminal is less than 3, aligning the combined virtual screen picture from top to bottom according to the sequence of the immediate operation of the applications of the mobile terminal.
When the number of the applications started by the mobile terminal is larger than or equal to 3, n =2 in the virtual screen size calculation formula. As shown in fig. 8 and 9, when the number of applications started by the mobile terminal is greater than or equal to 3, the virtual screen images are sequentially aligned and combined according to the sequence of the immediate operation of the applications of the mobile terminal.
As shown in fig. 3, 5, 6 and 8, when the combined display interface is smaller than the screen area of the computer terminal, the vacant area is filled with black.
And when the combined display interface is larger than the screen area of the computer terminal, the area beyond the screen of the computer terminal is viewed by sliding leftwards or upwards. As shown in fig. 4, when the card width > card height, that is, the computer-class terminal is a landscape screen, when the combined display interface is smaller than the screen area of the computer-class terminal, the area beyond the screen of the computer-class terminal is viewed by sliding to the left. As shown in fig. 7 and 9, when the card width is less than or equal to the card height, that is, when the computer terminal is in the vertical screen, when the combined display interface is smaller than the screen area of the computer terminal, the area beyond the screen of the computer terminal is viewed by sliding upward.
When the sliding check is performed beyond the screen area of the computer terminal, the sliding logic is the event transmission logic of the Android system: when the multi-control is nested, the screen receives a touch event, the touch event is preferentially responded by the internal control, when the internal control does not respond to the event, the event is responded by the external control, and when the internal control responds to the event, the external control does not respond.
Specifically, the product for establishing the interconnection channel in step S100 may be hundred million interconnection products of me, carelife of hundredth company, or careplay of apple company.
When the mobile terminal starts a plurality of applications, the combined split screen projection method of the mobile terminal and the computer terminal creates a plurality of virtual screens to display the application interfaces started by the mobile terminal, and combines the interfaces of the virtual screens to the computer terminal for display. When the mobile terminal starts a plurality of applications to project screens and switches the applications, the mobile terminal does not need to be frequently switched, the operation is convenient, and the driving operation safety is improved.