Video playing method and related device

By using the first processing mode in the terminal device to avoid caching and GPU processing, and switching to the second processing mode to use caching and GPU processing, the problem of high power consumption during video playback is solved, achieving smooth and low-power video playback.

CN120075532BActive Publication Date: 2026-01-09HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510418533.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2026-01-09
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

During video playback, the terminal device consumes more power due to multiple buffers and GPU processing, which reduces battery life.

Method used

The first processing mode is used for video stream decoding and playback, without using the buffer and GPU processing. Switching to the second processing mode uses multi-buffer buffer and GPU processing when a preset trigger event is detected.

Benefits of technology

It reduces the power consumption of terminal devices during video playback, ensuring smooth video playback and correct execution of preset operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120075532B_ABST
    Figure CN120075532B_ABST
Patent Text Reader

Abstract

The application provides a video playing method and related equipment, and relates to the technical field of terminal equipment. The video playing method comprises the following steps: in response to a first operation, a first interface of a video application is displayed; in response to a second operation on the first interface, a first picture of a first video is played starting from a first time, and image data of the first video is not processed by a first processor between the first time and a second time; in response to a preset trigger event at the second time, the image data of the first video is processed by using the first processor; after the second time, a second picture of the first video is played based on the image data of the first video processed by the first processor, and power consumption of the first processor between the first time and the second time is less than power consumption of the first processor after the second time. By using the above method, power consumption of a terminal equipment playing a video can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of Chinese invention patent application entitled "Video Playback Method and Related Equipment", application number "202410749805.X", and application date "2024-06-11". Technical Field

[0002] This application relates to the field of terminal devices, and more particularly to a video playback method and related equipment. Background Technology

[0003] With the development of terminal technology, the functions of terminal devices are becoming increasingly diverse, especially video playback, which is gradually becoming a commonly used function. Terminal devices can play videos through various installed applications.

[0004] To improve video playback smoothness and image quality, video playback applications typically employ multi-buffer caching technology to cache image frames and utilize the graphics processing unit (GPU) to enhance the cached image frames. However, during video playback, both using multiple buffers for image frame caching and using the GPU for image frame enhancement increase the power consumption of the terminal device, reducing its battery life. Summary of the Invention

[0005] In view of the above, it is necessary to provide a video playback method and related equipment to solve the problem of high power consumption of terminal devices during video playback.

[0006] In a first aspect, this application provides a video playback method applied to a terminal device, comprising: in response to a first operation, launching a video application; in response to a second operation of playing a first video on the video application, acquiring a video stream of the first video; processing the video stream using a first processing mode, the first processing mode including decoding the video stream and storing the decoded video image frames in a display buffer for display; and in response to a preset trigger event, processing the video stream using a second processing mode, the second processing mode including decoding the video stream and storing the decoded video image frames in a buffer, wherein the video image frames stored in the buffer can be copied to the display buffer for display.

[0007] Using the above technical solution, when a video application plays video, the first processing mode is used by default to decode and play the video stream. Since the buffer in the buffer is not used to cache video image frames and the GPU is not used to process video image frames, the power consumption of the terminal device during video playback can be reduced. When a preset trigger event is detected, such as a video image frame playback stuttering event or an event in which the video application receives a preset operation, the processing mode of the video stream is switched from the first processing mode to the second processing mode to ensure the smoothness of video playback and to ensure that the preset operation can be executed correctly. For example, the preset operation may include triggering the graphics processor (GPU) to process video image frames.

[0008] In one possible implementation, the video playback method further includes: acquiring media information of the video stream of the first video, the media information including the resolution of the first video; processing the video stream using a first processing mode when the resolution of the first video is not a preset resolution; and processing the video stream using a second processing mode when the resolution of the first video is a preset resolution.

[0009] Using the above technical solution, the preset resolution can be set according to actual needs. For example, the preset resolution may be ultra-high definition, such as 4K resolution. For ultra-high definition video playback, it may be necessary to call the GPU to adjust the resolution of the decoded video image frames. To ensure smooth video playback and successful resolution adjustment, a second processing mode is used to process the video stream. The GPU adjusts the resolution of the video image frames stored in the buffer and then copies them to the display buffer for display. For cases where the resolution is not the preset resolution, since it is not necessary to call the GPU to adjust the resolution of the decoded video image frames, the first processing mode can be used to process the video stream, thereby reducing the power consumption of the terminal device during video playback.

[0010] In one possible implementation, before processing the video stream using the first processing mode, the video playback method further includes: obtaining performance information of the terminal device, including one or more of processor model, memory size, battery rated capacity, and remaining battery capacity; and determining the processing mode of the video stream based on the performance information.

[0011] By adopting the above technical solution, the default processing mode for video playback can be determined based on the performance information of the terminal device. For example, if one of the following conditions is met: low processor performance score, small memory, small battery capacity, or low remaining battery power, the first processing mode is used by default for decoding and playing the video stream; otherwise, the second processing mode is used by default for decoding and playing the video stream.

[0012] In one possible implementation, before processing the video stream using the first processing mode, the video playback method further includes: obtaining historical video playback information of the terminal device, which includes one or more of the following: video playback frequency per unit time, video playback duration per unit time, number of operations of controls in the video playback interface per unit time, and network speed of the network connected to the terminal device when playing the video; and determining the processing mode of the video stream based on the historical video playback information.

[0013] Using the above technical solution, the default processing mode for video playback can also be determined based on the historical video playback information of the terminal device. For example, if one of the following conditions is met: high video playback frequency per unit time, long video playback duration per unit time, few operations on controls in the video playback interface per unit time, and good network speed when the terminal device plays video, the first processing mode is used by default for decoding and playing the video stream; otherwise, the second processing mode is used by default for decoding and playing the video stream. The unit time can be set according to actual needs, for example, the unit time can be one day.

[0014] In one possible implementation, before processing the video stream using the first processing mode, the video playback method further includes: determining the processing mode of the video stream based on a preset mode selection model, wherein the training data of the mode selection model includes the performance information of the terminal device and the historical video playback information of the terminal device.

[0015] Using the above technical solution, the default processing mode for video playback can also be determined based on the pre-trained mode selection model. The training data of the mode selection model may include the performance information of the terminal device and / or the historical video playback information of the terminal device.

[0016] In one possible implementation, the preset trigger events include video frame playback stuttering events or events where the video application receives a preset operation.

[0017] By adopting the above technical solution, if a video image frame playback stuttering event is detected or the video application receives a preset operation event, the smoothness of video playback and the correct execution of the preset operation can be ensured by switching the video stream processing mode from the first processing mode to the second processing mode. For example, the preset operation may include triggering the graphics processor (GPU) to process the video image frame.

[0018] In one possible implementation, the preset operation includes triggering an invocation of the graphics processor to process video image frames.

[0019] Using the above technical solution, the second processing mode is configured with logic for the graphics processor to process video image frames. When an event is detected that triggers the call to the graphics processor to process video image frames, the processing mode of the video stream is switched from the first processing mode to the second processing mode, so that the GPU can process the video image frames smoothly.

[0020] In one possible implementation, in the first processing mode, the decoded video image frames are not processed using a graphics processor.

[0021] By adopting the above technical solution, in the first processing mode, since the GPU is not used to process video image frames, the power consumption of video playback on the terminal device can be reduced.

[0022] In one possible implementation, the video application provides a video playback interface that includes multiple controls, and the preset operations include touch operations on a target control among the multiple controls, the target control being a control used to trigger GPU invocation.

[0023] Using the above technical solution, the second processing mode is configured with the execution logic of the task corresponding to the target control. When a click operation on the target control in the video playback interface is detected, the video stream processing mode is switched from the first processing mode to the second processing mode, so that the click operation on the target control can be successfully responded to.

[0024] Secondly, this application provides a terminal device, which includes a touch screen, a memory, and a processor; the touch screen, the memory, and the processor are coupled; the memory is used to store program instructions; the processor is used to read the program instructions stored in the memory to implement the video playback method of the first aspect described above.

[0025] Thirdly, this application provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the video playback method of the first aspect described above.

[0026] Fourthly, this application provides a chip coupled to a memory in a terminal device, the chip being used to control the terminal device to implement the video playback method described in the first aspect above.

[0027] Furthermore, the technical effects brought about by the second to fourth aspects can be found in the descriptions of the methods in the above-mentioned method section, and will not be repeated here. Attached Figure Description

[0028] Figure 1 This is a schematic diagram of the video playback architecture of a terminal device provided in an embodiment of this application;

[0029] Figure 2 This is a schematic diagram of an image frame stored in a display buffer according to an embodiment of this application;

[0030] Figure 3 A schematic diagram of an image frame stored in a display buffer, provided for another embodiment of this application;

[0031] Figure 4 This is a schematic diagram of the interface display of a terminal device provided in an embodiment of this application;

[0032] Figure 5 This is a schematic diagram of the interface display of a terminal device provided in another embodiment of this application;

[0033] Figure 6 This is a schematic diagram illustrating the process of a terminal device decoding and playing an acquired video stream, as provided in an embodiment of this application.

[0034] Figure 7 This is a schematic diagram of the application architecture of the mode selection framework provided in an embodiment of this application;

[0035] Figure 8 A flowchart illustrating a video playback method provided in an embodiment of this application;

[0036] Figure 9 A hardware architecture diagram of a terminal device provided in one embodiment of this application;

[0037] Figure 10 This is a software architecture diagram of a terminal device provided in one embodiment of this application. Detailed Implementation

[0038] The technical solutions of the embodiments of this application will now be described with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0039] In the following description, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the embodiments of this application, words such as "exemplary," "or," and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary," "or," and "for example" is intended to present the relevant concepts in a concrete manner.

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application's specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. It should be understood that, unless otherwise stated, " / " in this application means "or". For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, and B alone. "At least one" means one or more. "More than one" means two or more. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, and a, b, and c. It should be understood that the order of steps shown in the flowcharts herein can be changed, and some can be omitted.

[0041] To facilitate understanding of the embodiments of this application, the technical terms involved in this application will first be introduced:

[0042] User interface (UI): This is the medium through which an application or operating system interacts and exchanges information with the user. It converts the internal form of information into a form that the user can understand. The user interface is written in specific computer languages ​​such as Java or Extensible Markup Language (XML). This source code is parsed and rendered on the terminal device, ultimately presenting content that the user can recognize. 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 visible interface elements displayed on the terminal device's screen, such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, and widgets.

[0043] Application (APP): A software program that can perform one or more specific functions. Examples include instant messaging applications, video applications, audio applications, image capture applications, cloud desktop applications, etc.

[0044] Video: A dynamic visual presentation composed of consecutive image frames, which are the smallest units that make up a video. Each image frame is a still image, and when multiple image frames are played continuously at a certain rate (e.g., 24 FPS, 25 FPS, or 30 FPS), the human eye can perceive dynamic motion and change.

[0045] In related technologies, to ensure smooth video playback and improve image quality, video playback applications typically employ multi-buffer caching technology to cache image frames decoded from the video stream, and call the graphics processing unit (GPU) to perform rendering enhancements and resolution adjustments on the cached image frames. However, with the development of communication and video playback technologies, the network environment has greatly improved. It is now more likely that smooth video playback can be guaranteed without image frame caching, and the image quality of the decoded image frames is also more likely to meet the user's viewing needs. During video playback, continuously using multiple buffers for image frame caching introduces additional computational load and power consumption (image frames need to be copied from the cached buffer to the display buffer, requiring significant memory space). Furthermore, the use of the GPU further increases the power consumption of the terminal device, thereby reducing its battery life.

[0046] In view of this, embodiments of this application provide a video playback method, which preferentially uses a first processing mode for decoding and playing video streams. In the first processing mode, multi-buffer caching technology is not used to cache the image frames obtained from decoding the video stream, and the GPU is not invoked to process the image frames obtained from decoding the video stream (e.g., rendering enhancement, resolution adjustment, etc.). When an event for triggering a second processing mode is detected, the method switches from the first processing mode to the second processing mode and uses the second processing mode for decoding and playing video streams. In the second processing mode, multi-buffer caching technology is used to cache the image frames obtained from decoding the video stream, and / or the GPU is invoked to process the image frames obtained from decoding the video stream.

[0047] Please see Figure 1 This is a schematic diagram of the video playback architecture of the terminal device provided in this application under different processing modes.

[0048] Taking a smartphone as an example, the terminal device has an application installed that can play videos. This application can refer to applications that can play short videos, movies, TV series, etc., and this embodiment of the application does not limit this. The terminal device can launch the video application in response to the user's first operation. After the video application is launched, it can play the first video specified by the user in response to the user's second operation on the application interface.

[0049] In some embodiments, the first video may offer users different resolutions, and different resolutions may correspond to different video uniform resource locators (URLs). Video applications can access the video URL corresponding to the current resolution of the first video via a network (e.g., cellular communication network, wireless local area network, etc.) to obtain the video stream of the first video at that resolution.

[0050] The video stream of the first video can be a data stream in transport stream (TS) format or a data stream in other formats. This application embodiment does not limit this.

[0051] like Figure 1 As shown, in the first processing mode, the video stream of the first video can be decoded by a video codec (e.g., MediaCodec) to obtain image frames (hereinafter referred to as video image frames). The decoded video image frames can be directly sent to the display. For example, the decoded video image frames can be directly stored in the display buffer and displayed on the display screen by the display driver.

[0052] In some implementations, the display mechanism of the terminal device can be a double-buffered mechanism or a triple-buffered mechanism. If the terminal device's display mechanism is a double-buffered mechanism, the display buffer includes two buffers for display (hereinafter referred to as display buffers for ease of distinction). One display buffer is used to display the current screen, and the other display buffer serves as a backup buffer. Figure 1 The illustration shows a display buffer consisting of two display buffers. If the terminal device's display mechanism is a triple-buffering mechanism, the display buffer consists of three display buffers: one display buffer is used to display the current screen, and the other two display buffers serve as backup buffers.

[0053] In some implementations, the specific process of displaying each decoded video image frame on the display screen in the first processing mode may include:

[0054] i. The decoded video image frame is stored in a display buffer.

[0055] ii. The SurfaceFlinger service reads the image frames to be composited from the display buffer, including the decoded video image frames.

[0056] In some embodiments, during the playback of the first video on the terminal device, the image frames stored in the display buffer may include only the decoded video image frames, or they may include other image frames. That is, the image frames to be synthesized may include only the decoded video image frames, or they may include decoded video image frames and other image frames.

[0057] For example, such as Figure 2 As shown, the image frames stored in the display buffer include the decoded video image frame I1. For example... Figure 3 As shown, the image frames stored in the display buffer include the decoded video image frame I2, the image frame I3 corresponding to the playback controls (hereinafter referred to as the control image frame), and the image frame I4 corresponding to the bullet comments (hereinafter referred to as the bullet comment image frame). The control image frame I3 and the bullet comment image frame I4 can be drawn and rendered by the video application. The control image frame I3 can include one or more playback controls, such as the pause control Ac1, the next episode control Ac2, the bullet comment control Ac3, the speed control Ac4, the screenshot control Ac5, the smart recognition control Ac6, etc. The bullet comment image frame I4 can include one or more bullet comment contents.

[0058] iii. SurfaceFlinger sends the image frames to be composited, which it reads from the display buffer, to the hardware hybrid renderer (HWComposer, HWC) for image frame compositing.

[0059] iv.HWC sends the synthesis results to the display driver for display on the screen.

[0060] In some embodiments, if the image frame to be synthesized only includes the decoded video image frame, for example, in a full-screen playback environment, the HWC does not need to synthesize the video image frame. The HWC can directly send the video image frame as the synthesis result (i.e., the HWC can send it to the display driver without any processing) to display the video image frame on the screen. The display result is as follows: Figure 4 As shown in the image. In this scenario, video playback does not require GPU involvement, and video playback does not cause GPU power consumption.

[0061] In some embodiments, if the image frame to be synthesized includes not only the decoded video image frame but also other image frames, for example, if the playback interface is not full-screen, the image frame to be synthesized may also include... Figure 3The control image frame shown is an example. In this case, HWC can combine the decoded video image frame and the control image frame, and then send the combined result to the display driver for display on the screen. The display result is as follows: Figure 5 As shown. In this scenario, the video application may need to call the GPU to render the control image frames (e.g., render the text in the control image frames), but since only the control image frames are rendered by the GPU and the video image frames are not processed by the GPU, the GPU power consumption is lower in this scenario.

[0062] like Figure 1 As shown, in the second processing mode, the video stream of the first video can be decoded by a video codec to obtain video image frames, and the decoded video image frames can be stored in a buffer. The buffer can include n buffers (hereinafter referred to as buffers for ease of distinction), where n is a positive integer. The value of n can be set according to the memory size of the terminal device and the actual caching requirements, and this embodiment does not limit this. For example, if n is 40, the buffer can cache 40 video image frames.

[0063] In the second processing mode, video applications can also utilize the GPU to perform image enhancement, resolution adjustment, and format conversion on the video image frames stored in the buffer. The processed video image frames can then be transmitted to the display buffer for display. For example, image enhancement can involve the video application calling the GPU to render each decoded video image frame, adjusting one or more aspects such as brightness, contrast, color saturation, background, and people. Resolution adjustment can involve the video application calling the GPU to adjust the resolution of the decoded video image frames to better adapt to the display screen's resolution. Because this requires processing each video image frame to be played using the GPU, the GPU's power consumption is higher in this scenario.

[0064] In some embodiments, in the second processing mode, the video application can also respond to a user's click on the screenshot control Ac5 by invoking the GPU to process the captured video segment or captured video frame. For example, the video frame in the captured video segment is a composite of video image frames and control image frames, or a composite of video image frames, control image frames, and bullet screen image frames. By invoking the GPU to process the captured video segment, the final video segment frame can be made to include only video image frames. For example, the GPU can use recognition algorithms or models in related technologies to process the captured video segment, so that the final video segment frame includes only video image frames. Since each video image frame in the video segment needs to be processed, the GPU power consumption is high in this case.

[0065] In some embodiments, in the second processing mode, the video application can also respond to a user's click on the intelligent recognition control Ac6 by calling the GPU to recognize information about each character in the current frame, the actor playing each character, and so on. For example, the GPU can recognize information about each character in the current frame and the actor playing each character by running an existing generative artificial intelligence (AI) model. Because this requires calling the GPU to run generative AI model data, the GPU's power consumption is higher in this scenario.

[0066] In some embodiments, the first processing mode does not configure execution logic for the tasks corresponding to the screenshot control Ac5 and the smart recognition control Ac6, while the second processing mode does configure execution logic for the tasks corresponding to the screenshot control Ac5 and the smart recognition control Ac6. When a click operation is detected on the screenshot control Ac5 or the smart recognition control Ac6, the task corresponding to the screenshot control Ac5 or the smart recognition control Ac6 needs to be executed in the second processing mode to ensure that the task corresponding to the screenshot control Ac5 or the smart recognition control Ac6 is executed successfully.

[0067] The following is combined Figure 6 The process of decoding and playing video streams by terminal devices is described in detail. Figure 6 Taking a terminal device with a video application installed as an example, the video application can be a video playback application for playing short videos, movies and TV series, etc., and this application example does not limit this.

[0068] S30, in response to the user's operation of playing the first video on the application interface of the video application, obtains the video stream of the first video.

[0069] In some embodiments, after the video application is launched, the user can select a video to play from the application interface, for example, selecting to play the first video. The resolution of the first video can be selected by the user or preset by the video application. The video stream of the first video obtained by the terminal device is the video stream corresponding to the selected resolution. For example, different resolution video streams correspond to different video URLs, and the video application in the terminal device can access the corresponding video URL through the network to obtain the video stream corresponding to the selected resolution.

[0070] S31, determine the processing mode of the video stream of the first video.

[0071] In some embodiments, after acquiring the video stream of the first video, the terminal device may first determine the processing mode of the video stream of the first video, and then process the video stream of the first video based on the determined processing mode to play the first video.

[0072] For example, if the terminal device's processor score is low—for instance, the central processing unit (CPU) or system-on-chip (SoC) score is lower than a preset score, or the memory is small (e.g., lower than a first preset capacity), or the battery capacity is small (e.g., lower than a second preset capacity), or the remaining battery power is low (e.g., lower than a preset percentage)—the terminal device determines the processing mode for the first video stream to be a first processing mode. If the terminal device's processor score is high (CPU or SoC score is greater than or equal to a preset score), or the memory is large (e.g., greater than or equal to a first preset capacity), or the battery capacity is large (e.g., greater than or equal to a second preset capacity), or the remaining battery power is high (e.g., greater than or equal to a preset percentage)—the terminal device determines the processing mode for the first video stream to be a second processing mode.

[0073] For example, if a user watches videos on their terminal device frequently / for a long time each day (e.g., greater than or equal to a preset frequency / preset duration), or performs few operations on the video playback interface while watching videos (e.g., fewer than or equal to a preset number of operations), or has a good network speed while watching videos (e.g., a network speed greater than or equal to a preset speed), the terminal device determines the processing mode for the first video stream to be the first processing mode. If a user watches videos frequently / for a long time each day on their terminal device (e.g., less than a preset frequency / preset duration), or performs many operations on the video playback interface while watching videos (e.g., more than a preset number of operations), or has a poor network speed while watching videos (e.g., a network speed less than a preset speed), the terminal device determines the processing mode for the first video stream to be the second processing mode.

[0074] S32, if the processing mode of the video stream of the first video is determined to be the first processing mode, the video stream of the first video is decoded, and the decoded video image frames are stored in the display buffer.

[0075] In some embodiments, the display buffer may include two or three buffers (referred to as display buffers). If the processing mode of the video stream of the first video is determined to be a first processing mode, the terminal device decodes the video stream of the first video and stores the decoded video image frames in the display buffer. For example, the video stream of the first video is decoded by a video codec in the terminal device, and the decoded video image frames are stored in the display buffer.

[0076] In some embodiments, in the first processing mode, the terminal device may also switch the video stream processing mode from the first processing mode to the second processing mode in response to a preset trigger event, such as a user's click operation on a specified control in the video playback interface. For example, the specified control may include a screenshot control Ac5, a smart recognition control Ac6, etc.

[0077] S33, if it is determined that the processing mode of the video stream of the first video is the second processing mode, the video stream of the first video is decoded, and the decoded video image frames are stored in the buffer.

[0078] In some embodiments, the buffer may include multiple buffers (referred to as buffers) for caching video image frames. If the processing mode of the first video stream is determined to be a second processing mode, the terminal device decodes the first video stream and stores the decoded video image frames in the buffer that includes multiple buffers. In the event of network latency, by sequentially copying the video image frames stored in the multiple buffers to the display buffer for display, the smoothness of video playback can be improved, thereby avoiding video stuttering. For example, the video codec in the terminal device decodes the first video stream, and the video image frames decoded by the video codec are stored in the buffer.

[0079] In some embodiments, each buffer in the buffer can be used to store a video image frame. The buffer can also store information that characterizes the playback order of the video image frames, such as decoding timestamps, frame numbers, etc., so that the video image frames cached in the buffer can be copied to the display buffer according to the playback order information, so that the video image frames can be played in sequence.

[0080] S34, transfer the video image frames stored in the buffer to the display buffer.

[0081] In some embodiments, the terminal device may copy video image frames stored in a buffer to a display buffer, thereby transmitting the video image frames stored in the buffer to the display buffer. For example, the processor in the terminal device may copy a video image frame from the buffer to the display buffer in response to a playback request for a video image frame from a video application.

[0082] In some embodiments, the terminal device may also perform image enhancement, resolution adjustment, and other processing on the video image frames stored in the buffer, and then transmit the processed video image frames to the display buffer.

[0083] S35, SurfaceFlinger reads the image frame to be synthesized from the display buffer and sends the image frame to be synthesized to HWC. The image frame to be synthesized includes video image frames.

[0084] S36, HWC performs image frame synthesis and sends the synthesis result to the display driver.

[0085] S37, the display driver displays the composite result on the screen.

[0086] In some embodiments, if the display buffer only includes video image frames (i.e., the image frames to be composited only include video image frames), SurfaceFlinger reads the video image frames from the display buffer and sends them to HWC. HWC can directly send the video image frames to the display driver (i.e., HWC does not composite the video image frames), and the display driver displays the video image frames on the screen. If the display buffer includes other image frames (e.g., control image frames, bullet screen image frames) in addition to video image frames, SurfaceFlinger reads the image frames to be composited (video image frames and other image frames) from the display buffer and sends them to HWC. HWC composites the received image frames and sends the composited result to the display driver, which then displays the composited result on the screen.

[0087] like Figure 7 As shown, to determine the processing mode of a video stream, a mode selection framework can be configured in the terminal device. Based on the mode selection information output by the mode selection framework, the terminal device can use either a first processing mode or a second processing mode to decode and play the video stream. For example, in response to the operation of playing a first video, a video application can acquire the video stream of the first video. The first video application can then call a video codec to decode the video stream. Based on the mode selection information output by the mode selection framework, the video codec can store the decoded video image frames in a display buffer (corresponding to the first processing mode) or in a buffer (corresponding to the second processing mode).

[0088] For example, taking the mode selection information as a numerical value, when the mode selection information output by the mode selection framework is information 1, the terminal device uses the first processing mode to decode and play the video stream; when the mode selection information output by the mode selection framework is information 2, the terminal device uses the second processing mode to decode and play the video stream. In other embodiments, the mode selection information can also be represented by other characters, and practical applications are not limited to the examples above.

[0089] In some embodiments, the mode selection framework can output corresponding mode selection information based on the constructed device performance profile, device usage profile, video playback smoothness, or specific operations received during video playback.

[0090] In some embodiments, a device performance profile may include multiple performance information items, which may include parameter information such as the processor, memory, and battery in the terminal device. For example, the mode selection framework may determine the default processing mode for video playback as a first processing mode or a second processing mode based on the device performance profile. For instance, in cases where the processor performance score is low, the memory is small, the battery capacity is small, or the remaining battery power is low, the mode selection framework outputs mode selection information 1 to trigger the terminal device to default to using the first processing mode for decoding and playback of the video stream.

[0091] For example, a low processor performance score could mean the processor's benchmark score is below a preset score. A score below the preset score indicates that the processor (with integrated GPU) may experience significant time consumption when processing video image frames. Therefore, it is recommended to use the first processing mode for video stream decoding and playback. Insufficient memory could mean the memory capacity is below a first preset capacity. A memory capacity below the first preset capacity indicates that there may not be sufficient memory space for buffering. Therefore, it is recommended to use the first processing mode for video stream decoding and playback. Insufficient battery capacity could mean the battery's rated capacity is below a second preset capacity. A battery rated capacity below the second preset capacity indicates a shorter continuous video playback time. Therefore, it is recommended to use the first processing mode for video stream decoding and playback. Insufficient remaining battery power could mean the remaining battery power is below a preset percentage. A remaining battery power below a preset percentage indicates a shorter continuous video playback time. Therefore, it is recommended to use the first processing mode for video stream decoding and playback. The first preset capacity, second preset capacity, and preset percentage can all be set according to actual needs, and this application embodiment does not limit them.

[0092] In some embodiments, if the mode selection framework determines the default processing mode for video playback based on multiple performance information, a weight coefficient can be set for each performance information. For example, based on the score of each performance information (pre-built scoring rules) and the corresponding weight coefficient, a total score is obtained, and then the total score is compared with a preset score to determine whether the default processing mode is the first processing mode or the second processing mode.

[0093] In some embodiments, the device usage profile may include multiple pieces of historical video playback information. This information may include the frequency / duration of video viewing by the user on the terminal device per unit time (e.g., per day), the number of times the user manipulates controls in the video playback interface during video playback, and the network speed connected to the terminal device while watching video. For example, the mode selection framework may determine the default processing mode for video playback as a first processing mode or a second processing mode based on the device usage profile. For instance, if the frequency / duration of video viewing is high (greater than a preset frequency or duration), or the number of times controls are manipulated in the video playback interface is low (less than a preset number), or the network speed is good (network speed greater than a preset speed), the mode selection framework outputs mode selection information 1 to trigger the terminal device to default to the first processing mode for video stream decoding and playback, thereby reducing power consumption during video playback.

[0094] For example, a high frequency / duration of daily video viewing indicates that more device battery power is used for video playback. To extend the device's continuous video playback time, it is recommended to use the first processing mode for video stream decoding and playback. As another example, a low frequency of user interaction with controls in the video playback interface indicates a lower probability of clicking specific controls (e.g., screenshot control Ac5, smart recognition control Ac6, etc.). Therefore, it is recommended to use the first processing mode for video stream decoding and playback. Furthermore, a good network speed during video viewing indicates a lower probability of video playback stuttering without video frame buffering. Therefore, it is recommended to use the first processing mode for video stream decoding and playback.

[0095] In some embodiments, if the mode selection framework determines the default processing mode for video playback based on multiple historical video playback related information, a weight coefficient can be set for each historical video playback related information. For example, based on the score (pre-built scoring rules) and the corresponding weight coefficient of each historical video playback related information, a total score is obtained, and then the total score is compared with a preset score to determine whether the default processing mode is the first processing mode or the second processing mode.

[0096] In some embodiments, video playback smoothness may refer to whether there is screen stuttering during video playback, and specific operations received during video playback may refer to whether an operation that triggers the GPU to be invoked, or an operation that triggers the GPU to process video image frames, or a click operation on a specified control is received during video playback, etc.

[0097] For example, a specific operation could be an operation that triggers GPU access, such as clicking the bullet screen control Ac3 to enable the bullet screen function, clicking the screenshot control Ac5 to capture a video clip, clicking the smart recognition control Ac6 to identify characters in the scene, or switching the image resolution to a preset resolution (e.g., 4K resolution). In other embodiments, the specific operation may not include clicking the bullet screen control Ac3 to enable the bullet screen function.

[0098] For example, specific operations may also include clicking the intelligent recognition control Ac6 to identify characters in the picture, switching the picture clarity to a preset resolution, and other operations that can trigger the GPU to process video image frames.

[0099] In some embodiments, when video playback experiences stuttering, or a specific operation is received during video playback, the mode selection framework outputs mode selection information 2 to trigger the terminal device to adopt a second processing mode for video stream decoding and playback. Assuming the video playback frame rate is 25 FPS, if the display interval between two video image frames exceeds 40ms, video playback stuttering can be considered to have occurred. For example, a specific operation received during video playback requires calling the GPU or other hardware resources to execute the corresponding task. Task processing has a certain time consumption and occupies device resources (hardware resources or network resources). Adopting the second processing mode for video stream decoding and playback can maximize the smoothness of video playback.

[0100] In some embodiments, the terminal device may also be configured with controls or an interface for setting the processing mode. For example, the terminal device's settings application includes an interface for setting the processing mode. In this interface, the user can set the processing mode to be selected automatically or manually. Automatic selection of the processing mode may refer to automatically selecting the processing mode based on a mode selection framework, while manual selection of the processing mode may refer to the user setting the default processing mode used by the video application (e.g., using the first processing mode or the second processing mode by default).

[0101] In some embodiments, training data can be constructed and labels added to each training data point. The training data may include performance information and / or historical video playback information. A mode selection model is trained based on the labeled training data, and the mode selection framework can determine the default processing mode used by the video application based on the mode selection model. For example, any possible algorithm, such as decision tree algorithm or support vector machine algorithm, can be used to train the mode selection model. The machine learning algorithm can be selected according to actual usage requirements, and this application embodiment does not limit the choice.

[0102] For example, training data 'a' is labeled with label 1 (first processing mode), and training data 'b' is labeled with label 2 (second processing mode). Training data 'a' and training data 'b' are used as input to the pattern selection model, and label 1 and label 2 are used as the expected results. Initial values ​​are assigned to the connection weights between neurons in each layer of the neural network. Based on these connection weights, a neural network algorithm is used to obtain the actual output results corresponding to the training data. After processing the expected and actual output results using an error function, the connection weights between neurons in each layer are adjusted based on the processing results, resulting in the adjusted connection weights. This training process is repeated, and after multiple rounds of iterative training, the trained pattern selection model is obtained.

[0103] For example, taking a training data set that includes both performance information and historical video playback information, the mode selection model can be trained and deployed before the terminal device leaves the factory. After the terminal device leaves the factory, if a preset amount of historical video playback information has not been collected, the mode selection framework can input the performance information of the terminal device into the mode selection model to obtain the default video stream processing mode. If a preset amount of historical video playback information has been collected, the mode selection model deployed on the terminal device can be trained based on the collected historical video playback information. Subsequently, the mode selection framework can input the video playback information of the terminal device into the mode selection model to obtain the default video stream processing mode.

[0104] For example, assuming the training data includes historical video playback information, if a preset amount of historical video playback information has not been collected (i.e., an effective mode selection model has not yet been trained), the mode selection framework can use the developer's preset processing mode as the default video stream processing mode. For instance, the developer can preset a first or second processing mode as the default video stream processing mode based on the terminal's performance information. If a preset amount of historical video playback information has been collected, the mode selection model can be trained based on this information. Subsequently, the mode selection framework can input the terminal device's video playback information into the mode selection model to obtain the default video stream processing mode. For example, the mode selection framework can input the terminal device's video playback information from the previous day into the mode selection model to obtain the default video stream processing mode for that day.

[0105] In some embodiments, if the mode selection framework determines that the default processing mode used by the video application is the first processing mode based on the mode selection model, during video playback, the mode selection framework can also switch the first processing mode to the second processing mode when the screen stutters or when a specific operation is received (e.g., an operation that can trigger the GPU to call, or an operation that can trigger the GPU to process video image frames).

[0106] See Figure 8 The image shows a video playback method provided in an embodiment of this application. The video playback method can be applied to a terminal device, which includes a display screen. The video playback method may include:

[0107] S51, in response to the first action, launches the video application.

[0108] For example, the first operation is clicking the icon of a video application on the desktop. The terminal device can respond to the click on the video application icon and launch the video application. In other embodiments of this application, the first operation can also be calling the video application from another application. For example, if the application running in the foreground of the terminal device is an instant messaging application, and the user launches the video application and enters the application interface of the video application through a touch operation of a control, icon, option, etc. in the instant messaging application.

[0109] S52, in response to a second operation of playing the first video on a video application, acquires the video stream of the first video.

[0110] For example, the second operation could refer to clicking to play the first video on the application interface of a video application. The terminal device could then obtain the video stream of the first video in response to the click to play the first video.

[0111] S53, the video stream is processed using a first processing mode, which includes decoding the video stream and storing the decoded video image frames in a display buffer for display.

[0112] In some embodiments, the display buffer may include two or three display buffers, and the present application embodiments do not limit the number of display buffers contained in the display buffer.

[0113] In some embodiments, the terminal device can be configured to process the video stream using a first processing mode by default. In this first processing mode, the GPU is not used to process the decoded video image frames to save power consumption during video playback. The first processing mode may include decoding the video stream and storing the decoded video image frames in a display buffer for display. For example, SurfaceFlinger reads the image frames to be composited (video image frames, or video image frames and other image frames) from the display buffer and sends them to the HWC for composited composition and display.

[0114] S54, in response to a preset trigger event, processes the video stream using a second processing mode. The second processing mode includes decoding the video stream and storing the decoded video image frames in a buffer. The video image frames stored in the buffer can be copied to a display buffer for display.

[0115] In some embodiments, the buffer may include multiple buffers for caching video image frames. The number of buffers contained in the buffer may be set according to actual needs, and this application embodiment does not limit this.

[0116] In some embodiments, the preset trigger event may include a video image frame playback stuttering event or an event where the video playback interface of a video application receives a preset operation. For example, the preset operation may include an operation that triggers the GPU to process the video image frame, or the preset operation may include a touch operation on a target control among multiple controls in the video playback interface provided by the video application, wherein the target control is a control that can trigger the GPU to be invoked. For example, controls that can trigger the GPU to be invoked include a bullet screen control Ac3, a screenshot control Ac5, and a smart recognition control Ac6.

[0117] In some embodiments, the default processing mode used by the terminal device can also be determined based on the resolution of the first video. By obtaining the media information of the video stream of the first video (the media information includes the resolution of the first video), if the resolution of the first video is not a preset resolution, the first processing mode is used by default to process the video stream; if the resolution of the first video is a preset resolution, the second processing mode is used by default to process the video stream. The preset resolution can be an ultra-high-definition resolution, such as 4K resolution. For ultra-high-definition video playback, it may be necessary to call the GPU to adjust the resolution of the decoded video image frames. In order to ensure the smoothness of video playback and the smooth resolution adjustment, the second processing mode is used to process the video stream.

[0118] In some embodiments, the default processing mode may refer to the processing mode used at the beginning of the video stream.

[0119] In some embodiments, the default processing mode used by the terminal device can also be determined based on the performance information of the terminal device. For example, by obtaining the performance information of the terminal device, which may include one or more of the following: processor model, memory size, battery rated capacity, and remaining battery capacity, the default processing mode can be determined based on the performance information.

[0120] In some embodiments, the default processing mode used by the terminal device can also be determined based on historical video playback information of the terminal device. For example, by obtaining historical video playback information of the terminal device, which includes one or more of the following: video playback frequency per unit time, video playback duration per unit time, number of operations on controls in the video playback interface per unit time, and network speed of the network connected to the terminal device when playing video, the default processing mode can be determined based on historical video playback information.

[0121] In some embodiments, a mode selection model can be trained to determine the default processing mode used by the terminal device. The training data for the mode selection model may include performance information of the terminal device and / or historical video playback information of the terminal device.

[0122] See Figure 9 As shown, the terminal device 100 involved in the embodiments of this application will be described below. The terminal device in the embodiments of this application can be a mobile phone, tablet computer, desktop computer, laptop computer, handheld computer, notebook computer, ultra-mobile personal computer (UMPC), large screen, smart TV, netbook, as well as cellular phone, personal digital assistant (PDA), augmented reality (AR) / virtual reality (VR) devices, and other devices including touch screens. The embodiments of this application do not impose special limitations on the specific form of the terminal device. Please refer to... Figure 9 , Figure 9 This is a schematic diagram of the structure of the terminal device 100 provided in the embodiments of this application.

[0123] Terminal 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, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0124] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the terminal device 100. In other embodiments of this application, the terminal device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0125] In addition, an operating system runs on top of the aforementioned components. Examples include Apple's iOS operating system, Google's Android open-source operating system, and Microsoft's Windows operating system.

[0126] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0127] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0128] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instructions or data again, it can directly retrieve them from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves system efficiency.

[0129] In some embodiments, the processor 110 may include one or more interfaces. Interfaces 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.

[0130] The wireless communication function of the terminal device 100 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0131] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 100 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0132] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0133] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal device 100, 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), and infrared (IR) technologies. 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 antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0134] In some embodiments, antenna 1 of terminal device 100 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal device 100 to communicate with networks and other devices via 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0135] Terminal device 100 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0136] 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 (AMOLED), a flexible light-emitting diode (FLED), a minimized display, a microLED, a micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the terminal device 100 may include one or N display screens 194, where N is a positive integer greater than 1. In this embodiment, the display screen 194 can be a touch screen, that is, the display screen 194 integrates a touch sensor 180K.

[0137] Internal memory 121 may include one or more random access memory (RAM) and one or more non-volatile memory (NVM).

[0138] Random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, fifth generation DDR SDRAM is generally called DDR5 SDRAM), etc.

[0139] Non-volatile memory can include disk storage devices and flash memory.

[0140] Flash memory can be classified according to its operating principle, including NOR FLASH, NAND FLASH, 3D NAND FLASH, etc.; according to the level of the storage cell, including single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc.; and according to the storage specification, including universal flash storage (UFS) and embedded multimedia card (eMMC), etc.

[0141] The random access memory can be directly read and written by the processor 110. It can be used to store executable programs (such as machine instructions) of the operating system or other running programs, as well as user and application data.

[0142] Non-volatile memory can also store executable programs and user and application data, and can be pre-loaded into random access memory for direct reading and writing by the processor 110.

[0143] The external memory interface 120 can be used to connect to external non-volatile memory to expand the storage capacity of the terminal device 100. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize data storage function.

[0144] The video playback methods described in the above embodiments can all be implemented in the terminal device 100 having the above hardware structure.

[0145] The operating system of a terminal device can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application uses the layered architecture Android system as an example to illustrate the software structure of the terminal device. Figure 10 This is a software architecture diagram of a terminal device. A layered architecture divides the software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. Taking the Android system as an example, in some implementations, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer (Framework), the Hardware Abstraction Layer (HAL), and the kernel layer.

[0146] The application layer can include a series of application packages. For example, application packages can include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0147] The application framework layer provides an Application Programming Interface (API) and programming framework for applications within the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc. The application framework layer may also include a mode selection framework, which can be used to determine the processing mode of the video stream.

[0148] The hardware abstraction layer may include HWC, which can be used to synthesize image frames.

[0149] The kernel layer is the layer between hardware and software. The kernel layer may contain display drivers, camera drivers, audio drivers, sensor drivers, etc.

[0150] The kernel layer is the core of the operating system for a terminal device. It is the first layer of software extension based on the hardware, providing the most basic functions of the operating system. It is the foundation for the operating system's operation, responsible for managing system processes, memory, device drivers, files, and network systems, and determining the system's performance and stability. For example, the kernel can determine the timing of an application's operations on certain parts of the hardware.

[0151] The kernel layer includes hardware-dependent programs such as interrupt handlers and device drivers, as well as basic, common, and frequently running modules such as clock management and process scheduling modules, and critical data structures. The kernel layer can be located in the processor or embedded in internal memory.

[0152] This embodiment also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on the terminal device 100, the terminal device 100 performs the aforementioned related method steps to implement the video playback method in the above embodiment.

[0153] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement the video playback method described above.

[0154] In addition, embodiments of this application also provide an apparatus, which may specifically be a chip, component, or module. The apparatus may include a connected processor and a memory; wherein the memory is used to store computer execution instructions, and when the apparatus is running, the processor may execute the computer execution instructions stored in the memory to cause the chip to execute the video playback methods in the above-described method embodiments.

[0155] Through the above description of the embodiments, those skilled in the art can clearly understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above 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.

[0156] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

[0157] The unit described as a separate component may or may not be physically separate. The component shown as a unit can be one physical unit or multiple physical units, that is, it can be located in one place or distributed in multiple different places. Some or all of the units can be selected to achieve the purpose of the solution in this embodiment according to actual needs.

[0158] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0159] If the integrated unit is implemented as 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 solutions of the embodiments of this application, essentially or in other words, the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a device (which may be a microcontroller, chip, etc.) or processor to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0160] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. 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 of the technical features. 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.

Claims

1. A video playback method, applied to a terminal device, characterized in that, The method includes: In response to the first action, the first interface of the video application is displayed; In response to a second operation on the first interface, the first frame of the first video is started playing at a first moment. Between the first moment and the second moment, the image data of the first video has not been processed by the first processor. At the second moment, in response to a preset trigger event, the image data of the first video is processed using the first processor; After the second moment, based on the image data of the first video processed by the first processor, the second frame of the first video is played, and the power consumption of the first processor between the first moment and the second moment is less than the power consumption of the first processor after the second moment.

2. The video playback method as described in claim 1, characterized in that, The step of processing the image data of the first video using the first processor in response to a preset trigger event includes: In response to a click operation on the first control, the image data of the first video is processed using the first processor.

3. The video playback method as described in claim 2, characterized in that, The first control includes any one of the following: bullet screen control, screenshot control, intelligent recognition control, and resolution selection control.

4. The video playback method as described in claim 1, characterized in that, The step of processing the image data of the first video using the first processor in response to a preset trigger event includes: Get the stuttering event during playback of the first video; Based on the stuttering event, the first processor is used to process the image data of the first video.

5. The video playback method according to any one of claims 1 to 4, characterized in that, The display parameters of the second screen are different from those of the first screen. The display parameters include at least one of brightness, contrast, color saturation, and resolution.

6. The video playback method as described in claim 1, characterized in that, The first screen of the first video, which is started playing at a first moment in response to a second operation on the first interface, includes: In response to the second operation on the first interface, if the resolution of the first video to be played is not a preset resolution, the first frame of the first video is started playing at the first moment, and the image data of the first frame has not been processed by the first processor.

7. The video playback method as described in claim 6, characterized in that, The method further includes: In response to the second operation on the first interface, if the resolution of the first video to be played is the preset resolution, the third frame of the first video is started to be played at the first moment, and the image data of the third frame is processed by the first processor.

8. The video playback method as described in claim 1, characterized in that, The first screen of the first video, which is started playing at a first moment in response to a second operation on the first interface, includes: In response to the second operation on the first interface, if the performance information of the terminal device meets the preset conditions, the first frame of the first video will start playing at the first moment. The image data of the first frame has not been processed by the first processor. The performance information includes one or more of the following: processor model, memory size, battery rated capacity, and battery remaining capacity.

9. The video playback method as described in claim 8, characterized in that, The method further includes: In response to the second operation on the first interface, if the performance information of the terminal device does not meet the preset conditions, the third screen of the first video is started playing at the first moment, and the image data of the third screen is processed by the first processor.

10. The video playback method as described in claim 1, characterized in that, The first screen of the first video, which is started playing at a first moment in response to a second operation on the first interface, includes: In response to the second operation on the first interface, if the historical video playback information of the terminal device meets the preset conditions, the first frame of the first video will start playing at the first moment. The image data of the first frame has not been processed by the first processor. The historical video playback information includes one or more of the following: video playback frequency per unit time, video playback duration per unit time, number of operations of controls in the video playback interface per unit time, and network speed of the network connected to the terminal device when playing the video.

11. The video playback method as described in claim 10, characterized in that, The method further includes: In response to the second operation on the first interface, if the historical video playback information of the terminal device does not meet the preset conditions, the third screen of the first video will be played at the first moment, and the image data of the third screen will be processed by the first processor.

12. A terminal device, characterized in that, The terminal device includes a display screen, a memory, and a processor; The display screen, the memory, and the processor are coupled together; The memory is used to store program instructions; The processor is configured to read the program instructions stored in the memory to implement the video playback method as described in any one of claims 1 to 11.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the video playback method as described in any one of claims 1 to 11.

Citation Information

Patent Citations

  • Video playing method and related equipment

    CN119743606A