WO2012041082A1 - 一种视频解码和播放的方法、装置、系统和终端设备 - Google Patents

一种视频解码和播放的方法、装置、系统和终端设备 Download PDF

Info

Publication number
WO2012041082A1
WO2012041082A1 PCT/CN2011/076163 CN2011076163W WO2012041082A1 WO 2012041082 A1 WO2012041082 A1 WO 2012041082A1 CN 2011076163 W CN2011076163 W CN 2011076163W WO 2012041082 A1 WO2012041082 A1 WO 2012041082A1
Authority
WO
WIPO (PCT)
Prior art keywords
module
relative
sleep
decoding
instruction
Prior art date
Application number
PCT/CN2011/076163
Other languages
English (en)
French (fr)
Inventor
刘骁
Original Assignee
深圳市融创天下科技股份有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 深圳市融创天下科技股份有限公司 filed Critical 深圳市融创天下科技股份有限公司
Publication of WO2012041082A1 publication Critical patent/WO2012041082A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/44Processing 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/44004Processing 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals
    • H04N19/44Decoders specially adapted therefor, e.g. video decoders which are asymmetric with respect to the encoder
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • H04N21/43072Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen of multiple content streams on the same device
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing 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/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB

Definitions

  • the present invention relates to the field of video broadcasting, and in particular, to a method, device, system and terminal device for video decoding and playing.
  • the wireless network has narrow bandwidth and serious interference, which greatly increases the possibility of error in network transmission.
  • the mobile terminal has low processing capacity and small memory capacity.
  • the huge market opportunities for low-end users in mobile phones are huge.
  • the streaming media decoding technology requires high processing power, and the computational overhead is relatively large, and the processing power of the CPU is relatively high and the efficiency is low.
  • Mobile streaming media is not suitable for low bit network transmission.
  • the purpose of the embodiments of the present invention is to provide a method for video playback, which aims to solve the prior art. Because the decoding of a certain frame of video frames is too long, the display output is delayed and the display is uneven. At the same time, the present invention can be applied to a terminal embedded terminal device with a low CPU running frequency and a high bit rate and a high frame rate.
  • a method for video decoding includes the following steps:
  • the step of "determining whether the buffer is full" further includes the steps of:
  • the step of 'sleeping a waiting period' further includes the step 'waiting for the period to expire, the sleep is awakened, and determining whether the buffer is full again'.
  • the waiting period is 1000 ms* [(the number of frames that can be accommodated in the buffer/2) / frame rate].
  • Another object of the embodiments of the present invention is to provide a video decoding apparatus, where the apparatus includes a decoding module, a first determining module, a buffering module, and a first hibernation module, where:
  • the decoding module is connected to the first determining module, configured to acquire a video frame, obtain a relative time stamp or a relative audio time, decode the video frame, generate an image frame, and send a decoding completion instruction to the first determining module, and receive the first Determining a storage instruction of the module;
  • the first judging module is connected to the decoding module, the buffering module and the first hibernation module, and is configured to receive an instruction for decoding completion of the decoding module, request to acquire a storage state of the buffer module, and send a storage instruction to the decoding module according to the storage state of the buffer module or Sending a sleep instruction to the first sleep module; and determining, according to the sleep expiration command sent by the first sleep module, that the storage state of the buffer module is not full or full, and if the storage state is not full, sending the storage to the decoding module An instruction, if the storage state is full, the first hibernation module sends a sleep instruction;
  • the buffer module is connected to the first determining module, and configured to receive a request for acquiring the storage state of the buffer module by the first determining module, and send the storage state of the buffer module to the first determining module, and receive the image frame sent by the decoding module and the relative a timestamp or relative audio time, and storing the image frame and relative timestamp or relative audio time;
  • the first hibernation module is connected to the first judging module, and is configured to receive a sleep instruction sent by the first judging module, enter a sleep state of a waiting period, receive a wake-up instruction sent by the operating system, and send a sleep expiration command to the first judging module. .
  • Another object of the embodiments of the present invention is to provide a video playing method, including the following steps:
  • the step of determining whether the relative system time is less than the relative time stamp or the relative audio time further comprises the steps of:
  • step 'Read buffer image frame and relative timestamp or relative audio time' If no, display the image frame and go to step 'Read buffer image frame and relative timestamp or relative audio time'.
  • the method further includes the step “waiting for the expiration of the period, the sleep is awakened, and determining whether the relative system time is less than the relative time stamp or the relative audio time”.
  • the one waiting period is 1000 ms/(frame rate *2).
  • Another object of the embodiments of the present invention is to provide a video playback device, where the device includes a reading module, a second determining module, a display module, and a second hibernation module, where:
  • the reading module is connected to the second determining module, configured to read the image frame of the buffer area, and read the relative time stamp or relative audio time, send a read completion instruction to the second determining module, and receive the display of the second determining module Instruction to send an image frame;
  • the second determining module is connected to the reading module, the display module and the second hibernation module, and is configured to receive the reading completion instruction of the reading module and receive the sleep expiration instruction sent by the second hibernation module, according to the relative system time and the relative time a comparison result of the stamp or relative audio time or a display instruction to the reading module and the display module or a sleep instruction to the second sleep module according to a comparison result of the relative audio time and the relative time stamp;
  • a display module connected to the second determining module, configured to receive a display instruction of the second determining module, acquire an image frame, and display the image;
  • the second hibernation module is connected to the second judging module, and is configured to receive the sleep instruction sent by the second judging module, enter a sleep state of the waiting period, and receive the wake-up command sent by the operating system, and send the sleep period to the second judging module. Full instruction.
  • Another object of the embodiments of the present invention is to provide a video decoding and playback system, the system comprising:
  • the decoding device comprising a decoding module, a first determining module, a buffer module and a first hibernation module
  • the playback device comprising a reading module, a second judging module, a display module and a second hibernation module, wherein :
  • the decoding module is connected to the first determining module, configured to acquire a video frame, obtain a relative time stamp or a relative audio time, decode the video frame, generate an image frame, and send a decoding completion instruction to the first determining module, and receive the first Determining a storage instruction of the module;
  • the first judging module is connected to the decoding module, the buffering module and the first hibernation module, and is configured to receive an instruction for decoding completion of the decoding module, request to acquire a storage state of the buffer module, and send a storage instruction to the decoding module according to the storage state of the buffer module or Sending a sleep instruction to the first sleep module; and determining, according to the sleep expiration command sent by the first sleep module, that the storage state of the buffer module is not full or full, and if the storage state is not full, sending the storage to the decoding module An instruction, if the storage state is full, the first hibernation module sends a sleep instruction;
  • the buffer module is connected to the first determining module, and configured to receive a request for acquiring the storage state of the buffer module by the first determining module, and send the storage state of the buffer module to the first determining module, and receive the image frame sent by the decoding module and the relative a timestamp or relative audio time, and storing the image frame and relative timestamp or relative audio time;
  • the first hibernation module is connected to the first judging module, and is configured to receive a sleep instruction sent by the first judging module, enter a sleep state of a waiting period, receive a wake-up instruction sent by the operating system, and send a sleep expiration command to the first judging module. ;
  • the reading module is connected to the second determining module, configured to read the image frame of the buffer area, and read the relative time stamp or relative audio time, send a read completion instruction to the second determining module, and receive the display of the second determining module Instruction to send an image frame;
  • the second determining module is connected to the reading module, the display module and the second hibernation module, and is configured to receive the reading completion instruction of the reading module and receive the sleep expiration instruction sent by the second hibernation module, according to the relative system time and the relative time a comparison result of the stamp or relative audio time or a display instruction to the reading module and the display module or a sleep instruction to the second sleep module according to a comparison result of the relative audio time and the relative time stamp;
  • a display module connected to the second determining module, configured to receive a display instruction of the second determining module, acquire an image frame, and display the image;
  • the second hibernation module is connected to the second judging module, and is configured to receive the sleep instruction sent by the second judging module, enter a sleep state of the waiting period, and receive the wake-up command sent by the operating system, and send the sleep period to the second judging module. Full instruction.
  • Another object of embodiments of the present invention is to provide a terminal device including the video decoding and playback system.
  • the working system controls the priority of the working thread for decoding and playing, and after decoding the video frame to generate the image frame, controls the storage of the image frame or the sleep of the decoding thread according to the storage state of the buffer, and the working thread of the playback reads the image in the buffer.
  • the frame and the relative timestamp control the display of the image frame or the sleep of the playing thread according to the comparison result of the relative system time and the relative timestamp. Even if the CPU time for decoding a certain frame is too high, it does not affect the display device to display the image frame, and the image in the buffer can be accurately displayed on time.
  • the set sleep time ensures that the working thread enters the sleep state without working, avoids occupying the CPU, and is compatible with the CPU running frequency and can handle the terminal embedded terminal device with high bit rate and high frame rate. Suitable for video decoding and playback without audio.
  • FIG. 1 is a flowchart of a video decoding method according to an embodiment of the present invention.
  • FIG. 2 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a video playing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a video playing device according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a video decoding and playback system according to an embodiment of the present invention.
  • the invention controls the priority of the working thread for decoding and playing through the operating system, ensures that the working thread of the playing is higher than the priority of the decoded working thread, and achieves smooth display of the image frame; the decoded working thread decodes the video frame and generates an image frame. After storing the image frame in the buffer, even if the CPU time for decoding a certain frame is too high, the playback device does not affect the display of the image frame, so the image in the buffer can be accurately displayed on time; in decoding and display In the process, set different sleep time, to ensure that the working thread does not need to work to enter the sleep state, to avoid taking up the CPU.
  • FIG. 1 is a flowchart of a video decoding method according to an embodiment of the present invention. The method includes the following steps:
  • S101 Read a video frame and a relative timestamp, decode the video frame, and generate an image frame.
  • the step relative time stamp can be replaced with a relative audio time
  • the operating system When the video frame and the relative timestamp are read, the operating system creates a corresponding worker thread
  • the relative timestamp is a relative display time point corresponding to each image frame, and the display time point is a time offset starting from 0 ms, and the display start time is recorded in 0 ms at the start of display;
  • step S102 determining whether the buffer is full, if yes, proceeding to step S104, otherwise proceeding to step S103;
  • step S103 storing unwritten image frames and relative timestamps to the buffer, proceeds to step S101;
  • the waiting period is 1000ms*[(the number of frames that can be accommodated in the buffer/2)/frame rate], that is, the working thread no longer occupies the CPU during the waiting period;
  • step S105 wake up sleep, go to step S102 to determine again whether the buffer is full;
  • the wake-up sleep is that the operating system continues to respond to the worker thread
  • the decoded image frame is stored in the buffer, which avoids excessive time-consuming decoding, resulting in uneven frame loss and image playback. If the buffer is full, the sleep state is entered, thereby reducing CPU consumption. The buffer is re-judged by the operating system only after the waiting period expires; the waiting period depends on the size and frame rate of the buffer, and the image frame in the buffer is woken up to half of the time to continue storing the image frame.
  • FIG. 2 is a schematic structural diagram of a video decoding apparatus according to an embodiment of the present invention.
  • the decoding device includes: a decoding module, a first determining module, a buffering module, and a first hibernation module;
  • the decoding module is connected to the first determining module, configured to acquire a video frame, obtain a relative time stamp or a relative audio time, decode the video frame, generate an image frame, and send a decoding completion instruction to the first determining module, and receive the first Determining a storage instruction of the module;
  • the first judging module is connected to the decoding module, the buffering module and the first hibernation module, and is configured to receive an instruction for decoding completion of the decoding module, request to acquire a storage state of the buffer module, and send a storage instruction to the decoding module according to the storage state of the buffer module or Sending a sleep instruction to the first sleep module; and determining, according to the sleep expiration command sent by the first sleep module, that the storage state of the buffer module is not full or full, and if the storage state is not full, sending the storage to the decoding module An instruction, if the storage state is full, the first hibernation module sends a sleep instruction;
  • the buffer module is connected to the first determining module, and configured to receive a request for acquiring the storage state of the buffer module by the first determining module, and send the storage state of the buffer module to the first determining module, and receive the image frame sent by the decoding module and the relative a timestamp or relative audio time, and storing the image frame and relative timestamp or relative audio time;
  • the first hibernation module is connected to the first judging module, and is configured to receive a sleep instruction sent by the first judging module, enter a sleep state of a waiting period, receive a wake-up instruction sent by the operating system, and send a sleep expiration command to the first judging module. ;
  • the waiting period is 1000ms*[(the number of frames that the buffer can hold/2)/frame rate];
  • the sleep state refers to that the working thread of the decoding device no longer occupies the CPU.
  • the decoding module generates an image frame
  • the first determining module determines whether to store the buffer module or enter a sleep state by determining the storage state of the buffer module; if the storage state of the buffer module is not full, the image frame is stored to
  • the buffer module avoids the delay of frame loss and image output due to excessively long decoding time; if the buffer module is full, the sleep command is sent to the first hibernation module to enter a sleep state of a waiting period, thereby reducing CPU consumption. It is restarted by the operating system only after the waiting period expires; the waiting period depends on the size and frame rate of the buffer module, and the image frame in the buffer module is awake until it is halfway to continue storing the image frame.
  • FIG. 4 is a flowchart of a video playing method according to an embodiment of the present invention. The method includes the following steps:
  • the operating system creates a corresponding worker thread
  • the relative timestamp is a relative display time point corresponding to each image frame, which is a time offset starting from 0 ms, and the display start time is recorded in 0 ms at the start of display;
  • step S302 determining whether the relative system time is less than the relative timestamp, if yes, proceeding to step S304, otherwise proceeding to step S303;
  • the relative system time is a time offset based on 0 ms at the start of display
  • step S303 displaying an image frame, proceeds to step S301;
  • the waiting period is 1000ms/(frame rate*2) (takes an integer), and the working thread no longer occupies the CPU during the waiting period;
  • step S305 wake up sleep, proceeds to step S302;
  • the relative system time can be replaced by relative audio time
  • the wake-up hibernation is that the operating system continues to respond to the worker thread
  • the "relative time stamp” can also be replaced with “relative audio time”.
  • the display of the image frame is controlled by comparing the relative system time and the relative time stamp, and the real time display can be performed according to the relative time stamp of each frame given by the program source, thereby ensuring uniform display of the image frame in one second.
  • Sex also applies to smooth playback of videos without audio.
  • FIG. 4 is a schematic structural diagram of a video playing device according to an embodiment of the present invention.
  • the playback device includes: a reading module, a second determining module, a display module, and a second hibernation module, wherein:
  • the reading module is connected to the second determining module, configured to read the image frame of the buffer area and the relative time stamp or the relative audio time, send a read completion instruction to the second determining module, receive the display instruction of the second determining module, and send Image frame
  • the relative timestamp is a relative display time point corresponding to each image frame, which is a time offset starting from 0 ms, and the display start time is recorded in 0 ms at the start of display;
  • the second determining module is connected to the reading module, the display module and the second hibernation module, and is configured to receive the reading completion instruction of the reading module and receive the sleep expiration instruction sent by the second hibernation module, according to the relative system time and the relative time a comparison result of the stamp or the relative audio time or a display instruction to the reading module and the display module or a sleep instruction to the second sleep module according to the comparison result of the relative audio time and the relative time stamp;
  • the comparison result may refer to a determination result that the relative system time is less than the relative time stamp. If the comparison result is no, the display instruction is sent to the reading module and the display module, if the comparison result is yes. Sending a sleep instruction to the second sleep module;
  • a display module connected to the second determining module, configured to receive a display instruction of the second determining module, acquire an image frame, and display the image;
  • the second hibernation module is connected to the second judging module, and is configured to receive the sleep instruction sent by the second judging module, enter a sleep state of the waiting period, and receive the wake-up command sent by the operating system, and send the sleep period to the second judging module.
  • the waiting period is 1000ms/(frame rate*2) (takes an integer);
  • the sleep state refers to that the working thread of the playback device no longer occupies the CPU.
  • the second judging module controls the display of the display module by comparing the relative system time with the relative time stamp, and can display the real time display according to the relative time stamp of each frame given by the program source, ensuring that the display is performed within one second.
  • the uniformity of image frame display is also suitable for smooth playback of video without audio.
  • the sleep period of the second hibernation module is defined as 1000ms/(frame rate*2), which effectively controls the playback device between the operating system and the CPU. Efficient collaboration.
  • FIG. 5 is a schematic structural diagram of a video decoding and playback system according to an embodiment of the present invention.
  • the video decoding and playback system includes: a decoding device and a playback device;
  • the decoding device is connected to the playback device, and includes: a decoding module, a first determining module, a buffer module, and a first hibernation module, wherein:
  • the decoding module is connected to the first determining module, configured to acquire a video frame and a relative time stamp or a relative audio time, decode the video frame and generate an image frame, and send a decoding completion instruction to the first determining module, and receive the first determining module.
  • the image frame includes an image and a time stamp corresponding to each frame of image
  • the first judging module is connected to the decoding module, the buffering module and the first hibernation module, and is configured to receive the decoding completion instruction of the decoding module and receive the sleep expiration instruction sent by the first hibernation module, requesting to acquire the storage state of the buffer module, according to Transmitting the storage state to the decoding module or sending a sleep instruction to the first hibernation module;
  • the storage state is not full or full, and if the storage state is not full, sending a storage instruction to the decoding module, and if the storage state is full, the first hibernation module sends a sleep instruction;
  • the buffer module is connected to the first determining module, and configured to receive a request for acquiring the storage state of the buffer module by the first determining module, and send the storage state of the buffer module to the first determining module, and receive the image frame sent by the decoding module and the relative Timestamp or relative audio time, and store image frames and relative timestamps or relative audio time;
  • the first hibernation module is connected to the first judging module, and is configured to receive a sleep instruction sent by the first judging module, enter a sleep state of a waiting period, receive a wake-up instruction sent by the operating system, and send a sleep expiration command to the first judging module. ;
  • the waiting period is 1000ms*[(the number of frames that the buffer can hold/2)/frame rate];
  • the sleep state refers to that the working thread of the decoding device no longer occupies the CPU.
  • the playback device is connected to the decoding device, and includes: a reading module, a second determining module, a display module, and a second hibernation module, wherein:
  • the reading module is connected to the second determining module, configured to read the image frame of the buffer area and the relative time stamp or the relative audio time, send a read completion instruction to the second determining module, receive the display instruction of the second determining module, and send Image frame
  • the relative timestamp is a relative display time point corresponding to each image frame, which is a time offset starting from 0 ms, and the display start time is recorded in 0 ms at the start of display;
  • the second determining module is connected to the reading module, the display module and the second hibernation module, and is configured to receive the reading completion instruction of the reading module and receive the sleep expiration instruction sent by the second hibernation module, according to the relative system time and the relative time a comparison result of the stamp or relative audio time or a display instruction to the reading module and the display module or a sleep instruction to the second sleep module according to a comparison result of the relative audio time and the relative time stamp;
  • the comparison result may refer to a determination result that the relative system time is less than the relative time stamp. If the comparison result is no, the display instruction is sent to the reading module and the display module, if the comparison result is If yes, sending a sleep instruction to the second sleep module;
  • a display module connected to the second determining module, configured to receive a display instruction of the second determining module, acquire an image frame, and display the image;
  • the second hibernation module is connected to the second judging module, and is configured to receive a sleep instruction sent by the second judging module, enter a sleep state of a waiting period, receive a wake-up command sent by the operating system, and send a sleep expiration command to the second judging module. ;
  • the waiting period is 1000ms/(frame rate*2) (takes an integer);
  • the sleep state refers to that the working thread of the playback device no longer occupies the CPU.
  • the operating system sets the priority of the decoding device and the playback device, the priority of the playback device is higher than the priority of the decoding device;
  • the decoding module decodes the video frame to generate an image frame;
  • the first determining module acquires the buffer The storage state of the module, if not full, the first determining module sends a storage instruction to the decoding module, and the decoding module stores the image frame to the buffer module; if it is full, the first determining module sends a sleep instruction to the first sleeping module, and the decoding device enters a The sleep state of the waiting period;
  • the playback device reads the image frame of the buffer module, and the second determining module determines whether the relative system time is less than the relative time stamp.
  • the second determining module sends a display instruction to the reading module and the display module, and reads The module sends an image frame to the display module and displays; if yes, the second determining module sends a sleep instruction to the second sleep module, and the playback device enters a sleep state of one cycle.
  • the priority of the playback device is higher than the priority of the decoding device, ensuring that the playback device can smoothly play, even if the decoding device spends a CPU time decoding a certain frame.
  • the time is high, it does not affect the display device to display the image frame, and the image in the buffer can be accurately displayed on time.
  • the decoding device does not display the image image due to the non-uniformity of CPU usage during decoding, but can be stored in the buffer module. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Description

一种视频解码和播放的方法、装置、系统和终端设备 技术领域
本发明涉及视频播放领域,尤其涉及一种视频解码和播放的方法、装置、系统和终端设备。
背景技术
移动终端以及移动流媒体技术特点有:
无线网络带宽窄,干扰严重,导致网络传输的误码的可能性大大增加。移动终端处理能力低,内存容量小。手机中低端用户基数庞大而带来的巨大的市场商机。流媒体解码技术需要较高的处理能力,运算开销比较大,对CPU的处理能力要求比较高,效率低下。移动流媒体不适合低比特网络传输。
现有视频播放技术为了保障视频流畅播放,多数从解码和播放同步性来大概保证其流畅播放,但是在一秒内的帧图像输出确不能保证其流畅和均匀性。现有技术的表现会因解码某帧耗时过长,要么就尽快连续显示第二帧,要么就丢弃第二帧,会呈现出图象显示的不均匀性。
虽然计算机领域刚刚面世的GPU硬解码技术不依赖于CPU的能力,但解码支持度不高,对不同的视频编码、封装格式,硬解码无法做到全面兼容,画面输出补偿及画质增强技术不够,难以解决秒内的帧图像输出的均匀性。
发明内容
本发明实施例的目的在于提出一种视频播放的方法,旨在解决现有技术中 因解码某帧视频帧时间过长,而导致显示输出延迟、显示不均匀的问题,同时本发明可应用 CPU 运行频率低又能处理高码率高帧率的终端嵌入式终端设备。
本发明实施例是这样实现的,一种视频解码的方法,包括以下步骤:
读取视频帧,并读取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧;
判断缓冲区是否已满,如果是,休眠一个等待周期。
本发明视频解码的方法中,所述的步骤'判断缓冲区是否已满'还包括步骤:
如果否,存储图像帧和相对时间戳到缓冲区,并进入步骤'读取视频帧,并读取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧'。
本发明视频解码的方法中,所述的步骤'休眠一个等待周期'之后还包括步骤'等待周期期满,休眠被唤醒,再次判断缓冲区是否已满'。
本发明视频解码的方法中,等待周期为1000ms*[(缓冲区所能容纳的帧数/2)/帧率]。
本发明实施例的另一目的在于提出一种视频解码装置,所述装置包括解码模块、第一判断模块、缓冲模块和第一休眠模块,其中:
解码模块,与第一判断模块相连,用于获取视频帧,以及获取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令,请求获取缓冲模块的存储状态,根据缓冲模块的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;并根据第一休眠模块发送的休眠期满指令,判断所述缓冲模块的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储所述图像帧和相对时间戳或相对音频时间;
第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令。
本发明实施例的另一目的在于提出一种视频播放方法,包括以下步骤:
读取缓冲区的图像帧,并读取相对时间戳或相对音频时间;
判断相对系统时间是否小于相对时间戳或相对音频时间或者判断相对音频时间是否小于相对时间戳,如果是,休眠一个等待周期。
本发明视频播放方法中,所述的步骤'判断相对系统时间是否小于相对时间戳或相对音频时间'还包括步骤:
如果否,显示图像帧,并进入步骤'读取缓冲区的图像帧和相对时间戳或相对音频时间'。
本发明视频播放方法中,所述的步骤'休眠一个等待周期'之后还包括步骤'等待周期期满,休眠被唤醒,再次判断相对系统时间是否小于相对时间戳或相对音频时间'。
本发明视频播放方法中,所述的一个等待周期是1000ms/(帧率*2)。
本发明实施例的另一目的在于提出一种视频播放装置,所述装置包括读取模块、第二判断模块、显示模块和第二休眠模块,其中:
读取模块,与第二判断模块相连,用于读取缓存区的图像帧,以及读取相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的对比结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;并用于接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令。
本发明实施例的另一目的在于提出 一种 视频解码和播放系统 ,所述的系统包括:
解码装置和播放装置,所述解码装置包括解码模块、第一判断模块、缓冲模块和第一休眠模块,所述播放装置包括读取模块、第二判断模块、显示模块和第二休眠模块,其中:
解码模块,与第一判断模块相连,用于获取视频帧,以及获取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令,请求获取缓冲模块的存储状态,根据缓冲模块的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;并根据第一休眠模块发送的休眠期满指令,判断所述缓冲模块的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储所述图像帧和相对时间戳或相对音频时间;
第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令;
读取模块,与第二判断模块相连,用于读取缓存区的图像帧,以及读取相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的对比结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;并用于接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令。
本发明实施例的另一目的在于提出 一种包括所述视频解码和播放系统的终端设备。
本发明的有益效果:
通过操作系统控制解码与播放的工作线程的优先级,解码视频帧生成图像帧后,根据缓冲区的存储状态控制图像帧的存储或者解码线程的休眠,播放的工作线程读取缓冲区中的图像帧和相对时间戳,根据相对系统时间与相对时间戳的对比结果控制图像帧的显示或者播放线程的休眠。即使在解码某一帧占用CPU时间过高时,并不影响播放装置显示图像帧,可以准确的把缓冲区里的图像按时显示。在解码和显示过程中,设定的休眠时间,确保工作线程无需工作的情况下进入休眠状态,避免占用CPU,兼容CPU运行频率低又能处理高码率高帧率的终端嵌入式终端设备,适用无音频的视频解码和播放。
附图说明
图1是本发明实施例一种视频解码方法流程图;
图2是本发明实施例一种视频解码装置结构示意图;
图3是本发明实施例一种视频播放方法流程图;
图4是本发明实施例一种视频播放装置结构示意图;
图5是本发明实施例一种视频解码和播放系统结构示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图和实施例,对本发明进行进一步详细说明,为了便于说明,仅示出了与本发明实施例相关的部分。应当理解,此处所描写的具体实施例,仅仅用于解释本发明,并不用以限制本发明。
本发明通过操作系统控制解码与播放的工作线程的优先级,确保播放的工作线程高于解码的工作线程的优先级,达到图像帧的顺畅显示;解码的工作线程在解码视频帧并生成图像帧后,把图像帧存储到缓冲区,即使在解码某一帧占用CPU时间过高时,也不影响播放装置显示图像帧,因此可以准确的把缓冲区里的图象按时显示;在解码和显示过程中,设定不同的休眠时间,确保在工作线程无需工作的情况下进入休眠状态,避免占用CPU。
实施例一
图1是本发明实施例一种视频解码方法流程图。所述方法包括以下步骤:
S101,读取视频帧和相对时间戳,对视频帧进行解码并生成图像帧;
所述的步骤相对时间戳可替换为相对音频时间;
读取视频帧和相对时间戳时,操作系统创建所对应的工作线程;
所述的相对时间戳为每个图像帧所对应的被相对显示时间点,所述显示时间点是以0ms开始的时间偏移量,在开始显示时以0ms记录显示起点时间;
S102,判断缓冲区是否已满,是则进入步骤S104,否则进入步骤S103;
S103,存储未写入的图像帧和相对时间戳到缓冲区,进入步骤S101;
此处的“相对时间戳”也可替换为“相对音频时间”。
S104,休眠一个等待周期;
所述的一个等待周期是1000ms*[(缓冲区所能容纳的帧数/2)/帧率],即在等待周期内所述工作线程不再占用CPU;
S105,唤醒休眠,进入步骤S102再次判断缓冲区是否已满;
所述的唤醒休眠是操作系统再继续响应所述工作线程;
本发明实施例中解码生成图像帧存储到缓冲区,避免了因解码耗时过长,导致丢帧和图像播放的不均匀,如果缓冲区已满,则进入休眠状态,从而减少CPU的消耗,只有在等待周期期满才被操作系统唤醒重新判断缓冲区;等待周期的时间取决于缓冲区的大小和帧率,缓冲区里的图像帧被消耗到一半时才被唤醒继续存储图像帧。
实施例二
图2是本发明实施例一种视频解码装置结构示意图。
所述解码装置包括:解码模块、第一判断模块、缓冲模块和第一休眠模块;
解码模块,与第一判断模块相连,用于获取视频帧,以及获取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令,请求获取缓冲模块的存储状态,根据缓冲模块的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;并根据第一休眠模块发送的休眠期满指令,判断所述缓冲模块的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储所述图像帧和相对时间戳或相对音频时间;
第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令;
所述的等待周期是1000ms*[(缓冲区所能容纳的帧数/2)/帧率];
所述的休眠状态是指解码装置的工作线程不再占用CPU。
本发明实施例中解码模块生成图像帧,第一判断模块判断通过判断缓冲模块的存储状态,来控制是否存储到缓冲模块或者进入休眠状态;如果缓冲模块的存储状态为未满,图像帧存储到缓冲模块,避免了因解码耗时过长,导致丢帧和图像输出的不均匀;如果缓冲模块已满,则发送休眠指令到第一休眠模块进入一个等待周期的休眠状态,从而减少CPU的消耗,只有在等待周期期满才被操作系统唤醒重新启动;等待周期的时间取决于缓冲模块的大小和帧率,缓冲模块里的图像帧被消耗到一半时才被唤醒继续存储图像帧。
实施例三
图4是本发明实施例一种视频播放方法流程图。所述方法包括以下步骤:
S301,读取缓冲区的图像帧和相对时间戳;
读取缓冲区开始时,操作系统创建所对应的工作线程;
所述的相对时间戳为每个图像帧所对应的被相对显示时间点,是以0ms开始的时间偏移量,在开始显示时以0ms记录显示起点时间;
S302,判断相对系统时间是否小于相对时间戳,是则进入步骤S304,否则进入步骤S303;
所述的相对系统时间是开始显示时以0ms为基准的时间偏移量;
S303,显示图像帧,进入步骤S301;
S304,休眠一个等待周期;
所述的一个等待周期是1000ms/(帧率*2)(取整数),在等待周期内工作线程不再占用CPU;
S305,唤醒休眠,进入步骤S302;
所述的相对系统时间可替换为相对音频时间;
所述的唤醒休眠是操作系统继续响应工作线程;
所述“相对时间戳”也可替换为“相对音频时间”。
本发明实施例中通过比对相对系统时间与相对时间戳来控制图像帧的显示,能够完全按照节目源所给定的每帧相对时间戳进行实时显示,确保一秒内的图像帧显示的均匀性,同样适用于没有音频的视频的流畅播放。
实施例四
图4是本发明实施例一种视频播放装置结构示意图。
所述播放装置包括:读取模块、第二判断模块、显示模块和第二休眠模块,其中:
读取模块,与第二判断模块相连,用于读取缓存区的图像帧和相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
所述的相对时间戳为每个图像帧所对应的被相对显示时间点,是以0ms开始的时间偏移量,在开始显示时以0ms记录显示起点时间;
第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的比对结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
例如,所述的对比结果可以指相对系统时间是否小于相对时间戳的判断结果,如果所述的对比结果为否,则向读取模块和显示模块发送显示指令,如果所述的对比结果为是,则向第二休眠模块发送休眠指令;
显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;并用于接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令;
所述的等待周期是1000ms/(帧率*2)(取整数);
所述的休眠状态是指播放装置的工作线程不再占用CPU。
本发明实施例中第二判断模块通过比对相对系统时间与小于相对时间戳来控制显示模块的显示,能够完全按照节目源所给定的每帧相对时间戳进行实时显示,确保一秒内的图像帧显示的均匀性,同样适用于没有音频的视频的流畅播放,同时,第二休眠模块的休眠周期定义为1000ms/(帧率*2),有效控制播放装置与操作系统和CPU之间的高效协作。
实施例五
图5是本发明实施例一种视频解码和播放系统结构示意图。
所述视频解码和播放系统包括:解码装置和播放装置;
解码装置,与播放装置相连,包括:解码模块、第一判断模块、缓冲模块和第一休眠模块,其中:
解码模块,与第一判断模块相连,用于获取视频帧和相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
所述的图像帧包括图像和每帧图像对应的时间戳;
第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令和接收第一休眠模块发送的休眠期满指令,请求获取缓冲模块的存储状态,根据所述的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;
所述的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储图像帧和相对时间戳或相对音频时间;
第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令;
所述的等待周期是1000ms*[(缓冲区所能容纳的帧数/2)/帧率];
所述的休眠状态是指解码装置的工作线程不再占用CPU。
播放装置,与解码装置相连,包括:读取模块、第二判断模块、显示模块和第二休眠模块,其中:
读取模块,与第二判断模块相连,用于读取缓存区的图像帧和相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
所述的相对时间戳为每个图像帧所对应的被相对显示时间点,是以0ms开始的时间偏移量,在开始显示时以0ms记录显示起点时间;
第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的对比结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
例如,所述的对比结果可以是指相对系统时间是否小于相对时间戳的判断结果,如果所述的对比结果为否,则向读取模块和显示模块发送显示指令,如果所述的对比结果为是,则向第二休眠模块发送休眠指令;
显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令;
所述的等待周期是1000ms/(帧率*2)(取整数);
所述的休眠状态是指播放装置的工作线程不再占用CPU。
所述的视频解码和播放系统的工作过程如下:
解码装置和播放装置启动时,操作系统设定解码装置与播放装置的优先级,播放装置的优先级高于解码装置的优先级;解码模块对视频帧解码生成图像帧;第一判断模块获取缓冲模块的存储状态,如果未满,第一判断模块向解码模块发送存储指令,解码模块存储图像帧到缓冲模块;如果已满,第一判断模块向第一休眠模块发送休眠指令,解码装置进入一个等待周期的休眠状态;播放装置读取缓冲模块的图像帧,第二判断模块判断相对系统时间是否小于相对时间戳,如果否,第二判断模块向读取模块和显示模块发送显示指令,读取模块向显示模块发送图像帧并显示;如果是,第二判断模块向第二休眠模块发送休眠指令,播放装置进入一个周期的休眠状态。
本发明实施例中操作系统通过控制解码装置与播放装置的优先级,播放装置的优先级比解码装置的优先级高,确保播放装置能够顺畅播放,即使解码装置在解码某一帧占用CPU时间过高时,并不影响播放装置显示图像帧,可以准确的把缓冲区里的图象按时显示,解码装置因解码时CPU占用时间不均匀性不会影像图像的显示,只是存储到缓冲模块即可。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (12)

  1. 一种视频解码的方法, 其特征在于,所述方法 包括以下步骤 :
    读取视频帧,并读取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧;
    判断缓冲区是否已满,如果是,休眠一个等待周期。
  2. 如权利要求1所述的视频解码的方法,其特征在于,所述的步骤'判断缓冲区是否已满'还包括步骤:
    如果否,存储图像帧和相对时间戳到缓冲区,并进入步骤'读取视频帧,并读取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧'。
  3. 如权利要求1所述的视频解码的方法,其特征在于,所述的步骤'休眠一个等待周期'之后还包括步骤'等待周期期满,休眠被唤醒,再次判断缓冲区是否已满'。
  4. 如权利要求1所述的视频解码的方法,其特征在于,等待周期为1000ms*[(缓冲区所能容纳的帧数/2)/帧率]。
  5. 一种视频解码装置, 其特征在于,所述装置 包括解码模块、第一判断模块、缓冲模块和第一休眠模块,其中:
    解码模块,与第一判断模块相连,用于获取视频帧,以及获取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
    第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令,请求获取缓冲模块的存储状态,根据缓冲模块的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;并根据第一休眠模块发送的休眠期满指令,判断所述缓冲模块的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
    缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储所述图像帧和相对时间戳或相对音频时间;
    第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令。
  6. 一种视频播放的方法, 其特征在于,所述方法 包括以下步骤 :
    读取缓冲区的图像帧,并读取相对时间戳或相对音频时间;
    判断相对系统时间是否小于相对时间戳或相对音频时间或者判断相对音频时间是否小于相对时间戳,如果是,休眠一个等待周期。
  7. 如权利要求6所述的视频播放方法,其特征在于,所述的步骤'判断相对系统时间是否小于相对时间戳或相对音频时间或者判断相对音频时间是否小于相对时间戳'还包括步骤:
    如果否,显示图像帧,并进入步骤'读取缓冲区的图像帧和相对时间戳或相对音频时间'。
  8. 如权利要求6所述的视频播放方法,其特征在于,所述的步骤'休眠一个等待周期'之后还包括步骤'等待周期期满,休眠被唤醒,再次判断相对系统时间是否小于相对时间戳或相对音频时间'。
  9. 如权利要求6所述的视频播放方法,其特征在于,所述的一个等待周期是1000ms/(帧率*2)。
  10. 一种视频播放装置, 其特征在于,所述装置 包括读取模块、第二判断模块、显示模块和第二休眠模块,其中:
    读取模块,与第二判断模块相连,用于读取缓存区的图像帧,以及读取相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
    第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的对比结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
    显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
    第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;并用于接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令。
  11. 一种视频解码和播放系统, 其特征在于,所述系统 包括:
    解码装置和播放装置,所述解码装置包括解码模块、第一判断模块、缓冲模块和第一休眠模块,所述播放装置包括读取模块、第二判断模块、显示模块和第二休眠模块,其中:
    解码模块,与第一判断模块相连,用于获取视频帧,以及获取相对时间戳或相对音频时间,对视频帧进行解码并生成图像帧,向第一判断模块发送解码完成的指令,接收第一判断模块的存储指令;
    第一判断模块,与解码模块、缓冲模块和第一休眠模块相连,用于接收解码模块的解码完成的指令,请求获取缓冲模块的存储状态,根据缓冲模块的存储状态向解码模块发送存储指令或向第一休眠模块发送休眠指令;并根据第一休眠模块发送的休眠期满指令,判断所述缓冲模块的存储状态为未满或已满,如果存储状态为未满,则向解码模块发送存储指令,如果存储状态为已满,第一休眠模块发送休眠指令;
    缓冲模块,与第一判断模块相连,用于接收第一判断模块的获取缓冲模块的存储状态的请求,并向第一判断模块发送缓冲模块的存储状态,同时接收解码模块发送的图像帧和相对时间戳或相对音频时间,并存储所述图像帧和相对时间戳或相对音频时间;
    第一休眠模块,与第一判断模块相连,用于接收第一判断模块发送的休眠指令,进入一个等待周期的休眠状态,接收操作系统发送的唤醒指令,向第一判断模块发送休眠期满指令;
    读取模块,与第二判断模块相连,用于读取缓存区的图像帧,以及读取相对时间戳或相对音频时间,向第二判断模块发送读取完成指令,接收第二判断模块的显示指令,发送图像帧;
    第二判断模块,与读取模块、显示模块和第二休眠模块相连,用于接收读取模块的读取完成指令和接收第二休眠模块发送的休眠期满指令,根据相对系统时间与相对时间戳或相对音频时间的对比结果或者根据相对音频时间与相对时间戳的对比结果,向读取模块和显示模块发送显示指令或向第二休眠模块发送休眠指令;
    显示模块,与第二判断模块相连,用于接收第二判断模块的显示指令,获取图像帧并进行显示;
    第二休眠模块,与第二判断模块相连,用于接收第二判断模块发送的休眠指令,进入一个等待周期的休眠状态;并用于接收操作系统发送的唤醒指令,向第二判断模块发送休眠期满指令。
  12. 一种终端设备,其特征在于,包括如权利要求11所述的视频解码和播放系统。
PCT/CN2011/076163 2010-09-27 2011-06-22 一种视频解码和播放的方法、装置、系统和终端设备 WO2012041082A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010294846.2 2010-09-27
CN201010294846.2A CN101951517B (zh) 2010-09-27 2010-09-27 一种视频解码和播放的方法、系统、终端设备

Publications (1)

Publication Number Publication Date
WO2012041082A1 true WO2012041082A1 (zh) 2012-04-05

Family

ID=43454855

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076163 WO2012041082A1 (zh) 2010-09-27 2011-06-22 一种视频解码和播放的方法、装置、系统和终端设备

Country Status (2)

Country Link
CN (1) CN101951517B (zh)
WO (1) WO2012041082A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203960A (zh) * 2016-06-30 2017-09-26 北京新媒传信科技有限公司 图像渲染方法及装置
CN107888938A (zh) * 2016-09-29 2018-04-06 北京视联动力国际信息技术有限公司 一种网络视频播放方法及其装置
CN112686109A (zh) * 2020-12-22 2021-04-20 北京百度网讯科技有限公司 离线视频文件的提取方法、装置、电子设备及存储介质
CN113542795A (zh) * 2020-04-21 2021-10-22 腾讯科技(深圳)有限公司 视频处理方法、装置、电子设备及计算机可读存储介质
CN115619923A (zh) * 2022-09-30 2023-01-17 北京百度网讯科技有限公司 用于虚拟对象的渲染方法、装置、电子设备以及存储介质
CN112686109B (zh) * 2020-12-22 2024-06-21 北京百度网讯科技有限公司 离线视频文件的提取方法、装置、电子设备及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951517B (zh) * 2010-09-27 2014-02-26 深圳市融创天下科技股份有限公司 一种视频解码和播放的方法、系统、终端设备
CN103763635B (zh) * 2013-05-02 2018-07-27 乐视网信息技术(北京)股份有限公司 一种视频缓冲的控制方法和系统
CN104394456B (zh) * 2014-11-20 2017-12-01 福建星网视易信息系统有限公司 一种嵌入式环境下音视频解码的方法及装置
CN106095541B (zh) * 2016-05-31 2019-11-05 深圳市万普拉斯科技有限公司 睡眠管理方法及相关装置
CN107085537B (zh) * 2017-03-22 2019-03-15 武汉斗鱼网络科技有限公司 Flash应用在休眠模式下的运行方法及系统
CN109672931B (zh) 2018-12-20 2020-03-20 北京百度网讯科技有限公司 用于处理视频帧的方法和装置

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588988A (zh) * 2004-07-29 2005-03-02 联合信源数字音视频技术(北京)有限公司 视频解码和显示的同步控制装置及同步方法
CN1816156A (zh) * 2005-02-02 2006-08-09 乐金电子(惠州)有限公司 多媒体数据的同步播放方法
CN101271720A (zh) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 一种手机流媒体音视频的同步方法
CN101466045A (zh) * 2007-12-20 2009-06-24 上海奇码数字信息有限公司 自适应解码同步装置、同步方法及视频解码和显示系统
CN101710992A (zh) * 2009-11-16 2010-05-19 乐视网信息技术(北京)股份有限公司 一种预解码高清播放器及播放方法
CN101778269A (zh) * 2009-01-14 2010-07-14 扬智电子(上海)有限公司 机顶盒的音视频帧的同步方法
CN101951517A (zh) * 2010-09-27 2011-01-19 深圳市融创天下科技发展有限公司 一种视频解码和播放的方法、系统、终端设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1588988A (zh) * 2004-07-29 2005-03-02 联合信源数字音视频技术(北京)有限公司 视频解码和显示的同步控制装置及同步方法
CN1816156A (zh) * 2005-02-02 2006-08-09 乐金电子(惠州)有限公司 多媒体数据的同步播放方法
CN101466045A (zh) * 2007-12-20 2009-06-24 上海奇码数字信息有限公司 自适应解码同步装置、同步方法及视频解码和显示系统
CN101271720A (zh) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 一种手机流媒体音视频的同步方法
CN101778269A (zh) * 2009-01-14 2010-07-14 扬智电子(上海)有限公司 机顶盒的音视频帧的同步方法
CN101710992A (zh) * 2009-11-16 2010-05-19 乐视网信息技术(北京)股份有限公司 一种预解码高清播放器及播放方法
CN101951517A (zh) * 2010-09-27 2011-01-19 深圳市融创天下科技发展有限公司 一种视频解码和播放的方法、系统、终端设备

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107203960A (zh) * 2016-06-30 2017-09-26 北京新媒传信科技有限公司 图像渲染方法及装置
CN107203960B (zh) * 2016-06-30 2021-03-09 北京新媒传信科技有限公司 图像渲染方法及装置
CN107888938A (zh) * 2016-09-29 2018-04-06 北京视联动力国际信息技术有限公司 一种网络视频播放方法及其装置
CN107888938B (zh) * 2016-09-29 2019-02-05 视联动力信息技术股份有限公司 一种网络视频播放方法及其装置
CN113542795A (zh) * 2020-04-21 2021-10-22 腾讯科技(深圳)有限公司 视频处理方法、装置、电子设备及计算机可读存储介质
CN112686109A (zh) * 2020-12-22 2021-04-20 北京百度网讯科技有限公司 离线视频文件的提取方法、装置、电子设备及存储介质
CN112686109B (zh) * 2020-12-22 2024-06-21 北京百度网讯科技有限公司 离线视频文件的提取方法、装置、电子设备及存储介质
CN115619923A (zh) * 2022-09-30 2023-01-17 北京百度网讯科技有限公司 用于虚拟对象的渲染方法、装置、电子设备以及存储介质
CN115619923B (zh) * 2022-09-30 2023-12-12 北京百度网讯科技有限公司 用于虚拟对象的渲染方法、装置、电子设备以及存储介质

Also Published As

Publication number Publication date
CN101951517B (zh) 2014-02-26
CN101951517A (zh) 2011-01-19

Similar Documents

Publication Publication Date Title
WO2012041082A1 (zh) 一种视频解码和播放的方法、装置、系统和终端设备
US9668204B2 (en) Collaborative demand-based dual-mode Wi-Fi network control to optimize wireless power and performance
JP3776870B2 (ja) 情報処理装置および省電力制御方法
US9277230B2 (en) Display mode-based video encoding in wireless display devices
JP4912490B2 (ja) データ処理装置
JP2009044416A (ja) コンテンツ再生装置、コンテンツ再生方法、プログラム、およびコンテンツ再生システム
WO2012068893A1 (zh) 直播节目的回看方法、装置及终端
WO2016179918A1 (zh) 一种实现应用控制的方法及终端
KR20110065100A (ko) 멀티미디어 스트리밍 서비스를 지원하는 방법 및 장치
US11050805B2 (en) Method of controlling stream buffer in media playback device and related buffering device
US8605217B1 (en) Jitter cancellation for audio/video synchronization in a non-real time operating system
JP5428734B2 (ja) ネットワーク機器、情報処理装置、ストリーム切替方法、情報処理方法、プログラムおよびコンテンツ配信システム
CN114173208A (zh) 基于hdmi接口的音箱系统音视频播放控制方法及装置
TW201006169A (en) Unsupervised traffic estimation for low-power media streaming
WO2015074623A1 (zh) 视频播放方法和装置、智能终端
KR20110006949A (ko) 무선 통신망에서 슬립모드를 제어하는 방법 및 장치
WO2011137796A1 (zh) 休眠状态的控制方法,装置及系统
JP2006019888A (ja) 記録装置および記録制御方法
TWI526816B (zh) 媒體播放節能系統及方法
JP2012222689A (ja) 再生装置及び再生方法
JP2008096906A (ja) オーディオ信号復号装置およびリソースアクセス制御方法
CN105812938B (zh) 交互式网络电视的播放控制方法和装置
TWI439075B (zh) 纜線數據機及其與頭端同步的方法
CN115361578A (zh) 一种播放方法、装置和电子设备
JP5994483B2 (ja) 通信システム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11827978

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 08-08-13)

122 Ep: pct application non-entry in european phase

Ref document number: 11827978

Country of ref document: EP

Kind code of ref document: A1