CN106993220A - Method and device for adjusting multimedia decoding information buffer zone - Google Patents

Method and device for adjusting multimedia decoding information buffer zone Download PDF

Info

Publication number
CN106993220A
CN106993220A CN201710252385.4A CN201710252385A CN106993220A CN 106993220 A CN106993220 A CN 106993220A CN 201710252385 A CN201710252385 A CN 201710252385A CN 106993220 A CN106993220 A CN 106993220A
Authority
CN
China
Prior art keywords
buffering area
multimedia
parameter
buffer
decoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710252385.4A
Other languages
Chinese (zh)
Other versions
CN106993220B (en
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.)
Yuanxin Information Technology Group Co ltd
Original Assignee
Yuanxin Technology
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 Yuanxin Technology filed Critical Yuanxin Technology
Priority to CN201710252385.4A priority Critical patent/CN106993220B/en
Publication of CN106993220A publication Critical patent/CN106993220A/en
Application granted granted Critical
Publication of CN106993220B publication Critical patent/CN106993220B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0866Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches for peripheral storage systems, e.g. disk cache
    • G06F12/0871Allocation or management of cache space

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The invention provides a method and a device for adjusting a multimedia decoding information buffer area, wherein the method comprises the steps of judging whether the buffer area needs to be redistributed or not based on multimedia parameters acquired according to decoding data when the completion of the decoding of multimedia information is monitored so as to cache the decoding data; when the buffer area needs to be reallocated, determining the reallocated buffer area based on the multimedia parameters; buffering the decoded data into a reallocated buffer. By applying the technical scheme of the invention, the purpose of dynamically adjusting the preset buffer area based on the multimedia parameters of the multimedia information to be played can be realized, the multimedia information to be played can be smoothly played, the situation of jamming or error in the process of playing the multimedia information to be played is avoided, and meanwhile, the occupation of redundant system memory can be reduced, thereby avoiding influencing the system operation performance of the playing equipment and the operation of other applications, and improving the use experience of users.

Description

The method and apparatus for adjusting multimedia decoding message buffer
Technical field
The present invention relates to areas of information technology, specifically, multimedia decoding message buffer is adjusted the present invention relates to one kind The method in area and a kind of device of adjustment multimedia decoding message buffer.
Background technology
With the development of information technology, multimedia technology also obtains the concern of more and more people, because multimedia technology is It is acquired, encodes, decodes and exports by the signal of terminal-pair Voice & Video, so as to plays Voice & Video to user Technology;Therefore multimedia technology application has been arrived into the fields such as videophone, multimedia monitoring, video conference, multimedia teaching, it is people Life bring many facilities.
Generally for for the embedded device for playing multimedia messages function, the decoding process of multimedia messages is Need decoding device to be decoded in advance to multimedia messages, and decoded multimedia information storage is delayed to preset output Region is deposited, then is played out decoded multimedia messages by the embedded device, to complete the transmission of multimedia messages, Such as, Voice & Video is transmitted.When multimedia messages are transmitted, if the decoded data of multimedia messages are larger, for example, Resolution ratio is 1280 × 720 decoding video data, then needs the output buffer domain of larger capacity to store decoded number According to if the decoded data of multimedia messages are smaller, for example, decoding video data of the resolution ratio for 640 × 480, then need Decoded data are stored compared with the output buffer domain of low capacity.But in the prior art, for storing multimedia messages The buffer area of decoded data is preset to complete, and in order to ensure that embedded device is capable of smooth playing all size Multimedia messages, occur to avoid playing generation interim card, even wrong situation during multimedia messages, typically can be by buffering area Domain is preset to very Large Copacity, although the generation of mistake during broadcasting multimedia messages can be so avoided as much as, when many During the decoded data very little of media information, meaningless substantial amounts of system memory space will be taken, have impact on embedded device System performance.
The content of the invention
To overcome above-mentioned technical problem or solving above-mentioned technical problem at least in part, spy proposes following technical scheme:
One embodiment of the present of invention proposes a kind of method for adjusting multimedia decoding message buffer, including:
When monitoring multimedia messages decoding completion, based on the multimedia parameter got according to decoding data, judge Whether need to redistribute buffering area, to cache decoding data;
When judging to need to redistribute buffering area, the buffering area redistributed is determined based on multimedia parameter;
Decoding data is cached in the buffering area redistributed.
Preferably, before the step of multimedia messages are decoded, in addition to:
Based on Buffer allocation parameter, the initial capacity of allocation buffer is initialized;
Wherein, based on multimedia parameter, the step of judging whether to need to redistribute buffering area, including:
Comparative result based on multimedia parameter with the initial capacity of initialization allocation buffer, judges whether to need again Allocation buffer.
Preferably, when comparative result meets following any one, judgement needs to redistribute buffering area:
Comparative result is less than multimedia parameter for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution Based on predetermined operation mode by calculating obtained result of calculation;Or
Comparative result is more than multimedia parameter for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution Based on predetermined operation mode by calculating obtained result of calculation, and both differences are more than first threshold.
Wherein, multimedia parameter includes the instruction that the reference frame number of multimedia messages, multimedia messages whether there is B frames Parameter value, preset relevant parameter.
Preferably, the step of the buffering area redistributed is determined based on multimedia parameter, including:
The instruction parameter value and preset phase of reference frame number, multimedia messages based on multimedia messages with the presence or absence of B frames Related parameter, it is determined that redistributing the number of buffering area;
Based on the number for redistributing buffering area, open multimedia acceleration layer OpenMax releasing memory is notified and called Function, the buffering area of release initialization distribution, and open multimedia acceleration layer OpenMax storage allocation function is called, again Allocation buffer.
Preferably, this method also includes:
Based on the quantity for redistributing buffering area, Buffer allocation parameter is updated.
An alternative embodiment of the invention proposes a kind of device for adjusting multimedia decoding message buffer, including:
Monitoring modular, for when monitor multimedia messages decoding completion when, based on according to decoding data get it is many Media parameter, judges whether to need to redistribute buffering area, to cache decoding data;
Distribute module, for needing to redistribute buffering area when judgement, determines that redistributes delays based on multimedia parameter Rush area;
Cache module, for being cached to decoding data in the buffering area redistributed.
Preferably, the device also includes:Initialization module, for based on Buffer allocation parameter, initializing distributing buffer The initial capacity in area;
Wherein, monitoring modular, for the comparison knot based on multimedia parameter with the initial capacity of initialization allocation buffer Really, judge whether to need to redistribute buffering area.
Preferably, when comparative result meets following any one, judgement needs to redistribute buffering area:
Comparative result is less than multimedia parameter for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution Based on predetermined operation mode by calculating obtained result of calculation;Or
Comparative result is more than multimedia parameter for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution Based on predetermined operation mode by calculating obtained result of calculation, and both differences are more than first threshold.
Wherein, multimedia parameter includes the instruction that the reference frame number of multimedia messages, multimedia messages whether there is B frames Parameter value, preset relevant parameter.
Preferably, buffer module includes:
Determining unit, joins for the reference frame number based on multimedia messages, multimedia messages with the presence or absence of the instruction of B frames Numerical value and preset relevant parameter, it is determined that redistributing the number of buffering area;
Unit is redistributed, for based on the number for redistributing buffering area, notifying and calling open multimedia acceleration layer OpenMax releasing memory function, the buffering area of release initialization distribution, and call open multimedia acceleration layer OpenMax's Storage allocation function, redistributes buffering area.
Preferably, the device also includes:Update module, for based on the quantity for redistributing buffering area, updating buffering area Allocation of parameters.
In technical scheme, when monitoring multimedia messages decoding completion, based on being obtained according to decoding data The multimedia parameter arrived, judges whether to need to redistribute buffering area, to cache decoding data;When judging that it is slow that needs are redistributed Area is rushed, the buffering area for determining to redistribute based on multimedia parameter;Decoding data is cached in the buffering area redistributed;From And the purpose that the multimedia parameter based on multimedia messages to be played enters Mobile state adjustment to preset buffer area is realized, Satisfaction smoothly plays multimedia messages to be played, it is to avoid the feelings of interim card or mistake occur when there are playing multimedia messages to be played While condition, moreover it is possible to reduce to the occupancy of redundant system internal memory, thus avoid influenceing playback equipment system performance and its The operation that he applies, improves the usage experience of user.
The additional aspect of the present invention and advantage will be set forth in part in the description, and these will become from the following description Obtain substantially, or recognized by the practice of the present invention.
Brief description of the drawings
Of the invention above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Substantially and be readily appreciated that, wherein:
Fig. 1 illustrates for the flow of the method for the adjustment multimedia decoding message buffer of one embodiment in the present invention Figure;
Fig. 2 is the hardware vendor decoding storehouse of a preferred embodiment in the present invention and interacting for open multimedia acceleration layer Information schematic diagram;
Fig. 3 for the present invention in another embodiment adjustment multimedia decoding message buffer device structural framing Schematic diagram.
Embodiment
Embodiments of the invention are described below in detail, the example of the embodiment is shown in the drawings, wherein from beginning to end Same or similar label represents same or similar element or the element with same or like function.Below with reference to attached The embodiment of figure description is exemplary, is only used for explaining the present invention, and is not construed as limiting the claims.
Those skilled in the art of the present technique are appreciated that unless expressly stated, singulative " one " used herein, " one It is individual ", " described " and "the" may also comprise plural form.It is to be further understood that what is used in the specification of the present invention arranges Diction " comprising " refer to there is the feature, integer, step, operation, element and/or component, but it is not excluded that in the presence of or addition Other one or more features, integer, step, operation, element, component and/or their group.It should be understood that when we claim member Part is " connected " or during " coupled " to another element, and it can be directly connected or coupled to other elements, or can also exist Intermediary element.In addition, " connection " used herein or " coupling " can include wireless connection or wireless coupling.It is used herein to arrange Taking leave "and/or" includes one or more associated wholes or any cell for listing item and all combines.
Those skilled in the art of the present technique are appreciated that unless otherwise defined, all terms used herein (including technology art Language and scientific terminology), with the general understanding identical meaning with the those of ordinary skill in art of the present invention.Should also Understand, those terms defined in such as general dictionary, it should be understood that with the context with prior art The consistent meaning of meaning, and unless by specific definitions as here, otherwise will not use idealization or excessively formal implication To explain.
Fig. 1 is the schematic flow sheet of the method for the adjustment multimedia decoding message buffer of one embodiment of the invention.
It should be noted that the executive agent of the present embodiment is hardware vendor's decoding storehouse.Hardware vendor's decoding storehouse is embedded The routine interface for a set of encapsulation that formula device core chip maker provides, can complete the encoding and decoding of multimedia messages, such as The encoding and decoding and distribution of Voice & Video etc. and the buffering area for discharging the decoding data for buffer multimedia information;Simultaneously Hardware vendor's decoding storehouse can also be communicated with gst-omx modules.
Step S101:When monitoring multimedia messages decoding completion, based on the multimedia got according to decoding data Parameter, judges whether to need to redistribute buffering area, to cache decoding data;Step S102:When judging that it is slow that needs are redistributed Area is rushed, the buffering area for determining to redistribute based on multimedia parameter;Step S103:Decoding data is cached to redistribute slow Rush in area.
In technical scheme, when monitoring multimedia messages decoding completion, based on being obtained according to decoding data The multimedia parameter arrived, judges whether to need to redistribute buffering area, to cache decoding data;When judging that it is slow that needs are redistributed Area is rushed, the buffering area for determining to redistribute based on multimedia parameter;Decoding data is cached in the buffering area redistributed;From And the purpose that the multimedia parameter based on multimedia messages to be played enters Mobile state adjustment to preset buffer area is realized, Satisfaction smoothly plays multimedia messages to be played, it is to avoid the feelings of interim card or mistake occur when there are playing multimedia messages to be played While condition, moreover it is possible to reduce to the occupancy of redundant system internal memory, thus avoid influenceing playback equipment system performance and its The operation that he applies, improves the usage experience of user.
It is described further below for implementing for each step:
Step S101:When monitoring multimedia messages decoding completion, based on the multimedia got according to decoding data Parameter, judges whether to need to redistribute buffering area, to cache decoding data.
Wherein, multimedia messages include but is not limited to:Video information, audio-frequency information.
Wherein, multimedia parameter includes the instruction that the reference frame number of multimedia messages, multimedia messages whether there is B frames Parameter value, preset relevant parameter;Preset relevant parameter include avoiding output pause buffering area number, reconstruction frames number, The reserved buffer number of SurfaceFlinger components.
Specifically, before the step of multimedia messages are decoded, in addition to:Based on Buffer allocation parameter, initialization distribution The initial capacity of buffering area.
Wherein, Buffer allocation parameter is Buffer allocation number.
Specifically, based on multimedia parameter, the step of judging whether to need to redistribute buffering area, including:Based on many matchmakers The comparative result of body parameter and the initial capacity of initialization allocation buffer, judges whether to need to redistribute buffering area.
Wherein, when comparative result meets following any one, judgement needs to redistribute buffering area:Comparative result is initial The corresponding buffering area number of initial capacity for changing the buffering area of distribution passes through meter less than multimedia parameter based on predetermined operation mode Obtained result of calculation;Or comparative result is more than for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution The result of calculation that multimedia parameter is obtained based on predetermined operation mode by calculating, and both differences are more than first threshold.The One threshold value can be set to 1 or 2.
For example, hardware vendor's decoding storehouse is based on Buffer allocation number " 15 ", the initial capacity of allocation buffer is initialized For the buffer memory capacity of 15 buffering areas, and each buffering area is prefixed capacity, such as 4M;Hardware vendor decodes storehouse to video information Decoded;As shown in Fig. 2 when hardware vendor's decoding storehouse monitors that the video-information decoding is completed, believing according to from the video The reference frame number and video information for the video information for obtaining or extracting in the decoding data of breath are joined with the presence or absence of the instruction of B frames Numerical value, and preset relevant parameter, for example, the reference frame number " 2 " based on video information is individual, video information whether there is B frames Instruction parameter value " 1 ", and preset relevant parameter numerical value " 6 ", and based on following formula 1) draw needed for allocation buffer number, To cache the decoding data of the video information:
Formula 1) needed for allocation buffer number
=info->numRefFrames+info->has_b_frames+1+1+4
Wherein, info->NumRefFrames is the reference frame number of video information, and has_b_frames is video information With the presence or absence of the instruction parameter of B frames, first " 1 ", to avoid output pause buffering area number, second " 1 " is reconstruction frames Number, " 4 " are the reserved buffer number of SurfaceFlinger components.
By above-mentioned formula 1) calculate can determine that, it is necessary to distribute 9 buffering areas to cache the decoding data of the video information;So Afterwards according to initial capacity 15 capacity with needing allocation buffer of corresponding buffering area number of the buffering area of initialization distribution Corresponding buffering area number 9 compares, and show that comparative result is corresponding slow for the initial capacity of the buffering area of initialization distribution Area's number " 15 " is rushed more than the result of calculation that multimedia parameter is obtained based on predetermined operation mode by calculating, i.e., above-mentioned formula 1) The result of calculation " 9 " gone out, and both differences " 6 " are more than first threshold " 1 " or " 2 ".Then need to redistribute buffering area, with slow Deposit the decoding data of video information.
It should be noted that when the video information has B frames, then the video information whether there is the instruction parameter of B frames It is worth for 1;When B frames are not present in the video information, then the video information is 0 with the presence or absence of the instruction parameter value of B frames.And avoid defeated Go out to suspend buffering area number be predisposed to 1, reconstruction frames number be predisposed to 1, the reserved buffer of SurfaceFlinger components Number is predisposed to 4.
Step S102:When judging to need to redistribute buffering area, the buffering area redistributed is determined based on multimedia parameter.
Specifically, the step of determining to redistribute buffering area based on multimedia parameter, including:Based on multimedia messages Reference frame number, multimedia messages whether there is the instruction parameter value and preset relevant parameter of B frames, it is determined that redistributing buffering area Number;Based on the number for redistributing buffering area, open multimedia acceleration layer OpenMax releasing memory letter is notified and called Number, the buffering area of release initialization distribution, and open multimedia acceleration layer OpenMax storage allocation function is called, divide again With buffering area.
For example, as shown in Fig. 2 when hardware vendor's decoding storehouse judges to need to redistribute buffering area, then according to from the video The reference frame number and video information for the video information for obtaining or extracting in the decoding data of information whether there is the instruction of B frames Parameter value, and preset relevant parameter, for example, the reference frame number " 2 " based on video information is individual, video information whether there is B The instruction parameter value " 1 " of frame, and preset relevant parameter numerical value " 6 ", and based on following formula 2) draw needed for allocation buffer Number, to cache the decoding data of the video information:
Formula 2)
Redistribute number=info- of buffering area>numRefFrames+info->has_b_frames+1+1+4
Wherein, info->NumRefFrames is the reference frame number of video information, and has_b_frames is video information With the presence or absence of the instruction parameter of B frames, first " 1 ", to avoid output pause buffering area number, second " 1 " is reconstruction frames Number, " 4 " are the reserved buffer number of SurfaceFlinger components.
By above-mentioned formula 2) calculate can determine that, 9 buffering areas are redistributed to cache the decoding data of the video information;Firmly Part manufacturer decoding storehouse is individual based on the number " 9 " for redistributing buffering area, and the plug-in unit gst-omx modules into Gstreamer are sent Announcement information, notifies gst-omx modules redistribute buffering area and redistribute the number of buffering area to be 9, gst-omx modules After the announcement information that hardware vendor's decoding storehouse is sent is received, the announcement information is confirmed, and call open multimedia Acceleration layer OpenMax releasing memory function OMX_FreeBuffer, 15 buffering areas of release initialization distribution, is recalled out The storage allocation function OMX_AllocateBuffer for putting multimedia acceleration layer OpenMax redistributes 9 buffering areas.
Step S103:Decoding data is cached in the buffering area redistributed.
Specifically, after gst-omx modules redistribute buffering area, by the decoding data of multimedia messages, e.g., video letter The decoding data of breath, is cached into the buffering area redistributed.
Specifically, this method also includes:Based on the quantity for redistributing buffering area, Buffer allocation parameter is updated.
For example, as shown in Fig. 2 gst-omx modules complete to cache the decoding data of video information to redistributing After in buffering area, announcement information is sent to hardware vendor's decoding storehouse, notifies hardware vendor to decode storehouse Buffer allocation number and repaiied Change, and Buffer allocation number is revised as 9;Hardware vendor's decoding storehouse is receiving the notice that gst-omx modules are sent After information, confirm that buffering area has been redistributed, and update Buffer allocation number.
Fig. 3 for the present invention in another embodiment adjustment multimedia decoding message buffer device structural framing Schematic diagram.
Monitoring modular, when monitoring multimedia messages decoding completion, based on the multimedia got according to decoding data Parameter, judges whether to need to redistribute buffering area, to cache decoding data;Distribute module, when judging that it is slow that needs are redistributed Area is rushed, determines to redistribute buffering area based on multimedia parameter;Cache module, decoding data is cached to the buffering redistributed Qu Zhong.
It is described further below for implementing for modules:
Monitoring modular, when monitoring multimedia messages decoding completion, based on the multimedia got according to decoding data Parameter, judges whether to need to redistribute buffering area, to cache decoding data.
Wherein, multimedia messages include but is not limited to:Video information, audio-frequency information.
Wherein, multimedia parameter includes the instruction that the reference frame number of multimedia messages, multimedia messages whether there is B frames Parameter value, preset relevant parameter;Preset relevant parameter include avoiding output pause buffering area number, reconstruction frames number, The reserved buffer number of SurfaceFlinger components.
Specifically, the device also includes:Initialization module, based on Buffer allocation parameter, initialization allocation buffer Initial capacity.
Wherein, Buffer allocation parameter is Buffer allocation number.
Specifically, monitoring modular, the comparative result based on multimedia parameter with the initial capacity of initialization allocation buffer, Judge whether to need to redistribute buffering area.
Wherein, when comparative result meets following any one, judgement needs to redistribute buffering area:Comparative result is initial The corresponding buffering area number of initial capacity for changing the buffering area of distribution passes through meter less than multimedia parameter based on predetermined operation mode Obtained result of calculation;Or comparative result is more than for the corresponding buffering area number of initial capacity of the buffering area of initialization distribution The result of calculation that multimedia parameter is obtained based on predetermined operation mode by calculating, and both differences are more than first threshold.The One threshold value can be set to 1 or 2.
For example, initialization module is based on Buffer allocation number " 15 ", the initial capacity of initialization allocation buffer is 15 The buffer memory capacity of individual buffering area, and each buffering area is prefixed capacity, such as 4M;Hardware vendor decodes storehouse and video information is carried out Decoding;When monitoring module monitors to the video-information decoding are completed, according to from the decoding data of the video information obtain or The reference frame number and video information for the video information extracted whether there is the instruction parameter value of B frames, and preset related ginseng Number, for example, the reference frame number " 2 " based on video information is individual, video information whether there is the instruction parameter value " 1 " of B frames, and in advance Put the numerical value " 6 " of relevant parameter, and based on following formula 1) draw needed for allocation buffer number, to cache the solution of the video information Code data:
Formula 1)
Number=info- of required allocation buffer>numRefFrames+info->has_b_frames+1+1+4
Wherein, info->NumRefFrames is the reference frame number of video information, and has_b_frames is video information With the presence or absence of the instruction parameter of B frames, first " 1 ", to avoid output pause buffering area number, second " 1 " is reconstruction frames Number, " 4 " are the reserved buffer number of SurfaceFlinger components.
By above-mentioned formula 1) calculate can determine that, it is necessary to distribute 9 buffering areas to cache the decoding data of the video information;So The corresponding buffering area number of initial capacity for the buffering area that monitoring modular is distributed according to initialization 15 is with needing distributing buffer afterwards The corresponding buffering area number of capacity 9 in area compares, and draws initial capacity of the comparative result for the buffering area of initialization distribution Corresponding buffering area number " 15 " is more than multimedia parameter based on predetermined operation mode by calculating obtained result of calculation, i.e., on State formula 1) result of calculation " 9 " that draws, and both differences " 6 " are more than first threshold " 1 " or " 2 ".Then need to redistribute slow Area is rushed, with the decoding data of buffered video information.
It should be noted that when the video information has B frames, then the video information whether there is the instruction parameter of B frames It is worth for 1;When B frames are not present in the video information, then the video information is 0 with the presence or absence of the instruction parameter value of B frames.And avoid defeated Go out to suspend buffering area number be predisposed to 1, reconstruction frames number be predisposed to 1, the reserved buffer of SurfaceFlinger components Number is predisposed to 4.Distribute module, when judging to need to redistribute buffering area, is redistributed slow based on multimedia parameter determination Rush area.
Specifically, buffer module includes:Determining unit, the reference frame number based on multimedia messages, multimedia messages are The no instruction parameter value and preset relevant parameter that there is B frames, it is determined that redistributing the number of buffering area;Redistribute unit, base In the number for redistributing buffering area, open multimedia acceleration layer OpenMax releasing memory function is notified and calls, release is just The buffering area of beginningization distribution, and open multimedia acceleration layer OpenMax storage allocation function is called, redistribute buffering area.
For example, when monitoring modular judges to need to redistribute buffering area, it is determined that unit is according to the solution from the video information The reference frame number and video information of the video information for obtaining or extracting in code data whether there is the instruction parameter value of B frames, And preset relevant parameter, for example, the reference frame number " 2 " based on video information is individual, video information whether there is the instruction of B frames Parameter value " 1 ", and preset relevant parameter numerical value " 6 ", and based on following formula 2) draw needed for allocation buffer number, to cache The decoding data of the video information:
Formula 2)
Redistribute number=info- of buffering area>numRefFrames+info->has_b_frames+1+1+4
Wherein, info->NumRefFrames is the reference frame number of video information, and has_b_frames is video information With the presence or absence of the instruction parameter of B frames, first " 1 ", to avoid output pause buffering area number, second " 1 " is reconstruction frames Number, " 4 " are the reserved buffer number of SurfaceFlinger components.
By above-mentioned formula 2) calculate can determine that, 9 buffering areas are redistributed to cache the decoding data of the video information;Weight New allocation unit is individual based on the number " 9 " for redistributing buffering area, and the plug-in unit gst-omx modules into Gstreamer send logical Know information, notify gst-omx modules to redistribute buffering area and redistribute the number of buffering area for 9, gst-omx modules exist Receive after the announcement information for redistributing unit transmission, the announcement information is confirmed, and call open multimedia to accelerate Layer OpenMax releasing memory function OMX_FreeBuffer, 15 buffering areas of release initialization distribution, recalls opening many Media acceleration layer OpenMax storage allocation function OMX_AllocateBuffer redistributes 9 buffering areas.
Cache module, decoding data is cached in the buffering area redistributed.
Specifically, after gst-omx modules redistribute buffering area, cache module by the decoding data of multimedia messages, Such as, the decoding data of video information, is cached into the buffering area redistributed.
Specifically, the device also includes:Update module, based on the quantity for redistributing buffering area, updates Buffer allocation Parameter.
For example, gst-omx modules are after completing to cache the decoding data of video information into the buffering area redistributed, Announcement information is sent to hardware vendor's decoding storehouse, notifies hardware vendor to decode storehouse Buffer allocation number and changed, and will buffering Area's distribution number is revised as 9;Hardware vendor decodes storehouse after the announcement information that gst-omx modules are sent is received, and confirms Buffering area has been redistributed, and updates Buffer allocation number by update module.
Those skilled in the art of the present technique are appreciated that the present invention includes being related to for performing in operation described herein One or more of equipment.These equipment can be for needed for purpose and specially design and manufacture, or can also include general Known device in computer.These equipment have the computer program being stored in it, and these computer programs are optionally Activation is reconstructed.Such computer program can be stored in equipment (for example, computer) computer-readable recording medium or be stored in E-command and it is coupled to respectively in any kind of medium of bus suitable for storage, the computer-readable medium is included but not Be limited to any kind of disk (including floppy disk, hard disk, CD, CD-ROM and magneto-optic disk), ROM (Read-Only Memory, only Read memory), RAM (Random Access Memory, immediately memory), EPROM (Erasable Programmable Read-Only Memory, Erarable Programmable Read only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory, EEPROM), flash memory, magnetic card or light card Piece.It is, computer-readable recording medium includes storing or transmitting any Jie of information in the form of it can read by equipment (for example, computer) Matter.
Those skilled in the art of the present technique be appreciated that can be realized with computer program instructions these structure charts and/or The combination of each frame and these structure charts and/or the frame in block diagram and/or flow graph in block diagram and/or flow graph.This technology is led Field technique personnel be appreciated that these computer program instructions can be supplied to all-purpose computer, special purpose computer or other The processor of programmable data processing method is realized, so as to pass through the processing of computer or other programmable data processing methods The scheme that device is specified in the frame or multiple frames to perform structure chart disclosed by the invention and/or block diagram and/or flow graph.
Those skilled in the art of the present technique are appreciated that in the various operations discussed in the present invention, method, flow Step, measure, scheme can be replaced, changed, combined or deleted.Further, it is each with what is discussed in the present invention Kind operation, method, other steps in flow, measure, scheme can also be replaced, changed, reset, decomposed, combined or deleted. Further, it is of the prior art to have and the step in the various operations disclosed in the present invention, method, flow, measure, scheme It can also be replaced, changed, reset, decomposed, combined or deleted.
Described above is only some embodiments of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method for adjusting multimedia decoding message buffer, it is characterised in that including:
When monitoring multimedia messages decoding completion, based on the multimedia parameter got according to decoding data, judge whether Need to redistribute buffering area, to cache the decoding data;
When judging to need to redistribute buffering area, the buffering area redistributed is determined based on the multimedia parameter;
The decoding data is cached in the buffering area redistributed.
2. according to the method described in claim 1, wherein, before the step of multimedia messages are decoded, in addition to:
Based on Buffer allocation parameter, the initial capacity of allocation buffer is initialized;
Wherein, based on the multimedia parameter, the step of judging whether to need to redistribute buffering area, including:
Comparative result based on the multimedia parameter Yu the initial capacity of the initialization allocation buffer, judges whether needs Redistribute buffering area.
3. method according to claim 2, wherein, when the comparative result meets following any one, judgement needs weight New allocation buffer:
The comparative result is less than described many for the corresponding buffering area number of initial capacity of the buffering area of the initialization distribution Media parameter is based on predetermined operation mode by calculating obtained result of calculation;Or,
The comparative result is more than described many for the corresponding buffering area number of initial capacity of the buffering area of the initialization distribution The result of calculation that media parameter is obtained based on predetermined operation mode by calculating, and both differences are more than first threshold.
4. the method according to claim any one of 1-3, wherein, the multimedia parameter includes the reference of multimedia messages Frame number, multimedia messages whether there is instruction parameter value, the preset relevant parameter of B frames.
5. method according to claim 4, wherein, when the buffering area for determining to redistribute based on the multimedia parameter Step, including:
Reference frame number, the multimedia messages based on the multimedia messages are with the presence or absence of the instruction parameter value of B frames and pre- Relevant parameter is put, it is determined that redistributing the number of buffering area;
Based on the number for redistributing buffering area, open multimedia acceleration layer OpenMax releasing memory is notified and called Function, the buffering area of release initialization distribution, and open multimedia acceleration layer OpenMax storage allocation function is called, again Allocation buffer.
6. method according to claim 2, wherein, in addition to:
Based on the quantity for redistributing buffering area, the Buffer allocation parameter is updated.
7. a kind of device for adjusting multimedia decoding message buffer, it is characterised in that including:
Monitoring modular, for when monitoring multimedia messages decoding completion, based on the multimedia got according to decoding data Parameter, judges whether to need to redistribute buffering area, to cache the decoding data;
Distribute module, for needing to redistribute buffering area when judgement, determines that redistributes delays based on the multimedia parameter Rush area;
Cache module, for the decoding data to be cached in the buffering area redistributed.
8. device according to claim 7, wherein, in addition to:Initialization module, for based on Buffer allocation parameter, Initialize the initial capacity of allocation buffer;
Wherein, the monitoring modular, for the initial capacity based on the multimedia parameter Yu the initialization allocation buffer Comparative result, judge whether to need to redistribute buffering area.
9. device according to claim 8, wherein, when the comparative result meets following any one, judgement needs weight New allocation buffer:
The comparative result is less than described many for the corresponding buffering area number of initial capacity of the buffering area of the initialization distribution Media parameter is based on predetermined operation mode by calculating obtained result of calculation;Or,
The comparative result is more than described many for the corresponding buffering area number of initial capacity of the buffering area of the initialization distribution The result of calculation that media parameter is obtained based on predetermined operation mode by calculating, and both differences are more than first threshold.
10. the device according to claim any one of 7-9, wherein, the multimedia parameter includes the ginseng of multimedia messages Examine instruction parameter value, preset relevant parameter that frame number, multimedia messages whether there is B frames.
CN201710252385.4A 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone Active CN106993220B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710252385.4A CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710252385.4A CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Publications (2)

Publication Number Publication Date
CN106993220A true CN106993220A (en) 2017-07-28
CN106993220B CN106993220B (en) 2020-05-01

Family

ID=59416210

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710252385.4A Active CN106993220B (en) 2017-04-18 2017-04-18 Method and device for adjusting multimedia decoding information buffer zone

Country Status (1)

Country Link
CN (1) CN106993220B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725951A (en) * 2018-12-29 2019-05-07 上海掌门科技有限公司 Control method, system, electronic equipment and computer-readable medium
CN110740374A (en) * 2019-10-31 2020-01-31 广州市网星信息技术有限公司 multimedia data processing method, device, computer equipment and storage medium
CN111182309A (en) * 2019-12-31 2020-05-19 深圳市瑞讯云技术有限公司 Video decoding processing method and device
CN111736796A (en) * 2020-05-15 2020-10-02 深圳市战音科技有限公司 Real-time stream data processing method, device, equipment and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115767245A (en) * 2021-08-30 2023-03-07 瑞昱半导体股份有限公司 Video processing system and method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109356A (en) * 2012-12-20 2013-06-06 Japan Radio Co Ltd Image display driving device and image display system
CN104159079A (en) * 2014-08-13 2014-11-19 上海航天电子通讯设备研究所 Image real-time decoding display method
CN106528303A (en) * 2016-10-20 2017-03-22 武汉斗鱼网络科技有限公司 GPU texture sharing-based method and system for obtaining source images of D3D12 game

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013109356A (en) * 2012-12-20 2013-06-06 Japan Radio Co Ltd Image display driving device and image display system
CN104159079A (en) * 2014-08-13 2014-11-19 上海航天电子通讯设备研究所 Image real-time decoding display method
CN106528303A (en) * 2016-10-20 2017-03-22 武汉斗鱼网络科技有限公司 GPU texture sharing-based method and system for obtaining source images of D3D12 game

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109725951A (en) * 2018-12-29 2019-05-07 上海掌门科技有限公司 Control method, system, electronic equipment and computer-readable medium
CN110740374A (en) * 2019-10-31 2020-01-31 广州市网星信息技术有限公司 multimedia data processing method, device, computer equipment and storage medium
CN111182309A (en) * 2019-12-31 2020-05-19 深圳市瑞讯云技术有限公司 Video decoding processing method and device
CN111736796A (en) * 2020-05-15 2020-10-02 深圳市战音科技有限公司 Real-time stream data processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN106993220B (en) 2020-05-01

Similar Documents

Publication Publication Date Title
CN106993220A (en) Method and device for adjusting multimedia decoding information buffer zone
US11930197B2 (en) Video decoding method and apparatus, computer device, and storage medium
CN105577530B (en) Group chat information overview method and device
AU2015280330B2 (en) Efficient frame rendering
CN111510756A (en) Audio and video switching method and device, computer equipment and readable storage medium
CN108989854A (en) The playlist error label of conveying and rendering for Streaming Media
CN106375835B (en) A kind of flow media playing method and equipment
CN106210927A (en) A kind of track switching method and apparatus
CN104053002A (en) Video decoding method and device
CN109495776B (en) Audio sending and playing method and intelligent terminal
KR20030086376A (en) Method for controlling buffering of audio stream and apparatus thereof
CN102740139A (en) Information processing apparatus, information processing method, and program for synchronized playback on multiple devices
CN105847990B (en) The method and apparatus for playing media file
CN104427383B (en) A kind of information processing method and electronic equipment
CN106657172A (en) Method and device for realizing information push
CN103325385B (en) Voice communication method and equipment, the method and apparatus of operation wobble buffer
US8255492B2 (en) Dynamic content play control
CN114416013A (en) Data transmission method, data transmission device, electronic equipment and computer-readable storage medium
CN109640165A (en) Multi-medium play method, terminal device and the readable storage medium storing program for executing of track switching
CN115426501A (en) Audio and video code stream time calibration method and electronic equipment
CN110855645B (en) Streaming media data playing method and device
CN100425075C (en) Multimedia playing method for mobile communication terminal
CN108156514A (en) Playback method, device and the storage medium of media file
CN106454512A (en) Player event statistical method and device player and terminal equipment
CN107454445A (en) A kind of method and apparatus for carrying out video playback scheduling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20210201

Address after: 101300 room 153, 1 / F, building 17, 16 Caixiang East Road, Nancai Town, Shunyi District, Beijing

Patentee after: Yuanxin Information Technology Group Co.,Ltd.

Address before: 100176 room 2222, building D, building 33, 99 Kechuang 14th Street, Beijing Economic and Technological Development Zone, Beijing

Patentee before: BEIJING YUANXIN SCIENCE & TECHNOLOGY Co.,Ltd.

EE01 Entry into force of recordation of patent licensing contract
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20170728

Assignee: Beijing Yuanxin Junsheng Technology Co.,Ltd.

Assignor: Yuanxin Information Technology Group Co.,Ltd.

Contract record no.: X2021110000018

Denomination of invention: Method and device for adjusting multimedia decoding information buffer

Granted publication date: 20200501

License type: Common License

Record date: 20210531