CN109996104A - A kind of video broadcasting method, device and electronic equipment - Google Patents

A kind of video broadcasting method, device and electronic equipment Download PDF

Info

Publication number
CN109996104A
CN109996104A CN201910322732.5A CN201910322732A CN109996104A CN 109996104 A CN109996104 A CN 109996104A CN 201910322732 A CN201910322732 A CN 201910322732A CN 109996104 A CN109996104 A CN 109996104A
Authority
CN
China
Prior art keywords
video frame
texture cache
cache queue
electronic equipment
thread
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.)
Pending
Application number
CN201910322732.5A
Other languages
Chinese (zh)
Inventor
陈建生
黄为庆
刘小辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910322732.5A priority Critical patent/CN109996104A/en
Publication of CN109996104A publication Critical patent/CN109996104A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • 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/41Structure of client; Structure of client peripherals
    • H04N21/426Internal components of the client ; Characteristics thereof
    • 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
    • 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

Abstract

The embodiment of the invention provides a kind of video broadcasting method, device and electronic equipments, applied to electronic equipment, the described method includes: the decoding thread of the electronic equipment decodes the first video frame after the current video frame during playing current video frame, the second video frame is obtained;Texture cache queue is written in second video frame by the decoding thread of the electronic equipment, wherein the spatial cache of the texture cache queue is not less than space shared by second video frame;The rendering thread of the electronic equipment reads second video frame from the texture cache queue, renders second video frame, obtains third video frame, and play the third video frame.As it can be seen that the technical solution provided through the embodiment of the present invention, can be improved the fluency of video playing, the video viewing experience of user is improved.

Description

A kind of video broadcasting method, device and electronic equipment
Technical field
The present invention relates to multimedia technology fields, more particularly to a kind of video broadcasting method, device and electronic equipment.
Background technique
With the continuous development of computer technology, electronic equipment using more and more extensive, user often uses electronics Equipment watches video.The detailed process of electronic equipment broadcasting video are as follows: each video frame of the electronic equipment to video to be played Decoding operate is first carried out, then carries out Rendering operations, and then the video frame after being rendered, and plays the video frame after rendering.
However, inventor has found in the implementation of the present invention, at least there are the following problems for the prior art:
The decoding performance of electronic equipment is unstable sometimes, causes to decode some video frames when may consume longer Between, there is Caton so as to cause video playing, video display effect is poor, thereby reduces the video viewing experience of user.
Summary of the invention
The embodiment of the present invention is designed to provide a kind of video broadcasting method, device and electronic equipment, to solve to regard Occur Caton, the poor technical problem of video display effect in frequency playing process.Specific technical solution is as follows:
In a first aspect, being applied to electronic equipment, the method packet the embodiment of the invention provides a kind of video broadcasting method It includes:
During playing current video frame, the decoding thread of the electronic equipment is decoded after the current video frame The first video frame, obtain the second video frame;
Texture cache queue is written in second video frame by the decoding thread of the electronic equipment, wherein the texture cache The spatial cache of queue is not less than space shared by second video frame;
The rendering thread of the electronic equipment reads second video frame from the texture cache queue, renders described the Two video frames obtain third video frame, and play the third video frame.
Optionally, the step of texture cache queue is written in the second video frame by the decoding thread of the electronic equipment, comprising:
The decoding thread of the electronic equipment is by occupying rendering thread context or sharing rendering thread context Mode copies the second video frame to texture cache queue deeply.
Optionally, the buffer status of the texture cache queue include: can write state, readable state or just in read states.
Optionally, the step of texture cache queue is written in the second video frame by the decoding thread of the electronic equipment, comprising:
The buffer status of texture cache queue be can write state, the decoding thread of the electronic equipment writes the second video frame Enter texture cache queue.
Optionally, the buffer status in texture cache queue be can write state when, the decoding of the electronic equipment After the step of texture cache queue is written in second video frame by thread, the method also includes:
The decoding thread of the electronic equipment by the buffer status of the texture cache queue by can write state be changed to can Read states.
Optionally, the rendering thread of the electronic equipment reads the step of second video frame from the texture cache queue Suddenly, comprising:
When the buffer status of the texture cache queue is readable state, the rendering thread of the electronic equipment is from described Second video frame is read in texture cache queue.
Optionally, the buffer status in the texture cache queue is readable state, the rendering of the electronic equipment After the step of thread reads second video frame from the texture cache queue, the method also includes:
The buffer status of the texture cache queue is positive by the rendering thread of the electronic equipment by readable state change In read states;
Also, in the step of rendering thread of the electronic equipment renders second video frame, obtains third video frame Later, the method also includes:
By the buffer status of the texture cache queue by be just changed in read states can write state.
Optionally, the step of the first video frame after the decoding thread of the electronic equipment decodes the current video frame After rapid, the method also includes:
Video frame is shown that texture cache queue is written in duration by the decoding thread of the electronic equipment, so that the electronics The rendering thread of equipment reads the video frame from the texture cache queue and shows duration, and controls the third video frame Playing duration is that the video frame shows duration.
Optionally, the method also includes:
After receiving fast-forward play instruction, the decoding thread of the electronic equipment obtains the fast-forward play instruction and corresponds to The F.F. period;
The decoding thread of the electronic equipment deletes the F.F. period corresponding from the texture cache queue Two video frames.
Second aspect, the embodiment of the invention provides a kind of video play devices, are applied to electronic equipment, described device packet It includes:
Decoder module is used for during playing current video frame, decodes the first view after the current video frame Frequency frame obtains the second video frame;
First writing module, for texture cache queue to be written in the second video frame, wherein the texture cache queue Spatial cache is not less than space shared by second video frame;
Read module, for rendering second video frame from texture cache queue reading second video frame, Third video frame is obtained, and plays the third video frame.
Optionally, the write module is specifically used for:
By way of occupying rendering thread context or shared rendering thread context, the second video frame is copied deeply To texture cache queue.
Optionally, the buffer status of the texture cache queue include: can write state, readable state or just in read states.
Optionally, the write module is specifically used for:
Texture cache queue buffer status be can write state when, by the second video frame be written texture cache queue.
Optionally, described device further include:
First state changes module, after texture cache queue is written in the second video frame, by the texture cache The buffer status of queue by can write state be changed to readable state.
Optionally, the read module, is specifically used for:
When the buffer status of the texture cache queue is readable state, described the is read from the texture cache queue Two video frames.
Optionally, described device further include:
Second state change module is specifically used for after reading second video frame from the texture cache queue, by institute The buffer status for stating texture cache queue is changed to just by readable state in read states;
Also, described device further include:
The third state changes module, for after obtaining third video frame, by the caching shape of the texture cache queue State is by be just changed in read states can write state.
Optionally, described device further include:
Second writing module obtains the second video frame for the first video frame after decoding the current video frame Later, video frame is shown that texture cache queue is written in duration, so that the rendering thread of the electronic equipment is from the texture Buffer queue reads the video frame and shows duration, and the playing duration for controlling the third video frame is that the video frame is shown Duration.
Optionally, described device further include:
Period obtains module, corresponding for after receiving fast-forward play instruction, obtaining the fast-forward play instruction The F.F. period;
Video frame removing module, for deleting the F.F. period corresponding second view from the texture cache queue Frequency frame.
The third aspect, the embodiment of the invention also provides a kind of electronic equipment, including processor, communication interface, memory And communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes video broadcasting method described in first aspect.
At the another aspect that the present invention is implemented, a kind of computer readable storage medium is additionally provided, it is described computer-readable Instruction is stored in storage medium, when run on a computer, so that computer executes video described in first aspect and broadcasts Put method.
At the another aspect that the present invention is implemented, the embodiment of the invention also provides a kind of, and the computer program comprising instruction is produced Product, when run on a computer, so that computer executes video broadcasting method described in first aspect.
Technical solution provided in an embodiment of the present invention synchronizes, in a frame during video playing in order to guarantee that sound is drawn After presentation of video frames comes out, it will usually stop display a period of time.Therefore, during playing current video frame, that is, working as During preceding video frame stops display, the decoding thread of electronic equipment can decode the first video after current video frame Frame obtains the second video frame;And texture cache queue is written into the second video frame;The rendering thread of electronic equipment can be from texture Buffer queue reads the second video frame, renders the second video frame, obtains third video frame, and play third video frame.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, can also be improved the video viewing experience of user.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described.
Fig. 1 is a kind of flow chart of video broadcasting method provided by the embodiment of the present invention;
Fig. 2 is the flow chart of another kind video broadcasting method provided by the embodiment of the present invention;
Fig. 3 is a kind of structural schematic diagram of video play device provided by the embodiment of the present invention;
Fig. 4 is the structural schematic diagram of a kind of electronic equipment provided by the embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention is described.
With the continuous development of computer technology, electronic equipment using more and more extensive, user often uses electronics Equipment watches video.The detailed process of electronic equipment broadcasting video are as follows: each video frame of the electronic equipment to video to be played Decoding operate is first carried out, then carries out Rendering operations, and then the video frame after being rendered, and plays the video frame after rendering.
However, in practical applications, the decoding performance of electronic equipment is unstable sometimes, for example, for some low side electricity For sub- equipment and the electronic equipment for not supporting adaptive code stream to switch, decoding performance is unstable sometimes, causes to decode Some video frames may consume longer time, Caton occur so as to cause video playing, video display effect is poor, in turn Reduce the video viewing experience of user.
In order to solve the above-mentioned technical problem, the embodiment of the invention provides a kind of video broadcasting method, device and electronics to set It is standby, to improve the fluency of video playing, improve the video viewing experience of user.
A kind of video broadcasting method provided in an embodiment of the present invention is described in detail first below.
Wherein, a kind of video broadcasting method provided in an embodiment of the present invention is applied to electronic equipment, which can be with It is mobile phone, plate and computer etc., the embodiment of the present invention is not specifically limited electronic equipment.
As shown in Figure 1, a kind of video broadcasting method provided in an embodiment of the present invention, is applied to electronic equipment, the method Include:
S110, during playing current video frame, after the decoding thread decoding current video frame of electronic equipment First video frame obtains the second video frame.
It is synchronized to guarantee that sound is drawn, after a frame presentation of video frames comes out, it will usually stop display a period of time.It is playing During current video frame, i.e., during current video frame stops display, the decoding thread of electronic equipment, which can decode, works as Video frame after preceding video frame, for the convenience of description, the video frame after the current video frame can be known as the first video Frame, and the video frame that decoding obtains is known as the second video frame.
It is understood that the first video frame can be the frame video frame after current video frame, alternatively, current video A few frame video frames after frame, the frame number of the first video frame is determines according to actual conditions.Current video frame stops the time of display Longer, the frame number that the decoding thread of electronic equipment is capable of decoded first video frame is more.
Texture cache queue is written in second video frame by the decoding thread of S120, electronic equipment, wherein texture cache queue Spatial cache not less than space shared by the second video frame.
Wherein, texture cache queue is a buffer area in video memory, is stored in the texture cache queue to be rendered Video frame, i.e., the second video frame in storage in the texture cache queue.The texture cache queue can be by the first of electronic equipment Thread is established, this is all reasonable.For example, what the decoding thread that the texture cache queue can be electronic equipment was established, specifically , what the decoding thread which can be electronic equipment pre-established, it is also possible to the decoding line of electronic equipment What journey obtained establishing after the second video frame, this is all reasonable.Also, since texture cache queue is for storing the second video Frame, therefore, the spatial cache of texture cache queue is not less than space shared by the second video frame.
After electronic equipment obtains the second video frame, texture cache queue, such texture cache is written into the second video frame It can be stored with the video frame decoded in advance in queue, be conducive in subsequent step, it is unstable in the decoding performance of electronic equipment When, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e. the rendering of electronic equipment Thread can obtain the video frame decoded from texture cache queue.
It should be noted that the decoding thread that texture cache queue can be electronic equipment pre-established, it is also possible to What the decoding thread of electronic equipment obtained establishing after the second video frame.Since texture cache queue is for storing the second video frame, Therefore, the cache size of texture cache queue is more than or equal to the size of the second video frame.
In one embodiment, the step of texture cache queue is written in the second video frame by the decoding thread of electronic equipment Suddenly, may include:
The decoding thread of electronic equipment by way of occupying rendering thread context or shared rendering thread context, Copy the second video frame to texture cache queue deeply.
In this embodiment, the decoding thread of electronic equipment is by occupying rendering thread context or shared rendering line The mode of journey context copies the second video frame to texture cache queue deeply, in this way, the rendering thread of electronic equipment can be real The video frame decoded is stored in Shi get Zhi texture cache queue, the rendering thread of electronic equipment can be from texture cache queue Obtain the video frame decoded.
The rendering thread of S130, electronic equipment read the second video frame from texture cache queue, render the second video frame, obtain To third video frame, and play third video frame.
After texture cache queue is written in second video frame by the rendering thread of electronic equipment, since the second video frame is electronics The video frame obtained after the decoding thread decoding of equipment, therefore, the rendering thread of electronic equipment can be read from texture cache queue The second video frame is taken, the second video frame is rendered, obtains third video frame, and play third video frame.
Also, in the present solution, since the video frame decoded being stored in texture cache queue in advance, that is to say, that The video frame decoded i.e. the second video frame is stored in advance in video memory, in this way, the rendering thread of electronic equipment is in rendering the When two video frames, the second video frame can be directly obtained from video memory, and is not had to as the prior art, and electronic equipment is rendering When video frame, need to obtain video frame from memory.It will be appreciated by persons skilled in the art that the rendering thread of electronic equipment It is greater than the speed that video frame is obtained from memory from the speed for obtaining video frame in video memory, it is seen then that implement mention through the invention The speed of rendering thread render video frame can be improved in the technical solution of confession.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, to improve video playing Fluency improves the video viewing experience of user.
It is illustrated to be provided for the embodiments of the invention video broadcasting method in further detail, the embodiment of the present invention Additionally provide another video broadcasting method.
It should be noted that the buffer status of texture cache queue may include that write state, readable state or can read State.Wherein, can write state be used to indicate that decoded view can be written to texture cache queue in the decoding thread of electronic equipment Frequency frame;Readable state is used to indicate that the rendering thread of electronic equipment can to read the video frame decoded from texture cache queue; Just it is used to indicate that the rendering thread of electronic equipment to read the video frame decoded from texture cache queue in read states.
As shown in Fig. 2, another kind video broadcasting method provided by the embodiment of the present invention, may include:
S210, during playing current video frame, after the decoding thread decoding current video frame of electronic equipment First video frame obtains the second video frame.
Since the S210 of embodiment illustrated in fig. 2 and the S110 of embodiment illustrated in fig. 1 are identical, the embodiment of the present invention pair S210 is not specifically limited.
S220, the buffer status of texture cache queue be can write state when, the decoding thread of electronic equipment is by the second view Texture cache queue is written in frequency frame.
The decoding thread of electronic equipment may determine that texture cache queue caching whether be can write state, if texture is slow Deposit queue buffer status be can write state, illustrate electronic equipment decoding thread can to texture cache queue be written it is decoded Texture cache queue can be written in second video frame by video frame, therefore, the decoding thread of electronic equipment.
S230, the decoding thread of electronic equipment by the buffer status of texture cache queue by can write state be changed to readable shape State.
After texture cache queue is written in second video frame by the decoding thread of electronic equipment, illustrate in texture cache queue There may be the video frame decoded, the rendering thread of electronic equipment can obtain the video decoded from texture cache queue Frame, therefore, the decoding thread of electronic equipment can by the buffer status of texture cache queue by can write state be changed to readable shape State.
S240, when the buffer status of texture cache queue is readable state, the rendering thread of electronic equipment is slow from texture It deposits queue and reads the second video frame.
The rendering thread of electronic equipment may determine that whether the buffer status of texture cache queue is readable state, if line The buffer status for managing buffer queue is readable state, illustrates to be stored with the video frame decoded in texture cache queue, therefore, electricity The rendering thread of sub- equipment can read the second video frame from texture cache queue.
The buffer status of texture cache queue is changed to reading by the rendering thread of S250, electronic equipment by readable state State.
During the rendering thread of electronic equipment reads the second video frame from texture cache queue, texture can be delayed The buffer status for depositing queue is changed to just by readable state in read states.
The rendering thread of S260, electronic equipment render the second video frame, obtain third video frame.
The rendering thread of electronic equipment carries out the second video frame after obtaining the second video frame from texture cache queue Rendering operations obtain third video frame.Wherein, during electronic equipment renders the second video frame, texture cache queue Buffer status is constantly in just in read states, and during this, the decoding thread of electronic equipment will not be write to texture cache queue Enter the second video frame.
The buffer status of texture cache queue is changed to by just in read states writeable by S270, the rendering thread of electronic equipment State.
The second video frame is rendered in the rendering thread of electronic equipment, after obtaining third video frame, electronic equipment Rendering thread can be by the buffer status of texture cache queue by be just changed in read states can write state.
The rendering thread of S280, electronic equipment play third video frame.
The rendering thread of electronic equipment synchronizes, third video during playing third video frame in order to guarantee that sound is drawn Frame can stop display a period of time, during this period of time, the buffer status of texture cache queue be can write state, at this point, electronics The video frame decoded can be written to texture cache queue in the decoding thread of equipment.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, can also be improved the video viewing experience of user.
Also, not only texture cache queue can be written in the second video frame by the decoding thread of electronic equipment, can also be incited somebody to action Video frame shows that texture cache queue is written in duration.In one embodiment, current in the decoding thread decoding of electronic equipment After the step of the first video frame after video frame, video broadcasting method can also include:
Video frame is shown that texture cache queue is written in duration by the decoding thread of electronic equipment, so that the wash with watercolours of electronic equipment It contaminates thread and reads video frame display duration from texture cache queue, and the playing duration for controlling third video frame is that video frame is shown Duration.
In this embodiment, video frame is shown that texture cache queue is written in duration by the decoding thread of electronic equipment, this Sample, the rendering thread of electronic equipment can not only read the second video frame from texture cache queue, can also be from texture cache Queue reads video frame and shows duration, and the playing duration for controlling third video frame is that video frame shows duration, i.e. third video The period that frame stops display is that video frame shows duration.
Moreover, in practical applications, user, may fast-forward play view during using electronic equipment viewing video Frequency or pause play video.In one embodiment, video broadcasting method can also include:
After receiving fast-forward play instruction, when the decoding thread of electronic equipment obtains fast-forward play instruction corresponding F.F. Between section;
The decoding thread of electronic equipment deletes F.F. period corresponding second video frame from texture cache queue.
In this embodiment, electronic equipment sends fast-forward play instruction, electricity to electronic equipment in fast-forward play video After receiving fast-forward play instruction, the decoding thread of electronic equipment obtains fast-forward play and instructs the corresponding F.F. time sub- equipment Section, and F.F. period corresponding second video frame is deleted from texture cache queue, be conducive to electronic equipment so accurately Video is played, and then improves the viewing experience of user.For example, the currently playing moment is the 100th second, fast-forward play instruction pair The F.F. period answered is the 100th second to the 200th second, and therefore, the decoding thread of electronic equipment is deleted from texture cache queue 100th second to the 200th second corresponding second time period.
After receiving pause play instruction, rendering thread stops reading the second video from texture cache queue electronic equipment Frame and stopping the second video frame of rendering, and decode thread and stop the first video frame of decoding and stop to texture cache queue write-in Second video frame.
Second aspect, the embodiment of the invention provides a kind of video play devices, are applied to electronic equipment, as shown in figure 3, Described device includes:
Decoder module 310, for decoding first after the current video frame during playing current video frame Video frame obtains the second video frame;
First writing module 320, for texture cache queue to be written in the second video frame, wherein the texture cache team The spatial cache of column is not less than space shared by second video frame;
Read module 330 renders second video for reading second video frame from the texture cache queue Frame obtains third video frame, and plays the third video frame.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, the video viewing experience of user can also be improved.
Optionally, the write module is specifically used for:
By way of occupying rendering thread context or shared rendering thread context, the second video frame is copied deeply To texture cache queue.
Optionally, the buffer status of the texture cache queue include: can write state, readable state or just in read states.
Optionally, the write module is specifically used for:
Texture cache queue buffer status be can write state when, by the second video frame be written texture cache queue.
Optionally, described device further include:
First state changes module, after texture cache queue is written in the second video frame, by the texture cache The buffer status of queue by can write state be changed to readable state.
Optionally, the read module, is specifically used for:
When the buffer status of the texture cache queue is readable state, described the is read from the texture cache queue Two video frames.
Optionally, described device further include:
Second state change module is specifically used for after reading second video frame from the texture cache queue, by institute The buffer status for stating texture cache queue is changed to just by readable state in read states;
Also, described device further include:
The third state changes module, for after obtaining third video frame, by the caching shape of the texture cache queue State is by be just changed in read states can write state.
Optionally, described device further include:
Second writing module obtains the second video frame for the first video frame after decoding the current video frame Later, video frame is shown that texture cache queue is written in duration, so that the rendering thread of the electronic equipment is from the texture Buffer queue reads the video frame and shows duration, and the playing duration for controlling the third video frame is that the video frame is shown Duration.
Optionally, described device further include:
Period obtains module, corresponding for after receiving fast-forward play instruction, obtaining the fast-forward play instruction The F.F. period;
Video frame removing module, for deleting the F.F. period corresponding second view from the texture cache queue Frequency frame.
The third aspect, the embodiment of the invention also provides a kind of electronic equipment, as shown in figure 4, including processor 401, logical Believe interface 402, memory 403 and communication bus 404, wherein processor 401, communication interface 402, memory 403 pass through communication Bus 404 completes mutual communication,
Memory 403, for storing computer program;
Processor 401 when for executing the program stored on memory 403, realizes that video described in first aspect is broadcast Put method.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Component Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc.. Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), also may include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array, Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, the video viewing experience of user can also be improved.
Fourth aspect additionally provides a kind of computer readable storage medium in another embodiment provided by the invention, should Instruction is stored in computer readable storage medium, when run on a computer, so that computer executes above-described embodiment In any video broadcasting method.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, the video viewing experience of user can also be improved.
5th aspect, in another embodiment provided by the invention, additionally provides a kind of computer program comprising instruction Product, when run on a computer, so that computer executes any video broadcasting method in above-described embodiment.
As it can be seen that the technical solution provided through the embodiment of the present invention, while current video frame is stopped and shown, electronics is set Standby decoding thread can decode the first video frame after current video frame, and the second video frame that decoding obtains is stored in In texture cache queue, it can be stored with the video frame decoded in advance in such texture cache queue, therefore, in electronic equipment When decoding performance is unstable, electronic equipment can use the video frame being stored in advance in texture cache queue and be buffered, i.e., The rendering thread of electronic equipment can obtain the video frame decoded from texture cache queue, so as to improve video playing Fluency, the video viewing experience of user can also be improved.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.The computer program Product includes one or more computer instructions.When loading on computers and executing the computer program instructions, all or It partly generates according to process or function described in the embodiment of the present invention.The computer can be general purpose computer, dedicated meter Calculation machine, computer network or other programmable devices.The computer instruction can store in computer readable storage medium In, or from a computer readable storage medium to the transmission of another computer readable storage medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, number from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer readable storage medium can be any usable medium that computer can access or It is comprising data storage devices such as one or more usable mediums integrated server, data centers.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disk Solid State Disk (SSD)) etc..
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device, For electronic equipment, storage medium and computer program product embodiments, since it is substantially similar to the method embodiment, so retouching That states is fairly simple, and the relevent part can refer to the partial explaination of embodiments of method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (19)

1. a kind of video broadcasting method, which is characterized in that be applied to electronic equipment, which comprises
During playing current video frame, the decoding thread of the electronic equipment decodes after the current video frame One video frame obtains the second video frame;
Texture cache queue is written in second video frame by the decoding thread of the electronic equipment, wherein the texture cache queue Spatial cache not less than space shared by second video frame;
The rendering thread of the electronic equipment reads second video frame from the texture cache queue, renders second view Frequency frame obtains third video frame, and plays the third video frame.
2. the method according to claim 1, wherein the decoding thread of the electronic equipment writes the second video frame The step of entering texture cache queue, comprising:
The decoding thread of the electronic equipment by way of occupying rendering thread context or shared rendering thread context, Copy the second video frame to texture cache queue deeply.
3. the method according to claim 1, wherein the buffer status of the texture cache queue includes: writeable State, readable state or just in read states.
4. according to the method described in claim 3, it is characterized in that, the decoding thread of the electronic equipment writes the second video frame The step of entering texture cache queue, comprising:
Texture cache queue buffer status be can write state when, the decoding thread of the electronic equipment writes the second video frame Enter texture cache queue.
5. according to the method described in claim 4, it is characterized in that, being writeable in the buffer status in texture cache queue When state, after the step of texture cache queue is written in the second video frame by the decoding thread of the electronic equipment, the method Further include:
The decoding thread of the electronic equipment by the buffer status of the texture cache queue by can write state be changed to readable shape State.
6. according to the method described in claim 3, it is characterized in that, the rendering thread of the electronic equipment is from the texture cache The step of second video frame, is read in queue, comprising:
When the buffer status of the texture cache queue is readable state, the rendering thread of the electronic equipment is from the texture Buffer queue reads second video frame.
7. according to the method described in claim 6, it is characterized in that, the buffer status in the texture cache queue is can After the step of read states, the rendering thread of the electronic equipment reads second video frame from the texture cache queue, The method also includes:
The buffer status of the texture cache queue is changed to reading by the rendering thread of the electronic equipment by readable state State;
Also, after the step of rendering thread of the electronic equipment renders second video frame, obtains third video frame, The method also includes:
By the buffer status of the texture cache queue by be just changed in read states can write state.
8. method according to any one of claims 1 to 7, which is characterized in that in the decoding thread solution of the electronic equipment After the step of the first video frame after the code current video frame, the method also includes:
Video frame is shown that texture cache queue is written in duration by the decoding thread of the electronic equipment, so that the electronic equipment Rendering thread read the video frame from the texture cache queue and show duration, and control the broadcasting of the third video frame Video frame described in Shi Changwei shows duration.
9. method according to any one of claims 1 to 7, which is characterized in that the method also includes:
After receiving fast-forward play instruction, it is corresponding fast that the decoding thread of the electronic equipment obtains the fast-forward play instruction Into the period;
The decoding thread of the electronic equipment deletes the F.F. period corresponding second view from the texture cache queue Frequency frame.
10. a kind of video play device, which is characterized in that be applied to electronic equipment, described device includes:
Decoder module, for decoding the first video frame after the current video frame during playing current video frame, Obtain the second video frame;
First writing module, for texture cache queue, the cache size of the texture cache queue to be written in the second video frame More than or equal to the size of second video frame;
Read module renders second video frame, obtains for reading second video frame from the texture cache queue Third video frame, and play the third video frame.
11. device according to claim 10, which is characterized in that the write module is specifically used for:
By way of occupying rendering thread context or shared rendering thread context, the second video frame is copied to line deeply Manage buffer queue.
12. device according to claim 10, which is characterized in that the buffer status of the texture cache queue includes: can Write state, readable state or just in read states.
13. device according to claim 12, which is characterized in that the write module is specifically used for:
Texture cache queue buffer status be can write state when, by the second video frame be written texture cache queue.
14. device according to claim 12, which is characterized in that described device further include:
First state changes module, after texture cache queue is written in the second video frame, by the texture cache queue Buffer status by can write state be changed to readable state.
15. device according to claim 12, which is characterized in that the read module is specifically used for:
When the buffer status of the texture cache queue is readable state, second view is read from the texture cache queue Frequency frame.
16. device according to claim 15, which is characterized in that described device further include:
Second state change module, is specifically used for: after texture cache queue reading second video frame, by the line The buffer status of reason buffer queue is changed to just by readable state in read states;
Also, described device further include:
The third state changes module, for after obtaining third video frame, by the buffer status of the texture cache queue by Just being changed in read states can write state.
17. device according to any one of claims 10 to 16, which is characterized in that described device further include:
Second writing module, for the first video frame after decoding the current video frame, after obtaining the second video frame, Video frame is shown that texture cache queue is written in duration, so that the rendering thread of the electronic equipment is from the texture cache team Column read the video frame and show duration, and the playing duration for controlling the third video frame is that the video frame shows duration.
18. device according to any one of claims 10 to 16, which is characterized in that described device further include:
Period obtains module, for obtaining the fast-forward play and instructing corresponding F.F. after receiving fast-forward play instruction Period;
Video frame removing module, for deleting the F.F. period corresponding second video from the texture cache queue Frame.
19. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing Device, communication interface, memory complete mutual communication by communication bus;
Memory, for storing computer program;
Processor when for executing the program stored on memory, realizes any method and step of claim 1-9.
CN201910322732.5A 2019-04-22 2019-04-22 A kind of video broadcasting method, device and electronic equipment Pending CN109996104A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910322732.5A CN109996104A (en) 2019-04-22 2019-04-22 A kind of video broadcasting method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910322732.5A CN109996104A (en) 2019-04-22 2019-04-22 A kind of video broadcasting method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN109996104A true CN109996104A (en) 2019-07-09

Family

ID=67132906

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910322732.5A Pending CN109996104A (en) 2019-04-22 2019-04-22 A kind of video broadcasting method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109996104A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502294A (en) * 2019-07-20 2019-11-26 华为技术有限公司 The method, apparatus and electronic equipment of data processing
CN110708609A (en) * 2019-08-05 2020-01-17 青岛海信传媒网络技术有限公司 Video playing method and device
CN110727520A (en) * 2019-10-23 2020-01-24 四川长虹电器股份有限公司 Implementation method for optimizing Android frame animation
CN110753265A (en) * 2019-10-28 2020-02-04 北京奇艺世纪科技有限公司 Data processing method and device and electronic equipment
CN112954233A (en) * 2021-01-29 2021-06-11 稿定(厦门)科技有限公司 Video synthesis system and method based on GPU
WO2021232931A1 (en) * 2020-05-20 2021-11-25 中兴通讯股份有限公司 Channel switching method and apparatus, and device, system, and storage medium
CN114157918A (en) * 2021-11-02 2022-03-08 统信软件技术有限公司 Media file playing method and device, computing equipment and readable storage medium
CN114205662A (en) * 2021-12-13 2022-03-18 北京蔚领时代科技有限公司 Low-delay video rendering method and device for iOS (internet operating system) end
CN115209216A (en) * 2022-06-22 2022-10-18 浙江宇视科技有限公司 Video playing method and device and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101793557A (en) * 2009-12-18 2010-08-04 中国科学院西安光学精密机械研究所 Real-time data acquisition system and method of high-resolution imaging instrument
US20110110650A1 (en) * 2009-10-06 2011-05-12 Ipera Technology, Inc. Method and system for real-time video playback
CN105187897A (en) * 2015-09-09 2015-12-23 北京暴风科技股份有限公司 Multi-segment media file cross-segment playing method and system
CN105871916A (en) * 2016-06-08 2016-08-17 浙江宇视科技有限公司 Video stream transmission and display processing method, device and system
CN109194960A (en) * 2018-11-13 2019-01-11 北京奇艺世纪科技有限公司 A kind of picture frame rendering method, device and electronic equipment
CN109587570A (en) * 2017-09-29 2019-04-05 腾讯科技(深圳)有限公司 The playing method and device of video

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110110650A1 (en) * 2009-10-06 2011-05-12 Ipera Technology, Inc. Method and system for real-time video playback
CN101793557A (en) * 2009-12-18 2010-08-04 中国科学院西安光学精密机械研究所 Real-time data acquisition system and method of high-resolution imaging instrument
CN105187897A (en) * 2015-09-09 2015-12-23 北京暴风科技股份有限公司 Multi-segment media file cross-segment playing method and system
CN105871916A (en) * 2016-06-08 2016-08-17 浙江宇视科技有限公司 Video stream transmission and display processing method, device and system
CN109587570A (en) * 2017-09-29 2019-04-05 腾讯科技(深圳)有限公司 The playing method and device of video
CN109194960A (en) * 2018-11-13 2019-01-11 北京奇艺世纪科技有限公司 A kind of picture frame rendering method, device and electronic equipment

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110502294A (en) * 2019-07-20 2019-11-26 华为技术有限公司 The method, apparatus and electronic equipment of data processing
CN110502294B (en) * 2019-07-20 2021-08-20 华为技术有限公司 Data processing method and device and electronic equipment
CN110708609A (en) * 2019-08-05 2020-01-17 青岛海信传媒网络技术有限公司 Video playing method and device
CN110727520A (en) * 2019-10-23 2020-01-24 四川长虹电器股份有限公司 Implementation method for optimizing Android frame animation
CN110753265A (en) * 2019-10-28 2020-02-04 北京奇艺世纪科技有限公司 Data processing method and device and electronic equipment
CN110753265B (en) * 2019-10-28 2022-04-19 北京奇艺世纪科技有限公司 Data processing method and device and electronic equipment
WO2021232931A1 (en) * 2020-05-20 2021-11-25 中兴通讯股份有限公司 Channel switching method and apparatus, and device, system, and storage medium
CN112954233A (en) * 2021-01-29 2021-06-11 稿定(厦门)科技有限公司 Video synthesis system and method based on GPU
CN114157918A (en) * 2021-11-02 2022-03-08 统信软件技术有限公司 Media file playing method and device, computing equipment and readable storage medium
CN114205662A (en) * 2021-12-13 2022-03-18 北京蔚领时代科技有限公司 Low-delay video rendering method and device for iOS (internet operating system) end
CN114205662B (en) * 2021-12-13 2024-02-20 北京蔚领时代科技有限公司 Low-delay video rendering method and device of iOS (integrated operation system) terminal
CN115209216A (en) * 2022-06-22 2022-10-18 浙江宇视科技有限公司 Video playing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN109996104A (en) A kind of video broadcasting method, device and electronic equipment
KR101477434B1 (en) Out-of-order command execution in a multimedia processor
WO2017076289A1 (en) Method and device for playing video
KR101931073B1 (en) Frame-Based Clock Rate Adjustment for Processing Units
US9164908B2 (en) Managing out-of-order memory command execution from multiple queues while maintaining data coherency
US9928168B2 (en) Non-volatile random access system memory with DRAM program caching
KR101034080B1 (en) Uniform video decoding and display
CN108566634B (en) Method and device for reducing continuous awakening delay of Bluetooth sound box and Bluetooth sound box
TW201933875A (en) Information display method and apparatus
WO2020248909A1 (en) Video decoding method and apparatus, computer device, and storage medium
EP3410290B1 (en) Audio processing method, server, user equipment, and system
WO2017202175A1 (en) Method and device for video compression and electronic device
CN109195010A (en) A kind of code rate adjustment method and device
CN109284183A (en) Cardon playback method, device, computer storage medium and terminal
WO2021073206A1 (en) Video preview method and apparatus, and storage medium and electronic device
US20070233819A1 (en) Content playing system, playing apparatus, streaming play method and computer-readable recording medium
CN109672745A (en) The online control method for playing back of audio and device for FreeRTOS
CN113301424A (en) Play control method, device, storage medium and program product
CN108521604A (en) Redirect the multi-display method and device of video
CN111225242A (en) Video playing disaster tolerance method and device and computer storage medium
CN116954947A (en) Data request processing method, device, equipment and storage medium
US10685630B2 (en) Just-in time system bandwidth changes
CN115209216A (en) Video playing method and device and electronic equipment
CN113986849A (en) Music caching method and device, electronic equipment and storage medium
CN107301868B (en) Audio decoding system and audio decoding method

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190709

RJ01 Rejection of invention patent application after publication