CN115550709A - Data processing method and electronic device - Google Patents
Data processing method and electronic device Download PDFInfo
- Publication number
- CN115550709A CN115550709A CN202210019453.3A CN202210019453A CN115550709A CN 115550709 A CN115550709 A CN 115550709A CN 202210019453 A CN202210019453 A CN 202210019453A CN 115550709 A CN115550709 A CN 115550709A
- Authority
- CN
- China
- Prior art keywords
- video data
- frame
- buffer
- electronic device
- data frame
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/4302—Content synchronisation processes, e.g. decoder synchronisation
- H04N21/4305—Synchronising client clock from received content stream, e.g. locking decoder clock with encoder clock, extraction of the PCR packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/44004—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N5/00—Details of television systems
- H04N5/04—Synchronising
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
Abstract
Description
技术领域technical field
本申请涉及终端设备领域,尤其涉及一种数据处理方法及电子设备。The present application relates to the field of terminal equipment, and in particular to a data processing method and electronic equipment.
背景技术Background technique
当前,在两个电子设备之间通过网络传输视频数据、由接收端电子设备对视频数据对应的内容进行显示的场景中,接收端电子设备接收到视频数据,对视频数据进行解码后直接送显,但存在一些视频数据帧的显示时延很大,用户体验较差。At present, in the scene where video data is transmitted between two electronic devices through the network, and the receiving-end electronic device displays the content corresponding to the video data, the receiving-end electronic device receives the video data, decodes the video data and directly sends it to the display , but there is a large display delay of some video data frames, and the user experience is poor.
发明内容Contents of the invention
本申请实施例提供一种数据处理方法及电子设备,以降低视频数据帧的显示时延。Embodiments of the present application provide a data processing method and an electronic device, so as to reduce the display delay of video data frames.
在一些场景中,由于网络传输的不稳定性,导致接收端电子设备对视频数据的解码送显时间不稳定。接收端电子设备的SurfaceFlinger(图形合成者)是按照Vsync周期(即垂直同步周期)固定进行屏幕刷新的,因此解码后的各帧视频数据还需要按照顺序,进一步等待Vsync信号才能被SurfaceFlinger显示。这样,就造成一些视频数据帧的显示时延很大。In some scenarios, due to the instability of network transmission, the decoding and display time of the video data by the electronic device at the receiving end is unstable. The SurfaceFlinger (graphics synthesizer) of the receiving-end electronic device refreshes the screen according to the Vsync cycle (ie, the vertical synchronization cycle). Therefore, the decoded video data of each frame needs to be displayed in order by further waiting for the Vsync signal to be displayed by SurfaceFlinger. In this way, the display delay of some video data frames is very large.
第一方面,本申请实施例提供一种数据处理方法。该数据处理方法应用于电子设备,该方法包括:从电子设备的解码模块的输出缓存中读取第一视频数据帧,输出缓存用于存储解码模块从源端电子设备发送的编码数据中解码出来的视频数据帧。然后,确定在第一视频数据帧之前写入第一缓存的第二视频数据帧,第二视频数据帧与第一视频数据帧之间间隔第一数量个视频数据帧,第一缓存用于存储待发送给电子设备的显示系统的视频数据帧。接着,根据将向第一缓存写入第一视频数据帧的第一时刻和向第一缓存写入第二视频数据帧的第二时刻,确定第一时间差。当第一时间差小于或等于显示系统的当前垂直同步周期,丢弃第一视频数据帧。这样,如果在一个Vsync周期内缓存的待送显的视频数据帧达到一定的数量(该数量等于第一数量与1的和),电子设备就丢弃该视频数据帧,从而使得一个Vsync周期内缓存的待送显的视频数据帧的数量不超过第一数量。通过控制一个Vsync周期内缓存的待送显的视频数据帧的数量,能够减少视频数据帧等待显示的时长,从而降低显示时延。In a first aspect, the embodiment of the present application provides a data processing method. The data processing method is applied to an electronic device, and the method includes: reading the first video data frame from the output buffer of the decoding module of the electronic device, and the output buffer is used to store the decoded data decoded by the decoding module from the encoded data sent by the source electronic device frame of video data. Then, it is determined that the second video data frame written into the first buffer before the first video data frame is spaced by a first number of video data frames between the second video data frame and the first video data frame, and the first buffer is used for storing A frame of video data to be sent to the display system of the electronic device. Next, a first time difference is determined according to the first moment when the first video data frame is to be written into the first buffer and the second moment when the second video data frame is to be written into the first buffer. When the first time difference is less than or equal to the current vertical synchronization period of the display system, the first video data frame is discarded. In this way, if the video data frames to be displayed within one Vsync period are buffered and reach a certain number (the number is equal to the sum of the first number and 1), the electronic device discards the video data frames, thereby making the buffering within one Vsync period The number of video data frames to be displayed does not exceed the first number. By controlling the number of buffered video data frames to be displayed within one Vsync period, the waiting time for the video data frames to be displayed can be reduced, thereby reducing the display delay.
根据第一方面,在一种实现方式中,数据处理方法还可以包括:从电子设备的解码模块的输出缓存中读取第三视频数据帧,确定在第三视频数据帧之前写入第一缓存的第四视频数据帧,第四数据帧与第三视频数据帧之间间隔第一数量个视频数据帧。然后,根据将向第一缓存写入第三视频数据帧的第三时刻和向第一缓存写入第四视频数据帧的第四时刻,确定第二时间差,当第二时间差大于显示系统的当前垂直同步周期,向第一缓存写入第三视频数据帧。这样,如果将视频数据帧写入第一缓存的时刻,与在该视频数据帧之前被写入第一缓存的第(第一数量+1)个视频数据帧的写入时刻的时间差超过一个Vsync周期,该视频数据帧的写入不会使在一个Vsync周期内缓存的待送显的视频数据帧的数量超过第一数量,因此可以将该视频数据帧写入第一缓存,以便后续将该视频数据帧发送给显示系统进行显示。According to the first aspect, in an implementation manner, the data processing method may further include: reading the third video data frame from the output buffer of the decoding module of the electronic device, and determining that the first buffer is written before the third video data frame The fourth video data frame, the first number of video data frames are separated between the fourth data frame and the third video data frame. Then, according to the third moment of writing the third video data frame to the first buffer and the fourth moment of writing the fourth video data frame to the first buffer, determine the second time difference, when the second time difference is greater than the current display system In the vertical synchronization period, the third video data frame is written into the first buffer. In this way, if the video data frame is written into the first cache moment, the time difference with the writing moment of the (first quantity+1) video data frame written into the first cache before the video data frame exceeds one Vsync period, the writing of this video data frame will not cause the number of video data frames to be displayed in the cache in a Vsync cycle to exceed the first number, so the video data frame can be written into the first cache, so that the subsequent The video data frames are sent to the display system for display.
根据第一方面,在一种实现方式中,当第二时间差大于显示系统的当前垂直同步周期,向第一缓存写入第三视频数据帧之后,还包括:记录向第一缓存写入第三视频数据帧的时刻。这样,可以根据第三视频数据帧的写入时刻,来确定第三视频数据帧之后的第(第一数量+1)个视频数据帧是否可以写入第一缓存,以确保在一个Vsync周期内缓存的待送显的视频数据帧的数量不超过第一数量,降低显示时延。According to the first aspect, in an implementation manner, when the second time difference is greater than the current vertical synchronization cycle of the display system, after writing the third video data frame into the first buffer, it further includes: recording the third video data frame into the first buffer. The moment of the frame of video data. In this way, it can be determined whether the (first number+1)th video data frame after the third video data frame can be written into the first buffer according to the writing moment of the third video data frame, so as to ensure that within one Vsync period The number of cached video data frames to be displayed does not exceed the first number, thereby reducing display delay.
根据第一方面,在一种实现方式中,还包括:在当前时刻与上一次向显示系统发送视频数据帧的时刻之间的时间差等于当前垂直同步周期的情况下,从第一缓存中读取写入时刻最早的目标视频数据帧,将目标视频数据帧发送给显示系统。这样,按照当前垂直同步周期向显示系统发送视频数据帧,与显示系统的屏幕刷新频率相一致,能够降低对显示系统的缓存的容量要求,减少显示系统丢帧数量。According to the first aspect, in an implementation manner, it also includes: when the time difference between the current moment and the moment when the video data frame was sent to the display system last time is equal to the current vertical synchronization period, reading from the first cache Write the earliest target video data frame, and send the target video data frame to the display system. In this way, the video data frame is sent to the display system according to the current vertical synchronization cycle, which is consistent with the screen refresh frequency of the display system, which can reduce the capacity requirement of the cache of the display system and reduce the number of frames lost by the display system.
根据第一方面,在一种实现方式中,将目标视频数据帧发送给显示系统之后,还包括:从第一缓存中删除目标视频数据帧。这样,将已经送显的视频数据帧从第一缓存中删除,可以及时释放第一缓存的存储资源,以便第一缓存有足够的空间存储解码模块后续解码出的视频数据帧。According to the first aspect, in an implementation manner, after sending the target video data frame to the display system, the method further includes: deleting the target video data frame from the first cache. In this way, deleting the video data frames that have been sent for display from the first cache can release the storage resources of the first cache in time, so that the first cache has enough space to store the video data frames subsequently decoded by the decoding module.
根据第一方面,在一种实现方式中,从电子设备的解码模块的输出缓存中读取第一视频数据帧之前,还包括:从电子设备的解码模块的输出缓存中读取第五视频数据帧,在向第一缓存已写入的视频数据帧的数量小于或等于第一数量的情况下,向第一缓存写入第五视频数据帧。在源端向接收端传输数据的初期,第一缓存为空,此时不需要丢弃视频数据帧,当第一缓存中的视频数据帧达到第一数量后,再确定后续的视频数据帧是否写入第一缓存。According to the first aspect, in an implementation manner, before reading the first video data frame from the output buffer of the decoding module of the electronic device, it further includes: reading the fifth video data from the output buffer of the decoding module of the electronic device frame, when the number of video data frames written into the first buffer is less than or equal to the first number, write the fifth video data frame into the first buffer. At the initial stage of data transmission from the source end to the receiver end, the first buffer is empty, and there is no need to discard video data frames at this time. When the video data frames in the first buffer reach the first number, then determine whether the subsequent video data frames are written into the first cache.
根据第一方面,在一种实现方式中,从电子设备的解码模块的输出缓存中读取第五视频数据帧之前,还包括:接收源端电子设备发送的编码数据,编码数据是对视频数据帧编码得到的,将编码数据写入解码模块的输入缓存,以使解码模块对编码数据进行解码,得到解码出的视频数据帧,将解码出的视频数据帧存储到解码模块的输出缓存。这样,接收端电子设备能够对源端电子设备发送的编码数据进行持续接收和解码。According to the first aspect, in an implementation manner, before reading the fifth video data frame from the output buffer of the decoding module of the electronic device, it also includes: receiving the encoded data sent by the electronic device at the source end, the encoded data is the video data If the frame is encoded, write the encoded data into the input buffer of the decoding module, so that the decoding module decodes the encoded data to obtain the decoded video data frame, and store the decoded video data frame into the output buffer of the decoding module. In this way, the electronic device at the receiving end can continuously receive and decode the encoded data sent by the electronic device at the source end.
根据第一方面,在一种实现方式中,当第一时间差小于或等于显示系统的当前垂直同步周期,丢弃第一视频数据帧之后,还包括:从输出缓存中删除第一视频数据帧。这样,将已经丢弃的视频数据帧从输出缓存中删除,可以及时释放输出缓存的存储资源,以防止因输出缓存剩余存储空间不足导致解码模块后续解码出的视频数据帧覆盖还未送显的视频数据帧。According to the first aspect, in an implementation manner, after discarding the first video data frame when the first time difference is less than or equal to the current vertical synchronization period of the display system, the method further includes: deleting the first video data frame from the output buffer. In this way, by deleting the discarded video data frames from the output buffer, the storage resources of the output buffer can be released in time, so as to prevent the video data frames decoded by the decoding module from covering the video that has not yet been displayed due to insufficient remaining storage space of the output buffer Data Frame.
根据第一方面,在一种实现方式中,当第二时间差大于显示系统的当前垂直同步周期,向第一缓存写入第三视频数据帧之后,还包括:从输出缓存中删除第三视频数据帧。这样,将已经写入第一缓存的视频数据帧从输出缓存中删除,可以及时释放输出缓存的存储资源,以防止因输出缓存剩余存储空间不足导致解码模块后续解码出的视频数据帧覆盖还未送显的视频数据帧。According to the first aspect, in an implementation manner, when the second time difference is greater than the current vertical synchronization cycle of the display system, after writing the third video data frame into the first buffer, further comprising: deleting the third video data from the output buffer frame. In this way, the video data frames that have been written into the first buffer are deleted from the output buffer, and the storage resources of the output buffer can be released in time, so as to prevent the video data frames decoded by the decoding module from being overwritten due to insufficient remaining storage space in the output buffer. Send video data frame for display.
根据第一方面,在一种实现方式中,第一数量小于或等于第一缓存的容量。这样,可以保证第一缓存空间能够存储至少第一数量的视频数据帧,确保一定的显示质量。According to the first aspect, in an implementation manner, the first quantity is less than or equal to the capacity of the first cache. In this way, it can be ensured that the first buffer space can store at least the first number of video data frames, ensuring a certain display quality.
第二方面,本申请提供一种电子设备,该电子设备包括:存储器和处理器,处理器与存储器耦合,存储器存储有程序指令,当程序指令由处理器执行时,使得电子设备执行如下步骤:从电子设备的解码模块的输出缓存中读取第一视频数据帧;输出缓存用于存储解码模块从源端电子设备发送的编码数据中解码出来的视频数据帧,确定在第一视频数据帧之前写入第一缓存的第二视频数据帧,第二视频数据帧与第一视频数据帧之间间隔第一数量个视频数据帧,第一缓存用于存储待发送给电子设备的显示系统的视频数据帧,根据将向第一缓存写入第一视频数据帧的第一时刻和向第一缓存写入第二视频数据帧的第二时刻,确定第一时间差,当第一时间差小于或等于显示系统的当前垂直同步周期,丢弃第一视频数据帧。In a second aspect, the present application provides an electronic device, the electronic device includes: a memory and a processor, the processor is coupled to the memory, the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device performs the following steps: Read the first video data frame from the output buffer of the decoding module of the electronic device; the output buffer is used to store the video data frame decoded by the decoding module from the encoded data sent by the source electronic device, and it is determined before the first video data frame The second video data frame written into the first cache, the second video data frame and the first video data frame are separated by a first number of video data frames, and the first cache is used to store the video to be sent to the display system of the electronic device Data frame, according to the first moment of writing the first video data frame to the first buffer and the second moment of writing the second video data frame to the first buffer, determine the first time difference, when the first time difference is less than or equal to the display The current vertical synchronization period of the system, discarding the first video data frame.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:从电子设备的解码模块的输出缓存中读取第三视频数据帧,确定在第三视频数据帧之前写入第一缓存的第四视频数据帧,第四数据帧与第三视频数据帧之间间隔第一数量个视频数据帧。然后,根据将向第一缓存写入第三视频数据帧的第三时刻和向第一缓存写入第四视频数据帧的第四时刻,确定第二时间差,当第二时间差大于显示系统的当前垂直同步周期,向第一缓存写入第三视频数据帧。这样,如果将视频数据帧写入第一缓存的时刻,与在该视频数据帧之前被写入第一缓存的第(第一数量+1)个视频数据帧的写入时刻的时间差超过一个Vsync周期,该视频数据帧的写入不会使在一个Vsync周期内缓存的待送显的视频数据帧的数量超过第一数量,因此可以将该视频数据帧写入第一缓存,以便后续将该视频数据帧发送给显示系统进行显示。According to the second aspect, in an implementation manner, when the program instruction is executed by the processor, the electronic device is made to perform the following steps: read the third video data frame from the output buffer of the decoding module of the electronic device, and determine A fourth video data frame is written into the first buffer before the video data frame, and a first number of video data frames are separated between the fourth data frame and the third video data frame. Then, according to the third moment of writing the third video data frame to the first buffer and the fourth moment of writing the fourth video data frame to the first buffer, determine the second time difference, when the second time difference is greater than the current display system In the vertical synchronization period, the third video data frame is written into the first buffer. In this way, if the video data frame is written into the first cache moment, the time difference with the writing moment of the (first quantity+1) video data frame written into the first cache before the video data frame exceeds one Vsync period, the writing of this video data frame will not cause the number of video data frames to be displayed in the cache in a Vsync cycle to exceed the first number, so the video data frame can be written into the first cache, so that the subsequent The video data frames are sent to the display system for display.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:记录向第一缓存写入第三视频数据帧的时刻。这样,可以根据第三视频数据帧的写入时刻,来确定第三视频数据帧之后的第(第一数量+1)个视频数据帧是否可以写入第一缓存,以确保在一个Vsync周期内缓存的待送显的视频数据帧的数量不超过第一数量,降低显示时延。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: record the moment when the third video data frame is written into the first cache. In this way, it can be determined whether the (first number+1)th video data frame after the third video data frame can be written into the first buffer according to the writing moment of the third video data frame, so as to ensure that within one Vsync period The number of cached video data frames to be displayed does not exceed the first number, thereby reducing display delay.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:在当前时刻与上一次向显示系统发送视频数据帧的时刻之间的时间差等于当前垂直同步周期的情况下,从第一缓存中读取写入时刻最早的目标视频数据帧,将目标视频数据帧发送给显示系统。这样,按照当前垂直同步周期向显示系统发送视频数据帧,与显示系统的屏幕刷新频率相一致,能够降低对显示系统的缓存的容量要求,减少显示系统丢帧数量。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is made to perform the following steps: the time difference between the current moment and the last time the video data frame is sent to the display system is equal to the current vertical In the case of a synchronous cycle, the target video data frame with the earliest writing time is read from the first cache, and the target video data frame is sent to the display system. In this way, the video data frame is sent to the display system according to the current vertical synchronization cycle, which is consistent with the screen refresh frequency of the display system, which can reduce the capacity requirement of the cache of the display system and reduce the number of frames lost by the display system.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:从第一缓存中删除目标视频数据帧。这样,将已经送显的视频数据帧从第一缓存中删除,可以及时释放第一缓存的存储资源,以便第一缓存有足够的空间存储解码模块后续解码出的视频数据帧。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: delete the target video data frame from the first cache. In this way, deleting the video data frames that have been sent for display from the first cache can release the storage resources of the first cache in time, so that the first cache has enough space to store the video data frames subsequently decoded by the decoding module.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:从电子设备的解码模块的输出缓存中读取第五视频数据帧,在向第一缓存已写入的视频数据帧的数量小于或等于第一数量的情况下,向第一缓存写入第五视频数据帧。在源端向接收端传输数据的初期,第一缓存为空,此时不需要丢弃视频数据帧,当第一缓存中的视频数据帧达到第一数量后,再确定后续的视频数据帧是否写入第一缓存。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is made to perform the following steps: read the fifth video data frame from the output buffer of the decoding module of the electronic device, and send the first When the number of video data frames written in the cache is less than or equal to the first number, write the fifth video data frame into the first cache. At the initial stage of data transmission from the source end to the receiver end, the first buffer is empty, and there is no need to discard video data frames at this time. When the video data frames in the first buffer reach the first number, then determine whether the subsequent video data frames are written into the first cache.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:接收源端电子设备发送的编码数据,编码数据是对视频数据帧编码得到的,将编码数据写入解码模块的输入缓存,以使解码模块对编码数据进行解码,得到解码出的视频数据帧,将解码出的视频数据帧存储到解码模块的输出缓存。这样,接收端电子设备能够对源端电子设备发送的编码数据进行持续接收和解码。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: receive the encoded data sent by the source electronic device, the encoded data is obtained by encoding the video data frame, and convert the The encoded data is written into the input buffer of the decoding module, so that the decoding module decodes the encoded data to obtain decoded video data frames, and stores the decoded video data frames in the output buffer of the decoding module. In this way, the electronic device at the receiving end can continuously receive and decode the encoded data sent by the electronic device at the source end.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:从输出缓存中删除第一视频数据帧。这样,将已经丢弃的视频数据帧从输出缓存中删除,可以及时释放输出缓存的存储资源,以防止因输出缓存剩余存储空间不足导致解码模块后续解码出的视频数据帧覆盖还未送显的视频数据帧。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: delete the first video data frame from the output buffer. In this way, by deleting the discarded video data frames from the output buffer, the storage resources of the output buffer can be released in time, so as to prevent the video data frames decoded by the decoding module from covering the video that has not yet been displayed due to insufficient remaining storage space of the output buffer Data Frame.
根据第二方面,在一种实现方式中,当程序指令由处理器执行时,使得电子设备执行如下步骤:从输出缓存中删除第三视频数据帧。这样,将已经写入第一缓存的视频数据帧从输出缓存中删除,可以及时释放输出缓存的存储资源,以防止因输出缓存剩余存储空间不足导致解码模块后续解码出的视频数据帧覆盖还未送显的视频数据帧。According to the second aspect, in an implementation manner, when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: delete the third video data frame from the output buffer. In this way, the video data frames that have been written into the first buffer are deleted from the output buffer, and the storage resources of the output buffer can be released in time, so as to prevent the video data frames decoded by the decoding module from being overwritten due to insufficient remaining storage space in the output buffer. Send video data frame for display.
根据第二方面,在一种实现方式中,第一数量小于或等于第一缓存的容量。这样,可以保证第一缓存空间能够存储至少第一数量的视频数据帧,确保一定的显示质量。According to the second aspect, in an implementation manner, the first quantity is less than or equal to the capacity of the first cache. In this way, it can be ensured that the first buffer space can store at least the first number of video data frames, ensuring a certain display quality.
第三方面,本申请提供一种计算机可读存储介质,包括计算机程序,当计算机程序在电子设备上运行时,使得电子设备执行前述的第一方面中任意一项的数据处理方法。In a third aspect, the present application provides a computer-readable storage medium, including a computer program. When the computer program runs on an electronic device, the electronic device executes the data processing method in any one of the foregoing first aspects.
附图说明Description of drawings
图1为示例性示出的电子设备100的结构示意图;FIG. 1 is a schematic structural diagram of an electronic device 100 exemplarily shown;
图2为示例性示出的本申请实施例的电子设备100的软件结构框图;FIG. 2 is a software structural block diagram of an electronic device 100 according to an exemplary embodiment of the present application;
图3为示例性示出的本申请实施例的数据处理方法的一种应用场景示意图;FIG. 3 is a schematic diagram of an application scenario of a data processing method according to an embodiment of the present application;
图4为示例性示出的图3所示应用场景中的数据处理过程示意图;FIG. 4 is a schematic diagram of a data processing process in the application scenario shown in FIG. 3 exemplarily shown;
图5为示例性示出的本申请实施例的数据处理方法中数据的一种流转过程示意图;FIG. 5 is a schematic diagram of a flow process of data in the data processing method of the embodiment of the present application;
图6为示例性示出的视频帧处理过程中的时序示意图。Fig. 6 is a schematic diagram of timing in the video frame processing process exemplarily shown.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of this application.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。The term "and/or" in this article is just an association relationship describing associated objects, which means that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist simultaneously, and there exists alone B these three situations.
本申请实施例的说明书和权利要求书中的术语“第一”和“第二”等是用于区别不同的对象,而不是用于描述对象的特定顺序。例如,第一目标对象和第二目标对象等是用于区别不同的目标对象,而不是用于描述目标对象的特定顺序。The terms "first" and "second" in the description and claims of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order of objects. For example, the first target object, the second target object, etc. are used to distinguish different target objects, rather than describing a specific order of the target objects.
在本申请实施例中,“示例性的”或者“例如”等词用于表示作例子、例证或说明。本申请实施例中被描述为“示例性的”或者“例如”的任何实施例或设计方案不应被解释为比其它实施例或设计方案更优选或更具优势。确切而言,使用“示例性的”或者“例如”等词旨在以具体方式呈现相关概念。In the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application shall not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete manner.
在本申请实施例的描述中,除非另有说明,“多个”的含义是指两个或两个以上。例如,多个处理单元是指两个或两个以上的处理单元;多个系统是指两个或两个以上的系统。In the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more. For example, multiple processing units refer to two or more processing units; multiple systems refer to two or more systems.
本文中,显示时延是指视频数据帧在接收端电子设备中显示的时刻与该视频数据帧在源端电子设备中显示的时刻之差。In this paper, the display delay refers to the difference between the moment when the video data frame is displayed on the electronic device at the receiving end and the moment at which the video data frame is displayed on the electronic device at the source end.
本文中,Vsync周期即垂直同步周期,也可称为屏幕刷新周期。Vsync周期与屏幕刷新频率之间为倒数关系。例如当屏幕刷新频率为60Hz时,Vsync周期为16.6ms(毫秒),当屏幕刷新频率为120Hz时,Vsync周期为8.3ms。Herein, the Vsync period is a vertical synchronization period, which may also be called a screen refresh period. There is a reciprocal relationship between the Vsync period and the screen refresh rate. For example, when the screen refresh rate is 60Hz, the Vsync period is 16.6ms (milliseconds), and when the screen refresh rate is 120Hz, the Vsync period is 8.3ms.
本申请实施例的数据处理方法可以应用于投屏场景。在投屏场景中,第一电子设备作为源端,将视频数据编码后,可以通过网络,例如Wi-Fi、蓝牙等,传输给第二电子设备,第二电子设备为接收端。第二电子设备对视频数据进行解码后,将解码后的视频数据送到显示系统进行显示(简称送显)。The data processing method in the embodiment of the present application can be applied to a screen projection scenario. In the screen projection scenario, the first electronic device acts as the source, and after encoding the video data, it can be transmitted to the second electronic device through the network, such as Wi-Fi, Bluetooth, etc., and the second electronic device is the receiving end. After decoding the video data, the second electronic device sends the decoded video data to a display system for display (referred to as display sending).
传统方案中,视频数据被解码后立即被送显。接收端电子设备的SurfaceFlinger按照Vsync周期一帧一帧地显示视频数据。需要显示的视频帧都在SurfaceFlinger的缓存中等待,排序越靠后,视频帧等待的时间越长,显示时延就越大。In the traditional solution, the video data is sent to display immediately after being decoded. The SurfaceFlinger of the electronic device at the receiving end displays video data frame by frame according to the Vsync period. The video frames that need to be displayed are all waiting in SurfaceFlinger's cache. The lower the sorting, the longer the video frame waits, and the greater the display delay.
例如,假设缓存中有5个视频帧在等待显示,如果第1个视频帧需要等待1个Vsync周期才能显示,那么第2个视频帧需要等待2个Vsync周期,第3个视频帧需要等待3个Vsync周期,第4个视频帧需要等待4个Vsync周期,第5个视频帧需要等待5个Vsync周期。可见,排序越靠后的视频帧,等待时间越长,显示时延越大。如果等待的视频帧很多,那么排序在后的视频帧的显示时延将会很大,给用户的体验将会很差。For example, suppose there are 5 video frames waiting to be displayed in the cache. If the first video frame needs to wait for 1 Vsync cycle to be displayed, then the second video frame needs to wait for 2 Vsync cycles, and the third video frame needs to wait for 3 Vsync cycles, the fourth video frame needs to wait for 4 Vsync cycles, and the fifth video frame needs to wait for 5 Vsync cycles. It can be seen that the lower the video frame is, the longer the waiting time is, and the greater the display delay is. If there are a lot of waiting video frames, the display delay of the later video frames will be very large, and the user experience will be poor.
在一个示例中,第一电子设备例如可以是PC(Personal Computer,个人计算机)机,该PC机可以安装Windows系统。第二电子设备可以是安装有安卓(Android)系统的手机、平板等。In an example, the first electronic device may be, for example, a PC (Personal Computer, personal computer), and the PC may be installed with a Windows system. The second electronic device may be a mobile phone, a tablet, etc. installed with an Android (Android) system.
在另一个示例中,第一电子设备例如可以是安装有安卓系统的手机、平板等,第二电子设备可以是安装Windows系统的PC机。In another example, the first electronic device may be, for example, a mobile phone or a tablet installed with an Android system, and the second electronic device may be a PC installed with a Windows system.
在另一个示例中,第一电子设备例如可以是安装有安卓系统的手机、平板等,第二电子设备也可以是安装有安卓系统的手机、平板等。In another example, the first electronic device may be, for example, a mobile phone, a tablet, etc. installed with an Android system, and the second electronic device may also be a mobile phone, a tablet, etc. installed with an Android system.
本申请实施例提供一种数据处理方法,能够降低第二电子设备的显示时延,提升用户使用体验。The embodiment of the present application provides a data processing method, which can reduce the display delay of the second electronic device and improve user experience.
本申请实施例的数据处理方法可以应用于前述的第二电子设备。该第二电子设备的结构可以如图1所示。The data processing method in the embodiment of the present application may be applied to the aforementioned second electronic device. The structure of the second electronic device may be as shown in FIG. 1 .
图1为示例性示出的电子设备100的结构示意图。应该理解的是,图1所示电子设备100仅是电子设备的一个范例,并且电子设备100可以具有比图中所示的更多的或者更少的部件,可以组合两个或多个的部件,或者可以具有不同的部件配置。图1中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。FIG. 1 is a schematic structural diagram of an electronic device 100 exemplarily shown. It should be understood that the electronic device 100 shown in FIG. 1 is only an example of an electronic device, and the electronic device 100 may have more or fewer components than those shown in the figure, and two or more components may be combined , or can have different component configurations. The various components shown in FIG. 1 may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
请参见图1,电子设备100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。1, the electronic device 100 may include: a
电子设备100的软件系统可以采用分层架构、事件驱动架构、微核架构、微服务架构,或云架构。本申请实施例以分层架构的安卓(Android)系统为例,示例性说明电子设备100的软件结构。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In this embodiment of the present application, the software structure of the electronic device 100 is exemplarily described by taking an Android system with a layered architecture as an example.
图2为示例性示出的本申请实施例的电子设备100的软件结构框图。FIG. 2 is a schematic block diagram showing the software structure of the electronic device 100 according to the embodiment of the present application.
电子设备100的分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,Android系统可以包括应用程序层、应用程序框架层、以及内核层等。The layered architecture of the electronic device 100 divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate through software interfaces. In some embodiments, the Android system may include an application program layer, an application program framework layer, and a kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can consist of a series of application packages.
如图2所示,电子设备100的应用程序层的应用程序包可以包括业务、业务管理、业务设置、传输模块、解码逻辑模块、显示模块等模块。As shown in FIG. 2 , the application package of the application layer of the electronic device 100 may include modules such as service, service management, service setting, transmission module, decoding logic module, and display module.
其中,业务模块用于实现具体的业务功能。业务管理模块用于实现与业务模块所对应的业务相应的管理功能。业务管理模块用于实现与业务模块所对应的业务相应的设置功能。Among them, the business module is used to realize specific business functions. The service management module is used to realize the management function corresponding to the service corresponding to the service module. The business management module is used to realize the setting function corresponding to the business corresponding to the business module.
例如,业务模块可以为无线投屏模块。For example, the service module may be a wireless screen projection module.
其中,解码逻辑模块用于执行本申请的数据处理方法。解码逻辑模块的具体功能请参见本文后续实施例中的详细说明。Wherein, the decoding logic module is used to execute the data processing method of the present application. For the specific functions of the decoding logic module, please refer to the detailed description in the subsequent embodiments of this document.
其中,显示模块用于对视频数据进行显示。Wherein, the display module is used for displaying video data.
如图2所示,应用程序框架层可以包括基础能力、视频编解码、Socket等模块。As shown in Figure 2, the application framework layer may include basic capabilities, video codec, Socket and other modules.
其中,基础能力模块用于提供构建应用程序时可能用到的各种API(ApplicationProgramming Interface,应用程序接口)。Wherein, the basic capability module is used to provide various APIs (Application Programming Interface, application programming interface) that may be used when building an application program.
视频编解码模块用于实现对视频数据的编码和解码功能。视频编解码模块可以包括编码模块和解码模块。编码模块用于对视频数据进行编码,解码模块用于对视频数据进行解码。视频编解码模块可以是采用硬件方式对视频数据进行编码和解码的模块。其中,应用程序层的编码逻辑模块可以调用视频编解码模块中的编码模块进行编码,应用程序层的解码逻辑模块可以调用视频编解码模块中的解码模块进行解码。The video codec module is used to implement the encoding and decoding functions of video data. The video codec module may include an encoding module and a decoding module. The encoding module is used for encoding video data, and the decoding module is used for decoding video data. The video codec module may be a module for encoding and decoding video data in a hardware manner. Wherein, the encoding logic module of the application layer can call the encoding module in the video codec module for encoding, and the decoding logic module of the application layer can call the decoding module in the video codec module for decoding.
Socket(套接字)是对网络中不同主机上的应用进程之间进行双向通信的端点的抽象。一个套接字就是网络上进程通信的一端,提供了应用层进程利用网络协议交换数据的机制。从所处的地位来讲,套接字上联应用进程,下联网络协议栈,是应用程序通过网络协议进行通信的接口,是应用程序与网络协议栈进行交互的接口。Socket (socket) is an abstraction of endpoints for two-way communication between application processes on different hosts in the network. A socket is one end of process communication on the network, providing a mechanism for application layer processes to exchange data using network protocols. From the perspective of its position, the socket connects to the application process and connects to the network protocol stack, which is the interface for the application program to communicate through the network protocol, and the interface for the application program to interact with the network protocol stack.
其中,应用程序框架层还可以包括SurfaceFlinger(图2中未示出)。Wherein, the application framework layer may also include SurfaceFlinger (not shown in FIG. 2 ).
内核层是硬件和软件之间的层。The kernel layer is the layer between hardware and software.
如图2所示,内核层可以包括传感器驱动、Wi-Fi驱动、USB驱动等模块。As shown in Figure 2, the kernel layer may include modules such as a sensor driver, a Wi-Fi driver, and a USB driver.
可以理解的是,图2示出的软件结构中的层以及各层中包含的部件,并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的层,以及每个层中可以包括更多或更少的部件,本申请不做限定。It can be understood that the layers in the software structure shown in FIG. 2 and the components included in each layer do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or fewer layers than shown, and each layer may include more or fewer components, which is not limited in the present application.
图3为示例性示出的本申请实施例的数据处理方法的一种应用场景示意图。请参见图3,本实施例的应用场景中包括源端和接收端,二者均为电子设备。接收端的软件架构可以如图2所示,此处不再赘述。源端的软件架构可以包括应用程序层、应用程序框架层、以及内核层。其中,源端的应用程序层可以包括业务、业务管理、业务设置、传输模块、抓屏模块、编码逻辑模块等模块。源端的应用程序框架层可以与接收端的应用程序框架层结构相同,源端的内核层可以与接收端的内核层结构相同,请参见前述对图2所示软件结构的相关描述,此处不再赘述。FIG. 3 is a schematic diagram of an application scenario of the data processing method according to the embodiment of the present application. Referring to FIG. 3 , the application scenario of this embodiment includes a source end and a receiver end, both of which are electronic devices. The software architecture of the receiving end may be shown in FIG. 2 , which will not be repeated here. The software architecture at the source end may include an application program layer, an application program framework layer, and a kernel layer. Wherein, the application program layer at the source end may include modules such as business, business management, business setting, transmission module, screen capture module, and coding logic module. The application framework layer at the source can have the same structure as the application framework layer at the receiving end, and the kernel layer at the source can have the same structure as the kernel layer at the receiving end. Please refer to the aforementioned description of the software structure shown in FIG. 2 , which will not be repeated here.
图4为示例性示出的图3所示应用场景中的数据处理过程示意图。请参见图4,本实施例中,数据处理过程可以包括如下步骤:FIG. 4 is a schematic diagram of a data processing process in the application scenario shown in FIG. 3 exemplarily shown. Referring to Figure 4, in this embodiment, the data processing process may include the following steps:
S1、当源端的业务启动后,源端的业务模块向源端的抓屏模块发送业务启动通知。S1. After the service at the source end is started, the service module at the source end sends a service start notification to the screen capture module at the source end.
本实施例中,以源端为安装有安卓系统的手机A、接收端为安装有安卓系统的平板B、源端将视频投屏到接收端为例进行说明。In this embodiment, the source end is a mobile phone A installed with an Android system, the receiver is a tablet B installed with an Android system, and the source end projects a video to the receiver end as an example for illustration.
当用户开启手机A的无线投屏功能后,在手机A中搜索能够接收手机A投屏的设备,获得能够接收手机A投屏的可用设备列表C,可用设备列表C中包括平板B。然后,用户可以在搜索到的可用设备列表C中选中平板B作为本次的接收投屏设备。接着,手机A与平板B之间建立无线连接,例如Wi-Fi连接或者蓝牙连接。When the user turns on the wireless projection function of mobile phone A, search for devices that can receive the screen projection of mobile phone A in mobile phone A, and obtain the list C of available devices that can receive the screen projection of mobile phone A, and the available device list C includes tablet B. Then, the user can select the tablet B in the searched available device list C as the receiving device for screen projection this time. Next, a wireless connection, such as a Wi-Fi connection or a Bluetooth connection, is established between the mobile phone A and the tablet B.
手机A与平板B之间的无线连接建立成功后,手机A中的无线投屏模块向手机A中的抓屏模块发送业务启动通知。该业务启动通知用于指示抓屏模块抓取屏幕上的视频数据。After the wireless connection between mobile phone A and tablet B is successfully established, the wireless screen projection module in mobile phone A sends a service start notification to the screen capture module in mobile phone A. The service start notification is used to instruct the screen capture module to capture video data on the screen.
在手机A与平板B之间的无线连接建立成功后,平板B中的解码逻辑模块创建第一线程、第二线程、第三线程和第一缓存。After the wireless connection between mobile phone A and tablet B is successfully established, the decoding logic module in tablet B creates the first thread, the second thread, the third thread and the first cache.
其中,第一缓存的容量N需要大于平板B中解码模块的输出缓存(OutputBuffer)的容量。N表示第一缓存中能够存储的最大帧数。Wherein, the capacity N of the first buffer needs to be greater than the capacity of the output buffer (OutputBuffer) of the decoding module in the tablet B. N represents the maximum number of frames that can be stored in the first cache.
在实际应用中,第一缓存的容量可以根据经验设置。例如,如果平板B中解码模块的解码速度与平板B的屏幕刷新频率相差较小,可以设置较小容量的第一缓存。反之,如果平板B中解码模块的解码速度与平板B的屏幕刷新频率相差较大,可以设置较大容量的第一缓存。In practical applications, the capacity of the first cache can be set according to experience. For example, if the difference between the decoding speed of the decoding module in tablet B and the screen refresh frequency of tablet B is small, a first buffer with a smaller capacity may be set. On the contrary, if the decoding speed of the decoding module in the tablet B is greatly different from the refresh rate of the screen of the tablet B, a larger-capacity first buffer can be set.
S2、源端的抓屏模块抓取源端屏幕上的视频数据。S2. The screen capture module of the source terminal captures the video data on the screen of the source terminal.
例如,手机A的抓屏模块接收到业务启动通知后,开始抓取手机A屏幕上的视频数据。抓屏模块可以按照一定的帧率抓取视频数据,例如60FPS。For example, the screen capture module of mobile phone A starts to capture video data on the screen of mobile phone A after receiving the service start notification. The screen capture module can capture video data at a certain frame rate, such as 60FPS.
S3、源端的抓屏模块向源端的编码逻辑模块发送视频数据。S3. The screen capture module at the source end sends video data to the encoding logic module at the source end.
例如,手机A的抓屏模块向手机A的编码逻辑模块发送抓取到的视频数据。For example, the screen capture module of mobile phone A sends captured video data to the encoding logic module of mobile phone A.
S4、源端的编码逻辑模块调用编码模块对视频数据进行编码,得到编码数据。S4. The encoding logic module at the source calls the encoding module to encode the video data to obtain encoded data.
此处,编码模块为源端的视频编解码模块中的模块。Here, the coding module is a module in the video codec module at the source end.
其中,编码模块可以基于视频编码标准H.264对视频数据进行编码。编码模块还可以采用JPEG(Joint Photographic Experts Group,联合图像专家小组)、H.261、MPEG(Moving Picture Experts Group,动态图像专家组)等中的任一种编码方法进行编码。Wherein, the coding module can code the video data based on the video coding standard H.264. The coding module can also use any coding method among JPEG (Joint Photographic Experts Group, Joint Photographic Experts Group), H.261, MPEG (Moving Picture Experts Group, Dynamic Picture Experts Group), etc. to perform coding.
在另一个示例中,编码模块还可以采用两种以上的编码方法进行混合编码。In another example, the encoding module may also use more than two encoding methods to perform mixed encoding.
需要说明的是,以上仅为编码模块所采用的编码方法的示意性说明,并不排除其它的编码方法,本申请实施例对编码模块所采用的编码方法不做限制。It should be noted that the above is only a schematic description of the encoding method adopted by the encoding module, and other encoding methods are not excluded, and the embodiment of the present application does not limit the encoding method adopted by the encoding module.
S5、源端的编码逻辑模块向源端的传输模块发送编码数据。S5. The encoding logic module at the source end sends the encoded data to the transmission module at the source end.
其中,在一个示例中,传输模块可以为Wi-Fi模块。在另一个示例中,传输模块可以为蓝牙模块。Wherein, in an example, the transmission module may be a Wi-Fi module. In another example, the transmission module may be a Bluetooth module.
假设手机A和平板B都安装有Wi-Fi模块和蓝牙模块,当在无线投屏中手机A与平板B之间的无线连接为Wi-Fi连接时,手机A的编码逻辑模块向手机A的Wi-Fi模块发送编码数据。如果在无线投屏中手机A与平板B之间的无线连接为蓝牙连接,手机A的编码逻辑模块向手机A的蓝牙模块发送编码数据。Assuming that both mobile phone A and tablet B are equipped with Wi-Fi modules and Bluetooth modules, when the wireless connection between mobile phone A and tablet B is a Wi-Fi connection in wireless projection, the coding logic module of mobile phone A sends The Wi-Fi module sends encoded data. If the wireless connection between mobile phone A and tablet B is a Bluetooth connection in the wireless screen projection, the encoding logic module of mobile phone A sends encoded data to the Bluetooth module of mobile phone A.
S6、源端的传输模块向接收端的传输模块发送编码数据。S6. The transmission module at the source end sends the encoded data to the transmission module at the receiving end.
例如,如果在无线投屏中手机A与平板B之间的无线连接为Wi-Fi连接,手机A的Wi-Fi模块向平板B的Wi-Fi模块发送编码数据。For example, if the wireless connection between mobile phone A and tablet B is a Wi-Fi connection in wireless screen projection, the Wi-Fi module of mobile phone A sends coded data to the Wi-Fi module of tablet B.
如果在无线投屏中手机A与平板B之间的无线连接为蓝牙连接,手机A的蓝牙模块向平板B的蓝牙模块发送编码数据。If the wireless connection between mobile phone A and tablet B is a Bluetooth connection in wireless screen projection, the Bluetooth module of mobile phone A sends coded data to the Bluetooth module of tablet B.
由于网络传输的不稳定,接收端在一个Vsync周期内接收到的帧数是不固定的。例如,在第1个Vsync周期,接收端接收到1帧数据;在第2个Vsync周期,接收端接收到2帧数据;在第3个Vsync周期,接收端接收到1帧数据……。Due to the instability of network transmission, the number of frames received by the receiving end within one Vsync period is not fixed. For example, in the first Vsync cycle, the receiving end receives 1 frame of data; in the second Vsync cycle, the receiving end receives 2 frames of data; in the third Vsync cycle, the receiving end receives 1 frame of data... .
S7、接收端的传输模块向接收端的解码逻辑模块发送编码数据。S7. The transmission module at the receiving end sends the encoded data to the decoding logic module at the receiving end.
例如,平板B的Wi-Fi模块接收到手机A的Wi-Fi模块发送的编码数据后,可以向平板B的解码码逻辑模块发送编码数据。For example, after receiving the encoded data sent by the Wi-Fi module of mobile phone A, the Wi-Fi module of tablet B can send the encoded data to the decoding logic module of tablet B.
S8、接收端的编码逻辑模块通过已创建的第一线程接收编码数据。S8. The encoding logic module at the receiving end receives the encoded data through the created first thread.
S9、接收端的编码逻辑模块通过第一线程发送编码数据到解码模块的输入缓存。S9. The encoding logic module at the receiving end sends the encoded data to the input buffer of the decoding module through the first thread.
此处,解码模块为源端的视频编解码模块中的模块。解码模块自身有两个缓存,一个为输入缓存(InputBuffer),另一个为输出缓存(OutputBuffer)。前述的第一缓存不属于解码模块,第一缓存是解码逻辑模块所创建的缓存。Here, the decoding module is a module in the video codec module at the source end. The decoding module itself has two buffers, one is the input buffer (InputBuffer), and the other is the output buffer (OutputBuffer). The aforementioned first cache does not belong to the decoding module, and the first cache is a cache created by the decoding logic module.
S10、接收端的解码模块对编码数据进行解码,得到视频数据,存储到解码模块的输出缓存。S10. The decoding module at the receiving end decodes the coded data to obtain video data, which is stored in the output buffer of the decoding module.
解码模块从编码数据中解码出视频数据后,会立即将视频数据存储到解码模块的输出缓存OutputBuffer中。After the decoding module decodes the video data from the encoded data, it will immediately store the video data in the output buffer OutputBuffer of the decoding module.
S11、接收端的解码逻辑模块通过已创建的第二线程从解码模块的输出缓存中获视频数据,根据预设的送显阈值M确定是否将获取的视频数据存储到已创建的第一缓存中。S11. The decoding logic module at the receiving end obtains video data from the output buffer of the decoding module through the created second thread, and determines whether to store the acquired video data in the created first buffer according to the preset display threshold M.
第二线程可以对解码模块的输出缓存OutputBuffer进行监听,一旦输出缓存OutputBuffer中被写入视频数据,立即将输出缓存OutputBuffer中的视频数据读取到第一缓存中。然后,输出缓存OutputBuffer可以删除第二线程已读取完毕的视频数据。The second thread can monitor the output buffer OutputBuffer of the decoding module, and once video data is written into the output buffer OutputBuffer, immediately read the video data in the output buffer OutputBuffer into the first buffer. Then, the output buffer OutputBuffer can delete the video data that the second thread has finished reading.
每一次第二线程从输出缓存OutputBuffer读取的视频数据可以为一帧或多帧。The video data read by the second thread from the output buffer OutputBuffer each time may be one or more frames.
其中,送显阈值M表示一个Vsync周期内的最大送显帧数。送显阈值M可以预先设置,M小于或等于N。其中,M的值可以根据对时延的要求确定。当要求时延较小时,可以设置M值为较小的值;当要求时延较大时,可以设置M值为较大的值。这样,就将在一个Vsync周期内送显的帧数控制在M帧以下。Wherein, the display threshold M represents the maximum number of display frames within one Vsync period. The display threshold M can be preset, and M is less than or equal to N. Wherein, the value of M can be determined according to the requirement on time delay. When the required time delay is small, the value of M can be set to a small value; when the time delay is required to be large, the value of M can be set to a large value. In this way, the number of frames sent for display in one Vsync cycle is controlled below M frames.
本申请实施例中,根据预设的送显阈值M确定是否将获取的视频数据存储到已创建的第一缓存中,可以包括:In the embodiment of the present application, determining whether to store the acquired video data into the created first cache according to the preset display threshold M may include:
获取当前视频数据帧进入第一缓存的时间T1;Obtain the time T1 when the current video data frame enters the first cache;
获取当前视频数据帧之前的第M-1帧视频数据进入第一缓存的时间T2;Obtain the time T2 when the M-1th frame video data before the current video data frame enters the first buffer;
将T1与T2的差值与Vsync周期进行比较,得到比较结果;Compare the difference between T1 and T2 with the Vsync period to obtain the comparison result;
如果比较结果指示T1与T2的差值大于Vsync周期,那么将当前视频数据帧存储到第一缓存中;如果比较结果指示T1与T2的差值小于或等于Vsync周期,那么将当前视频数据帧丢弃,当前视频帧不会被存储到第一缓存中。If the comparison result indicates that the difference between T1 and T2 is greater than the Vsync period, then the current video data frame is stored in the first buffer; if the comparison result indicates that the difference between T1 and T2 is less than or equal to the Vsync period, then the current video data frame is discarded , the current video frame will not be stored in the first buffer.
S12、接收端的解码逻辑模块通过已创建的第三线程从第一缓存中周期性地读取视频数据,周期为Vsync周期。S12. The decoding logic module at the receiving end periodically reads video data from the first cache through the created third thread, and the period is a Vsync period.
例如,如果平板B的Vsync周期为16.6ms,那么第三线程每隔16.6ms从第一缓存中读取一帧视频数据。如果平板B的Vsync周期为8.3ms,那么第三线程每隔8.3ms从第一缓存中读取一帧视频数据。For example, if the Vsync period of tablet B is 16.6ms, then the third thread reads a frame of video data from the first buffer every 16.6ms. If the Vsync period of tablet B is 8.3ms, then the third thread reads a frame of video data from the first buffer every 8.3ms.
需要说明的是,以上的Vsync周期的数值仅为示例性说明,并不对本申请实施例的Vsync周期进行限制。在实际应用中,可以根据第二电子设备中SurfaceFlingerVsync采用的屏幕刷新频率确定实际的Vsync周期。It should be noted that the above numerical values of the Vsync period are only illustrative, and do not limit the Vsync period of the embodiment of the present application. In practical applications, the actual Vsync period may be determined according to the screen refresh rate adopted by SurfaceFlingerVsync in the second electronic device.
S13、接收端的解码逻辑模块通过第三线程按照Vsync周期发送视频数据至显示模块。S13. The decoding logic module at the receiving end sends the video data to the display module through the third thread according to the Vsync period.
例如,如果平板B的Vsync周期为16.6ms,那么第三线程每隔16.6ms向显示模块发送一帧视频数据。如果平板B的Vsync周期为8.3ms,那么第三线程每隔8.3ms向显示模块发送一帧视频数据。For example, if the Vsync period of tablet B is 16.6ms, then the third thread sends a frame of video data to the display module every 16.6ms. If the Vsync period of tablet B is 8.3ms, then the third thread sends a frame of video data to the display module every 8.3ms.
需要说明的是,在同一个Vsync周期内,第三线程从第一缓存中读取视频数据帧的时刻t1早于第三线程向显示模块发送视频数据的时刻t2。It should be noted that, within the same Vsync cycle, the time t1 when the third thread reads the video data frame from the first cache is earlier than the time t2 when the third thread sends the video data to the display module.
显示模块接收到视频数据帧后,可以调用releaseOutputBuffer方法,releaseOutputBuffer方法调用安卓显示系统的MediaCodec,MediaCodec再调用SurfaceFlinger,由SurfaceFlinger显示视频数据帧对应的界面。After the display module receives the video data frame, it can call the releaseOutputBuffer method. The releaseOutputBuffer method calls the MediaCodec of the Android display system, and the MediaCodec calls SurfaceFlinger. SurfaceFlinger displays the interface corresponding to the video data frame.
图5为示例性示出的本申请实施例的数据处理方法中数据的一种流转过程示意图。结合图4,如图5所示,第一线程接收源端传输过来的编码数据,然后将编码数据存储到解码模块的输入缓存中。然后,解码模块对输入缓存中的数据进行解码,将解码出的视频数据存储到解码模块的输出缓存中。接着,第二线程从解码模块的输出缓存中获取视频数据帧,如果该视频数据帧进入第一缓存的时间T1与该视频数据帧之前的第M-1帧视频数据进入第一缓存的时间T2的差值t0大于Vsync周期,那么将该视频数据帧存储到第一缓存中;如果T1与T2的差值t0小于或等于Vsync周期,那么将该视频数据帧丢弃,该视频数据帧不会被存储到第一缓存中。接下来,第三线程按照Vsync周期从第一缓存中逐帧读取视频数据,待接收到Vsync信号,第三线程将读取的视频数据传送给SurfaceFlinger进行显示。SurfaceFlinger接收到视频数据后,按照Vsync周期逐帧显示视频图像。FIG. 5 is a schematic diagram illustrating a data transfer process in the data processing method of the embodiment of the present application. Referring to FIG. 4 , as shown in FIG. 5 , the first thread receives the encoded data transmitted from the source, and then stores the encoded data in the input buffer of the decoding module. Then, the decoding module decodes the data in the input buffer, and stores the decoded video data in the output buffer of the decoding module. Then, the second thread obtains the video data frame from the output buffer of the decoding module, if the time T1 when the video data frame enters the first buffer and the time T2 when the M-1 frame video data before the video data frame enters the first buffer If the difference t0 between T1 and T2 is less than or equal to the Vsync cycle, then the video data frame is discarded, and the video data frame will not be stored in the first buffer. stored in the first cache. Next, the third thread reads video data frame by frame from the first buffer according to the Vsync cycle, and upon receiving the Vsync signal, the third thread transmits the read video data to SurfaceFlinger for display. After SurfaceFlinger receives the video data, it displays the video image frame by frame according to the Vsync cycle.
本申请实施例通过控制一个Vsync周期内缓存的待送显的视频数据帧的数量,能够减少视频数据帧等待显示的时长,从而降低显示时延。下面通过视频帧处理过程中的时序对此进行说明。In this embodiment of the present application, by controlling the number of buffered video data frames to be displayed within one Vsync cycle, the waiting time for the video data frames to be displayed can be reduced, thereby reducing the display delay. This is illustrated below with the timing during video frame processing.
图6为示例性示出的视频帧处理过程中的时序示意图。图6中的所有时间轴是对齐的。请参见图6,在第一个Vsync周期内,第二线程在t1时刻从输出缓存中读取第一帧视频数据,在t2时刻从输出缓存中读取第二帧视频数据,在t3时刻从输出缓存中读取第三帧视频数据,在t4时刻从输出缓存中读取第四帧视频数据,在t5时刻从输出缓存中读取第五帧视频数据。在第二个Vsync周期内,第二线程在t6时刻从输出缓存中读取第六帧视频数据。Fig. 6 is a schematic diagram of timing in the video frame processing process exemplarily shown. All time axes in Figure 6 are aligned. Please refer to Figure 6, in the first Vsync cycle, the second thread reads the first frame of video data from the output buffer at t1, reads the second frame of video data from the output buffer at t2, and reads the second frame of video data from the output buffer at t3. The third frame of video data is read from the output buffer, the fourth frame of video data is read from the output buffer at time t4, and the fifth frame of video data is read from the output buffer at time t5. In the second Vsync period, the second thread reads the sixth frame of video data from the output buffer at time t6.
请继续参见图6,第一帧视频数据在t1'时刻进入第一缓存,第二帧视频数据在t2'时刻进入第一缓存,第三帧视频数据在t3'时刻进入第一缓存,第四帧视频数据在t4'时刻进入第一缓存,第五帧视频数据在t5'时刻进入第一缓存,第六帧视频数据在t6'时刻进入第一缓存。Please continue to refer to Figure 6, the first frame of video data enters the first buffer at t1', the second frame of video data enters the first buffer at t2', the third frame of video data enters the first buffer at t3', and the fourth frame of video data enters the first buffer at t3'. A frame of video data enters the first buffer at time t4', a fifth frame of video data enters the first buffer at time t5', and a sixth frame of video data enters the first buffer at time t6'.
假设SurfaceFlinger缓存的容量为6帧。在传统方案中,第一帧视频数据、第二帧视频数据、第三帧视频数据、第四帧视频数据、第五帧视频数据、第六帧视频数据都被送入SurfaceFlinger缓存,然后SurfaceFlinger按照Vsync周期逐帧进行显示。这样,第六帧视频数据与第一帧视频数据的显示时间间隔为5个Vsync周期,即第六帧视频数据在第一帧视频数据显示后需要等待5个Vsync周期才能显示,第六帧视频数据之后的视频数据的显示时延会大于第六帧视频数据的显示时延,并且后面随着帧数的增多,显示时延会越来越大。Assume that the SurfaceFlinger cache has a capacity of 6 frames. In the traditional scheme, the first frame of video data, the second frame of video data, the third frame of video data, the fourth frame of video data, the fifth frame of video data, and the sixth frame of video data are all sent to the SurfaceFlinger cache, and then SurfaceFlinger follows The Vsync period is displayed frame by frame. In this way, the display time interval between the sixth frame of video data and the first frame of video data is 5 Vsync cycles, that is, the sixth frame of video data needs to wait for 5 Vsync cycles to be displayed after the first frame of video data is displayed, and the sixth frame of video The display delay of the video data following the data will be greater than the display delay of the sixth frame of video data, and as the number of frames increases later, the display delay will become larger and larger.
本文中,视频数据帧进入第一缓存的时刻是指将向第一缓存写入视频数据帧的时刻,但是否实际写入第一缓存还需要根据本实施例后续的判断,如果确定丢弃该视频数据帧,那么该视频数据帧不会被写入第一缓存,如果确定写入第一缓存该视频数据帧,那么在已经确定的该视频数据帧进入第一缓存的时刻将该视频数据帧写入第一缓存。Herein, the moment when the video data frame enters the first cache refers to the moment when the video data frame will be written into the first cache, but whether it is actually written into the first cache still needs to be judged according to the follow-up of this embodiment. If it is determined to discard the video data frame, then the video data frame will not be written into the first cache, if it is determined to write the video data frame into the first cache, then the video data frame will be written at the moment when the determined video data frame enters the first cache into the first cache.
请继续参见图6,按照本申请实施例的数据处理方法,假设送显阈值M=5,由于第五帧视频数据进入第一缓存的时刻t5'与第一帧视频数据进入第一缓存的时刻t1'之间的差值小于一个Vsync周期,第二线程将第五帧视频数据丢弃,第五帧视频数据不会被存储到第一缓存中。第六帧视频数据进入第一缓存的时刻t6'与第一帧视频数据(由于第五帧视频数据被丢弃,因此第六帧视频数据的前M-1帧视频数据为第一帧视频数据)进入第一缓存的时刻t1'之间的差值大于一个Vsync周期,因此第二线程将第六帧视频数据写入第一缓存。这种情况下,第六帧视频数据在第一帧视频数据显示后需要等待4个Vsync周期就能够显示。可见,相比于传统方案,第六帧视频数据的显示时延降低了。并且,第六帧视频数据之后的每一帧视频数据都会根据送显阈值M进行判断后符合条件(该条件指该视频数据帧进入第一缓存的时刻与该视频数据帧的前M-1帧视频数据进入第一缓存的时刻之差大于一个Vsync周期)才会被写入第一缓存。这样,就保证了在任意一个时长等于一个Vsync周期的时间窗内等待送显的帧数不超过送显阈值M,从而有效降低了视频数据帧的显示时延。Please continue to refer to Fig. 6, according to the data processing method of the embodiment of the present application, assuming that the display threshold M=5, since the moment t5' when the fifth frame of video data enters the first buffer and the moment when the first frame of video data enters the first buffer The difference between t1' is less than one Vsync period, the second thread discards the fifth frame of video data, and the fifth frame of video data will not be stored in the first buffer. The moment t6' when the sixth frame of video data enters the first cache is the same as the first frame of video data (because the fifth frame of video data is discarded, the first M-1 frame of video data of the sixth frame of video data is the first frame of video data) The difference between the times t1' entering the first buffer is greater than one Vsync period, so the second thread writes the sixth frame of video data into the first buffer. In this case, the sixth frame of video data can be displayed after waiting for 4 Vsync periods after the first frame of video data is displayed. It can be seen that, compared with the traditional solution, the display delay of the sixth frame of video data is reduced. And, each frame of video data after the sixth frame of video data will meet the condition after being judged according to the display threshold M (this condition refers to the moment when the video data frame enters the first cache and the preceding M-1 frame of the video data frame The difference between the moment when the video data enters the first buffer is greater than one Vsync period) will be written into the first buffer. In this way, it is ensured that the number of frames waiting to be sent for display in any time window whose duration is equal to one Vsync period does not exceed the display threshold M, thereby effectively reducing the display delay of video data frames.
需要说明的是,以上的数据处理方式仅为本申请数据处理方法的一个实施例,本申请数据处理方法还可以采用其他的实施例。It should be noted that the above data processing method is only one embodiment of the data processing method of the present application, and the data processing method of the present application can also adopt other embodiments.
例如,前述实施例中采用了3个处理线程,并且构建了一个新的缓存,即第一缓存,而在本申请其他实施例中,也可以采用2个处理线程,并且无需构建上述的第一缓存。For example, 3 processing threads are used in the foregoing embodiments, and a new cache, that is, the first cache is constructed, while in other embodiments of the present application, 2 processing threads can also be used, and there is no need to construct the above-mentioned first cache. cache.
在采用2个处理线程的实施例中,线程1可以与前述的第一线程相同,另一个线程2可以用于按照Vsync周期从解码模块的输出缓存中读取视频数据并送显。例如,假设送显阈值M=5,在第1个Vsync周期,接收端电子设备接收到第1~5帧视频数据;在第2个Vsync周期,接收端接收到第6~9帧视频数据;在第3个Vsync周期……。线程2构造送显周期,送显周期的时长与Vsync周期的时长相等。In an embodiment using two processing threads, thread 1 can be the same as the aforementioned first thread, and another thread 2 can be used to read video data from the output buffer of the decoding module and send it to display according to the Vsync period. For example, assuming that the display threshold M=5, in the first Vsync cycle, the electronic device at the receiving end receives the 1st to 5th frames of video data; in the second Vsync cycle, the receiving end receives the 6th to 9th frames of video data; On the 3rd Vsync cycle.... Thread 2 constructs a display sending cycle, and the duration of the display sending cycle is equal to the duration of the Vsync cycle.
在第1个送显周期,线程2从解码模块的输出缓存中读取第1帧视频数据并发送给SurfaceFlinger;在第2个送显周期,线程2从解码模块的输出缓存中读取第2帧视频数据并发送给SurfaceFlinger……在第5个送显周期,线程2从解码模块的输出缓存中读取第5帧视频数据,如果向SurfaceFlinger发送第5帧视频数据的时刻与向SurfaceFlinger发送第1帧视频数据的时刻的差值小于或等于Vsync周期,线程2丢弃第5帧视频数据。接下来,线程2从解码模块的输出缓存中读取第6帧视频数据,如果向SurfaceFlinger发送第6帧视频数据的时刻与向SurfaceFlinger发送第1帧视频数据的时刻的差值大于Vsync周期,线程2将第6帧视频数据发送给SurfaceFlinger。然后,线程2从解码模块的输出缓存中读取第7帧视频数据,如果向SurfaceFlinger发送第7帧视频数据的时刻与向SurfaceFlinger发送第2帧视频数据的时刻的差值小于或等于Vsync周期,线程2丢弃第7帧视频数据……依此类推。In the first display cycle, thread 2 reads the first frame of video data from the output buffer of the decoding module and sends it to SurfaceFlinger; in the second display cycle, thread 2 reads the second frame of video data from the output buffer of the decoding module. Frame video data and send it to SurfaceFlinger... In the 5th sending cycle, thread 2 reads the 5th frame video data from the output buffer of the decoding module, if the moment of sending the 5th frame video data to SurfaceFlinger is the same as sending the 5th frame video data to SurfaceFlinger If the time difference of one frame of video data is less than or equal to the Vsync period, thread 2 discards the fifth frame of video data. Next, thread 2 reads the sixth frame of video data from the output buffer of the decoding module. If the difference between the moment of sending the sixth frame of video data to SurfaceFlinger and the moment of sending the first frame of video data to SurfaceFlinger is greater than the Vsync period, the thread 2 Send the sixth frame of video data to SurfaceFlinger. Then, thread 2 reads the 7th frame of video data from the output buffer of the decoding module. If the difference between the moment of sending the 7th frame of video data to SurfaceFlinger and the moment of sending the 2nd frame of video data to SurfaceFlinger is less than or equal to the Vsync period, Thread 2 discards frame 7 video data...and so on.
可见,本申请实施例中,在每一个Vsync周期内等待送显的帧数都不会超过送显阈值M。这样,通过控制一个Vsync周期内缓存的待送显的视频数据帧的数量,减少视频数据帧等待显示的时长,从而降低显示时延。It can be seen that in the embodiment of the present application, the number of frames waiting to be sent for display in each Vsync period will not exceed the threshold M for display. In this way, by controlling the number of buffered video data frames to be displayed within one Vsync cycle, the waiting time for the video data frames to be displayed is reduced, thereby reducing the display delay.
本申请实施例还提供一种电子设备,该电子设备包括存储器和处理器,存储器与处理器耦合,存储器存储有程序指令,当程序指令由所述处理器执行时,使得电子设备前述电子设备所执行的数据处理方法。The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory is coupled to the processor, the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device described above The data processing method to execute.
可以理解的是,电子设备为了实现上述功能,其包含了执行各个功能相应的硬件和/或软件模块。结合本文中所公开的实施例描述的各示例的算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。本领域技术人员可以结合实施例对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。It can be understood that, in order to realize the above functions, the electronic device includes hardware and/or software modules corresponding to each function. Combining the algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software drives hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions in combination with the embodiments for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
本实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机指令,当该计算机指令在电子设备上运行时,使得电子设备执行上述相关方法步骤实现上述实施例中的数据处理方法。This embodiment also provides a computer storage medium, in which computer instructions are stored, and when the computer instructions are run on the electronic device, the electronic device is made to execute the above related method steps to implement the data processing method in the above embodiment.
本实施例还提供了一种计算机程序产品,当该计算机程序产品在计算机上运行时,使得计算机执行上述相关步骤,以实现上述实施例中的数据处理方法。This embodiment also provides a computer program product, which, when running on a computer, causes the computer to execute the above related steps, so as to implement the data processing method in the above embodiment.
另外,本申请实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的数据处理方法。In addition, the embodiment of the present application also provides a device, which may specifically be a chip, a component or a module, and the device may include a connected processor and a memory; wherein, the memory is used to store instructions executed by a computer, and when the device is running, the processing The processor can execute the computer-executable instructions stored in the memory, so that the chip executes the data processing methods in the above method embodiments.
其中,本实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。Wherein, the electronic device, computer storage medium, computer program product or chip provided in this embodiment is all used to execute the corresponding method provided above, therefore, the beneficial effects it can achieve can refer to the corresponding method provided above The beneficial effects in the method will not be repeated here.
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can understand that for the convenience and brevity of the description, only the division of the above functional modules is used as an example for illustration. In practical applications, the above functions can be assigned by different Completion of functional modules means that the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or It may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。A unit described as a separate component may or may not be physically separated, and a component shown as a unit may be one physical unit or multiple physical units, which may be located in one place or distributed to multiple different places. Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
本申请各个实施例的任意内容,以及同一实施例的任意内容,均可以自由组合。对上述内容的任意组合均在本申请的范围之内。Any content of each embodiment of the present application, as well as any content of the same embodiment, can be freely combined. Any combination of the above contents is within the scope of the present application.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If an integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in various embodiments of the present application. The above-mentioned storage medium includes: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk, and other various media that can store program codes.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.
结合本申请实施例公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于随机存取存储器(Random Access Memory,RAM)、闪存、只读存储器(Read Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦可编程只读存储器(Electrically EPROM,EEPROM)、寄存器、硬盘、移动硬盘、只读光盘(CD-ROM)或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。The steps of the method or algorithm described in connection with the disclosure of the embodiments of the present application may be implemented in hardware, or in the form of a processor executing software instructions. The software instructions can be composed of corresponding software modules, and the software modules can be stored in random access memory (Random Access Memory, RAM), flash memory, read-only memory (Read Only Memory, ROM), erasable programmable read-only memory ( Erasable Programmable ROM, EPROM), Electrically Erasable Programmable Read-Only Memory (Electrically EPROM, EEPROM), registers, hard disk, removable hard disk, CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such the processor can read information from, and write information to, the storage medium. Of course, the storage medium may also be a component of the processor. The processor and storage medium can be located in the ASIC.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本申请实施例所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in the foregoing one or more examples, the functions described in the embodiments of the present application may be implemented by hardware, software, firmware or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application have been described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementations. The above-mentioned specific implementations are only illustrative and not restrictive. Those of ordinary skill in the art will Under the inspiration of this application, without departing from the purpose of this application and the scope of protection of the claims, many forms can also be made, all of which belong to the protection of this application.
Claims (11)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210019453.3A CN115550709B (en) | 2022-01-07 | 2022-01-07 | Data processing methods and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210019453.3A CN115550709B (en) | 2022-01-07 | 2022-01-07 | Data processing methods and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115550709A true CN115550709A (en) | 2022-12-30 |
CN115550709B CN115550709B (en) | 2023-09-26 |
Family
ID=84723977
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210019453.3A Active CN115550709B (en) | 2022-01-07 | 2022-01-07 | Data processing methods and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115550709B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115834793A (en) * | 2023-02-16 | 2023-03-21 | 深圳曦华科技有限公司 | Image data transmission control method under video mode |
CN117215426A (en) * | 2023-01-28 | 2023-12-12 | 荣耀终端有限公司 | Display method and electronic equipment |
CN118870083A (en) * | 2024-09-27 | 2024-10-29 | 杭州海康威视数字技术股份有限公司 | Video display method, device, electronic device and computer program product |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
BE591124A (en) * | 1959-06-15 | 1960-09-16 | Western Electric Co | Alternate change coded pulse transmission. |
JPH1032821A (en) * | 1996-07-15 | 1998-02-03 | Nec Corp | Decoding device for mpeg encoding image data |
JP2006166034A (en) * | 2004-12-07 | 2006-06-22 | Sanyo Electric Co Ltd | Video and sound output device |
US20110267269A1 (en) * | 2010-05-03 | 2011-11-03 | Microsoft Corporation | Heterogeneous image sensor synchronization |
US20120081567A1 (en) * | 2010-09-30 | 2012-04-05 | Apple Inc. | Techniques for synchronizing audio and video data in an image signal processing system |
CN102792682A (en) * | 2010-09-26 | 2012-11-21 | 联发科技(新加坡)私人有限公司 | Method for performing video display control, and associated video processing circuit and display system |
CN108476306A (en) * | 2016-12-30 | 2018-08-31 | 华为技术有限公司 | Image display method and terminal device |
JP2020042125A (en) * | 2018-09-10 | 2020-03-19 | 日本放送協会 | Real-time editing system |
CN111246178A (en) * | 2020-02-05 | 2020-06-05 | 浙江大华技术股份有限公司 | Video processing method and device, storage medium and electronic device |
CN111954067A (en) * | 2020-09-01 | 2020-11-17 | 杭州视洞科技有限公司 | Method for improving video rendering efficiency and user interaction fluency |
CN112153082A (en) * | 2020-11-25 | 2020-12-29 | 深圳乐播科技有限公司 | Method and device for smoothly displaying real-time streaming video picture in android system |
CN112929741A (en) * | 2021-01-21 | 2021-06-08 | 杭州雾联科技有限公司 | Video frame rendering method and device, electronic equipment and storage medium |
CN113364767A (en) * | 2021-06-03 | 2021-09-07 | 北京字节跳动网络技术有限公司 | Streaming media data display method and device, electronic equipment and storage medium |
CN113873345A (en) * | 2021-09-27 | 2021-12-31 | 中国电子科技集团公司第二十八研究所 | Distributed ultrahigh-definition video synchronous processing method |
-
2022
- 2022-01-07 CN CN202210019453.3A patent/CN115550709B/en active Active
Patent Citations (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
BE591124A (en) * | 1959-06-15 | 1960-09-16 | Western Electric Co | Alternate change coded pulse transmission. |
JPH1032821A (en) * | 1996-07-15 | 1998-02-03 | Nec Corp | Decoding device for mpeg encoding image data |
JP2006166034A (en) * | 2004-12-07 | 2006-06-22 | Sanyo Electric Co Ltd | Video and sound output device |
US20110267269A1 (en) * | 2010-05-03 | 2011-11-03 | Microsoft Corporation | Heterogeneous image sensor synchronization |
CN102792682A (en) * | 2010-09-26 | 2012-11-21 | 联发科技(新加坡)私人有限公司 | Method for performing video display control, and associated video processing circuit and display system |
US20120081567A1 (en) * | 2010-09-30 | 2012-04-05 | Apple Inc. | Techniques for synchronizing audio and video data in an image signal processing system |
CN108476306A (en) * | 2016-12-30 | 2018-08-31 | 华为技术有限公司 | Image display method and terminal device |
CN113225427A (en) * | 2016-12-30 | 2021-08-06 | 荣耀终端有限公司 | Image display method and terminal equipment |
JP2020042125A (en) * | 2018-09-10 | 2020-03-19 | 日本放送協会 | Real-time editing system |
CN111246178A (en) * | 2020-02-05 | 2020-06-05 | 浙江大华技术股份有限公司 | Video processing method and device, storage medium and electronic device |
CN111954067A (en) * | 2020-09-01 | 2020-11-17 | 杭州视洞科技有限公司 | Method for improving video rendering efficiency and user interaction fluency |
CN112153082A (en) * | 2020-11-25 | 2020-12-29 | 深圳乐播科技有限公司 | Method and device for smoothly displaying real-time streaming video picture in android system |
CN112929741A (en) * | 2021-01-21 | 2021-06-08 | 杭州雾联科技有限公司 | Video frame rendering method and device, electronic equipment and storage medium |
CN113364767A (en) * | 2021-06-03 | 2021-09-07 | 北京字节跳动网络技术有限公司 | Streaming media data display method and device, electronic equipment and storage medium |
CN113873345A (en) * | 2021-09-27 | 2021-12-31 | 中国电子科技集团公司第二十八研究所 | Distributed ultrahigh-definition video synchronous processing method |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117215426A (en) * | 2023-01-28 | 2023-12-12 | 荣耀终端有限公司 | Display method and electronic equipment |
CN115834793A (en) * | 2023-02-16 | 2023-03-21 | 深圳曦华科技有限公司 | Image data transmission control method under video mode |
CN118870083A (en) * | 2024-09-27 | 2024-10-29 | 杭州海康威视数字技术股份有限公司 | Video display method, device, electronic device and computer program product |
Also Published As
Publication number | Publication date |
---|---|
CN115550709B (en) | 2023-09-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN115550709B (en) | Data processing methods and electronic equipment | |
CN110121114B (en) | Method for transmitting stream data and data transmitting apparatus | |
WO2022017205A1 (en) | Method for displaying multiple windows and electronic device | |
CN114499772B (en) | Data transmission method and electronic device | |
CN114286035B (en) | Image acquisition card, image acquisition method and image acquisition system | |
CN112887608A (en) | Image processing method and device, image processing chip and electronic equipment | |
CN113726815B (en) | Method for dynamically adjusting video, electronic equipment, chip system and storage medium | |
US12267500B2 (en) | Storage of EVC decoder configuration information | |
US12061662B2 (en) | Methods, apparatuses and systems for displaying alarm file | |
EP4510595A1 (en) | Video synchronous display method and apparatus, device and medium | |
CN114339349B (en) | A display device, data transmission method and storage medium | |
CN106412518A (en) | Wireless video transmission system based on TD-LTE emergency communication | |
CN119011083A (en) | Data transmission method, sending equipment and receiving equipment | |
CN115550708B (en) | Data processing method and electronic equipment | |
CN116055613B (en) | A screen projection method and device | |
WO2022170866A1 (en) | Data transmission method and apparatus, and storage medium | |
CN116055802A (en) | Image frame processing method and electronic equipment | |
US20240073415A1 (en) | Encoding Method, Electronic Device, Communication System, Storage Medium, and Program Product | |
CN117711354B (en) | Display method, readable storage medium, and electronic device | |
CN113115039B (en) | Working frequency determination method and device and electronic equipment | |
CN117270917B (en) | Software upgrading method and electronic equipment | |
US20240223786A1 (en) | Video transmission method and electronic device | |
US20230379434A1 (en) | Data transmission method and apparatus | |
CN119629707A (en) | Data transmission method and electronic device | |
CN118592021A (en) | Electronic device for processing video and operating method thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |
|
CP03 | Change of name, title or address |