Video switching method and electronic equipment
By transmitting video playback control information in multi-screen collaboration technology, switching animations are generated, which solves the problem of flickering screens and freezes when switching video streams, achieving smooth video stream switching and improving user experience.
Patent Information
- Application Number
- CN202310341966.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-03-28
AI Technical Summary
In multi-screen collaboration technology, electronic devices are prone to screen flickering, black screens, or freezes when switching video streams, making it impossible to switch video streams smoothly.
By transmitting the video playback control information corresponding to the video stream in the first electronic device, the second electronic device can generate and display switching animations based on this information, thereby smoothly adjusting the position and size of the screen projection window when switching video streams.
It achieves a smooth transition when switching video streams, improves user experience and device collaboration efficiency, and avoids screen flickering and freezing.
Smart Images

Figure CN118741195A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic equipment, and in particular to a video switching method and electronic equipment. Background Art
[0002] With the development of electronic devices, the interaction between electronic devices is becoming more and more frequent. Multi-screen collaboration technology is a distributed technology that can achieve cross-system and cross-device collaboration, and carry out resource sharing and collaborative operations between electronic devices. As one of the main ways of electronic device interaction, multi-screen collaboration can make up for the shortcomings of electronic devices themselves, give full play to the advantages of different electronic devices, and thus improve user experience.
[0003] Taking establishing a collaborative operation connection between a first electronic device and a second electronic device as an example, the first electronic device can transmit video data to the second electronic device by transmitting a video stream, so as to realize screen projection of the video played on the first electronic device to the second electronic device for display and playback.
[0004] However, when the display state of the window playing the video stream in the first electronic device changes. For example, when the first electronic device switches from a horizontal screen state to a vertical screen state, when the second electronic device switches the display state of the projection window, the display content in the projection window is prone to flickering, black screen or freeze, resulting in the inability to smoothly switch the video stream. Summary of the invention
[0005] The embodiment of the present application provides a video switching method and an electronic device, which can be applied in a collaborative operation scenario in which a first electronic device projects a screen to a second electronic device. Specifically, the first electronic device can transmit control information (such as position information, etc.) of a video playback control corresponding to a video stream to the second electronic device. When the first electronic device switches the display state of the window playing the video stream (i.e., when switching the video stream), the second electronic device can determine the position information of the projection window change based on the control information, and then can generate and display a switching animation, so that the second electronic device can smoothly switch the video stream.
[0006] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions:
[0007] In a first aspect, a video switching method is provided, which can be applied to a second electronic device. Specifically, the method includes: the second electronic device receives a first video stream sent by a first electronic device, wherein the first video stream is display data when the first electronic device displays a window of a first application in a first state. Then, the second electronic device displays the first video stream in a first window in its display interface. Next, the second electronic device can also receive a second video stream and first control information sent by the first electronic device. Among them, the second video stream is display data when the first electronic device displays a window of the first application in a second state, the first control information is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing a video in the window of the first application. Then, the second electronic device can generate a switching effect according to the first window information, the first control information and the second window information, so that the second electronic device displays the window of the first application in the first state from the window of the first application in the second state. Among them, the above-mentioned first window information is associated with the first window, and the above-mentioned second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state. And the display content of the switching effect generated by the second electronic device is related to the first application. Finally, after the switching animation is displayed, the second electronic device can display the first video stream in the second window of its display interface, and the second window is associated with the second window information, that is, the position and size of the second window can be determined based on the second window information.
[0008] In this method, the second electronic device can receive the first control information sent by the first electronic device. In this way, when the state of the window of the first application displayed by the first electronic device changes, that is, when the video stream sent by the first electronic device to the first electronic device is switched from the first video stream to the second video stream, the second electronic device can determine the transformation position of the first window according to the first control information, the first window information and the second window information, and then generate and display the switching effect, so that the second electronic device can smoothly display the window of the first application in the first state (i.e., the first window) to the window of the first application in the second state (i.e., the second window), thereby improving the smoothness of the second electronic device switching the video stream.
[0009] In combination with the first aspect, in an optional implementation, the first control information is also associated with the size of the first control in the window of the first application displayed in the second state.
[0010] In this implementation, the second electronic device can more accurately determine the transformation position and size of the first window based on the first control information, that is, the position and size of the first control in the window of the first application displayed in the second state, which can further improve the smoothness of switching video streams by the second electronic device.
[0011] In combination with the first aspect, in an optional implementation, the first window information is associated with at least one of the position or size of the window of the first application displayed in the first state by the first electronic device. Then, before displaying the first video stream in the first window of the second electronic device, the method further includes: the second electronic device receives at least one of the position or size of the window of the first application displayed in the first state by the first electronic device sent by the first electronic device.
[0012] In this implementation, the second electronic device can more accurately determine the first window information based on at least one of the position or size of the window of the first application displayed in the first state by the first electronic device. Furthermore, the second electronic device can accurately determine the position and size of the first window based on the first window information to display the first video stream in the first window, thereby realizing the function of projecting the first video stream on the second electronic device and improving the user experience. In addition, the second electronic device can also more accurately determine the starting position and size of the switching animation based on the first window information, thereby further improving the smoothness of the second electronic device switching the video stream.
[0013] In combination with the first aspect, in an optional implementation, before the second electronic device generates a switching animation based on the first window information, the first control information and the second window information, the method also includes: the second electronic device receives the position of the window of the first application displayed in the second state by the first electronic device, which is sent by the first electronic device.
[0014] In this way, the second electronic device can accurately determine the second window information according to the position of the window of the first application displayed in the second state by the first electronic device. Furthermore, when generating a switching animation, the second electronic device can determine the end position of the window displaying the switching animation according to the second window information, so as to further improve the smoothness of the second electronic device switching the video stream.
[0015] In combination with the first aspect, in an optional implementation, the second window information is also associated with the size of the window of the first application displayed in the second state by the first electronic device. Then, before the second electronic device generates a switching animation according to the first window information, the first control information, and the second window information, the method further includes: the second electronic device receives the size of the window of the first application displayed in the second state by the first electronic device sent by the first electronic device.
[0016] In this way, the second electronic device can accurately determine the second window information according to the size of the window of the first application displayed in the second state by the first electronic device. Furthermore, when generating a switching effect, the second electronic device can determine the size of the window displaying the switching effect at the end position according to the second window information, so as to further improve the smoothness of the second electronic device switching the video stream.
[0017] In combination with the first aspect, in an optional implementation, before the second electronic device receives the second video stream and the first control information sent by the first electronic device, the method further includes: the second electronic device receives a switching instruction.
[0018] In this implementation, the switching instruction may be sent by the first electronic device, and the switching instruction may be initiated by the user through a switching operation. The switching instruction may be used to instruct the first electronic device to change the screen orientation from horizontal to vertical, that is, the second electronic device may respond to the switching instruction to switch from receiving the first video stream to receiving the second video stream, and receive the first control information to generate a switching animation, so that the second electronic device may smoothly switch the video stream.
[0019] In combination with the first aspect, in an optional implementation, the first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
[0020] In combination with the first aspect, in an optional implementation, the second electronic device generates a switching animation according to the first window information, the first control information, and the second window information, including: the second electronic device reduces the first window according to the first window information and the first control information, and the size and position of the reduced first window are associated with the first control information. The second electronic device then enlarges the first window according to the second window information, and the size and position of the enlarged first window are associated with the second window information.
[0021] In this implementation, the switching animation generated by the second electronic device can determine the size and position of the first window change according to the first window information, the first control information, and the second window information, so that the first window can be first reduced to the position and size associated with the first control information, and then enlarged to the position and size associated with the second control information. In this way, the switching animation can dynamically change so that the second electronic device can smoothly switch from the first window to the second window, which can further improve the smoothness of the switching animation display.
[0022] In combination with the first aspect, in an optional implementation, the second electronic device shrinks the first window according to the first window information and the first control information, including: the second electronic device shrinks the first window to a first point, where the first point is determined according to the first control information.
[0023] In conjunction with the first aspect, in an optional implementation, the first point is the center point of the first control in the window of the first application displayed in the second state by the second electronic device. In this way, not only can the difficulty of the second electronic device generating the switching animation be reduced, but also the smoothness of the switching animation can be visually improved, thereby improving the user experience.
[0024] In conjunction with the first aspect, in an optional implementation, the second electronic device displays one or more of the following animations while reducing the first window: rotation, fade in and fade out, and fly in and fly out. The second electronic device displays one or more of the following animations while enlarging the first window: rotation, fade in and fade out, and fly in and fly out.
[0025] In this implementation, the second electronic device can also display various animations such as rotation, fade-in and fade-out, and fly-in and fly-out while shrinking and enlarging the projection window. In this way, the diversity of the switching animations generated by the second electronic device can be increased, the display effect of the switching animations can be enhanced, and the user experience can be improved.
[0026] In combination with the first aspect, in an optional implementation, the display content of the switching animation is: one or more of the last frame image of the first video stream, the first frame image of the second video stream, the mask image, the preset image, and the preset video. In this way, the continuity of the display content of the switching animation can be ensured, and the smoothness of the second electronic device switching the video stream can be further improved.
[0027] In combination with the first aspect, in an optional implementation, the method further includes: the second electronic device reduces the first window at a first speed, and then enlarges the first window at a second speed. The first speed and the second speed can be determined based on the cache capacity and decoding capacity of the second electronic device. Specifically, the cache capacity of the second electronic device is used to characterize the ability of the second electronic device to cache the video stream, and the decoding capacity of the second electronic device is used to characterize the ability of the second electronic device to decode the video stream.
[0028] In this implementation, the second electronic device can determine the speed of reducing and enlarging the projection window based on the decoding capability and cache capability of the second electronic device, which can further improve the smoothness of the switching animation changes.
[0029] In combination with the first aspect, in an optional implementation, the method for generating a switching animation by the second electronic device according to the first window information, the first control information, and the second window information may specifically include: the second electronic device may determine the moving distance according to the first window information, the first control information, and the second window information. The second electronic device may also determine the moving time according to the cache capacity and decoding capacity of the second electronic device. Finally, the second electronic device may determine the first speed and the second speed according to the moving distance and the moving time.
[0030] In this implementation, the second electronic device can estimate the moving speed of the switching animation based on the moving distance and moving time of the switching animation. In this way, the second electronic device can determine the speed of reducing the projection window and the speed of enlarging the projection window, thereby improving the smoothness of the switching animation.
[0031] In combination with the first aspect, in an optional implementation, the moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time. Then the specific method for the second electronic device to determine the first speed and the second speed according to the moving distance and the moving time may include: first, the second electronic device determines the first distance according to the first window information and the first control information, and determines the second distance according to the first control information and the second window information. Then, the second electronic device determines the first time according to the cache capacity of the second electronic device, and determines the second time according to the decoding capacity of the second electronic device. Next, the second electronic device determines the first estimated speed according to the first distance and the first time, and determines the second estimated speed according to the second distance and the second time. Finally, when the first estimated speed is less than or equal to the second estimated speed, the second electronic device can determine that the first speed and the second speed are both the first estimated speed. When the first estimated speed is greater than the second estimated speed, the second electronic device can determine that the first speed and the second speed are both the second estimated speed. In this way, the second electronic device can reserve enough time for caching and decoding the switched second video stream, thereby ensuring that the switched second video stream can be played smoothly after the switching animation is displayed.
[0032] In combination with the first aspect, in an optional implementation, the moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time. Then the specific method for the second electronic device to determine the first speed and the second speed according to the moving distance and the moving time may also include: first, the second electronic device determines the first distance according to the first window information and the first control information, and determines the second distance according to the first control information and the second window information. Then, the second electronic device determines the first time according to the decoding capability of the second electronic device, determines the second speed according to the second distance and the first time, and then determines the second time according to the first distance and the second speed, and then the second electronic device determines the third time according to the cache capability of the second electronic device. Finally, when the second time is greater than or equal to the third time, the second electronic device determines that the first speed is the same as the second speed. When the second time is less than the third time, the second electronic device determines the first speed according to the first distance and the third time. In this way, the second electronic device can ensure that there is enough time to cache the switched second video stream, so that after the switching animation is displayed, the switched second video stream can be played smoothly.
[0033] In a second aspect, a video switching method is provided, which can be applied to a first electronic device. Specifically, the method includes: the first electronic device sends a first video stream, wherein the first video stream is display data when the first electronic device displays a window of a first application in a first state. The first electronic device obtains first control information, and the first control information is associated with the position of the first control in the window of the first application displayed in a second state, and the first control is a control for playing a video in the window of the first application. Then, the first electronic device sends a second video stream and the first control information. Among them, the second video stream is display data when the first electronic device displays the window of the first application in the second state, and the first control information is used for the second electronic device to generate a switching effect, and the switching effect includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state.
[0034] In this method, the first electronic device can obtain the first control information and send the first control information to the second electronic device. In this way, when the state of the window of the first application displayed by the first electronic device changes, that is, when the video stream sent by the first electronic device to the first electronic device is switched from the first video stream to the second video stream, the second electronic device can determine the change position of the first window in the display interface of the second electronic device according to the first control information, and then generate and display the switching effect, so that the second electronic device can smoothly display the window of the first application in the first state (i.e., the first window) to the window of the first application in the second state (i.e., the second window), thereby improving the smoothness of the second electronic device switching the video stream.
[0035] In conjunction with the second aspect, in an optional implementation, the first control information is also associated with the size of the first control in the window of the first application displayed in the second state. In this way, the second electronic device can more accurately determine the transformation position and size of the first window based on the first control information, that is, the position and size of the first control in the window of the first application displayed in the second state, and the smoothness of switching video streams of the second electronic device can be further improved.
[0036] In combination with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device obtains at least one of the position or size of the window of the first application displayed by the first electronic device in the first state. Then, the first electronic device sends at least one of the position or size of the window of the first application displayed by the first electronic device in the first state. At least one of the position or size of the window of the first application displayed by the first electronic device in the first state can be used to determine the first window information, and the first window information can be used by the second electronic device to generate a switching effect.
[0037] In conjunction with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device obtains at least one of the position or size of the window of the first application displayed by the first electronic device in the second state. The first electronic device sends at least one of the position or size of the window of the first application displayed by the first electronic device in the second state, wherein at least one of the position or size of the window of the first application displayed by the first electronic device in the second state is used to determine the second window information, and the second window information is used by the second electronic device to generate a switching effect.
[0038] In this way, the second electronic device can accurately determine the second window information according to at least one of the position or size of the window of the first application displayed in the second state by the first electronic device. Further, the second electronic device can determine the end position of the window displaying the switching effect according to the second window information, thereby improving the smoothness of the second electronic device switching the video stream.
[0039] In combination with the second aspect, in an optional implementation, before the first electronic device sends the second video stream and the first control information, the method further includes: the first electronic device sends a switching instruction, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
[0040] In combination with the second aspect, in an optional implementation, the first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
[0041] In a third aspect, a video switching device is provided, the device comprising: a receiving module, a display module, a control perception module and a motion control module. The receiving module is used to receive a first video stream sent by a first electronic device, the first video stream being display data when the first electronic device displays a window of a first application in a first state. The display module is used to display the first video stream in a first window of a second electronic device. The receiving module is also used to receive a second video stream sent by the first electronic device, the second video stream being display data when the first electronic device displays a window of the first application in a second state. The control perception module is used to receive first control information sent by the first electronic device, the first control information being associated with the position of the first control in the window of the first application displayed in the second state. The first control is a control for playing a video in the window of the first application. The motion control module is used to generate a switching motion according to the first window information, the first control information and the second window information, wherein the first window information is associated with the first window, and the second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state. Specifically, the switching motion includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state, wherein the display content of the switching motion is related to the first application. The display module is also used to display the first video stream in a second window of the second electronic device after the switching animation effect display is completed, wherein the second window is associated with the second window information.
[0042] In a fourth aspect, a video switching device is provided, the device comprising: a sending module and a control perception module. The sending module is used to send a first video stream, which is display data when a first electronic device displays a window of a first application in a first state. The control perception module is used to obtain and send first control information, the first control information is associated with the position of a first control in a window of a first application displayed in a second state, and the first control is a control for playing a video in the window of the first application. The first control information is used for the second electronic device to generate a switching effect, and the switching effect includes the second electronic device displaying the window of the first application in the first state to the window of the first application in the second state. The sending module is also used to send a second video stream, which is display data when the first electronic device displays the window of the first application in the second state.
[0043] In a fifth aspect, an electronic device is provided, comprising: a memory, and one or more processors; the memory is coupled to the processor; wherein computer program code is stored in the memory, and the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in the first aspect and any one of its optional methods, or the electronic device executes the method as described in the second aspect and any one of its optional methods.
[0044] In a sixth aspect, a computer-readable storage medium is provided, comprising computer instructions, which, when executed on an electronic device, causes the electronic device to execute the method according to the first aspect and any one of its optional methods, or causes the electronic device to execute the method according to the second aspect and any one of its optional methods.
[0045] In the seventh aspect, a computer program product is provided. When the computer program product runs on a computer, it enables the computer to execute the method as described in the first aspect and any one of its optional methods, or enables the computer to execute the method as described in the second aspect and any one of its optional methods.
[0046] It can be understood that the beneficial effects that can be achieved by the video switching device of the third aspect, the video switching device of the fourth aspect, the electronic device of the fifth aspect, the computer-readable storage medium of the sixth aspect, and the computer program product of the seventh aspect can be referred to the beneficial effects of the first aspect and any possible design method thereof, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A schematic diagram of a screen projection scenario provided in an embodiment of the present application;
[0048] Figure 2 A schematic diagram of the principle of transmitting video data provided for related technologies;
[0049] Figure 3 A schematic diagram of the principle of a video stream switching method provided for related technologies;
[0050] Figure 4 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 1 ;
[0051] Figure 5 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;
[0052] Figure 6 A schematic diagram of the software structure of an electronic device provided in an embodiment of the present application;
[0053] Figure 7 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 2 ;
[0054] Figure 8 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 3 ;
[0055] Fig. 9 Schematic diagram of the video switching method provided in the embodiment of the present application Figure 1 ;
[0056] Fig.10 A schematic diagram of a mobile phone display interface provided in an embodiment of the present application;
[0057] Fig.11 A schematic diagram of first control information provided in an embodiment of the present application;
[0058] Fig.12 A schematic diagram of mapping first control information provided in an embodiment of the present application;
[0059] Fig.13 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 1 ;
[0060] Fig.14 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 2 ;
[0061] Fig.15 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 4 ;
[0062] Fig.16 Schematic diagram of the video switching method provided in the embodiment of the present application Figure 2 ;
[0063] Fig.17 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 3 ;
[0064] Fig.18 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 4 ;
[0065] Fig.19 A schematic diagram of a mobile phone display interface provided in an embodiment of the present application;
[0066] Fig. 20 A schematic diagram of the structure of the video switching device provided in the embodiment of the present application Figure 1 ;
[0067] Fig.21 A schematic diagram of the structure of the video switching device provided in the embodiment of the present application Figure 2 ;
[0068] Fig. 22 A schematic diagram of the composition of a chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0069] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a description of the association relationship of the associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. Those skilled in the art will understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the differences. At the same time, in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete manner for ease of understanding.
[0070] With the development of electronic devices, the degree of intelligence of electronic devices such as smartphones, laptops, tablets, and smart screens has increased rapidly, and the interaction between electronic devices has become more and more frequent. Multi-screen collaboration technology is a distributed technology that can achieve cross-system and cross-device collaboration, and perform resource sharing and collaborative operations between electronic devices. As one of the main ways for electronic devices to interact, multi-screen collaboration can make up for the shortcomings of electronic devices themselves, give full play to the advantages of different electronic devices, and thus improve user experience. For example, smartphones have the advantage of being easy to carry and are mainly used for users' daily communication and social interaction. However, the screen of smartphones is small, and it is difficult for users to obtain a high user experience in application scenarios such as watching videos or playing games. Large-screen devices such as computers, smart screens, and TVs have the advantages of large screens and high display resolutions. Therefore, users can project the screen on their smartphones to other devices (such as computers or smart screens, etc.) through window projection to obtain a high user experience.
[0071] See also Figure 1In the screen projection scenario shown, the user can project video a played on the main control side electronic device (hereinafter referred to as the first electronic device) to a large-screen device such as a collaborative side electronic device (hereinafter referred to as the second electronic device) for display and playback. The playback interface of video a on the second electronic device is larger, so that the user can obtain a higher video viewing experience.
[0072] In one implementation, after establishing a cooperative operation connection between the first electronic device and the second electronic device, the first electronic device can transmit video data to the second electronic device in the form of a video stream. For example, Miracast technology, AirPlay technology, HiSight technology, etc. can be used to transmit the video data of the first electronic device to the second electronic device in the form of a video stream.
[0073] Specifically, Figure 2 A schematic diagram of the principle of transmitting video data provided for related technologies, such as Figure 2 As shown, a collaborative connection can be established between the first electronic device and the second electronic device through a collaborative module. Exemplarily, a socket channel can be established between the first electronic device and the second electronic device through a collaborative module, and the socket channel can be based on, for example, a multicast source discovery protocol (MSDP) or a hisight protocol. The socket channel can be used as an information channel for the first electronic device to send video stream data to the second electronic device. Another socket channel can also be established between the first electronic device and the second electronic device as a control channel, and the control channel can be used for the second electronic device to send a control instruction to the first electronic device to achieve control (or reverse control) of the first electronic device.
[0074] Specifically, when the first electronic device sends video stream data to the second electronic device, first, the first electronic device can compress each frame of video a to obtain video stream data composed of multiple video frames (i.e., encode video a to obtain video stream data). Then, the first electronic device sends the video stream data to the second electronic device through the socket channel (information channel), and the second electronic device receives and caches the video stream data, decodes the video stream data, and plays video a.
[0075] However, in the related technologies of multi-screen collaboration, the first electronic device will not transmit the control information (for example, size information, position information, etc.) of the video playback control in its display interface to the second electronic device during the process of transmitting video stream data, that is, the second electronic device cannot obtain the control information of the video playback control in the first electronic device. In this way, when the display state of the window playing the video stream in the first electronic device changes. For example, when the window of the first electronic device playing the video stream switches from a horizontal screen state to a vertical screen state, when the second electronic device switches the display state of the projection window, the display content in the projection window is prone to flickering, black screen or freeze, etc., which makes it impossible to switch the video stream smoothly.
[0076] In this case, when the second electronic device has not completed decoding the video stream after the display state changes, it can usually use a preset image (for example, a mask image) as a transition between the two video streams before and after the change, and then play the video stream after the decoding of the changed video stream is completed. In this way, when the second electronic device switches the video stream, the video screen is prone to flickering, screen stretching or freezing, which further causes the second electronic device to be unable to smoothly switch between the two video streams.
[0077] In an application scenario, in a collaborative operation application scenario where a first electronic device projects a screen onto a second electronic device, the first electronic device switches between horizontal and vertical video streams as an example. Specifically, the first electronic device switches from playing a horizontal video stream to a vertical video stream, that is, the video stream sent by the first electronic device to the second electronic device switches from a horizontal video stream to a vertical video stream. Among them, the horizontal video stream is a video stream played by the first electronic device in the horizontal state, and the vertical video stream is a video stream played by the first electronic device in the vertical state.
[0078] Specifically, the screen of the first electronic device usually has two screen states: landscape state and portrait state. When the first electronic device is in the portrait state, the first electronic device displays a portrait screen interface. When the first electronic device is in the landscape state, the first electronic device displays a landscape interface. Therefore, the first electronic device can present a normal perspective of the application interface to the user in both the portrait state and the landscape state, so that the user can browse the application interface normally.
[0079] It should be noted that the screen shape of the first electronic device is usually a rectangle. Therefore, in the screen state of the first electronic device, the horizontal screen state is usually the state of the first electronic device when the bottom of the screen (the bottom of the screen is the side indicated by the direction of gravity acceleration, that is, the side of the screen close to the ground) is the long side. The vertical screen state is usually the state of the first electronic device when the bottom of the screen is the short side. Alternatively, when the side of the screen of the first electronic device corresponding to the jaw or forehead of the user who is using the screen is the long side, the first electronic device is in the horizontal screen state; when the side of the screen of the first electronic device corresponding to the jaw or forehead of the user who is using the screen is the short side, the first electronic device is in the vertical screen state.
[0080] When the first electronic device is in a landscape state and displays a landscape interface, the user can rotate the first electronic device to make the first electronic device rotate a certain angle and then switch from the landscape state to the portrait state. Correspondingly, when the first electronic device is in a portrait state and displays a portrait interface, the user can also rotate the first electronic device to make the first electronic device rotate a certain angle and then switch from the portrait state to the landscape state.
[0081] See also Figure 3 The schematic diagram of the video stream switching principle in the related technology shown is taken as an example of a first electronic device being a mobile phone and a second electronic device being a computer. First, the mobile phone plays a horizontal screen video stream (i.e., the mobile phone plays the video stream in a horizontal screen state), and sends the horizontal screen video stream to the computer, which receives the horizontal screen video stream, caches and decodes it, and then plays the vertical screen video stream. Then, after T milliseconds (ms) of time, the mobile phone plays the vertical screen video stream (i.e., the mobile phone plays the video stream in a vertical screen state), and sends the vertical screen video stream to the computer, which receives the vertical screen video stream, caches and decodes it, and then plays the vertical screen video stream. However, since the mobile phone does not transmit the control information of the video playback control in the window that plays the vertical screen video stream to the computer. Therefore, the computer cannot determine the transformation position of the switching effect of the vertical screen video stream and the horizontal screen video stream, resulting in the inability to determine the switching effect. In this case, the computer usually directly recreates the session to receive the vertical screen video stream and switch to play the vertical screen video stream. In addition, affected by the computer's decoding ability, it will also cause abnormal phenomena such as flashing or freezing in the video stream switching process.
[0082] Please continue to see Figure 3For computers with strong decoding capabilities, the speed of decoding the vertical screen video stream is faster and the decoding time T1 is shorter. Therefore, the computer can quickly switch from playing the vertical screen video stream to the vertical screen video stream, which causes the screen to flicker during the video stream switching process. For computers with weak decoding capabilities, the speed of decoding the vertical screen video stream is slower and the decoding time T2 is longer. Therefore, the computer switches from playing the vertical screen video stream to the vertical screen video stream slowly, which causes the screen to freeze during the video stream switching process. This will cause the computer to be unable to switch video streams smoothly.
[0083] In order to solve the problem that the electronic device on the collaborative side (such as the above-mentioned computer) cannot smoothly switch between two video streams in the application scenario of multi-screen collaboration. The embodiment of the present application provides a video switching method. In the collaborative operation scenario where the electronic device on the master side projects the screen to the electronic device on the collaborative side, when the video stream of the electronic device on the master side is switched, that is, when the display state of the window playing the video stream changes, the electronic device on the collaborative side can receive the control information of the video playback control corresponding to the switched video stream sent by the electronic device on the master side, and determine the change position of the projection window in the process of the electronic device on the collaborative side switching between the two video streams according to the control information, and then generate and display the switching animation, so that the electronic device on the collaborative side can smoothly switch between the two video streams.
[0084] For details, see Figure 4 , Figure 4 The schematic diagram of the principle of the video switching method provided in the embodiment of the present application is as follows. Figure 4 As shown, the electronic device on the master side is a mobile phone, the electronic device on the cooperative side is a computer, and the mobile phone switches from the first video stream to the second video stream as an example. When the mobile phone plays the first video stream, the first video stream is sent to the computer, and the first video stream is the display data when the mobile phone displays the window of the first application in the first state. The computer receives the first video stream, caches and decodes it, and plays the first video stream in the first window. After the mobile phone switches from playing the first video stream to the second video stream, that is, after the mobile phone switches from displaying the window of the first application in the first state to displaying the window of the first application in the second state, the second video stream and the first control information are sent to the computer. Among them, the second video stream is the display data when the mobile phone displays the window of the first application in the second state, the first control information is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing the video in the window of the first application. In this way, the computer can determine the transformation position of the first window according to the first window information, the first control information, and the second window information, and generate and display the switching effect, so that the computer can smoothly switch from playing the first video stream to playing the second video stream.
[0085] In some embodiments, the computer can also obtain the computer's decoding capability parameters, and determine the transformation speed (or moving speed) of the switching effect between the first video stream and the second video stream based on the decoding capability parameters, so as to avoid abnormal phenomena such as screen flickering or freezing when the computer switches to the second video stream, thereby further improving the smoothness of the computer switching between the two video streams.
[0086] The video switching method provided in the embodiment of the present application can be applied to the application scenario in which the first electronic device casts the screen to the second electronic device. Exemplarily, in the embodiment of the present application, the first electronic device and the second electronic device may include but are not limited to smart phones, netbooks, tablet computers, smart watches, smart bracelets, phone watches, smart cameras, PDAs, personal computers (personal computers, PCs), personal digital assistants (personal digital assistants, PDAs), portable multimedia players (portable multimedia player, PMP), augmented reality (augmentedreality, AR) / virtual reality (virtual reality, VR) devices, televisions, projection devices, or somatosensory game consoles in human-computer interaction scenarios, etc. Alternatively, the first electronic device and the second electronic device may also be electronic devices of other types or structures, which are not limited in the present application.
[0087] Usually, in order to maximize the advantages of multi-screen collaborative operation technology, multi-screen collaborative operation technology is mostly used between portable devices (ie, the first electronic device) and large-screen devices (ie, the second electronic device). For example, the portable device is a smart phone, and the large-screen device is a laptop. For another example, the portable device is a tablet computer, and the large-screen device is a TV. Of course, the present application does not limit the specific devices in the multi-window projection scenario. As mentioned above, the first electronic device and the second electronic device can be any electronic device that supports multi-screen collaborative operation technology, such as a smart phone, a netbook, a tablet computer, a smart watch, a smart bracelet, a phone watch, a smart camera, a PDA, a PMP, an AR / VR device, or a TV.
[0088] In an embodiment of the present application, a wireless communication connection can be established between the first electronic device and the second electronic device through methods such as "touch", "scan" (such as scanning a QR code or a barcode), and "approach automatic discovery" (such as with the help of Bluetooth or wireless fidelity (Wi-Fi)). Among them, the first electronic device and the second electronic device can follow a wireless transmission protocol and transmit information through a wireless connection transceiver. Among them, the wireless transmission protocol may include but is not limited to a Bluetooth (BT) transmission protocol or a Wi-Fi transmission protocol. For example, the Wi-Fi transmission protocol may be a Wi-Fi P2P transmission protocol. The wireless connection transceiver includes but is not limited to Bluetooth, Wi-Fi and other transceivers. Information transmission between the first electronic device and the second electronic device is achieved through wireless pairing. Among them, the information transmitted between the first electronic device and the second electronic device includes but is not limited to content data to be displayed (such as a standard video stream) and control instructions.
[0089] Alternatively, a wired communication connection may be established between the first electronic device and the second electronic device. For example, a wired communication connection is established between the first electronic device and the second electronic device via a video graphics array (VGA), a digital visual interface (DVI), a high definition multimedia interface (HDMI), or a data transmission line. Information transmission is achieved between the first electronic device and the second electronic device through the established wired communication connection. This application does not limit the specific connection method between the first electronic device and the second electronic device.
[0090] Figure 5 Schematic diagram of the hardware structure of the electronic device 100 is shown. Figure 5 The electronic device 100 shown may be a first electronic device or a second electronic device.
[0091] like Figure 5As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.
[0092] It is to be understood that the structure illustrated in the embodiment of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or separate some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0093] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0094] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0095] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0096] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.
[0097] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0098] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0099] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0100] The modulation and demodulation processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.
[0101] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0102] Exemplarily, when the electronic device 100 is the first electronic device in the aforementioned embodiment, the first electronic device can send video streams, control information, control instructions, etc. to the second electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0103] Exemplarily, when electronic device 100 is the second electronic device in the aforementioned embodiment, the second electronic device can receive the video stream, control information, control instructions, etc. sent by the first electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc.
[0104] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0105] The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0106] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is a positive integer greater than 1.
[0107] For example, when the electronic device 100 is the first electronic device in the aforementioned embodiment, the display screen 194 of the first electronic device can display the video stream selected by the user to be played on the first electronic device. When the user clicks or touches the screen, some functional controls are further displayed, such as switching controls, collaborative controls, etc.
[0108] For example, when the electronic device 100 is the second electronic device in the aforementioned embodiment, the display screen 194 of the second electronic device can display the video stream selected by the user to play on the first electronic device. In addition, when the video stream is switched, a switching effect can also be displayed. And when the user clicks or touches the screen, some functional controls are further displayed, such as switching controls, collaborative controls, etc.
[0109] Video codecs are used to compress or decompress digital videos. The electronic device 100 may support one or more video codecs. Thus, the electronic device 100 may play or record videos in a variety of coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0110] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.
[0111] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0112] Exemplarily, when the electronic device 100 is the second electronic device in the aforementioned embodiment, the processor 110 can determine the change position of the projection window in the process of switching the first video stream to the second video stream according to the first window information, the first control information and the second window information by running instructions stored in the internal memory 121, and generate and display a switching animation so that the computer can smoothly switch between the two video streams.
[0113] The electronic device 100 can implement audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.
[0114] When the electronic device 100 displays video content, the audio module 170 can synchronously play audio content corresponding to the video content.
[0115] Exemplarily, when the electronic device 100 is the first electronic device in the aforementioned embodiment, if the first electronic device displays content, the audio module 170 of the first electronic device can synchronously play the audio content corresponding to the video content. If the first electronic device projects the video content to the second electronic device, the audio module 170 of the first electronic device may not play the audio content corresponding to the video content.
[0116] Exemplarily, when the electronic device 100 is the second electronic device in the aforementioned embodiment, if the second electronic device displays video content, the audio module 170 of the second electronic device can synchronously play the audio content corresponding to the video content. If the second electronic device displays the video content projected by the first electronic device in the screen projection scene, the audio module 170 of the second electronic device can synchronously play the audio content corresponding to the projected video content.
[0117] In some embodiments, based on Figure 5 When the electronic device 100 shown implements the video switching method in the embodiment of the present application, when the electronic device 100 is the first electronic device and the second electronic device in the aforementioned embodiment, the first electronic device is used to cast the screen to the second electronic device, and the first electronic device switches from playing the first video stream to the second video stream as an example. The processor 110 of the first electronic device can obtain the first control information by running the instructions stored in the internal memory 121. And send the second video stream and the first control information to the second electronic device through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc. The second electronic device receives the second video stream and the first control information through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, etc. The processor 110 of the second electronic device can determine the switching effect between the first video stream and the second video stream according to the first control information, the first window information, and the second window information by running the instructions stored in the internal memory 121. Further, the second electronic device can execute the switching effect with the processor 110 and display the switching effect through the display screen 194.
[0118] The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present invention, the Android system of the layered architecture is taken as an example to exemplify the software structure of the electronic device 100.
[0119] Figure 6 1 is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.
[0120] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.
[0121] The application layer can include a series of application packages.
[0122] like Figure 6 As shown, the application package may include short message applications, video applications, office applications, game applications, life applications, shopping applications or functional applications, etc. Specifically, for example, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message and other applications.
[0123] The application framework layer provides an application programming interface (API) and a programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0124] like Figure 6 As shown, the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, a collaboration module, a control perception module, a motion effect control module, and the like.
[0125] The cooperation module is used to establish a cooperation operation connection with other electronic devices so that the electronic devices can realize the cooperation operation function.
[0126] The control sensing module is used to obtain the control information (such as the position information and size information of the control) corresponding to the video stream played in the electronic device, that is, the information of the playback control used to play the video stream. It is also used to transmit the control information to the electronic device so that the electronic device can determine the change position of the switching effect according to the control information.
[0127] The motion effect control module is used to determine the position information of the switching motion effect transformation according to the control information obtained by the control perception module to generate the switching motion effect.
[0128] In some embodiments, the application framework layer may further include a decoding capability adaptation module and a decoding monitoring module.
[0129] The decoding capability adaptation module is used to obtain the decoding capability parameters of the electronic device, so as to determine the change speed of the switching animation according to the decoding capability parameters, so as to generate the switching animation.
[0130] The decoding monitoring module is used to monitor the actual decoding capability parameters of the electronic device for the video stream when the electronic device displays the switching animation effect, so as to update the decoding capability parameters of the electronic device.
[0131] The animation control module can also be used to determine the change speed of the switching animation according to the decoding capability parameters obtained by the decoding capability adaptation module, so that the switching animation can smoothly switch between two video streams.
[0132] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.
[0133] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0134] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.
[0135] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.).
[0136] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0137] The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, an electronic device vibrates, an indicator light flashes, etc.
[0138] Android Runtime includes core libraries and virtual machines. Android Runtime is responsible for scheduling and management of the Android system.
[0139] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.
[0140] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
[0141] The system library can include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), screen projection module, etc.
[0142] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.
[0143] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0144] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0145] A 2D graphics engine is a drawing engine for 2D drawings.
[0146] The screen projection module is used for the electronic device 100 to project the screen to other devices, or to receive the projection data of other devices. The screen projection module can realize the selection of the projection application, the sending of the projection data, the receiving of the projection data, and the display of the projection data.
[0147] The kernel layer is a layer between hardware and software. The kernel layer at least includes display driver, camera driver, audio driver, sensor driver, etc., and the present application embodiment does not impose any restrictions on this.
[0148] In some embodiments, based on Figure 6 When the electronic device 100 shown implements the video switching method in the embodiment of the present application, when the electronic device 100 is the first electronic device and the second electronic device in the aforementioned embodiment, the first electronic device is projected to the second electronic device, and the first electronic device switches from the first video stream to the second video stream as an example. Figure 7 As shown in the principle diagram, the first electronic device and the second electronic device can establish a collaborative operation connection through the collaborative module. The first electronic device can obtain the first control information in the first electronic device through the control perception module and send it to the control perception module of the second electronic device. The control perception module of the second electronic device receives the first control information and sends it to the motion effect control module. Based on the first control information, the first window information and the second window information, the motion effect control module can determine and display the switching motion effect between the first video stream and the second video stream.
[0149] In some embodiments, when the second electronic device includes a decoding capability adaptation module and a decoding monitoring module, the decoding capability adaptation module of the second electronic device can obtain the decoding capability parameters of the second electronic device and send them to the motion effect control module. The decoding monitoring module of the second electronic device can obtain the actual decoding capability parameters of the second electronic device for the video stream. The motion effect control module can determine and adjust the conversion speed of the switching motion effect based on the decoding capability parameters to achieve smooth switching between the first video stream and the second video stream.
[0150] The following uses an example in which the first electronic device is a mobile phone and the second electronic device is a computer to illustrate the video switching method provided in the embodiment of the present application.
[0151] Among them, both the mobile phone and the computer have the ability to operate in coordination, and the mobile phone can cast the video stream to the computer for playback. Take the case where the mobile phone switches from playing a horizontal screen video stream (i.e., the first video stream) to playing a vertical screen video stream (i.e., the second video stream), that is, the video stream sent by the mobile phone to the computer switches from playing a horizontal screen video stream to a vertical screen video stream. Among them, the horizontal screen video stream is the video stream played by the mobile phone in the horizontal screen state (i.e., the second state), and the vertical screen video stream is the video stream played by the mobile phone in the vertical screen state (i.e., the second state).
[0152] Figure 8 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 3 ,like Figure 8 As shown, first, when the mobile phone plays a horizontal video stream, it sends the horizontal video stream to the computer. The computer displays the horizontal video stream in the first window. After the mobile phone switches from playing the horizontal video stream to the vertical video stream, the vertical video stream and the first control information are sent to the computer, and the first control information is associated with the position of the control for playing the video in the window where the mobile phone plays the vertical video stream. The computer can generate and display a switching animation based on the first window information, the first control information, and the second window information, so that the computer can smoothly switch from the horizontal video stream to the vertical video stream.
[0153] Specifically, Fig. 9 Schematic diagram of the video switching method provided in the embodiment of the present application Figure 1 ,like Fig. 9 As shown, the video switching method provided in the embodiment of the present application mainly includes S101-S108:
[0154] S101. The mobile phone and the computer establish a collaborative operation connection.
[0155] In the embodiment of the present application, the mobile phone can establish a collaborative operation connection with the computer. In this way, the mobile phone can send information such as video streams to the computer, and the computer can receive and play the video streams, so that the mobile phone can project the video to the computer for playback, thus realizing the collaborative operation of the mobile phone and the computer.
[0156] Exemplarily, the mobile phone can establish a collaborative operation connection with the computer based on a wireless connection method such as Bluetooth transmission protocol or Wi-Fi transmission protocol, or the mobile phone can also establish a collaborative operation connection with the computer based on a wired connection method such as HDMI or a data transmission cable. This application does not make specific limitations on this.
[0157] In some embodiments, the mobile phone can establish an information channel with the computer to transmit the video stream. The mobile phone can also establish a control channel with the computer to transmit control information for projecting the video stream.
[0158] S102. The mobile phone sends a horizontal screen video stream to the computer.
[0159] In an embodiment of the present application, when a mobile phone plays a horizontal video stream, a horizontal video stream is sent to a computer. The horizontal video stream may be video data provided by a first application, and the first application may be, for example, a video application, an information application, etc. Then, the mobile phone may display a window of the first application through a display screen, and play the horizontal video stream in the window. That is, the horizontal video stream is also display data when the mobile phone displays the window of the first application in a horizontal state.
[0160] It should be noted that in the embodiment of the present application, the mobile phone plays a horizontal screen video stream, that is, plays the video stream in a horizontal screen state (or called a horizontal screen interface, a horizontal screen window). The mobile phone plays a vertical screen video stream, that is, plays the video stream in a vertical screen state (or called a vertical screen interface, a vertical screen window). The mobile phone plays a horizontal screen video stream, that is, plays the video stream in a horizontal screen state (or called a horizontal screen interface, a horizontal screen window).
[0161] Specifically, the horizontal screen video stream may be encoded video data, for example, the horizontal screen video stream may be encoded binary video stream data. In one implementation, the mobile phone may send the horizontal screen video stream via an information channel established with the computer.
[0162] In some embodiments, the mobile phone may also send a first indication message to the computer, and the first indication message may be used to indicate the position and / or size of the projection window for playing the horizontal video stream on the computer, so that the computer can quickly generate a projection window for playing the horizontal video stream.
[0163] In one implementation, the first indication information may be a full-screen playback instruction, which may be used to instruct the computer to play a horizontal video stream in full-screen mode, i.e., to instruct the computer to generate a projection window that fully covers the computer display interface, and play the horizontal video stream in the projection window.
[0164] In another implementation, the first indication information may also be the position and / or size of the window in which the mobile phone displays the horizontal video stream. The position and / or size of the window in which the mobile phone displays the horizontal video stream may be used by the computer to determine the position and / or size of the projection window and generate a projection window to play the horizontal video stream.
[0165] S103: The computer receives the horizontal screen video stream and displays the horizontal screen video stream in the first window.
[0166] In the embodiment of the present application, when the horizontal screen video stream is encoded video data, the computer can cache and decode the received horizontal screen video stream. Specifically, the computer receives and caches the horizontal screen video stream data, and after the horizontal screen video stream data is fully stored in the cache area of the computer, the cached horizontal screen video stream data is decoded to obtain the decoded horizontal screen video stream, and the horizontal screen video stream is displayed in the projection window (i.e., the first window).
[0167] The position and size of the first window can be determined based on the first window information. The first window information can include the size of the entire display interface (full screen) of the computer, and the first window information can also be associated with the position and / or size of the window of the first application displayed in a horizontal state on the mobile phone (i.e., the window playing the horizontal video stream).
[0168] In one implementation, the computer may be preset with first window information. For example, when the computer displays the horizontal video stream in full screen, that is, the first window covers the entire display interface of the computer. The first window information preset in the computer may be the size of the entire display interface of the computer. In this way, when the mobile phone also sends the first instruction information (such as the above-mentioned full-screen play instruction) to the computer in S102, the computer may respond to the full-screen play instruction, generate the first window according to the preset first window information, and play the horizontal video stream in full screen.
[0169] In another implementation, the computer can also receive the position and / or size of the window of the mobile phone playing the horizontal screen video stream sent by the mobile phone, and determine the first window information according to the position and / or size of the window of the mobile phone playing the horizontal screen video stream. Due to the different sizes of the display interfaces of the mobile phone and the computer, the positions of the windows playing the horizontal screen video stream are different in the mobile phone and the computer, and the sizes may also be different. Therefore, the computer can map and transform the position and / or size of the window of the mobile phone playing the horizontal screen video stream received (such as: position offset, proportional scaling, etc.) to determine the first window information. Further, the computer can generate a first window based on the first window information to play the horizontal screen video stream in the first window.
[0170] In this implementation, the computer can receive the position and / or size of the window of the mobile phone playing the horizontal video stream while receiving the horizontal video stream, that is, in S102, the mobile phone can send the position and / or size of the window of the mobile phone playing the horizontal video stream while sending the horizontal video stream to the computer. Alternatively, the computer can also obtain the position and / or size of the window playing the horizontal video stream from the mobile phone before receiving the horizontal video stream. In this way, the first window playing the horizontal video stream can be generated in time to prevent the playback of the horizontal video stream from being stuck.
[0171] S104. The mobile phone sends the vertical screen video stream and the first control information to the computer in response to the switching instruction.
[0172] In the implementation of this application, the switching instruction can be used to indicate that the state of the window in which the mobile phone plays the video stream has changed, that is, the mobile phone changes from horizontal to vertical, and the corresponding video stream also changes. Specifically, the switching instruction can be used to instruct the mobile phone to switch from horizontal screen state to vertical screen state, that is, switch from playing a horizontal screen video stream to a vertical screen video stream.
[0173] In one example, the switching instruction can be generated by the user initiating a switching operation on the mobile phone. For example, the user can click the switching control in the mobile phone interface to initiate a switching operation on the mobile phone and generate a switching instruction. When the mobile phone is in a horizontal screen state and displays a horizontal screen interface, the user can also rotate the mobile phone to change the horizontal screen state to a vertical screen state after rotating the mobile phone at a certain angle to initiate a switching operation on the mobile phone and generate a switching instruction. In this case, the mobile phone can also send a switching instruction to the computer in response to the switching instruction to trigger the computer to switch the video stream.
[0174] In another example, the switching instruction may also be generated by the user initiating a switching operation on a computer, and the computer sends the switching instruction to the mobile phone to instruct the mobile phone to switch the video stream.
[0175] In the embodiment of the present application, the mobile phone can switch from playing a horizontal video stream to a vertical video stream in response to a switching instruction. That is, in the scenario of collaborative operation, the video stream sent by the mobile phone to the computer is switched from a horizontal video stream to a vertical video stream, and the vertical video stream is the display data when the mobile phone displays the window of the first application in a vertical state.
[0176] The vertical screen video stream may be encoded video data. Specifically, the vertical screen video stream may be binary video stream data. In one implementation, the mobile phone may send the vertical screen video stream via an information channel established with the computer.
[0177] At the same time, when the mobile phone sends a vertical screen video stream to the computer, the first control information can also be sent. The first control is a control for playing a video in the window of the first application displayed in the vertical screen state of the mobile phone (i.e., the window playing the vertical screen video stream), and the first control information is associated with the position of the first control in the window of the mobile phone playing the vertical screen video stream.
[0178] For example, Fig.10 A schematic diagram of a mobile phone display interface provided in an embodiment of the present application, such as Fig.10 As shown, in the window 101 of the first application displayed in the vertical screen state of the mobile phone, the control for playing the video includes the play control 102, and the first control may be the play control 102. The first control information may specifically include the position information of the play control 102, and the first control information may also include the size information of the play control 102. The first control information may be used by the computer to determine the position of the switching animation change.
[0179] In one implementation, when the first control is a rectangle, the first control information may be rectangle information of the first control.
[0180] In an example, the first control information may be position information (eg, coordinate information) of one of the vertices of the first control (rectangle), and the side length (eg, width and height) of the rectangle as the first control information. Fig.11 A schematic diagram of a first control information provided in an embodiment of the present application, such as Fig.11 As shown, the first control information can be a rectangle information (l, r, w, h) composed of the coordinate value (l, r) of the vertex a of the rectangle, the width (width, w) and the height (height, h) of the rectangle. Among them, the vertex a can also be replaced by the vertex b, the vertex c or the vertex d, and this application does not make specific restrictions on this.
[0181] In another example, the first control information may also be the position information of any three or four vertices in the first control (rectangle). a , r a ), the coordinate value of vertex b (l b , r b ) and the coordinate value of vertex c (l c , r c ) form a rectangular information (l a , r a , l b , r b , l c , r c ), namely, as the first control information. The present application does not specifically limit the specific expression method of the first control information.
[0182] In one implementation, the first control information can be acquired by a control perception module in the mobile phone. Specifically, the control perception module can detect the play control in the window of the mobile phone display interface, as well as the position information and size information of the play control in the window of the first application, and generate the first control information.
[0183] In this case, the control perception module can start running when the collaborative operation is triggered (that is, when the S101 mobile phone and the computer establish a collaborative operation connection), the control perception module can also start running before the collaborative operation is triggered, or the control perception module can also start running after the collaborative operation is triggered and before the first control information is sent. This application does not make specific limitations on this.
[0184] In one implementation, when a control channel is established between a mobile phone and a computer, the mobile phone can send first control information to the computer through the control channel.
[0185] In another implementation, an independent logical channel may be opened between the mobile phone and the computer to send the first control information to the computer. In this way, since the independent logical channel is isolated from the information channel and the control channel, the efficiency of transmitting the first control information can be guaranteed, and the first control information can be prevented from interfering with the transmission of the vertical screen video stream.
[0186] S105. The computer receives the vertical screen video stream and the first control information, and in response to the switching instruction, generates and displays a switching animation according to the first window information, the first control information and the second window information.
[0187] In an embodiment of the present application, when the vertical screen video stream is encoded video data, the computer can cache and decode the received vertical screen video stream. Specifically, the computer receives and caches the vertical screen video stream data, and after the vertical screen video stream data is fully stored in the cache area of the computer, the cached vertical screen video stream data is decoded to obtain the decoded vertical screen video stream, and the vertical screen video stream can be displayed in the second window.
[0188] At the same time, the computer can also map the received first control information, obtain and save the projection position of the first control in the computer (ie, the first mapping control information), so as to be used by the computer to determine the position information of the video stream switching effect.
[0189] Exemplarily, after receiving the first control information, the computer can map and transform the received first control information (such as position offset, proportional scaling, etc.) according to the projection position of the window of the first application in the computer display interface, obtain the first mapping control information, and save the first mapping control information.
[0190] Fig.12 A schematic diagram of mapping first control information provided in an embodiment of the present application, such as Fig.12 As shown, taking the first control as the playback control 102 as an example, the first control information is rectangular information (l1, r1, w1, h1), and the first mapping control information obtained after the mapping transformation is rectangular information (l1′, r1′, w1′, h1′). Among them, if the size of the first control after mapping does not change, w1′ is the same as w1, and h1′ is the same as h1. In this way, the position information and size information of the first control in the mobile phone display can be converted into the position information and size information in the computer display, so that the computer can accurately determine the position information of the video stream switching effect in the computer.
[0191] Among them, the above-mentioned second window is associated with the second window information, that is, the position and size of the second window can be determined based on the second window information. Specifically, the second window information is associated with the position and / or size of the window of the first application displayed in the vertical screen state of the mobile phone (that is, the window for playing the vertical screen video stream). The second window information can be the same as the position and / or size of the window of the mobile phone playing the vertical screen video stream. The second window information can also be the same position and / or size of the window of the mobile phone playing the vertical screen video stream after mapping transformation. The expression method of the second window information is similar to that of the first control information. When the window of the mobile phone playing the vertical screen video stream is rectangular, the second window information can be the rectangular information of the window of the mobile phone playing the vertical screen video stream. This application does not specifically limit the specific expression method of the second window information.
[0192] In one implementation, the window in which the mobile phone plays the vertical screen video stream may be a display window of the entire display screen of the mobile phone. Fig.10 As shown, the window for playing the vertical screen video stream on the mobile phone may be window 101, and the size of window 101 may be the size information of the entire display window of the mobile phone.
[0193] In another implementation, the computer can receive the position and / or size of the window of the mobile phone playing the vertical screen video stream sent by the mobile phone, and determine the second window information according to the position and / or size of the window of the mobile phone playing the vertical screen video stream. Then, the computer can also map the position and / or size of the window of the mobile phone playing the vertical screen video stream received (such as: position offset, proportional scaling, etc.) to determine the second window information. Further, the computer can regenerate the second window according to the second window information to play the vertical screen video stream in the second window. Alternatively, the computer can also adjust the position and / or size of the first window according to the second window information, and use the adjusted first window as the second window, that is, the second window is obtained by changing the first window without regenerating.
[0194] In this implementation, the computer can receive the position and / or size of the window of the mobile phone playing the vertical screen video stream while receiving the vertical screen video stream, that is, in S104, the mobile phone can send the position and / or size of the window of the mobile phone playing the vertical screen video stream while sending the vertical screen video stream to the computer. Alternatively, the computer can also obtain the position and / or size of the window playing the vertical screen video stream from the mobile phone before receiving the vertical screen video stream. In this way, the computer can generate the switching animation in time to prevent freezes during the switching of the vertical screen video stream.
[0195] In another implementation, the second window information can be saved in the computer, so there is no need to obtain the position and / or size of the window in which the mobile phone plays the vertical screen video stream through the mobile phone again. For example, before the mobile phone sends the horizontal screen video stream to the computer in S102, as described in S401-S410 below, if there is a process in which the mobile phone switches from playing the vertical screen video stream to playing the horizontal screen video stream, that is, the projection window of the computer switches from playing the vertical screen video stream to playing the horizontal screen video stream. Specifically, in S403, if the computer has received the position and / or size of the window in which the mobile phone plays the vertical screen video stream, the position and / or size of the window in which the mobile phone plays the vertical screen video stream can be saved. In this case, the computer does not need to obtain the position and / or size of the window in which the mobile phone plays the vertical screen video stream again.
[0196] The computer can generate and display a switching effect in response to a switching instruction. The switching instruction can be generated by a user initiating a switching operation on a mobile phone, and then sent from the mobile phone to the computer. The switching instruction can also be generated by a user initiating a switching operation on a computer. The switching instruction can be used to instruct the computer to change the display state of the window (such as the first window) playing the video stream, and generate and display a switching effect.
[0197] Specifically, the computer can generate and display a switching effect based on the first window information, the first control information, and the second window information. The switching effect includes the computer displaying the window of the first application in a horizontal state to the window of the first application in a vertical state, that is, the computer changes from the first window playing the horizontal video stream to the second window playing the vertical video stream.
[0198] In some embodiments, the computer can scale the first window according to the first window information, the first control information, and the second window information, and make the content displayed in the first window change as the size of the first window changes, thereby forming a switching effect. Specifically, the switching effect generated by the computer may include: reducing the first window according to the first window information and the first control information, and the size and position of the reduced first window are associated with the first control information. Then, according to the second window information, the first window is enlarged, and the size and position of the enlarged first window are associated with the second window information.
[0199] The size and position of the first window after reduction may be the same as the size and position determined by the mapped first control information (i.e., the first mapping control information), or the size and position of the first window after reduction may also be a position and size determined by the first mapping control information according to a first preset rule (e.g., offset, scaling, etc.), or a point determined. The size and position of the first window after enlargement may be the same as the size and position determined by the second window information, or the size and position of the first window after enlargement may also be a position and size determined by the second window information according to a second preset rule (e.g., offset, scaling, etc.).
[0200] In one implementation, in the computer-generated switching effect, the first window can be reduced to a first point according to the first control information, and then the first window can be enlarged from the first point. The first point is determined according to the first control information, and the first point can be a point determined according to the position and size of the first control in the first control information and a preset rule.
[0201] For example, Fig.13 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 1 ,like Fig.13 As shown, the first point can be the center point of the first control in the window of the vertical screen video stream played by the computer. Then the switching effect generated by the computer can be: in the display interface 200 of the computer, the first window 210 is reduced to the center point 220 of the first control, and then the center point 220 of the first control is enlarged to the second window 230. In this way, not only can the difficulty of the computer-generated switching effect be reduced, but also the smoothness of the switching effect can be visually improved, thereby improving the user experience.
[0202] In another implementation, in the computer-generated switching animation, the first window can be reduced to a size and position determined by the first mapping control information according to the first control information, and then the first window can be enlarged to a size and position determined according to the second window information.
[0203] For example, Fig.14 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 2 ,like Fig.14 As shown, the switching animation generated by the computer can also be that in the display interface 200 of the computer, the first window (i.e., the starting window 201) determined by the first window information (l0, r0, w0, h0) is reduced to the window (i.e., the middle window 202) determined by the first mapping control information (l1′, r1′, w1′, h1′), and then enlarged from the middle window 202 to the second window (i.e., the ending window 203) determined by the second window information (l2, r2, w2, h2).
[0204] In some embodiments, the computer-generated switching effects may also include: reducing the first window with a first action, and then enlarging the first window to the second window with a second action. The first action and the second action may be the same or different, and the first action and the second action may be one or more of the following effects: rotation, fade in and fade out, or fly in and out. This application does not specifically limit the first action and the second action. In this way, the diversity of the switching effects generated by the computer can be improved, the display effect of the switching effects can be enhanced, and the user experience can be improved.
[0205] In some embodiments, the computer-generated switching animation may further include: shrinking the first window at a first speed, and then enlarging the first window to the second window at a second speed.
[0206] In one implementation, Fig.13 Taking the implementation method of the switching effect shown as an example, the computer-generated switching effect may include: shrinking the first window 210 to the center point 220 of the first control at a first speed, and then enlarging from the center point 220 of the first control to the second window 230 at a second speed.
[0207] In yet another implementation, Fig.14 Taking the implementation method of the switching effect shown as an example, the switching effect generated by the computer may include: shrinking the starting window 201 to the middle window 202 at a first speed, and then enlarging the middle window 202 to the ending window 203 at a second speed.
[0208] The first speed and the second speed may be the same or different, that is, the switching effect may be reduced from the starting window 201 to the middle window 202 and then enlarged to the ending window 203 at the same speed. The switching effect may also be reduced from the starting window 201 to the middle window 202 and then enlarged from the middle window 202 to the ending window 203 at different speeds.
[0209] In some embodiments, when the computer's decoding capability is stable, the computer can determine the first speed and the second speed based on the first window information, the first control information, the second window information, and the preset time. The preset time is the switching animation playback time (i.e., the window movement time) determined based on the computer's decoding capability according to prior knowledge or experiments. Playing the switching animation at the preset time can ensure that there will be no abnormalities such as screen flashing and freeze when the video stream is switched.
[0210] Specifically, the computer may determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information.
[0211] When the first speed and the second speed are the same, the computer can obtain the first speed, that is, the second speed, by calculating the sum of the first distance and the second distance and dividing it by the preset time.
[0212] When the first speed and the second speed are different, the computer can divide the preset time into the first preset time and the second preset time according to actual use requirements, and use them as the moving time of the first distance and the second distance respectively. Then, the first speed is obtained by dividing the first distance by the first preset time, and the second speed is obtained by dividing the second distance by the second preset time.
[0213] In some embodiments, the computer can also estimate the moving speed of the switching animation based on the process of the computer caching and decoding the horizontal screen video stream, combined with the computer's caching capacity and decoding capacity, and determine the first speed and the second speed. Among them, the computer's caching capacity is used to characterize the computer's ability to cache video streams. For example, the caching capacity can be: the size of the computer's cache area and the cache speed. The cache speed can be determined based on the size of the network bandwidth of the communication connection between the mobile phone and the computer. The computer's decoding capability is used to characterize the computer's ability to decode video streams. For example, the decoding capability includes but is not limited to: decoding time and decoding speed for video streams with different code streams. In the following embodiments, the amount of data decoded by the computer per unit time, such as the amount of data processed per millisecond (Mb / ms), is used as the decoding capability to illustrate the solution provided in the embodiments of the present application.
[0214] Specifically, the computer may also determine the first speed and the second speed according to the first window information, the first control information, the second window information, the cache capacity and the decoding capacity of the computer.
[0215] In one implementation, taking the case where the first speed determined by the computer and the second speed are the same as an example, specifically, the method for the computer to determine the first speed and the second speed may include S201-S206:
[0216] S201. The computer determines a first distance S1 according to the first window information and the first control information (specifically, the mapped first control information, i.e., the first mapped control information), and determines a second distance S2 according to the first mapped control information and the first window information.
[0217] In the case where both the first mapping control information and the second window information are rectangular information, taking the first mapping control information as (l2′, r2′, w2′, h2′) and the second window information as (l3′, r3′, w3′, h3′) as an example, the second distance S2 can be calculated by the following expression:
[0218]
[0219] The calculation method of the first distance is the same as the calculation method of the second distance, which will not be described in detail here.
[0220] S202, the computer determines the first time t1, that is, the moving time of the first distance, according to the buffer size B and the buffer speed x. Specifically, the expression of the first time t1 can be:
[0221]
[0222] S203, the computer determines the second time t2, i.e., the moving time of the second distance, according to the preset decoded data volume D and the decoding capability parameter y. The preset decoded data volume D is the preset data volume that meets the smooth playback condition of the data stream, for example, the data volume of one or more frames of images in the video stream.
[0223] Specifically, the expression of the second time t2 can be:
[0224]
[0225] S204, the computer determines a first estimated speed v1′ according to the first distance S1 and the first time t1. Specifically, the expression of the first estimated speed v1′ can be:
[0226]
[0227] S205, the computer determines a second estimated speed v2′ according to the second distance S2 and the second time t2. Specifically, the expression of the second estimated speed v2′ can be:
[0228]
[0229] S206. When the first estimated speed v1′ is less than or equal to the second estimated speed v2′, the computer can determine that the first speed and the second speed are both the first estimated speed v1′. When the first estimated speed v1′ is greater than the second estimated speed v2′, the computer can determine that the first speed and the second speed are both the second estimated speed v2′. In this way, sufficient time can be reserved for the computer to cache and decode the switched vertical screen video stream, thereby ensuring that the switched vertical screen video stream can be played smoothly after the computer's switching animation is displayed.
[0230] In this implementation, that is, when the first speed and the second speed are the same, the switching animation is reduced from the starting window 201 to the middle window 202 at the same speed, and then enlarged to the ending window 203. In this way, the moving speed of the switching animation is uniform and unchanged, which can improve the smoothness of the switching animation and the user experience.
[0231] In one implementation, taking the case where the first speed and the second speed determined by the computer are different as an example, the method for determining the first speed and the second speed by the computer may include S301-S306:
[0232] S301, the computer determines the first distance S1 according to the first window information and the first control information (specifically, the mapped first control information, i.e., the first mapped control information), and determines the second distance S2 according to the first mapped control information and the first window information. The specific implementation method can refer to the above S201, which will not be described in detail here.
[0233] S302, the computer determines the first time t1, that is, the moving time of the second distance, according to the preset decoding data volume D and the decoding capability parameter y. Specifically, the expression of the first time t1 can be:
[0234]
[0235] S303, the computer determines a first estimated speed v1′, that is, a moving speed of the second distance, according to the second distance S2 and the first time t1. Specifically, the expression of the first estimated speed v1′ can be:
[0236]
[0237] S304, the computer determines the second time t2, that is, the moving time of the first distance, according to the first distance S1 and the first estimated speed v1′. Specifically, the expression of the second time t2 can be:
[0238]
[0239] S305: The computer determines a third time t3, i.e., the buffering time, according to the buffer size B and the buffering speed x. Specifically, the expression of the third time t3 can be:
[0240]
[0241] S306: When the second time t2 is greater than or equal to the third time t3, the computer can determine that the first speed and the second speed are both the first estimated speed v1′.
[0242] When the second time t2 is less than the third time t3, the computer can determine that the second speed is the first estimated speed v1′. And the first speed, that is, the moving speed of the first distance, can be determined according to the first distance S1 and the third time t3. Specifically, the expression of the first speed v1 can be:
[0243]
[0244] In this way, it can be ensured that the computer has enough time to cache the switched vertical screen video stream, so that after the computer's switching animation effect is displayed, the switched vertical screen video stream can be played smoothly.
[0245] In some embodiments, when the switching effect generated by the computer is to reduce the first window to the first point at the first speed, and then to enlarge the first point to the second window at the second speed, the computer can also determine the first speed and the second speed through the above S201-S206, and S301-S306. Specifically, when the computer determines the first distance and the second distance (such as the above S201 and S301), the first mapping control information can be replaced with the position information of the first point. In this way, the computer can accurately determine the first speed and the second speed.
[0246] In one implementation, the computer can implement the above S201-S206 and S301-S306 through a motion effect control module in the computer.
[0247] In some embodiments, in order to ensure that there is no ghosting or screen flickering in the switching animation, the computer can also determine whether the first speed and the second speed are between the first speed threshold and the second speed threshold, that is, greater than the first speed threshold and less than the second speed threshold. The first speed threshold is the minimum speed for the video stream playback screen to have no ghosting, and the second speed threshold is the maximum speed for the video stream playback screen to have no screen flickering.
[0248] Specifically, the first speed threshold and the second speed threshold can be determined based on consensus baseline data (such as prior knowledge), and the first speed threshold and the second speed threshold can also be determined based on user experience data. The first speed threshold and the second speed threshold can be constant values, and the first speed threshold and the second speed threshold can also be dynamically adjusted according to user experience, and this application does not make specific limitations on this.
[0249] When the first speed and the second speed are not between the first speed threshold and the second speed threshold, the computer can adjust the first speed and the second speed so that the first speed and the second speed are between the first speed threshold and the second speed threshold, so that the computer determines that there is no ghosting or screen flickering in the screen switching animation.
[0250] In one implementation, the computer can adjust the first speed and the second speed through a decoding capability adaptation module in the computer. Specifically, as can be seen from the above-mentioned process of determining the first speed and the second speed in S201-S206 and S301-S306, the first speed and the second speed are related to the decoding capability parameters of the computer. Therefore, the decoding capability adaptation module can adjust the decoding capability parameters to adjust the first speed and the second speed between the first speed threshold and the second speed threshold.
[0251] In some embodiments, the computer can use the first speed and the second speed as the baseline to maintain a constant speed to generate the switching effect. For example, the switching effect can be uniformly transformed from the starting window 201 to the middle window 202 at the first speed, and then uniformly transformed from the middle window 202 to the ending window 203 at the second speed.
[0252] In some embodiments, the computer can also use the first speed and the second speed as the baseline to generate a switching effect by changing the speed. That is, the switching effect changes from the starting window 201 to the middle window 202 with the first speed as the baseline, first fast then slow or first slow then fast, and then from the middle window 202 to the ending window 203 with the second speed as the baseline, first fast then slow or first slow then fast. Exemplarily, the computer can use the first speed and the second speed as the baseline to determine the specific speed of the speed change based on the Bezier curve principle.
[0253] In some embodiments, the display content of the switching animation may be related to the display content of the first application (i.e., the horizontal video stream and the vertical video stream). Specifically, the display content of the switching animation may be: one or more of the following: the video of the horizontal video stream, the last frame image of the horizontal video stream, the video of the vertical video stream, the first frame image of the vertical video stream, a frame image in the horizontal video stream, and a mask image of a frame image in the horizontal video stream. The display content of the switching animation may also include, but is not limited to: a preset mask image, a preset image (such as a preset logo), a preset video, etc. Among them, the mask image is an image after blurring the image.
[0254] In one implementation, in S104 or S105, after receiving the switching instruction, the computer can obtain the last frame image of the horizontal screen video stream, or the mask image, or the preset image, or the preset video, etc., to generate the display content of the switching animation, for example, the display content of the starting window 201.
[0255] In one implementation, in S104, after receiving the switching instruction, the mobile phone can also obtain the first frame image of the vertical screen video stream, or the mask image, or the preset image, or the preset video, etc., to generate the display content of the switching animation, for example, the display content of the termination window 203.
[0256] In some application scenarios, before the computer completes decoding of the received vertical video stream, if the mobile phone does not stop sending the horizontal video stream to the computer, then during the process of displaying the switching effect, the display content of the first window (for example: from the starting window 301 to the middle window 302, and / or, the window in the process from the middle window 302 to the ending window 303) can continue to play the horizontal video stream until the last frame of the horizontal video stream is played.
[0257] In one implementation, before the switching animation moves to the termination window, if the horizontal screen video stream has been played, the last frame image of the horizontal screen video stream can be used as the display content of the switching animation moving window until it moves to the termination window, that is, the switching animation is completed.
[0258] In one implementation, when the animation is switched to the termination window, if the horizontal video stream has not been played, it can continue to be played in the termination window. At the same time, the computer will cache and decode the received vertical video stream. After the vertical video stream is decoded, it will continue (or replace) the horizontal video stream played in the termination window and play the vertical video stream in the termination window, so that the vertical video stream and the horizontal video stream content are connected and the video stream is smoothly switched.
[0259] like Fig. 9 As shown, after the computer generates and displays the switching animation, the method further includes:
[0260] S106. After the computer completes switching the dynamic effect display, the vertical screen video stream is displayed in the second window.
[0261] In an embodiment of the present application, after the switching effect is displayed, the computer can display a vertical screen video stream in the second window. The second window can be the window when the switching effect is displayed, for example, the above-mentioned termination window 203. That is, the second window can be obtained by changing the position and / or size of the first window. The second window can also be a display window regenerated by the computer according to the second window information after the switching effect is displayed. This application does not make specific limitations on this.
[0262] In some embodiments, during the process of the computer generating the switching animation in S105, when the computer determines the first speed and the second speed according to the decoding capability, such as Fig. 9 As shown, before S105, the video switching method provided in the embodiment of the present application further includes:
[0263] S107. The computer obtains the decoding capability parameters of the computer.
[0264] In the embodiment of the present application, the computer can also obtain the computer's decoding capability parameters, which are used to characterize the computer's ability to decode video streams. The decoding capability parameters include but are not limited to: decoding time for video streams with different bit streams, decoding speed (i.e., the amount of data decoded by the computer per unit time), etc.
[0265] In one implementation, S107 may be implemented by a decoding capability adaptation module in a computer.
[0266] In one example, the decoding capability adaptation module can obtain the decoding capability parameters of the computer through local storage or cloud server. Specifically, a preset decoding capability mapping table is stored in the local storage of the computer or in the cloud server, and the decoding capability mapping table is a decoding capability mapping table for different bitstream video streams based on different network parameters and electronic device (such as computer) capabilities. Among them, network parameters include, for example, bandwidth, rate, and latency, and electronic device capabilities include, for example, the processing capability of the device chip, etc.
[0267] In another example, the decoding capability adaptation module can also estimate the decoding capability parameters of the computer. Specifically, the computer can obtain the time point (T startTimeBuf ), the time point when the vertical screen video stream decoding is completed recorded in the decoder (T endTimeBuf ) and the amount of data accumulated in the buffer (D sum ). Then, the computer can estimate the computer's decoding capability parameter y according to the following expression:
[0268]
[0269] It should be noted that S107 is an optional step, and S107 is executed when the computer needs to determine the first speed and the second speed of the switching effect in combination with the decoding capability parameters in S105. S107 can be executed when the collaborative operation is triggered (i.e., when the mobile phone and the computer establish a collaborative operation connection in S101), and S107 can also be executed after S101 and before S105 to ensure that the first speed and the second speed can be determined according to the decoding capability parameters in S105. This application does not make specific restrictions on this.
[0270] In some embodiments, Fig. 9 As shown, after S105, the video switching method provided in the embodiment of the present application further includes:
[0271] S108. After the computer displays the switching animation, obtain actual decoding capability parameters for decoding the vertical screen video stream, and update the original decoding capability parameters.
[0272] In some embodiments, after the computer displays the switching effect determined in S105, the actual decoding capability parameters of the computer for decoding the vertical screen video stream can be obtained. In addition, the computer can use the actual decoding parameters to update the decoding capability parameters of the computer in the decoding capability mapping table. In this way, the decoding capability parameters in the decoding capability mapping table can be close to the actual decoding capability of the computer.
[0273] In one implementation, S108 can be implemented by a decoding detection module in a computer. Specifically, the decoding detection module can monitor the decoding capability parameters of the computer in real time. During the process of the computer display switching effect, the decoding detection module can obtain the decoding capability parameters of the computer decoding the vertical screen video stream in real time. After the computer display switching effect is completed, the decoding detection module can determine the actual decoding capability parameters to update the original decoding capability parameters in the decoding capability mapping table.
[0274] As in the video switching method described in S101-S108 in the above embodiments, by using the method provided in the embodiments of the present application, the mobile phone can obtain the information (such as position information) of the control used to play the video in the window where the mobile phone plays the vertical screen video stream, that is, the first control information. And the first control information can be transmitted to the computer. In this way, when the window where the mobile phone plays the video stream switches from the horizontal screen state to the vertical screen state, that is, when the horizontal screen video stream is switched to the vertical screen video stream. The computer can determine the change position of the first window in the process of the computer switching from playing the horizontal screen video stream to playing the vertical screen video stream based on the first window information, the first control information, and the second window information, and then generate and display the switching animation, so that the computer can smoothly switch between the two video streams.
[0275] Next, we continue to take the mobile phone and computer in the above embodiment as an example. In some application scenarios, before the computer generates a switching animation based on the method described in S101-S108 above to achieve smooth switching from playing a video stream in a horizontal screen state to playing a video stream in a vertical screen state, the computer can also generate a switching animation to achieve smooth switching from playing a video stream in a vertical screen state to playing a video stream in a horizontal screen state when the mobile phone switches from playing a vertical screen video stream to playing a horizontal screen video stream.
[0276] Fig.15 Schematic diagram of the principle of the video switching method provided in the embodiment of the present application Figure 4 ,like Fig.15 As shown, first, when the mobile phone plays a vertical screen video stream, it sends the vertical screen video stream and the first control information to the computer, and the first control information is associated with the position of the control for playing the video in the window where the mobile phone plays the vertical screen video stream. The computer plays the vertical screen video stream in the third window. And when the first control information changes, the updated first control information is sent to the computer. After the mobile phone switches from playing the vertical screen video stream to the horizontal screen video stream, the horizontal screen video stream is sent to the computer. The computer can generate and display the switching animation according to the third window information, the second control information and the fourth window information, so that the computer can smoothly switch from the vertical screen video stream to the horizontal screen video stream.
[0277] Specifically, Fig.16 Schematic diagram of the video switching method provided in the embodiment of the present application Figure 2 ,like Fig.16As shown, the video switching method provided in the embodiment of the present application mainly includes S401-S410:
[0278] S401. The mobile phone and the computer establish a collaborative operation connection.
[0279] Specifically, the implementation method of establishing a collaborative operation connection between the mobile phone and the computer can refer to the above S101, which will not be described in detail here.
[0280] S402: The mobile phone sends a vertical screen video stream and first control information to the computer.
[0281] In some embodiments, there are multiple video playback controls in the display interface of the mobile phone playing the vertical screen video stream, that is, the window of the first application displayed by the mobile phone includes multiple first controls. Fig.10 As shown, the window of the first application displayed on the mobile phone also includes multiple first controls such as play control 103, play control 104 and play control 105. The mobile phone can also obtain control information of play control 103, play control 104 and play control 105 to obtain multiple first control information.
[0282] In some embodiments, when at least one first control is included, the mobile phone can also obtain and send first identification information corresponding to each first control information. Specifically, the first identification information is the identification information corresponding to the first control information, that is, the identification information corresponding to the first control, and each first identification information corresponds to a first control. Among them, the first identification information is a unique identifier of the first control. For example, the first identification information can be an identity document (ID) of the first control, and the first identification information can be used to distinguish the first control, so as to quickly determine the first control information corresponding to the first control.
[0283] In one implementation, the mobile phone can send the first control information and the corresponding first identification information to the computer through a control channel. In another implementation, the mobile phone can also send the first control information and the corresponding first identification information to the computer through an independent logical channel.
[0284] In some embodiments, the mobile phone may also send a second indication message to the computer, and the second indication message may be used to indicate the position and / or size of the projection window for playing the vertical video stream on the computer. In this way, the computer can quickly generate a projection window for playing the vertical video stream.
[0285] In one implementation, the second indication information may be the position and / or size of the window in which the mobile phone displays the vertical video stream. The position and / or size of the window in which the mobile phone displays the vertical video stream may be used by the computer to determine the position and / or size of the projection window and generate a projection window to play the vertical video stream.
[0286] S403: The computer receives the vertical screen video stream and the first control information, the computer displays the vertical screen video stream in a third window, and saves the first control information.
[0287] In an embodiment of the present application, after the computer caches and decodes the received vertical screen video stream, it obtains the decoded vertical screen video stream and displays the vertical screen video stream in the projection window (i.e., the third window). Among them, the position and size of the third window can be determined based on the third window information. The third window information can be associated with the size of the window in which the mobile phone displays the vertical screen video stream.
[0288] In one implementation, when the mobile phone sends the second indication information to the computer at S402, and the second indication information can be the position and / or size of the window in which the mobile phone displays the vertical screen video stream, the computer can determine the third window information according to the second indication information. Further, the computer can generate a third window according to the third window information to play the vertical screen video stream in the third window.
[0289] In addition, the computer can also perform position mapping on the received first control information, obtain and save the projection position of the first control in the computer (ie, the first mapping control information), and save the first mapping control information.
[0290] In some embodiments, when a mobile phone sends multiple first control information and corresponding first identification information, the computer can also map and transform each of the multiple first control information to obtain first mapping control information corresponding to the multiple first control information, and save each first mapping control information and the first identification information corresponding thereto.
[0291] S404: The mobile phone sends a horizontal screen video stream to the computer in response to the switching instruction.
[0292] Specifically, the switching instruction can be used to instruct the mobile phone to switch from the portrait mode to the landscape mode, that is, to switch from playing the portrait video stream to the landscape video stream. The switching instruction can be generated by the user initiating a switching operation on the mobile phone. The switching instruction can also be generated by the user initiating a switching operation on the computer, and the computer sends the switching instruction to the mobile phone.
[0293] In an embodiment of the present application, the mobile phone can switch from playing a vertical screen video stream to a horizontal screen video stream in response to a switching instruction, that is, the video stream sent by the mobile phone to the computer is switched from a vertical screen video stream to a horizontal screen video stream.
[0294] In some embodiments, when the mobile phone sends the first identification information to the computer in S402, the mobile phone may also send target identification information to the computer. The target identification information is identification information of the target control, and the target identification information is one of the first identification information, that is, the target control is one of the first controls. Specifically, the target control is the first control determined by the user for switching to horizontal screen playback, that is, the target control is the first control selected by the user in the mobile phone display interface to switch to playing the horizontal screen video stream.
[0295] In some embodiments, similar to the way in which the mobile phone sends the first control information, the mobile phone can send the identification information of the target control to the computer through the control channel. An independent logical channel can also be opened between the mobile phone and the computer to send the identification information of the target control to the computer, which is not specifically limited in this application.
[0296] S405: The mobile phone receives the horizontal screen video stream, and in response to the switching instruction, generates and displays a switching animation according to the third window information, the first control information and the fourth window information.
[0297] In an embodiment of the present application, the computer can cache and decode the received horizontal screen video stream to obtain the decoded horizontal screen video stream, and can display the vertical screen video stream in the fourth window. Among them, the position and size of the fourth window can be determined according to the fourth window information. The fourth window information may include the size of the entire display interface (full screen) of the computer, and the fourth window information may also be associated with the position and / or size of the window of the first application displayed in the horizontal screen state of the mobile phone (i.e., the window playing the horizontal screen video stream).
[0298] In one implementation, the fourth window information may be preset in the computer. Exemplarily, the fourth window information preset in the computer may be the size of the entire display interface of the computer. Thus, in S404, the mobile phone may also send a full-screen play instruction to the computer, and the computer may respond to the full-screen play instruction, generate a fourth window according to the preset fourth window information, and play the horizontal screen video stream in full-screen mode.
[0299] In another implementation, the computer can also receive the position and / or size of the window of the mobile phone playing the horizontal screen video stream sent by the mobile phone, and determine the fourth window information according to the position and / or size of the window of the mobile phone playing the horizontal screen video stream. Exemplarily, the computer can map and transform the position and / or size of the window of the mobile phone playing the horizontal screen video stream (such as: position offset, proportional scaling, etc.) to determine the fourth window information. Further, the computer can generate a fourth window according to the fourth window information to play the horizontal screen video stream in the fourth window.
[0300] In response to the switching instruction, the computer can generate and display a switching animation based on the third window information, the first control information and the fourth window information. The switching animation includes the computer displaying the window of the first application in a portrait state to the window of the first application in a landscape state, that is, the computer changes from the third window playing the vertical video stream to the fourth window playing the horizontal video stream.
[0301] In some embodiments, the computer can scale the first window according to the third window information, the first control information, and the fourth window information, and make the content displayed in the third window change as the size of the third window changes, thereby forming a switching effect. Specifically, the switching effect generated by the computer may include: according to the third window information and the first control information, the third window is reduced, and the size and position of the reduced third window are associated with the first control information. Then, according to the fourth window information, the third window is enlarged, and the size and position of the enlarged third window are associated with the fourth window information.
[0302] In one implementation, in the computer-generated switching effect, the third window can be reduced to a second point according to the first control information, and then the third window can be enlarged from the second point. The second point is determined according to the first control information, and the second point can be a point determined according to the position and size of the first control in the first control information and a preset rule.
[0303] For example, Fig.17 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 3 ,like Fig.17 As shown, taking the second point as the center point of the first control in the window of the computer playing the vertical screen video stream, and the fourth window as the full screen window of the computer as an example, the switching effect generated by the computer may include: in the display interface 200 of the computer, the third window 310 is reduced to the center point 320 of the first control with the third action and the third speed, and then enlarged from the center point 320 of the first control to the fourth window 330 with the fourth action and the fourth speed.
[0304] In another implementation, in the computer-generated switching animation, the third window can be reduced to the size and position determined by the first mapping control information with a third action and a third speed according to the first control information, and then the third window can be enlarged to the size and position determined according to the fourth window information with a fourth action and a fourth speed.
[0305] For example, Fig.18 Schematic diagram of the switching effect provided in the embodiment of the present application Figure 4 ,like Fig.18As shown, taking the fourth window as a full-screen window of the computer as an example, the switching animation generated by the computer can be that the third window (i.e., the starting window 301) determined by the third window information (l2, r2, w2, h2) in the display interface of the computer is reduced to the window (i.e., the middle window 302) determined by the first mapping control information (l1′, r1′, w1′, h1′) with the third action and the third speed, and then enlarged from the middle window 302 to the fourth window (i.e., the ending window 303) determined by the fourth window information (l3, r3, w3, h3).
[0306] The third action and the fourth action may be the same or different, and the third action and the fourth action may be one or more of the following motion effects: rotation, fade in and fade out, or fly in and fly out, etc. This application does not specifically limit the third action and the fourth action.
[0307] In some embodiments, when the decoding capability of the computer is stable, the computer can determine the third speed and the fourth speed according to the third window information, the first control information, the fourth window information and the preset time.
[0308] In some embodiments, the computer can also estimate the moving speed of the switching animation and determine the third speed and the fourth speed based on the computer's caching and decoding process of the horizontal screen video stream, combined with the computer's caching capacity and decoding capacity.
[0309] Specifically, the computer can determine the third speed and the fourth speed according to the third window information, the first control information and the fourth window information as well as the cache capacity and decoding capacity of the computer. The method for determining the third speed, the fourth speed and the display content of the switching animation can refer to the method for determining the first speed, the second speed and the display content of the switching animation in S105 above, which will not be described in detail here.
[0310] S406. After the computer completes switching the dynamic effect display, it displays the horizontal screen video stream in the fourth window.
[0311] The fourth window may be a window when the display of the switching effect is completed, for example, the above-mentioned termination window 303. That is, the second window may be obtained by changing the position and / or size of the third window. The fourth window may also be a display window regenerated by the computer according to the fourth window information after the display of the switching effect is completed. This application does not make specific limitations on this.
[0312] In some embodiments, during the process of the computer generating the switching animation in S405, when the computer determines the third speed and the fourth speed according to the decoding capability, such as Fig.16 As shown, before S405, the video switching method provided in the embodiment of the present application further includes:
[0313] S407: The computer obtains the decoding capability parameters of the computer.
[0314] S408. After the computer displays the switching effect, obtain actual decoding capability parameters for decoding the horizontal screen video stream, and update the original decoding capability parameters.
[0315] Specifically, the implementation of S407-S408 may refer to the above S107-S108, which will not be elaborated here.
[0316] In some embodiments, in order to enable the computer to accurately determine the change position of the switching effect and improve the smoothness of the switching effect generated by the computer, the mobile phone can also monitor the first control information in real time, and when the first control information changes, obtain and send the updated first control information to the computer, so that the first control information can be updated in time. Fig.16 As shown, before S405, the video switching method provided in the embodiment of the present application further includes:
[0317] S409: The mobile phone detects the first control information in real time, and when the first control information changes, obtains and sends the updated first control information to the computer.
[0318] In some application scenarios, when the first control information changes. For example, Fig.19 A schematic diagram of a mobile phone display interface provided in an embodiment of the present application, such as Fig.19 As shown, the user can move the display interface of the mobile phone up and down by sliding the display screen of the mobile phone up and down, thereby changing the position of the play controls (such as play controls 102, play controls 103, play controls 104 and play controls 105) in the window of the first application, resulting in changes in the first control information. The mobile phone detects the first control information in real time and sends the updated first control information to the computer. In this way, it can be ensured that the computer can quickly and accurately obtain the first control information when determining the motion effect.
[0319] In one implementation, S409 can be implemented by a control perception module in the mobile phone. Specifically, the control perception module can detect in real time whether the information and size of the first control in the window of the first application displayed on the mobile phone have changed. If the first control information has changed, the latest first control information is obtained to update the first control information, and the updated first control information is sent to the computer. In this way, the computer can accurately determine the switching effect based on the first control information.
[0320] In some embodiments, when the mobile phone sends the first identification information to the computer in S402, the mobile phone may also send updated first control information and corresponding first identification information to the computer, so that the computer can quickly update the first control information according to the first identification information.
[0321] In the embodiment of the present application, whether the first control information has changed includes but is not limited to: the size information of the first control has changed, the position information of the first control has changed, the first control information has been deleted (i.e. the original first control is moved out of the window of the mobile phone displaying the first application) and the first control information is added (i.e. the new first control is moved into the window of the mobile phone displaying the first application). Fig.19 As shown, the play controls 106, 107 and 108 are newly added play controls after the window content of the mobile phone displaying the first application changes. The control information corresponding to the play controls 106, 107 and 108 is the newly added first control information.
[0322] S410. The computer receives updated first control information and saves the updated first control information.
[0323] In an embodiment of the present application, after receiving the updated first control information, the computer can perform a mapping transformation on the received updated first control information to obtain updated first mapping control information, and replace the original first mapping control information with the updated first mapping control information to implement the update of the first mapping control information.
[0324] Exemplarily, when the mobile phone sends the updated first control information and the corresponding first identification information to the computer, the computer can determine the first control information saved in S403 according to the first identification information, and replace the original first control information with the updated first control information corresponding to the first identification information. If the computer does not find the saved original first control information according to the first identification information, it means that the updated first control information corresponding to the first identification information is the newly added first control information, and the first control information is directly saved.
[0325] In one implementation, if the computer does not receive the first identification information saved in S403, it means that the first control corresponding to the first identification information has been moved out of the window of the mobile phone displaying the first application, and the computer can delete the first control information corresponding to the first identification information. In this way, the computer's storage resources can be saved.
[0326] In the embodiment of the present application, the above S409 and S410 are optional steps. If the first control information will change, S409 and S410 are performed after S402. If the first control information will not change, S409 and S410 are not performed.
[0327] As in the video switching method described in S401-S410 of the above embodiment, by using the method provided in the embodiment of the present application, the mobile phone can obtain the information (such as position information) of the control used to play the video in the window where the mobile phone plays the vertical screen video stream, that is, the first control information, and can transmit the first control information to the computer. In this way, when the window where the mobile phone plays the video stream switches from the vertical screen state to the horizontal screen state, that is, when the vertical screen video stream is switched to the horizontal screen video stream. The computer can determine the change position of the third window in the process of the computer switching from playing the vertical screen video stream to playing the horizontal screen video stream based on the third window information, the first control information and the fourth window information, and then generate and display the switching animation, so that the computer can smoothly switch between the two video streams.
[0328] It is understandable that, in order to realize the above functions, the above electronic device includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0329] The embodiment of the present application can group the functional modules of the electronic device according to the above method example. For example, each functional module can be grouped according to each function, or two or more functions can be integrated into one processing module. The above integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the grouping of modules in the embodiment of the present application is schematic and is only a logical functional grouping. There may be other grouping methods in actual implementation.
[0330] An embodiment of the present application also provides a video switching device, which can be the above-mentioned second electronic device (such as the computer in the above-mentioned embodiment), or a chip in the second electronic device, or a system on chip. The video switching device can be used to execute the functions related to the computer in the above-mentioned embodiment.
[0331] As a feasible method, Fig. 20As shown, the video switching device 200 includes: a receiving module 201, a display module 202, a control perception module 203 and a motion effect control module 204. The receiving module 201 is used to receive a first video stream, which is display data when the first electronic device displays the window of the first application in the first state. The display module 202 is used to display the first video stream in the first window. The receiving module 201 is also used to receive a second video stream, which is display data when the first electronic device displays the window of the first application in the second state. The control perception module is used to receive first control information, which is associated with the position of the first control in the window of the first application displayed in the second state, and the first control is a control for playing a video in the window of the first application. The motion effect control module 203 is used to generate a switching motion effect according to the first window information, the first control information and the second window information, wherein the first window information is associated with the first window, the second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state, and the switching motion effect includes from displaying the window of the first application in the first state to displaying the window of the first application in the second state, wherein the display content of the switching motion effect is related to the first application. The display module 202 is also used to display the first video stream in the second window after the switching animation effect display is completed, and the second window is associated with the second window information.
[0332] In some embodiments, the video switching device 200 further includes: a collaboration module 205, a decoding capability adaptation module 206, and a decoding monitoring module 207. The collaboration module 205 is used to establish a collaborative operation connection to implement a collaborative operation function. The decoding capability adaptation module 206 is used to obtain a decoding capability parameter to determine the change speed of the switching effect. The decoding monitoring module 207 is used to monitor the actual decoding capability parameters of the video stream to update the decoding capability parameters.
[0333] An embodiment of the present application also provides a video switching device, which can be the above-mentioned first electronic device (such as the mobile phone in the above-mentioned embodiment), or a chip in the first electronic device, or a system on chip. The video switching device can be used to execute the functions of the mobile phone involved in the above-mentioned embodiment.
[0334] As a feasible method, Fig.21As shown, the video switching device 300 includes: a sending module 301 and a control perception module 302. Among them, the sending module 301 is used to send a first video stream, and the first video stream is the display data when the first electronic device displays the window of the first application in the first state. The control perception module 302 is used to obtain and send first control information, and the first control information is associated with the position of the first control in the window of the first application displayed in the second state. The first control is a control for playing a video in the window of the first application; the first control information is used for the second electronic device to generate a switching effect, and the switching effect includes the second electronic device from displaying the window of the first application in the first state to displaying the window of the first application in the second state. The sending module 301 is also used to send a second video stream, and the second video stream is the display data when the window of the first application is displayed in the second state.
[0335] The present application also provides an electronic device, which may include: a memory and one or more processors. The memory is coupled to the processor. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the electronic device can execute the various functions or steps executed by the mobile phone in the above method embodiment, or the electronic device can execute the various functions or steps executed by the computer in the above method embodiment. Of course, the electronic device includes but is not limited to the above memory and one or more processors. For example, the structure of the electronic device can refer to Figure 5 The structure of the electronic device shown.
[0336] The present application also provides a chip system, which can be applied to the electronic device in the above embodiment. Fig. 22 As shown, the chip system includes at least one processor 401 and at least one interface circuit 402. The processor 401 may be a processor in the above-mentioned electronic device. The processor 401 and the interface circuit 402 may be interconnected via a line. The processor 401 may receive and execute computer instructions from the memory of the above-mentioned electronic device via the interface circuit 402. When the computer instructions are executed by the processor 401, the electronic device may execute the various steps executed by the mobile phone in the above-mentioned embodiment, or the electronic device may execute the various steps executed by the computer in the above-mentioned embodiment. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0337] An embodiment of the present application also provides a computer-readable storage medium for storing computer instructions executed by the above electronic device.
[0338] An embodiment of the present application also provides a computer program product, including computer instructions executed by the above electronic device.
[0339] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0340] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0341] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0342] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0343] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0344] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A video switching method, characterized in that: Applied to a second electronic device, the method includes: receiving a first video stream sent by a first electronic device, where the first video stream is display data when the first electronic device displays a window of a first application in a first state; Displaying the first video stream in a first window of the second electronic device; receiving a second video stream and first control information sent by the first electronic device, wherein the second video stream is display data when the first electronic device displays the window of the first application in a second state, the first control information is associated with a position of a first control in the window of the first application displayed in the second state, and the first control is a control in the window of the first application for playing a video; Generate a switching animation according to the first window information, the first control information, and the second window information, wherein the first window information is associated with the first window, the second window information is associated with the position of the window of the first application displayed by the first electronic device in the second state, the switching animation includes the second electronic device changing from displaying the window of the first application in the first state to displaying the window of the first application in the second state, wherein the display content of the switching animation is related to the first application; After the switching animation is displayed, the first video stream is displayed in a second window of the second electronic device, and the second window is associated with the second window information.
2. The method according to claim 1, characterized in that The first control information is also associated with the size of the first control in the window of the first application displayed in the second state.
3. The method according to claim 1 or 2, characterized in that: The first window information is associated with at least one of a position or a size of a window of the first application displayed by the first electronic device in the first state; Before displaying the first video stream in the first window of the second electronic device, the method further includes: At least one of a position or a size of a window of the first application displayed by the first electronic device in the first state is received, which is sent by the first electronic device.
4. The method according to any one of claims 1 to 3, characterized in that: Before generating the switching animation according to the first window information, the first control information and the second window information, the method further includes: A position of a window of the first application displayed by the first electronic device in the second state is received, which is sent by the first electronic device.
5. The method according to any one of claims 1 to 4, characterized in that: The second window information is also associated with a size of a window of the first application displayed by the first electronic device in the second state; Before generating the switching animation according to the first window information, the first control information and the second window information, the method further includes: Receive the size of the window of the first application displayed by the first electronic device in the second state, which is sent by the first electronic device.
6. The method according to any one of claims 1 to 5, characterized in that: Before receiving the second video stream and the first control information sent by the first electronic device, the method further includes: A switching instruction is received, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
7. The method according to claim 6, characterized in that The first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
8. The method according to any one of claims 1 to 7, characterized in that: The generating a switching animation according to the first window information, the first control information and the second window information includes: According to the first window information and the first control information, shrinking the first window, wherein the size and position of the shrunken first window are associated with the first control information; Then, the first window is enlarged according to the second window information, and the size and position of the enlarged first window are associated with the second window information.
9. The method according to claim 8, characterized in that The reducing the first window according to the first window information and the first control information includes: The first window is reduced to a first point, where the first point is determined according to the first control information.
10. The method according to claim 9, characterized in that The first point is a center point of the first control in the window of the first application displayed by the second electronic device in the second state.
11. The method according to any one of claims 8 to 10, characterized in that: While reducing the first window, one or more of the following animations are displayed: rotation, fade in and fade out, and fly in and fly out; while enlarging the first window, one or more of the following animations are displayed: rotation, fade in and fade out, and fly in and fly out.
12. The method according to any one of claims 1 to 11, characterized in that: The display content of the switching animation is: one or more of the last frame image of the first video stream, the first frame image of the second video stream, a mask image, a preset image, and a preset video.
13. The method according to any one of claims 8 to 12, characterized in that: The method further comprises: reducing the first window at a first speed, and then enlarging the first window at a second speed; The first speed and the second speed are determined according to the cache capacity and decoding capacity of the second electronic device, the cache capacity of the second electronic device is used to characterize the ability of the second electronic device to cache the video stream, and the decoding capacity of the second electronic device is used to characterize the ability of the second electronic device to decode the video stream.
14. The method according to claim 13, characterized in that The generating of the switching animation according to the first window information, the first control information and the second window information further includes: Determine a moving distance according to the first window information, the first control information and the second window information; Determining the moving time according to the buffering capacity and decoding capacity of the second electronic device; The first speed and the second speed are determined according to the moving distance and the moving time.
15. The method according to claim 14, characterized in that The moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time; Then determining the first speed and the second speed according to the moving distance and the moving time includes: Determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information; determining the first time according to a cache capability of the second electronic device; determining the second time according to a decoding capability of the second electronic device; Determine a first estimated speed according to the first distance and the first time, and determine a second estimated speed according to the second distance and the second time; When the first estimated speed is less than or equal to the second estimated speed, determining that the first speed and the second speed are both the first estimated speed; When the first estimated speed is greater than the second estimated speed, it is determined that the first speed and the second speed are both the second estimated speed.
16. The method according to claim 14, characterized in that The moving distance includes: a first distance and a second distance, and the moving time includes: a first time and a second time; Then determining the first speed and the second speed according to the moving distance and the moving time includes: Determine the first distance according to the first window information and the first control information, and determine the second distance according to the first control information and the second window information; determining the first time according to a decoding capability of the second electronic device; determining the second speed according to the second distance and the first time; determining a second time according to the first distance and the second speed; Determining the third time according to the cache capability of the second electronic device; When the second time is greater than or equal to the third time, determining that the first speed is the same as the second speed; When the second time is less than the third time, the first speed is determined according to the first distance and the third time.
17. A video switching method, characterized in that: Applied to a first electronic device, the method includes: Sending a first video stream, where the first video stream is display data when the first electronic device displays a window of a first application in a first state; Acquire first control information, where the first control information is associated with a position of a first control in the window of the first application displayed in the second state, and the first control is a control in the window of the first application for playing a video; A second video stream and the first control information are sent, wherein the second video stream is display data when the first electronic device displays the window of the first application in a second state, and the first control information is used for the second electronic device to generate a switching effect, wherein the switching effect includes the second electronic device displaying the window of the first application in the first state to displaying the window of the first application in the second state.
18. The method according to claim 17, characterized in that The first control information is also associated with the size of the first control in the window of the first application displayed in the second state.
19. The method according to claim 17 or 18, characterized in that Before sending the second video stream and the first control information, the method further includes: Acquire at least one of a position or a size of a window of the first application displayed by the first electronic device in the first state; At least one of the position or size of the window of the first application displayed by the first electronic device in the first state is sent, and at least one of the position or size of the window of the first application displayed by the first electronic device in the first state is used to determine first window information, and the first window information is used by the second electronic device to generate the switching animation.
20. The method according to any one of claims 17 to 19, characterized in that: Before sending the second video stream and the first control information, the method further includes: Acquire at least one of a position or a size of a window of the first application displayed by the first electronic device in the second state; At least one of the position or size of the window of the first application displayed by the first electronic device in the second state is sent, and at least one of the position or size of the window of the first application displayed by the first electronic device in the second state is used to determine second window information, and the second window information is used by the second electronic device to generate the switching animation.
21. The method according to any one of claims 17 to 20, characterized in that: Before sending the second video stream and the first control information, the method further includes: A switching instruction is sent, where the switching instruction is used to instruct the first electronic device to change the screen orientation from horizontal to vertical.
22. The method according to any one of claims 17 to 21, characterized in that: The first state is a horizontal screen state, and the second state is a vertical screen state, and the switching instruction is used to instruct the first electronic device to switch from the horizontal screen state to the vertical screen state.
23. An electronic device, characterized in that: include: A memory and one or more processors; the memory is coupled to the processor; wherein the memory stores computer program code, the computer program code includes computer instructions, and when the computer instructions are executed by the processor, the electronic device executes the method as described in any one of claims 1 to 16, or the electronic device executes the method as described in any one of claims 17 to 22.
24. A computer-readable storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method according to any one of claims 1 to 16, or cause the electronic device to execute the method according to any one of claims 17 to 22.
Citation Information
Patent Citations
Material display method and device, terminal and storage medium
CN111221455A
Display method, intelligent terminal and storage medium
CN114706549A
Application interface display method under multi-window mirroring scenario, and electronic device
WO2022052772A1
Display device, method for receiving screen projection content, and screen projection method
WO2022193475A1
Cited By
Video switching method and electronic device
EP4664896A1
Portable electronic device and transmission control method thereof
TWI919504B
Portable electronic device and transmission control method thereof
US12739503B2
Video switching method and electronic device
WO2024198633A1
