Display device and screen projection method
Patent Information
- Application Number
- CN202210743842.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-27
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-06-27
AI Technical Summary
[0004]本申请示例性的实施方式提供一种显示设备和投屏方法,用于解决手机发送的投影视频可能会与电视上用于播放投屏视频的视频播放窗口不匹配的问题
[0021] As can be seen from the above technical solutions, the display device and projection method provided in this application embodiment, in response to a received trigger command, will display a training interface on the display and receive a first video stream sent by the terminal device. Then, based on the identification information, video playback parameters, and the size of the first video stream, a scaling ratio is obtained. The first video stream is scaled according to the scaling ratio to obtain a second video stream. Layout offset parameters are obtained based on the video playback parameters and the size of the second video stream. The video playback parameters include the size of the first video playback window and/or a preset video stream size. Finally, the second video stream is offset based on the layout offset parameters, and the display is controlled to play the offset second video stream in the first video window. The training interface includes a first video playback window and a second video playback window. The second video window is used to play fitness videos obtained from the server. The first video stream is a video stream captured by the video recording device of the terminal device and carries identification information used to identify the posture of the terminal device when recording the video corresponding to the first video stream. Since the identification information is used to identify the posture of the terminal device when recording the video corresponding to the first video stream, and the video playback parameters include the size of the first video playback window used to play the first video stream and/or the preset video stream size, this embodiment of the invention can scale the first video stream according to the posture of the terminal device when recording the video corresponding to the first video stream, so that the resulting second video stream is adapted to the video playback parameters in the horizontal or vertical direction. Because this embodiment of the invention also obtains layout offset parameters based on the video playback parameters and the size of the second video stream, and offsets the second video stream based on the layout offset parameters during video playback, this embodiment of the invention can also adapt the second video stream to the video playback parameters in another direction. In summary, this embodiment of the invention can adapt the size of the projected video stream to the size of the video playback window used to play the projected video stream and/or the preset video stream size in both the horizontal and vertical directions within the follow-up interface.
Smart Images

Figure CN116801027B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of display technology. More specifically, it relates to a display device and a projection method. Background Technology
[0002] Currently, an increasing number of TV applications require TVs to support camera-related functions, but for various reasons, most TVs do not come with a camera by default. Therefore, how to achieve equivalent camera functionality on a TV by using a camera from another device, when the user's TV does not have one, has become one of the hot research topics in this field.
[0003] The existing solutions for achieving equivalent camera functionality on televisions involve connecting a mobile phone to the TV, capturing video using the phone's camera, and projecting the captured image onto the TV screen. However, the aspect ratios of TV and mobile phone screens generally differ significantly, and mobile phones can capture video in various orientations, such as landscape and portrait. Therefore, the projected video sent by the phone often doesn't match the video playback window on the TV, leading to incomplete video images and aspect ratio distortion, severely impacting the user experience. Therefore, how to adjust the projected video stream to fit the playback window when the TV receives it is a pressing issue that needs to be addressed. Summary of the Invention
[0004] Exemplary embodiments of this application provide a display device and a screen projection method to solve the problem that projected videos sent by mobile phones may not match the video playback window on a television used to play projected videos.
[0005] The technical solutions provided in this application are as follows:
[0006] In a first aspect, embodiments of this application provide a display device, including:
[0007] monitor;
[0008] The controller is configured as follows:
[0009] In response to a received trigger command, a follow-up exercise interface is displayed on the monitor, wherein the follow-up exercise interface includes a first video playback window and a second video playback window, the second video window being used to play fitness videos obtained from the server;
[0010] The terminal device receives a first video stream, wherein the first video stream is a video stream acquired by the video recording device of the terminal device, and carries identification information for identifying the posture of the terminal device when recording the video corresponding to the first video stream.
[0011] The scaling ratio is obtained based on the identification information, video playback parameters, and the size of the first video stream. The first video stream is scaled according to the scaling ratio to obtain the second video stream. The layout offset parameters are obtained based on the video playback parameters and the size of the second video stream. The video playback parameters include the size of the first video playback window and / or the preset video stream size.
[0012] The second video stream is offset based on the layout offset parameters, and the display is controlled to play the offset second video stream in the first video window.
[0013] Secondly, embodiments of this application provide a screen mirroring method, including:
[0014] In response to a received trigger command, a follow-up exercise interface is displayed on the monitor, wherein the follow-up exercise interface includes a first video playback window and a second video playback window, the second video window being used to play fitness videos obtained from the server;
[0015] The terminal device receives a first video stream, wherein the first video stream is a video stream acquired by the video recording device of the terminal device, and carries identification information for identifying the posture of the terminal device when recording the video corresponding to the first video stream.
[0016] The scaling ratio is obtained based on the identification information, video playback parameters, and the size of the first video stream. The first video stream is scaled according to the scaling ratio to obtain the second video stream. The layout offset parameters are obtained based on the video playback parameters and the size of the second video stream. The video playback parameters include the size of the first video playback window and / or the preset video stream size.
[0017] The second video stream is offset based on the layout offset parameters, and the display is controlled to play the offset second video stream in the first video window.
[0018] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to implement the screen projection method described in the second aspect when executing the computer program.
[0019] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a computing device, causes the computing device to implement the screen projection method described in the second aspect.
[0020] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, enables the computer to implement the screen projection method described in the second aspect.
[0021] As can be seen from the above technical solutions, the display device and projection method provided in this application embodiment, in response to a received trigger command, will display a training interface on the display and receive a first video stream sent by the terminal device. Then, based on the identification information, video playback parameters, and the size of the first video stream, a scaling ratio is obtained. The first video stream is scaled according to the scaling ratio to obtain a second video stream. Layout offset parameters are obtained based on the video playback parameters and the size of the second video stream. The video playback parameters include the size of the first video playback window and / or a preset video stream size. Finally, the second video stream is offset based on the layout offset parameters, and the display is controlled to play the offset second video stream in the first video window. The training interface includes a first video playback window and a second video playback window. The second video window is used to play fitness videos obtained from the server. The first video stream is a video stream captured by the video recording device of the terminal device and carries identification information used to identify the posture of the terminal device when recording the video corresponding to the first video stream. Since the identification information is used to identify the posture of the terminal device when recording the video corresponding to the first video stream, and the video playback parameters include the size of the first video playback window used to play the first video stream and / or the preset video stream size, this embodiment of the invention can scale the first video stream according to the posture of the terminal device when recording the video corresponding to the first video stream, so that the resulting second video stream is adapted to the video playback parameters in the horizontal or vertical direction. Because this embodiment of the invention also obtains layout offset parameters based on the video playback parameters and the size of the second video stream, and offsets the second video stream based on the layout offset parameters during video playback, this embodiment of the invention can also adapt the second video stream to the video playback parameters in another direction. In summary, this embodiment of the invention can adapt the size of the projected video stream to the size of the video playback window used to play the projected video stream and / or the preset video stream size in both the horizontal and vertical directions within the follow-up interface. Attached Figure Description
[0022] To more clearly illustrate the implementation methods in the embodiments of this application or related technologies, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0023] Figure 1 A scenario architecture diagram of the screen projection method in some embodiments is shown;
[0024] Figure 2 Hardware configuration block diagrams of the control device are shown in some embodiments;
[0025] Figure 3 A hardware configuration block diagram of a display device is shown in some embodiments;
[0026] Figure 4 A software configuration diagram of a display device in some embodiments is shown;
[0027] Figure 5 The flowcharts of the screen projection method in some embodiments are shown;
[0028] Figure 6 Flowcharts of the screen projection method in other embodiments are shown;
[0029] Figure 7 It shows Figure 6 A schematic diagram illustrating the screen mirroring method.
[0030] Figure 8 It shows Figure 6 The schematic diagram of the screen projection method shown;
[0031] Figure 9 Flowcharts of the screen projection method in other embodiments are shown;
[0032] Figure 10 It shows Figure 9 The schematic diagram of the screen projection method shown;
[0033] Figure 11 Flowcharts of the screen projection method in other embodiments are shown;
[0034] Figure 12 It shows Figure 11 A schematic diagram illustrating the screen mirroring method.
[0035] Figure 13 It shows Figure 11 The schematic diagram of the screen projection method shown;
[0036] Figure 14 Flowcharts of the screen projection method in other embodiments are shown;
[0037] Figure 15 It shows Figure 14 The schematic diagram of the screen projection method shown;
[0038] Figure 16 Flowcharts of the screen projection method in other embodiments are shown;
[0039] Figure 17 It shows Figure 16 A schematic diagram illustrating the screen mirroring method.
[0040] Figure 18 It shows Figure 16 The schematic diagram of the screen projection method shown;
[0041] Figure 19 A scenario architecture diagram of the screen projection method shown in some embodiments is illustrated. Detailed Implementation
[0042] To make the objectives and implementation methods of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the exemplary embodiments described are only some embodiments of this application, and not all embodiments.
[0043] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0044] The terms “comprising” and “having”, and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device that includes a range of components is not necessarily limited to all of the components that are clearly listed, but may include other components that are not clearly listed or that are inherent to such product or device.
[0045] Figure 1 This is a schematic diagram of the scenario architecture for the screen projection method provided in the embodiments of this application. Figure 1 As shown, the scenario architecture provided in this application embodiment includes: a control device 100, a display device 200, a terminal device 300, and a server 400.
[0046] Users can operate the display device 200 through the terminal device 300 or the control device 100, and can send video streams to the display device 200 through the terminal device 300 to control the display device 200 to perform corresponding operations, and to play videos according to the video streams sent by the display device 200. The display device provided in this application embodiment can have various implementation forms, such as a television, a smart speaker refrigerator with display function, a curtain with display function, a personal computer (PC), a laser projection device, a monitor, an electronic bulletin board, a wearable device, an in-vehicle device, an electronic table, etc.
[0047] In some embodiments, the control device 100 may be a remote control. Communication between the remote control and the display device 200 includes infrared protocol communication, Bluetooth protocol communication, and other short-range communication methods, controlling the display device 200 wirelessly or via wired means. Users can control the display device 200 by inputting user commands through buttons on the remote control, voice input, control panel input, etc.
[0048] In some embodiments, the display device 200 can also be controlled using a terminal device 300 (such as a mobile terminal, tablet computer, computer, laptop computer, etc.). For example, the display device 200 can be controlled using an application running on a smart device.
[0049] In some embodiments, the display device 200 can also be controlled in ways other than the control device 100 and the terminal device 300. For example, it can be controlled by directly receiving the user's voice commands through a module configured inside the display device 200 for acquiring voice commands.
[0050] In some embodiments, the display device 200 can also communicate with the server 400 to obtain relevant media resources from the server. The display device 200 may communicate with the server 400 via a local area network (LAN) or a wireless local area network (WLAN). The server 400 can provide the display device 200 with media resource services and various content and interactive features. The server 400 can be a cluster or multiple clusters, and may include one or more types of servers.
[0051] Figure 2 An example is shown Figure 1 A block diagram showing the configuration of the control device 100 in the illustrated embodiment. (See diagram below.) Figure 2 As shown, the control device 100 includes a controller 110, a communication interface 130, a user input / output interface 140, a memory, and a power supply. The control device 100 can receive operation commands input by the user, convert the operation commands into commands that the display device 200 can recognize and respond to, and forward the operation commands or commands obtained by converting voice commands to the display device 200, thus acting as an intermediary for interaction between the user and the display device 200.
[0052] like Figure 3 The display device 200 includes at least one of the following: a tuner 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface.
[0053] In some embodiments, controller 250 includes a processor, a video processor, an audio processor, a graphics processor, RAM, ROM, and a first to an nth interface for input / output.
[0054] The display 260 includes a display screen assembly for presenting images, a driving assembly for driving image display, a component for receiving image signals from the controller output, and a user control UI interface for displaying video content, image content, menu control interface, and user control UI interface.
[0055] The display 260 can be an LCD display, an OLED display, or a projection display, and can also be a projection device and a projection screen.
[0056] The communicator 220 is a component used to communicate with external devices or servers according to various communication protocol types. For example, the communicator may include at least one of the following: a Wi-Fi module, a Bluetooth module, a wired Ethernet module, other network communication protocol chips or near-field communication protocol chips, and an infrared receiver. The display device 200 can establish the transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.
[0057] The user interface can be used to receive control signals input by the user through the control device 100 (such as an infrared remote control) or by touch or gesture.
[0058] Detector 230 is used to collect signals from the external environment or to interact with the external environment. For example, detector 230 includes a light receiver, a sensor for collecting ambient light intensity; or, detector 230 includes an image acquisition device, such as a camera, which can be used to collect external environmental scenes, user attributes, or user interaction gestures; or, detector 230 includes a sound acquisition device, such as a microphone, for receiving external sounds.
[0059] The external device interface 240 may include, but is not limited to, one or more of the following: High Definition Multimedia Interface (HDMI), analog or high-definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, etc. It may also be a composite input / output interface formed by multiple interfaces mentioned above.
[0060] The tuner / demodulator 210 receives broadcast television signals via wired or wireless means, and demodulates audio and video signals, such as EPG data signals, from multiple wireless or wired broadcast television signals.
[0061] In some embodiments, the controller 250 and the tuner 210 may be located in different separate devices, that is, the tuner 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0062] The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in the memory. The controller 250 controls the overall operation of the display device 200. For example, in response to receiving a user command to select a UI object to display on the monitor 260, the controller 250 can execute operations related to the object selected by the user command.
[0063] In some embodiments, the controller includes at least one of a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM (random access memory), ROM (read-only memory), a first to an nth interface for input / output, a communication bus, etc.
[0064] Users can input commands through a graphical user interface (GUI) displayed on the monitor 260, and the user interface receives the user input commands through the GUI. Alternatively, users can input commands by entering specific sounds or gestures, and the user interface receives the user input commands by recognizing the sounds or gestures through sensors.
[0065] A "user interface" is the medium through which an application or operating system interacts and exchanges information with the user. It converts information from its internal form to a form that the user can accept. A common form of user interface is the graphical user interface (GUI), which refers to a user interface related to computer operation displayed graphically. It can be an icon, window, control, or other interface element displayed on the screen of an electronic device. Controls can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.
[0066] See Figure 4 In some embodiments, the operating system of the display device 200 is divided into four layers, from top to bottom: the Applications layer (hereinafter referred to as the "Application Layer"), the Application Framework layer (hereinafter referred to as the "Framework Layer"), the Android runtime and system library layer (hereinafter referred to as the "System Runtime Library Layer"), and the kernel layer.
[0067] In some embodiments, at least one application runs in the application layer. These applications may be Windows programs, system settings programs, or clock programs that come with the operating system; they may also be applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the examples above.
[0068] The framework layer provides application programming interfaces (APIs) and a programming framework for applications. The application framework layer includes predefined functions. It acts as a central processing unit, determining the actions taken by applications within the application layer. Through the API, applications can access system resources and obtain system services during execution.
[0069] like Figure 4 As shown, the application framework layer in this embodiment includes managers, content providers, etc., wherein the managers include at least one of the following modules: ActivityManager, which interacts with all activities running in the system; LocationManager, which provides access to system location services for system services or applications; PackageManager, which retrieves various information related to applications currently installed on the device; NotificationManager, which controls the display and clearing of notification messages; and WindowManager, which manages icons, windows, toolbars, wallpapers, and desktop widgets on the user interface.
[0070] In some embodiments, the Activity Manager manages the lifecycle of individual applications and common navigation and back functions, such as controlling application exit, opening, and back actions. The Window Manager manages all window programs, such as obtaining the screen size, determining if a status bar is present, locking the screen, capturing the screen, and controlling display window changes (e.g., shrinking the display window, shaking the display, distorting the display, etc.).
[0071] In some embodiments, the system runtime library layer provides support for the upper layer, namely the framework layer. When the framework layer is used, the Android operating system runs the C / C++ libraries contained in the system runtime library layer to implement the functions that the framework layer needs to perform.
[0072] In some embodiments, the kernel layer is a layer between hardware and software. For example... Figure 4As shown, the kernel layer includes at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver.
[0073] In some embodiments, the controller 250, in response to a received trigger command, displays a follow-up interface on the display 260, wherein the follow-up interface includes a first video playback window and a second video playback window, the second video window being used to play fitness videos obtained from a server.
[0074] In some embodiments, when the controller 250 receives a first video stream generated by the terminal device based on its video recording device via the communicator 220, the controller 250 obtains a scaling ratio based on the identification information, video playback parameters, and the size of the first video stream; scales the first video stream according to the scaling ratio to obtain a second video stream; and obtains a layout offset parameter based on the video playback parameters and the size of the second video stream; offsets the second video stream based on the layout offset parameter; and controls the display 260 to play the offset second video stream in the first video window.
[0075] In some embodiments, the identification information includes a first posture identifier or a second posture identifier; when the identification information includes a first posture identifier, the identification information is used to identify that the posture of the terminal device recording the video corresponding to the first video stream is a portrait posture; when the identification information includes a second posture identifier, the identification information is used to identify that the posture of the terminal device recording the video corresponding to the first video stream is a landscape posture. The video playback parameters corresponding to the first posture identifier and the video playback parameters corresponding to the second posture identifier are different.
[0076] In some embodiments, when the identification information is used to identify that the terminal device is in a portrait orientation when recording the video corresponding to the first video stream, the controller 250 scales the first video stream according to the scaling ratio to obtain a second video stream, and obtains layout offset parameters according to the video playback parameters and the size of the second video stream. This includes the controller 250 obtaining a first scaling ratio based on the width of the first video stream and a target width; the target width is the width of the first video playback window or the width in the preset video stream size.
[0077] The first video stream is scaled using the first scaling ratio to obtain the second video stream; the first layout offset parameter is obtained based on the height of the second video stream and the height of the first video playback window.
[0078] The controller 250 offsets the second video stream based on the layout offset parameter, including offsetting the second video stream in the height direction based on the first layout offset parameter.
[0079] Wherein, the first scaling ratio is the ratio of the target width to the width of the first video stream; the first layout offset parameter is half the difference between the height of the second video stream and the height of the first video playback window.
[0080] In some embodiments, when the identification information is used to identify that the terminal device is in landscape mode when recording the video corresponding to the first video stream,
[0081] The controller 250 obtains a scaling ratio based on the identification information, video playback parameters, and the size of the first video stream, and scales the first video stream according to the scaling ratio to obtain a second video stream, including:
[0082] The controller 250 obtains a second scaling ratio based on the height of the first video stream and the target height; the target height is the height of the first video playback window or the height in the preset video stream size; the controller uses the second scaling ratio to scale the first video stream to obtain the second video stream.
[0083] The controller 250 obtains layout offset parameters based on the video playback parameters and the size of the second video stream, including: obtaining a second layout offset parameter based on the width of the second video stream and the width of the first video playback window; and offsetting the second video stream in the width direction based on the second layout offset parameter. Wherein, the second scaling ratio is the ratio of the target height to the height of the first video stream; and the second layout offset parameter is half the difference between the width of the second video stream and the width of the first video playback window.
[0084] In some embodiments, after the communicator 250 offsets the second video stream based on the layout offset parameter and controls the display to play the offset second video stream in the first video window, the controller 250 is further configured to:
[0085] In response to a received cropping playback instruction, a third scaling factor is obtained based on the size of the selected area and the size of the first video playback window. The cropping playback instruction carries the size of the selected area and the position information of the selected area, and is used to instruct video playback based on the video content of the first video stream within the selected area. The third scaling factor is the smaller of a first ratio and a second ratio, where the first ratio is the ratio of the height of the first video playback window to the height of the selected area, and the second ratio is the ratio of the width of the first video playback window to the width of the selected area.
[0086] The first video stream is scaled using the third scaling factor to obtain a third video stream; a third layout offset parameter is obtained based on the third scaling factor, the width of the first video playback window, the position information of the selected area, and the width of the selected area; a fourth layout offset parameter is obtained based on the third scaling factor, the height of the first video playback window, the position information of the selected area, and the height of the selected area.
[0087] The third video stream is played in the first video playback window, and the third video stream is offset in the width direction based on the third layout offset parameter, and offset in the height direction based on the fourth layout offset parameter. The display is then controlled to play the offset third video stream in the first video window.
[0088] In some embodiments, the controller 250 obtains a third layout offset parameter based on the third scaling ratio, the width of the first video playback window, the position information of the selected area, and the width of the selected area, including:
[0089] The controller 250 calculates the third layout offset parameter using the following formula:
[0090] Formula 1 is: CLIP3 = (X + select_w / 2) * R3 - WL / 2;
[0091] The controller 250 obtains a fourth layout offset parameter based on the third scaling ratio, the height of the first video playback window, the position information of the selected area, and the height of the selected area, including: the controller 250 calculates the third layout offset parameter using the following formula:
[0092] Formula 2 is: CLIP4 = (Y + select_h / 2) * R3 - HL / 2;
[0093] Wherein, CLIP3 is the third layout offset parameter, CLIP4 is the fourth layout offset parameter, X is the distance from the left edge of the selected area to the left edge of the first video stream, Y is the distance from the top edge of the selected area to the top edge of the first video stream, select_w / 2 and select_h / 2 are the width and height of the selected area, respectively, R3 is the third scaling ratio, and WL and HL are the width and height of the first video playback window, respectively.
[0094] Figure 5 The flowchart of the screen projection method provided in the embodiments of this application is illustrated by way of example. Figure 5 As shown, the screen mirroring method provided in this application includes the following steps:
[0095] S51, Receive the first video stream sent by the terminal device.
[0096] The first video stream is a video stream obtained by video recording device of the terminal device, and carries identification information for identifying the posture of the terminal device when recording the video corresponding to the first video stream.
[0097] In some embodiments, the first video stream may be a video stream recorded in real time by a terminal device using a video recording device and sent to a display device. In other embodiments, the first video stream may also be a video stream sent by the terminal device to the display device when casting a pre-recorded video.
[0098] In some embodiments, the terminal device in this application can be a mobile phone, and the video recording device of the terminal device can be the front / rear camera of the mobile phone.
[0099] It should be noted that before receiving the first video stream sent by the terminal device, a trigger command can be received first to display the follow-up exercise interface on the monitor. The follow-up exercise interface includes a first video playback window and a second video playback window. The second video window is used to play the fitness video obtained from the server.
[0100] The trigger command can be triggered after the user performs an operation on the terminal device to trigger the display of the follow-up interface.
[0101] Optionally, the triggering instruction can also be an instruction received by the display device from other control devices to trigger the display of the follow-up interface.
[0102] S52. Obtain the scaling ratio based on the identification information, video playback parameters, and the size of the first video stream.
[0103] The video playback parameters include the size of the first video playback window used to play the first video stream and / or the preset video stream size.
[0104] In some embodiments, the scaling ratio can be obtained solely based on the identification information, the size of the first video playback window, and the size of the first video stream, so that the size of the scaled first video stream is adapted to the size of the first video playback window.
[0105] In some embodiments, the scaling ratio can be obtained solely based on the identification information, the preset video stream size, and the size of the first video stream, thereby scaling the first video stream to a video stream of the preset video stream size.
[0106] In some embodiments, the scaling ratio can be obtained based on the identification information, the size of the first video playback window, the preset video stream size, and the size of the first video stream, so that the size of the scaled first video stream is adapted to the size of the first video playback window while better conforming to the aspect ratio of the original video. For example, if the size of the first video playback window is 629×629, the preset video stream size can be set to 450×629 to make the aspect ratio of the projected video more consistent with the aspect ratio of the mobile phone in portrait mode. As another example, if the size of the first video playback window is 629×629, the preset video stream size can be set to 629×450 to make the aspect ratio of the projected video more consistent with the aspect ratio of the mobile phone in landscape mode.
[0107] In some embodiments, the identification information includes: a first posture identifier or a second posture identifier.
[0108] When the identification information includes a first posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a portrait posture;
[0109] When the identification information includes a second posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a landscape posture.
[0110] The video playback parameters corresponding to the first posture identifier are different from those corresponding to the second posture identifier.
[0111] The video playback parameters include the size of the first video playback window and / or the preset video stream size for playing the first video stream. In some embodiments of this disclosure, different video playback parameters can be set for different posture identifiers. That is, for different postures when the terminal device records the video corresponding to the first video stream, different sizes of the first video playback window and / or preset video stream sizes can be assigned.
[0112] For example, when the identification information includes a first posture identifier, it indicates that the posture of the terminal device when recording the video corresponding to the first video stream is a landscape posture. In this case, the corresponding video playback parameters can be: the size of the first video stream is 1920×1080, and the size of the first video playback window is 626x629.
[0113] For example, when the identification information includes a second posture identifier, it indicates that the posture of the terminal device when recording the video corresponding to the first video stream is a portrait posture. In this case, the corresponding video playback parameters can be: the size of the first video stream is 1080×1920 and the size of the first video playback window is 626x629.
[0114] S53. Scale the first video stream according to the scaling ratio to obtain the second video stream.
[0115] For example, if the size of the first video stream is 1080×1920 and the scaling ratio is R, then the size of the second video stream is 1080*R×1920*R.
[0116] The scaling operation in step S53 above can adapt the length or width of the first video stream to the video playback parameters.
[0117] S54. Obtain the layout offset parameters based on the video playback parameters and the size of the second video stream.
[0118] Step S53 described above allows the length or width of the second video stream to be adapted to the video playback parameters. However, another adjustment is needed between the length and width of the second video stream to ensure that both length and width are adapted to the playback parameters. In this embodiment, the method for adapting the length and width of the second video stream to the playback parameters is to offset the second video stream in the other direction (length and width) during video playback. Therefore, in this embodiment, it is necessary to first obtain layout offset parameters based on the video playback parameters and the dimensions of the second video stream so that layout offset can be performed during subsequent playback based on the second video stream.
[0119] S55. The second video stream is offset based on the layout offset parameter, and the offset second video stream is played in the first video playback window.
[0120] In some embodiments, offsetting the second video stream based on the layout offset parameters may include: adjusting the origin of the coordinate system of the second video stream based on the layout parameters to offset the second video stream. In other embodiments, offsetting the second video stream based on the layout offset parameters may also include: adjusting and calculating the distances between the edges of the first video playback window corresponding to each edge (top edge, bottom edge, left edge, and right edge) of the second video stream based on the layout parameters, and then offsetting the second video stream according to the distances between the edges of the second video stream and the edges of the first video playback window.
[0121] The screen mirroring method provided in this application, upon receiving a first video stream generated by a video recording device of a receiving terminal device, first obtains a scaling ratio based on the identification information, video playback parameters, and size of the first video stream. Then, it scales the first video stream according to the scaling ratio to obtain a second video stream. It also obtains a layout offset parameter based on the video playback parameters and the size of the second video stream. Finally, it plays the second video stream within the first video playback window and offsets the second video stream based on the layout offset parameter. Since the identification information identifies the posture of the terminal device when recording the video corresponding to the first video stream, and the video playback parameters include the size of the first video playback window for playing the first video stream and / or a preset video stream size, this embodiment can scale the first video stream according to the posture of the terminal device when recording the video corresponding to the first video stream, so that the obtained second video stream is adapted to the video playback parameters in the horizontal or vertical direction. Because this embodiment also obtains the layout offset parameter based on the video playback parameters and the size of the second video stream, and offsets the second video stream based on the layout offset parameter during video playback, this embodiment can also adapt the second video stream to the video playback parameters in another direction. In summary, the embodiments of the present invention can adapt the size of the projected video stream to the size of the video playback window and / or the preset video stream size for playing the projected video stream in both horizontal and vertical directions.
[0122] As an extension and refinement of the above embodiments, refer to Figure 6 As shown, another screen mirroring method provided by an embodiment of the present invention includes:
[0123] S601, Receive the first video stream sent by the terminal device.
[0124] The first video stream is a video stream obtained by video recording through the video recording device of the terminal device, and carries identification information for identifying that the posture of the terminal device when recording the video corresponding to the first video stream is a vertical screen posture.
[0125] For example, refer to Figure 7 As shown, Figure 7 The example shown uses a television as the display device 71 and a mobile phone as the terminal device 72. The terminal device 72 records the video corresponding to the first video stream in a portrait orientation.
[0126] S602. Obtain the first scaling ratio based on the width of the first video stream and the width of the first video playback window.
[0127] In this embodiment of the invention, the width refers to the number of pixels contained in a pixel row (horizontal) and the height refers to the number of pixels contained in a pixel column (vertical).
[0128] Since the first video stream in this embodiment of the invention is a video stream generated by the video recording device of the terminal device, the size of the first video stream is the same as the screen resolution of the terminal device. For example, if the screen resolution of the terminal device is 1080×1920, then the size of the first video stream is 1080×1920.
[0129] In some embodiments, the first scaling ratio is the ratio of the width of the first video playback window to the width of the first video stream.
[0130] Let: the first scaling factor be R1, the size of the first video stream be W1×H1, and the size of the first video playback window be WL×HL, then we have:
[0131] R1 = WL / W1
[0132] For example, when the size of the first video stream is 1080×1920 and the size of the first video playback window is 626x629, the first scaling ratio R1 = 629 / 1080.
[0133] S603. Scale the first video stream using the first scaling ratio to obtain the second video stream.
[0134] As described in the example above, the size of the first video stream is 1080×1920, the size of the first video playback window is 626x629, and the first scaling ratio R1 = 629 / 1080. Therefore, the size of the second video stream obtained by scaling the first video stream using the first scaling ratio is 629×1118.
[0135] At this point, the width of the second video stream is adapted to the width of the first video playback window.
[0136] S604. Obtain the first layout offset parameter based on the height of the second video stream and the height of the first video playback window.
[0137] In some embodiments, the first layout offset parameter is half the difference between the height of the second video stream and the height of the first video playback window.
[0138] Let: the first layout offset parameter be CLIP1, the size of the second video stream be W2×H2, and the size of the first video playback window be WL×HL, then we have:
[0139] CLIP1 = 1 / 2(H2-HL)
[0140] For example, when the size of the second video stream is 629x1118 and the size of the first video playback window is 629×629, the first layout offset parameter CLIP1 = 1 / 2(1118-629).
[0141] S605. The second video stream is offset in the height direction based on the first layout offset parameter, and the offset second video stream is played in the first video playback window.
[0142] For example, refer to Figure 8 As shown, Figure 8 The screen projection method provided in the above embodiment is illustrated using an example where the size of the first video stream is 1080×1920 and the size of the first video playback window 800 is 629×629. (Refer to...) Figure 8 As shown, a first scaling factor of 629 / 1080 is obtained based on the width of the first video stream 81 (1080) and the width of the first video playback window (629). Then, the first video stream 81 is scaled according to the first scaling factor of 629 / 1080 to obtain a second video stream 82. The size of the second video stream 82 is 629×1118. Then, based on the height of the second video stream 82 (1118) and the height of the first video playback window 800, a first layout offset parameter 1 / 2(1118-629)≈244 is obtained. Finally, video playback is performed on the second video stream 82 within the first video playback window 800, and the second video stream is offset upwards by the first layout offset parameter 244 to achieve... Figure 8 The display effect shown.
[0143] As an extension and refinement of the above embodiments, refer to Figure 9 As shown, another screen mirroring method provided by an embodiment of the present invention includes:
[0144] S901, Receive the first video stream sent by the terminal device.
[0145] The first video stream is a video stream obtained by video recording through the video recording device of the terminal device, and carries identification information for identifying that the posture of the terminal device when recording the video corresponding to the first video stream is a vertical screen posture.
[0146] S902. Obtain the first scaling ratio based on the width of the first video stream and the width in the preset video stream size.
[0147] In some embodiments, the first scaling ratio is the ratio of the width in the preset video stream size to the width of the first video stream.
[0148] Let: the first scaling factor be R1, the size of the first video stream be W1×H1, and the preset video stream size be WS×HS, then we have:
[0149] R1 = WS / W1
[0150] For example, when the size of the first video stream is 1080×1920 and the preset video stream size is 450x629, the first scaling ratio R1 = 450 / 1080.
[0151] S903. Scale the first video stream using the first scaling ratio to obtain the second video stream.
[0152] As described in the example above, the size of the first video stream is 1080×1920, the preset video stream size is 450x629, and the first scaling ratio R1 = 450 / 1080. Therefore, the size of the second video stream obtained by scaling the first video stream using the first scaling ratio is 450×800.
[0153] At this point, the width of the second video stream is the same as the width of the preset video playback stream.
[0154] S904. Obtain the first layout offset parameter based on the height of the second video stream and the height of the first video playback window.
[0155] In some embodiments, the first layout offset parameter is half the difference between the height of the second video stream and the height of the first video playback window.
[0156] Let: the first layout offset parameter be CLIP1, the size of the second video stream be W2×H2, and the size of the first video playback window be WL×HL, then we have:
[0157] CLIP1 = 1 / 2(H2-HL)
[0158] For example, when the size of the second video stream is 629×800 and the size of the first video playback window is 629×629, the first layout offset parameter CLIP1 = 1 / 2(800-629).
[0159] S905. The second video stream is offset in the height direction based on the first layout offset parameter, and the offset second video stream is played in the first video playback window.
[0160] For example, refer to Figure 10 As shown, Figure 10 The screen projection method provided in the above embodiment is illustrated using an example where the size of the first video stream is 1080×1920, the size of the first video playback window 1000 is 629×629, and the size of the preset video stream is 450×629. (Refer to...) Figure 10 As shown, a first scaling factor of 450 / 1080 is obtained based on the width of the first video stream 81 (1080) and the width of the first video playback window (450). Then, the first video stream 81 is scaled according to the first scaling factor of 450 / 1080 to obtain a second video stream 82. The size of the second video stream 82 is 450×800. Next, a first layout offset parameter of 1 / 2(800-629)≈85 is obtained based on the height of the second video stream 82 (800) and the height of the first video playback window 1000. Finally, video playback is performed on the second video stream 82 within the first video playback window 1000, and the second video stream is offset upwards by the first layout offset parameter 85 to achieve... Figure 10 The display effect shown.
[0161] Figure 9 The aspect ratio of the video displayed in the screen mirroring method shown is closer to that of the terminal device's screen in portrait mode, thus providing a better display of the terminal device's screen mirroring.
[0162] As an extension and refinement of the above embodiments, refer to Figure 11 As shown, another screen mirroring method provided by an embodiment of the present invention includes:
[0163] S111, Receive the first video stream sent by the terminal device.
[0164] The first video stream is a video stream recorded by the video recording device of the terminal device, and carries identification information to indicate that the posture of the terminal device when recording the video corresponding to the first video stream is landscape posture.
[0165] For example, refer to Figure 12 As shown, Figure 12 The example shown uses a television as the display device 121 and a mobile phone as the terminal device 122. The terminal device 122 records the video corresponding to the first video stream in a landscape orientation.
[0166] S112. Obtain the second scaling ratio based on the height of the first video stream and the height of the first video playback window.
[0167] Similarly, the width here refers to the number of pixels contained in a pixel row (horizontal), and the height refers to the number of pixels contained in a pixel column (vertical).
[0168] In some embodiments, the first scaling ratio is the ratio of the height of the first video playback window to the height of the first video stream.
[0169] Let the second scaling factor be R2, the size of the first video stream be W1×H1, and the size of the first video playback window be WL×HL, then we have:
[0170] R2 = HL / H1
[0171] For example, when the size of the first video stream is 1920×1080 and the size of the first video playback window is 626x629, the first scaling ratio R2 = 629 / 1080.
[0172] S113. Scale the first video stream using the first scaling ratio to obtain the second video stream.
[0173] As described in the example above, the size of the first video stream is 1920×1080, the size of the first video playback window is 626x629, and the second scaling ratio R2 = 629 / 1080. Therefore, the size of the second video stream obtained by scaling the first video stream using the first scaling ratio is 1118×629.
[0174] At this point, the height of the second video stream is adapted to the height of the first video playback window.
[0175] S114. Obtain the second layout offset parameter based on the width of the second video stream and the width of the first video playback window.
[0176] In some embodiments, the second layout offset parameter is half the difference between the width of the second video stream and the width of the first video playback window.
[0177] Let: the second layout offset parameter be CLIP2, the size of the second video stream be W2×H2, and the size of the first video playback window be WL×HL, then we have:
[0178] CLIP2 = 1 / 2(W2 - WL)
[0179] For example, when the size of the second video stream is 1118×629 and the size of the first video playback window is 629×629, the second layout offset parameter CLIP2 = 1 / 2(1118-629).
[0180] S115. The second video stream is offset in the width direction based on the first layout offset parameter, and the offset second video stream is played in the first video playback window.
[0181] For example, refer to Figure 13 As shown, Figure 13 The screen projection method provided in the above embodiment is illustrated using an example where the size of the first video stream is 1920×1080 and the size of the first video playback window 1300 is 629×629. (Refer to...) Figure 13 As shown, a first scaling factor of 629 / 1080 is obtained based on the height 1080 of the first video stream 131 and the width 629 of the first video playback window. Then, the first video stream 131 is scaled according to the first scaling factor of 629 / 1080 to obtain a second video stream 132. The size of the second video stream 132 is 1118×629. Then, based on the width 1118 of the second video stream 132 and the height of the first video playback window 800, a second layout offset parameter 1 / 2(1118-629)≈244 is obtained. Finally, video is played in the first video playback window 1300 based on the second video stream 132, and the second video stream is offset to the left by the first layout offset parameter 244 to achieve... Figure 13 The display effect shown.
[0182] As an extension and refinement of the above embodiments, refer to Figure 14 As shown, another screen mirroring method provided by an embodiment of the present invention includes:
[0183] S141, Receive the first video stream sent by the terminal device.
[0184] The first video stream is a video stream recorded by the video recording device of the terminal device, and carries identification information to indicate that the posture of the terminal device when recording the video corresponding to the first video stream is landscape posture.
[0185] S142. Obtain the second scaling ratio based on the height of the first video stream and the height in the preset video stream size.
[0186] In some embodiments, the second scaling ratio is the ratio of the height in the preset video stream size to the height of the first video stream.
[0187] Let: the second scaling factor be R2, the size of the first video stream be W1×H1, and the preset video stream size be WS×HS, then we have:
[0188] R1 = HS / H1
[0189] For example, when the size of the first video stream is 1920×1080 and the preset video stream size is 450x629, the first scaling ratio R1 = 450 / 1080.
[0190] S143. Scale the first video stream using the first scaling ratio to obtain the second video stream.
[0191] As described in the example above, the size of the first video stream is 1920×1080, the preset video stream size is 450x629, and the second scaling ratio R2 = 450 / 1080. Therefore, the size of the second video stream obtained by scaling the first video stream using the second scaling ratio is 800×450.
[0192] At this point, the height of the second video stream is the same as the height of the preset video playback stream.
[0193] S144. Obtain the second layout offset parameter based on the width of the second video stream and the width of the first video playback window.
[0194] In some embodiments, the second layout offset parameter is half the difference between the width of the second video stream and the width of the first video playback window.
[0195] Let: the second layout offset parameter be CLIP2, the size of the second video stream be W2×H2, and the size of the first video playback window be WL×HL, then we have:
[0196] CLIP2 = 1 / 2(W2 - WL)
[0197] For example, when the size of the second video stream is 800×629 and the size of the first video playback window is 629×629, the second layout offset parameter CLIP2 = 1 / 2(800-629).
[0198] S145. The second video stream is offset in the width direction based on the first layout offset parameter, and the offset second video stream is played in the first video playback window.
[0199] For example, refer to Figure 15 As shown, Figure 15 The screen projection method provided in the above embodiment is illustrated using an example where the size of the first video stream is 1920×1080, the size of the first video playback window 1500 is 629×629, and the size of the preset video stream is 450×629. (Refer to...) Figure 15 As shown, a first scaling factor of 450 / 1080 is obtained based on the height 1080 of the first video stream 151 and the height 450 of the first video playback window. Then, the first video stream 151 is scaled according to the first scaling factor of 450 / 1080 to obtain a second video stream 152. The size of the second video stream 152 is 800×450. Then, based on the width 800 of the second video stream 152 and the width of the first video playback window 1500, a second layout offset parameter 1 / 2(800-629)≈85 is obtained. Finally, video is played in the first video playback window 1500 based on the second video stream 152, and the second video stream is offset to the left by the first layout offset parameter 85 to achieve... Figure 15 The display effect shown.
[0200] Figure 16 The aspect ratio of the video displayed in the screen mirroring method shown is closer to that of the terminal device's screen in landscape mode, thus providing a better display of the terminal device's screen mirroring.
[0201] Reference Figure 16 As shown, another embodiment of the present invention provides a screen projection method, including:
[0202] S161, Receive the first video stream sent by the terminal device.
[0203] The first video stream is a video stream recorded by the video recording device of the terminal device, and carries identification information for identifying the posture of the terminal device when recording the video corresponding to the first video stream.
[0204] It should be noted that, in the above Figure 5 , Figure 6 , Figure 9 , Figure 11 , Figure 14 After any of the screen mirroring methods, the first video stream received from the subsequent terminal device can also be processed according to... Figure 16 The processing and display are performed as shown.
[0205] S162, Receive the trimming and playback command.
[0206] The cropping playback instruction carries the size of the selected area and the location information of the selected area, and is used to instruct video playback based on the video content of the first video stream within the selected area.
[0207] For example, refer to Figure 17 As shown, Figure 17 The example shown uses a television as the display device 171 and a mobile phone as the terminal device 172. In response to a user operation that determines a selected area 1700, the terminal device 172 sends a trimming playback command to the display device 171, instructing that video playback be performed based on the video content of the first video stream within the selected area.
[0208] In some embodiments, the size and location information of the selected region can be characterized by the position coordinates (x1, y1) of the upper right vertex and (x2, y2) of the lower left vertex.
[0209] S163. In response to the cropping playback command, obtain a third scaling ratio based on the size of the selected area and the size of the first video playback window.
[0210] The third scaling ratio is the smaller of the first ratio and the second ratio. The first ratio is the ratio of the height of the first video playback window to the height of the selected area, and the second ratio is the ratio of the width of the first video playback window to the width of the selected area.
[0211] Let the size of the selected area be select_w × select_h, the size of the first video playback window be 629 × 629, and the third scaling factor be R3, then we have:
[0212] R3=min(629 / select_w,692 / select_h)
[0213] For example, when the size of the selected area is 265×360 and the size of the first video playback window is 629x629, the third scaling ratio R3 = 629 / 360.
[0214] For example, when the size of the selected area is 256×128 and the size of the first video playback window is 629x629, the third scaling ratio R3 = 629 / 256.
[0215] S164. Scale the first video stream using the third scaling ratio to obtain a third video stream.
[0216] For example, if the size of the first video stream is 1920×1080, the size of the first video playback window is 629×629, and the size of the selected area is 480×270, then the third scaling ratio R3 = 629 / 480, and the size of the third video stream obtained by scaling the first video stream using the third scaling ratio is 2516×1415.
[0217] S165. Obtain the third layout offset parameter based on the third scaling ratio, the width of the first video playback window, the position information of the selected area, and the width of the selected area.
[0218] In some embodiments, the controller is specifically configured to calculate the third layout offset parameter using the following formula:
[0219] CLIP3=(X+select_w / 2)*R3-WL / 2
[0220] Where CLIP3 is the third layout offset parameter, X is the distance from the left edge of the selected area to the left edge of the first video stream, select_w / 2 is the width of the selected area, R3 is the third scaling ratio, and WL is the width of the first video playback window.
[0221] For example, when the size of the first video playback window is 629x629, the distance from the left edge of the selected area to the left edge of the first video stream is 1000, and the size of the selected area is 480×270, the third layout offset parameter CLIP3 = 1310.
[0222] S166. Obtain the fourth layout offset parameter based on the third scaling ratio, the height of the first video playback window, the position information of the selected area, and the height of the selected area.
[0223] In some embodiments, the controller is specifically configured to calculate the fourth layout offset parameter using the following formula:
[0224] Let the fourth layout offset parameter be CLIP4, the size of the third video stream be W3×H3, and the size of the first video playback window be WL×HL, then Formula 2 is:
[0225] CLIP4=(Y+select_h / 2)*R3-HL / 2
[0226] Where CLIP4 is the fourth layout offset parameter, Y is the distance from the top edge of the selected area to the top edge of the first video stream, select_h / 2 is the height of the selected area, R3 is the third scaling factor, and HL is the height of the first video playback window.
[0227] For example, when the size of the first video playback window is 629x629, the distance from the left edge of the selected area to the left edge of the first video stream is 400, and the size of the selected area is 480×270, the fourth layout offset parameter CLIP4 = 386.
[0228] S167. The third video stream is offset in the width direction based on the third layout offset parameter, and the third video stream is offset in the height direction based on the fourth layout offset parameter, and the offset third video stream is played in the first video window.
[0229] In some embodiments, offsetting the second video stream in the width direction based on the third layout offset parameter and offsetting the third video stream in the height direction based on the fourth layout offset parameter may include: adjusting the origin of the coordinate system of the third video stream based on the third and fourth layout offset parameters to offset the third video stream. In other embodiments, offsetting the second video stream based on the layout offset parameter may also include: adjusting and calculating the distances between the edges of the first video playback window corresponding to each edge (top edge, bottom edge, left edge, and right edge) of the third video stream based on the layout parameters, and then offsetting the third video stream according to the distances between the edges of the first video playback window corresponding to each edge of the second video stream.
[0230] For example, refer to Figure 18 As shown, Figure 18 The screen projection method provided in the above embodiment is illustrated using an example where the size of the first video stream is 1920×1080, the size of the first video playback window is 629×629, the size of the selected area is 480×270, the distance from the left edge of the selected area to the left edge of the first video stream is 1000, and the distance from the top edge of the selected area to the top edge of the first video stream is 400. (Refer to...) Figure 18As shown, firstly, since 629 / 480 < 629 / 270, the third scaling ratio is determined to be 629 / 480. Secondly, the first video stream 181 is scaled according to the third scaling ratio to obtain the third video stream 182, the size of which is 2516×1415. Then, the third layout offset parameter 1310 is obtained based on the third scaling ratio, the width of the first video playback window, the position information of the selected area, and the width of the selected area. The fourth layout offset parameter 386 is also obtained based on the third scaling ratio, the height of the first video playback window, the position information of the selected area, and the height of the selected area. Finally, video is played in the first video playback window 1800 based on the third video stream 182, and the third video stream is offset to the left by the third layout offset parameter 1310 and upward by the fourth layout offset parameter 386, respectively, to achieve... Figure 18 The display effect shown.
[0231] Based on any of the above embodiments, the screen projection method provided by the present invention further includes: receiving a second video stream sent by a server; and playing a video in a second video playback window based on the second video stream.
[0232] For example, the above embodiments will be described below using a video fitness scenario as an example. Figure 19 As shown, the scene construction includes a fitness video server 191, a display device 192, and a terminal device 193. The display device 192 can obtain fitness videos from the fitness video server 191 and play them in a second video playback window 1922; users can watch the fitness videos played by the display device 192 and follow the fitness videos for fitness training; the terminal device 193 can record a first video stream using a video recording device and send the first video stream to the display device 192. After receiving the first video stream sent by the terminal device 193, the display device plays the projected video in the first video playback window 1921 using the projection method provided in this embodiment of the invention.
[0233] In some embodiments, this application also provides an electronic device, including: a memory and a processor, wherein the memory is used to store a computer program; and the processor is used to cause the electronic device to implement the screen projection method described in any of the above embodiments when executing the computer program.
[0234] In some embodiments, this application provides a computer-readable storage medium storing a computer program that, when executed by a computing device, causes the computing device to implement the screen projection method described in any of the above embodiments.
[0235] In some embodiments, this application provides a computer program product that, when run on a computer, enables the computer to implement the screen projection method described in the second aspect or any embodiment of the second aspect.
[0236] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.
[0237] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.
Claims
1. A display device without a camera, characterized in that, include: monitor; The controller is configured as follows: In response to a received trigger command, a follow-up exercise interface is displayed on the monitor, wherein the follow-up exercise interface includes a first video playback window and a second video playback window, the second video playback window being used to play fitness videos obtained from the server; The terminal device receives a first video stream sent by a terminal device, wherein the terminal device is equipped with a camera, the first video stream is a video stream captured by the camera of the terminal device, and carries identification information for identifying the posture of the terminal device when capturing the video corresponding to the first video stream, the identification information identifying whether the terminal device is in landscape or portrait posture. The scaling ratio is obtained based on the identification information, video playback parameters, and the size of the first video stream. The first video stream is then scaled according to the scaling ratio to obtain the second video stream, wherein the size of the second video stream corresponds to different identification information. The layout offset parameters are obtained based on the video playback parameters and the size of the second video stream; the video playback parameters include the size of the first video playback window and / or the preset video stream size, wherein, in landscape mode, the layout offset parameters represent the offset amount in the width direction; in portrait mode, the layout offset parameters represent the offset amount in the height direction. The second video stream is offset based on the layout offset parameter, and the first video playback window is played according to the offset second video stream. The fitness video is displayed in the second video playback window, and the second video playback window and the first video playback window are displayed side by side on the display.
2. The display device according to claim 1, characterized in that, The identification information includes: a first posture identifier or a second posture identifier; When the identification information includes a first posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a portrait posture; When the identification information includes a second posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a landscape posture; The video playback parameters corresponding to the first posture identifier are different from those corresponding to the second posture identifier.
3. The display device according to claim 2, characterized in that, When the identification information is used to identify that the terminal device is in portrait orientation when recording the video corresponding to the first video stream, The controller scales the first video stream according to the scaling ratio to obtain the second video stream, and obtains layout offset parameters according to the video playback parameters and the size of the second video stream. The controller obtains a first scaling ratio based on the width of the first video stream and a target width; the target width is the width of the first video playback window or the width in the preset video stream size. The first video stream is scaled using the first scaling ratio to obtain the second video stream; the first layout offset parameter is obtained based on the height of the second video stream and the height of the first video playback window. The controller offsetting the second video stream based on the layout offset parameter includes offsetting the second video stream in the height direction based on the first layout offset parameter.
4. The display device according to claim 3, characterized in that, The first scaling ratio is the ratio of the target width to the width of the first video stream; The first layout offset parameter is half the difference between the height of the second video stream and the height of the first video playback window.
5. The display device according to claim 2, characterized in that, When the identification information is used to identify that the terminal device is in landscape mode when recording the video corresponding to the first video stream, The controller obtains a scaling ratio based on the identification information, video playback parameters, and the size of the first video stream, and scales the first video stream according to the scaling ratio to obtain a second video stream, including: The controller obtains a second scaling ratio based on the height of the first video stream and the target height; the target height is the height of the first video playback window or the height in the preset video stream size; the controller uses the second scaling ratio to scale the first video stream to obtain the second video stream. The controller obtains layout offset parameters based on the video playback parameters and the size of the second video stream, including: the controller obtains a second layout offset parameter based on the width of the second video stream and the width of the first video playback window; The controller offsets the second video stream based on the layout offset parameters, including: The controller offsets the second video stream in the width direction based on the second layout offset parameter.
6. The display device according to claim 5, characterized in that, The second scaling factor is the ratio of the target height to the height of the first video stream; The second layout offset parameter is half the difference between the width of the second video stream and the width of the first video playback window.
7. The display device according to any one of claims 1-6, characterized in that, After the controller offsets the second video stream based on the layout offset parameters and controls the display to play the offset second video stream in the first video playback window, the controller is further configured to: In response to a received cropping playback instruction, a third scaling factor is obtained based on the size of the selected area and the size of the first video playback window. The cropping playback instruction carries the size of the selected area and the position information of the selected area, and is used to instruct video playback based on the video content of the first video stream within the selected area. The third scaling factor is the smaller of a first ratio and a second ratio, where the first ratio is the ratio of the height of the first video playback window to the height of the selected area, and the second ratio is the ratio of the width of the first video playback window to the width of the selected area. The third video stream is obtained by scaling the first video stream using the third scaling ratio. A third layout offset parameter is obtained based on the third scaling ratio, the width of the first video playback window, the position information of the selected area, and the width of the selected area; a fourth layout offset parameter is obtained based on the third scaling ratio, the height of the first video playback window, the position information of the selected area, and the height of the selected area. The third video stream is played in the first video playback window, and the third video stream is offset in the width direction based on the third layout offset parameter, and offset in the height direction based on the fourth layout offset parameter. The display is then controlled to play the offset third video stream in the first video playback window.
8. The display device according to claim 7, characterized in that, The controller obtains a third layout offset parameter based on the third scaling ratio, the width of the first video playback window, the position information of the selected area, and the width of the selected area, including: The controller calculates the third layout offset parameter using the following formula: Formula 1 is: ; The controller obtains a fourth layout offset parameter based on the third scaling ratio, the height of the first video playback window, the position information of the selected area, and the height of the selected area, including: the controller calculates the third layout offset parameter using the following formula: Formula 2 is as follows: in, The third layout offset parameter, The fourth layout offset parameter, The distance from the left edge of the selected region to the left edge of the first video stream. The distance from the top edge of the selected region to the top edge of the first video stream. and These represent the width and height of the selected area, respectively. For the third scaling factor, and These are the width and height of the first video playback window, respectively.
9. A screen projection method, applied to a display device without a camera, characterized in that, include: In response to the received trigger command, a follow-up exercise interface is displayed, wherein the follow-up exercise interface includes a first video playback window and a second video playback window, the second video playback window being used to play fitness videos obtained from the server; The terminal device receives a first video stream sent by a terminal device, wherein the terminal device is equipped with a camera, the first video stream is a video stream captured by the camera of the terminal device, and carries identification information for identifying the posture of the terminal device when recording the video corresponding to the first video stream, the identification information identifying whether the terminal device is in landscape or portrait posture. The scaling ratio is obtained based on the identification information, video playback parameters, and the size of the first video stream. The first video stream is then scaled according to the scaling ratio to obtain the second video stream, wherein the size of the second video stream corresponds to different identification information. The layout offset parameters are obtained based on the video playback parameters and the size of the second video stream; the video playback parameters include the size of the first video playback window and / or the preset video stream size, wherein, in landscape mode, the layout offset parameters represent the offset amount in the width direction; in portrait mode, the layout offset parameters represent the offset amount in the height direction. The second video stream is offset based on the layout offset parameter, and the first video playback window is played according to the offset second video stream. The fitness video is displayed in the second video playback window, and the second video playback window and the first video playback window are displayed side by side on the display.
10. The method according to claim 9, characterized in that, The identification information includes: a first posture identifier or a second posture identifier; When the identification information includes a first posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a portrait posture; When the identification information includes a second posture identifier, the identification information is used to identify that the posture of the terminal device when recording the video corresponding to the first video stream is a landscape posture; The video playback parameters corresponding to the first posture identifier are different from those corresponding to the second posture identifier.
Citation Information
Patent Citations
Interface display method and display equipment
CN112399234A
Projection screen image display method and display equipment
CN112565839A