CN101477820A - File playing method and apparatus - Google Patents

File playing method and apparatus Download PDF

Info

Publication number
CN101477820A
CN101477820A CNA2008102475902A CN200810247590A CN101477820A CN 101477820 A CN101477820 A CN 101477820A CN A2008102475902 A CNA2008102475902 A CN A2008102475902A CN 200810247590 A CN200810247590 A CN 200810247590A CN 101477820 A CN101477820 A CN 101477820A
Authority
CN
China
Prior art keywords
file
play
frame
broadcast
waiting
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
CNA2008102475902A
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.)
Huawei Device Shenzhen Co Ltd
Original Assignee
Shenzhen Huawei Communication Technologies 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 Shenzhen Huawei Communication Technologies Co Ltd filed Critical Shenzhen Huawei Communication Technologies Co Ltd
Priority to CNA2008102475902A priority Critical patent/CN101477820A/en
Publication of CN101477820A publication Critical patent/CN101477820A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention relates to a method and a device for playing files, wherein, the method comprises the following steps: obtaining the system loading information; acquiring corresponding files playing capacity supported by the system according to the system loading information; and selecting data corresponding to the playing capacity of the files from the files to be played. The embodiment detects the system before the files are played, acquires the corresponding files playing capacity according to the system loading information, and selects the data corresponding to the current files playing capacity in the playing device from the files to be played, thereby ensuring that the files can be played smoothly, and improving the service quality of the concurrent multi-service.

Description

Document play-back method and device
Technical field
The embodiment of the invention relates to communication technical field, particularly a kind of document play-back method and device.
Background technology
Along with the variation of development of science and technology and user's request, mobile phone develops towards the direction of functional mobile phone/smart mobile phone (Fea ture Phone/SmartPhone).The amusement of functional mobile phone/smart mobile phone and communication function except possessing call function, also possess such as functions such as recreation, MP3, MP4, online, video callings from strength to strength.When therefore the user used mobile phone, following operative scenario appearred in the situation that may exist a plurality of tasks to work simultaneously:
Scene one, user play games in the file of downloading FTP, and musical instrument digital interface (Musical Instrument Digital Interface is adopted in recreation; Hereinafter to be referred as: MIDI) file sound accompaniment.
Scene two, user have incoming call in the file of downloading FTP, incoming call adopts the ring of MIDI mode.
Scene three, user play video files such as MP4 in the file of downloading FTP.
Scene four, user have the invitation of visual telephone in the file of downloading FTP.
Because the embedded system in the equipment such as mobile phone is a resource-constrained system, for scene one, suppose that the user adopts the sound accompaniment of playing of the MIDI file of 64 chords, be to work preferably at ordinary times.If when downloading FTP data (as downloading the data of 2M), play games, owing to download FTP data occupancy system resource, make system's surplus resources (CPU/DSP resource, bus bandwidth, internal memory or storage resources etc.) limited, if adopt the MIDI sound accompaniment of 64 chord game replayings, the situation of MIDI sound accompaniment can appear in time handling in CPU, causes the user to hear choppy voice.For scene two, there is above-mentioned situation equally, because downloading, FTP takies resource, if receive incoming call simultaneously, can set up a circuit switching (CircleSwitch; Hereinafter to be referred as: CS) circuit, make that then limited system resource is more limited, CPU can not in time handle the MIDI ring, and the ring back tone when making incoming call becomes intermittent.For scene three, suppose that the user adopts standardized images form commonly used (Quarter Common Intermediate Format; Hereinafter to be referred as: QCIF) the MP4 video file of 25 frame per second is play, just often can work preferably, but carrying out the FTP data in the time of as if playing video file downloads, because the FTP data are downloaded occupying system resources, make system's surplus resources limited, if adopt the frame per second of QCIF 25 to play, because CPU has little time to handle, then the user can see that image is intermittent.For scene four, there is above-mentioned situation equally.Because download very consumption of natural resource of FTP data, the surplus resources of system is limited, if receive videophone when downloading the FTP data, need set up a CS circuit, limited system resource is more limited, produces video jitter, makes that coherent image becomes intermittent originally.
In realizing process of the present invention, the inventor finds that there are the following problems at least in the prior art: when the embedded system multi-service and when depositing, because system loading is heavier, cause the broadcast of multifiles such as audio frequency or video discontinuous, influence service quality.
Summary of the invention
The embodiment of the invention provides a kind of document play-back method and device, causes file to play problems such as discontinuous in order to solve in the system of the prior art multi-service and to deposit, with the smooth playing that guarantees file, improve service quality.
The embodiment of the invention provides a kind of document play-back method, comprising:
Obtain system loading information;
Obtain the file ability to play that corresponding system supports according to described system loading information;
Choose and wait to broadcast data corresponding in the file and play with described file ability to play.
The embodiment of the invention provides a kind of file playing device again, comprising:
First acquisition module is used to obtain system loading information;
Second acquisition module is used for obtaining the file ability to play that corresponding system supports according to described system loading information;
Choose module, be used for choosing and wait to broadcast the file data corresponding and play with described file ability to play.
The embodiment of the invention provides a kind of document play-back method and device, before played file, choose and wait to broadcast in the file data corresponding and play, guaranteed the smooth playing of file, improve multi-service and the service quality when depositing with the current file ability to play of playing device.
Description of drawings
Fig. 1 is the process flow diagram of document play-back method first embodiment of the present invention;
Fig. 2 is the process flow diagram of document play-back method second embodiment of the present invention;
Fig. 3 is the contrast figure of system loading information in the document play-back method of the present invention and file ability to play;
Fig. 4 is the synoptic diagram that the present invention includes the image sequence of I frame, P frame, B frame;
Fig. 5 is the schematic flow sheet of video coding process of the present invention;
Fig. 6 is the process flow diagram of document play-back method the 3rd embodiment of the present invention;
Fig. 7 is the structural representation of file playing device first embodiment of the present invention;
Fig. 8 is the structural representation of file playing device second embodiment of the present invention.
Embodiment
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Fig. 1 is the process flow diagram of document play-back method first embodiment of the present invention, and as shown in Figure 1, this document player method may further comprise the steps:
Step 101, obtain system loading information.
The situation that in the embedded system of equipment such as mobile phone, has multi-service and deposit, for example: the business that might carry out other when system receives new service request.For the effect smoothness that files such as audio frequency, video are play, system can detect current system state earlier before calling program is play file, obtain system loading information.Wherein system loading information comprises: central processing unit (CentralProcess Unit; Hereinafter to be referred as: CPU) information on load, bus load information, Memory Load information etc., the perhaps combination of these several information.Wherein, the method that detects and obtain cpu load information can be: the frequency and the time of (IDLE) task that interior CPU of analysis a period of time enters the free time, for example: set the task A of a low priority, utilize formula L cpu = T 2 - T idle T 2 × 100 % Add up current system loading information, wherein, L CpuFor current cpu load is a cpu load information, T 2Be the time of statistical system information on load, T IdleFor the CPU of system at T 2In enter time of task A.Detect and obtain bus information on load method for example: utilize formula L bus = T load T 1 × 100 % Statistics is at unit interval T 1The occupied time T of read-write operation interior, that bus is initiated Load, L wherein BusFor current bus load is a bus load information.
The different system loading information and the corresponding relation of file ability to play can set in advance.The file ability to play can be for synthetic, decoding, synchronously, ability such as broadcast, the attribute of broadcasting file according to different waiting can be different.The method that system loading information and described file ability to play wherein be set can have multiple, and for example: when the attribute of the frequency file of waiting to broadcast was MIDI, the corresponding file ability to play can be the chord number supported of system etc. for synthesis capability.The attribute difference of waiting to broadcast video file also can corresponding different file ability to play, and this document ability to play can be the maximum decoding frame number of the system current support corresponding with the attribute of waiting to broadcast video file, video encoding capability etc.
Step 102, obtain the file ability to play that corresponding system supports according to this system loading information.
File to be broadcast can be multifiles such as audio frequency, video.After obtaining system loading information,, then can obtain the information such as maximum chord number of the system support corresponding according to this system loading information with the attribute of this frequency file of waiting to broadcast if wait to broadcast file and be frequency file to be broadcast; If wait to broadcast file and be video file to be broadcast, then can obtain maximum that the system corresponding with the attribute of this frequency file of waiting to broadcast the support information such as frame number of decoding according to this system loading information.
Step 103, choose and wait to broadcast data corresponding in the file and play with this document ability to play.
If wait to broadcast file and be frequency file to be broadcast, obtain the maximum chord number of the current support of system after, choose in this frequency file of waiting to broadcast and play with maximum chord number corresponding audio data.For example: whether the chord number T that judges the frequency file of waiting to broadcast is greater than the maximum chord number S of the current support of system, if, then play when waiting to broadcast frequency file, interrupted phenomenon can occur, from the T chord, choose the voice data of S chord by processing such as this frequency file to be broadcast are resolved, decoded and synthesizes and play; Otherwise can play-over the voice data of T chord in the frequency file of waiting to broadcast.When system plays waits to broadcast frequency file,, choose suitable play parameter, just can guarantee for example MIDI the tinkle of bells of smooth displaying audio file according to current file ability to play.
If wait to broadcast file and be video file to be broadcast, obtain the maximum decoding frame number of the system current support corresponding with the broadcast condition of waiting to broadcast video file after, selects described waiting to broadcast in the video file to play with the described maximum corresponding video data of frame number of decoding.When the maximum decoding frame number of the current support of system waits to broadcast the video file frame number less than this, play this video file to be broadcast and discontinuous situation to occur playing, at this moment can select to abandon the part delta frame, the implication that abandons delta frame is to identify the classification of present frame in the system layer of code stream, if the delta frame that can abandon, then this delta frame is not decoded and play disposal, directly skip this delta frame, in code stream, read the next frame data.The order that wherein abandons delta frame generally be abandon the B frame earlier, abandon with reference to the P frame again, abandon then non-with reference to the P frame, particularly, if the described frame number of waiting to broadcast video file is K with described maximum difference of decoding frame number, whether judging the described number M that waits to broadcast B frame in the video file more than or equal to K, is then to skip K B frame, remaining video data is play; Otherwise, if the difference of K and M is E, judges and describedly whether wait to broadcast in the video file number N with reference to the P frame more than or equal to E, be that then to skip E individual with reference to the P frame, remaining video data is play; Otherwise, if the difference of E and N is F, judges and describedly whether wait to broadcast in the video file non-number L with reference to the P frame more than or equal to F, be that then to skip F individual non-with reference to the P frame, remaining video data is play; Otherwise, return the described state of waiting to broadcast video file, wherein M, N, L, E, F are integer.Wherein skip the B frame, with reference to the P frame or non-during with reference to the P frame can be skip at random, also can be to skip according to certain criterion.When the maximum of the current support of system decoding frame number waits to broadcast the video file frame number more than or equal to this, then can directly treat and broadcast video file and decode and play.
Present embodiment is before played file, the system loading information of playing device is obtained in detection, and obtain the file ability to play of the system corresponding with this system loading information, choose and wait to broadcast in the file data corresponding and play with system current file ability to play, can guarantee the smooth playing of file, the service quality when the raising multi-service is concurrent.
Audio file has many kinds, and MIDI file wherein is meant the data of the MIDI information that writes down in the computing machine.The MIDI file is not the pronunciation of directly writing down musical instrument, but write down various information or the instruction that plays an instrument, as: use any musical instrument, when by certain key, how dynamics waits, and the sound that sends when playing, then pass through the converted of playout software or source of sound, so the MIDI file is more much smaller than audio files usually, the melody of a first MIDI file layout has only tens K or tens K, have only about the per mille of audio files, be convenient to store and carry.
Software can be selected different source of sound (wave table) broadcast mode when playing the MIDI music, to obtain best result of broadcast etc.In the MIDI scheme in early days, adopt the scheme of external MIDI chip, be responsible for synthetic specific MIDI music by external MIDI chip.But because the MIDI chip cost is higher, about 4-5 dollar, and along with flush bonding processor, for example: CPU/ digital signal processor (Digital SignalProcessor; Hereinafter to be referred as the DSP) lifting of performance, the MIDI of main flow is based on the implementation of software at present, can reduce external MIDI chip, reducing cost, and guarantees better user experience.MIDI is commonly used for recreation sound accompaniment, incoming ring tone, scenes such as quarter-bell.
Existing mobile phone, for example functional mobile phone/smart mobile phone in order to embody system performance preferably, is often supported higher chord number, as 64/72/128 chord etc.The chord number is high more, and the resource consumption of playing the required system of this audio file is high more.Table 1 is the resource consumption table of a typical audio process, and the Mono in the table is a monophony, and Stereo is stereo, 1,000,000 grades machine language instruction number (the Million Instructions Per Second that the per second that the voice of each activation consume is handled; Hereinafter to be referred as: MIPS) for playing the MIPS that monophony/stereo chord need consume.It in the table 1 the resource consumption situation when adopting built-in method for resampling, if adopt external hardware resampling module, then can pay the utmost attention to outside resampling module, then can export the file of low code check at software inhouse, for example: during the output Stereo-44.1kHz of system pattern, if the system resource that only adopts the method for built-in resampling to consume 1.98MIPS, but then only need to consume 0.60MIPS after the external hardware resampling module and just can realize if adopt, then can realize by resample module and the combination of Stereo-11kHz pattern of external hardware.
Table 1
Pattern The MIPS that the voice of each activation consume
Mono-11kHz 0.50
Stereo-11kHz 0.60
Mono-22kHz 0.68
Stereo-22kHz 1.03
Mono-44.1kHz 1.21
Stereo-44.1kHz 1.98
According to table 1 as can be known, to the MIDI file of one 40 chord two-channel, adopt the output of 44.1kHz, needing cpu resource is 40*1.98=79.2MIPS; In like manner 64 chords adopt the output of 44.1kHz, required cpu resource is 64*1.98=126.72MIPS, 72 chords adopt the output of 44.1kHz, required cpu resource is 72*1.98=142.56MIPS, 128 chords adopt the output of 44.1kHz, and required cpu resource is 128*1.98=253.44MIPS.
Fig. 2 is the process flow diagram of document play-back method second embodiment of the present invention, and as shown in Figure 2, on the basis of document play-back method first embodiment of the present invention, mobile phone play MIDI ring file is an example during with multitask, and this document player method can may further comprise the steps:
Step 201, call MIDI ring playing program.
Step 202, the current system loading information of detection.
Wherein, system loading information can be information on load or this combinations of several such as CPU, bus or internal memory.For example: the method that detects cpu load information can be to analyze the frequency and the time of (IDLE) task that enters the free time of CPU in a period of time, obtains the utilization rate of CPU.Different system loading information corresponding file ability to play can set in advance.The attribute corresponding file ability to play of MIDI file can be the chord number of system's support.Fig. 3 is the contrast figure of system loading information and file ability to play in the document play-back method of the present invention, as shown in Figure 3, when system loading information when interval [0, a], respective file ability to play A; When system loading when interval [a, b], respective file ability to play B; When system loading when interval [b, c], respective file ability to play C; When system loading when interval [c, 1], respective file ability to play D.The file ability to play of this moment is the maximum chord number of the current support of system.Wherein the value of a, b and c can be provided with according to the concrete ability to play and the requirement of system.For example get a=30%, b=50%, c=70%.And working as system loading information when [0, a], respective file ability to play A is that maximum 72 chords of supporting are play; When system loading information when [a, b], respective file ability to play B is that maximum 64 chords of supporting are play; When system loading information when [b, c], respective file ability to play C is that maximum 40 chords of supporting are play; When system loading information when [c, 1], respective file ability to play D is that maximum 32 chords of supporting are play.
Step 203, the current maximum MIDI chord number S that supports of the system that obtains.
In the specific implementation process, if when taking a large amount of system resource during the user's download file, need the sound accompaniment of MIDI ring file of broadcast MIDI ring file promptly to be broadcast, detect the system of this moment earlier, the system loading information of obtaining this moment is assumed to be 60%, then can draw from Fig. 3: system loading information 60% corresponding file ability to play C plays for maximum 40 chords of supporting, i.e. the current maximum MIDI chord number S=40 that supports of system.
Step 204, resolve MIDI ring file to be broadcast, obtain the chord number T of this MIDI ring file to be broadcast.
Parsing obtains the chord number T of MIDI ring file to be broadcast, and for example: if T=64, MIDI ring file promptly to be broadcast is 64 chords, if T=32, MIDI ring file promptly to be broadcast is 32 chords.Wherein step 203 and step 204 can be in no particular order on sequential.
If step 205, the current maximum MIDI chord number S that supports of comparison system and the chord number T of this MIDI ring file to be broadcast are T〉S, then execution in step 206, otherwise execution in step 207.
Step 206, from T chord of MIDI ring file to be broadcast, choose the voice data of S chord, execution in step 207.
Because maximum support system's this moment 40 chords are play,, play-over this moment and can appearance play discontinuous situation if MIDI ring file to be broadcast is the file of 64 chords.Can carry out pre-service to the MIDI ring file of these 64 chords to be broadcast, from the MIDI ring file of this 64 chord according to certain rule resolve, decode and synthesize etc. handle after, choose 40 chords wherein.
Step 207, the current MIDI ring data of broadcast.
System chooses suitable play parameter and for example plays the required play parameter of 40 chord MIDI files according to the file ability to play of current support, and 40 current chord MIDI ring data are play.Frequency file even to be broadcast is 64 chord MIDI ring files, and in fact system plays is the MIDI ring data of 40 chords.If frequency file to be broadcast is 32 chord MIDI ring files, then system chooses the MIDI ring data that suitable play parameter is play-overed this 32 chord.
Present embodiment is before displaying audio file, the current maximum chord number of supporting of system is obtained in detection, choosing in the frequency file of waiting to broadcast the chord corresponding with the chord number of current maximum support plays, guarantee the smooth playing of audio file in multi-service and when depositing, improved service quality.
Video file is different with audio file, in OO MPEG4 technology, the frame that adopts for the frame coding mode of each object comprises a plurality of object videos, and is divided into following frame type for the coded system of concrete object video in the video coding: I frame, P frame, B frame.Wherein the P frame be further divided into as with reference to the P frame of frame promptly with reference to P frame (as the reference frame of other P frames or B frame) and not conduct be non-with reference to the P frame of frame with reference to the P frame.Fig. 4 is the synoptic diagram that the present invention includes the image sequence of I frame, P frame, B frame, and as shown in Figure 4, the I frame is represented not adopt the coding of reference picture and the image that produces.The P frame is represented to adopt last I frame or last P frame to carry out motion compensated prediction and the frame of video that produces.The B frame represents to adopt simultaneously last and back one I frame or P frame to make benchmark, carries out motion compensated predictive coding and the frame of video that produces, the B frame, with reference to the P frame and non-all be delta frame with reference to the P frame.
Traditional I, P, B frame coding use the PB frame pattern to increase the frame per second of image under the prerequisite that does not roll up data volume.Fig. 5 is the schematic flow sheet of video coding process of the present invention, and as shown in Figure 5, estimation relates to three kinds of frame structures: I frame, P frame and B frame.The frame that only comprises intraframe coding is called the I frame, I frame or P frame is carried out the frame that previous line prediction obtains be called the P frame, and the bi-directional predicted frame that obtains was called the B frame before and after I frame or P frame were carried out.During estimation, the P two field picture uses the front, and the I frame or the P frame of decoding are called forward prediction as the reference frame recently; And that the B two field picture uses two two field pictures to be called as prediction reference is bi-directional predicted.Prior to coded frame (forward prediction), another frame is later than coded frame (back forecast) to one of them reference frame on DISPLAY ORDER on DISPLAY ORDER.The reference frame of B frame under any circumstance all is I frame or P frame.The B two field picture is the ratio of compression height not only, and because the B frame itself is not used in the benchmark of reference prediction, so error can not transmitted.
Fig. 6 is the process flow diagram of document play-back method the 3rd embodiment of the present invention, and as shown in Figure 6, on the basis of document play-back method first embodiment of the present invention, video file such as mobile phone play MP4 is an example during with multitask, and this document player method can may further comprise the steps:
Step 301, call the video decode program.
Step 302, the current system of detection obtain system loading information.
Step 303, obtain the maximum decoding frame number of the current support of system.
Wherein can treat by Video Decoder in the system and broadcast video file and decode, play by media player then, the current file ability to play of wherein corresponding with this system loading information Video Decoder can be the maximum decoding frame number of the corresponding current support of system of this Video Decoder and the attribute of waiting to broadcast video file.For example: in multitask and when depositing, the Video Decoder that obtains mobile phone wait to broadcast under the attribute Profile X and Level Y of video file, the maximum decoding frame number of the corresponding current support of system.Be example with the MPEG4 video encoding standard below, the implication of Profile and Level is simply introduced.Video encoding standard is a graduate series: the set by employed coding tools is divided into different " class (Profiles) ", the complexity that expression control is calculated; Be divided into simultaneously different " level (Levels) " again, bit stream correlation parameters such as the resolution of main and coded image and code check." level " with " class " and Several combination constitute the subclass of MPEG-4 video encoding standard under certain application-specific, for example: to the image of a certain input format, adopt specific collection the compressed encoding instrument, produce encoding code stream in the schedule speed scope etc.Table 2 is the Profile of typical MPEG4 and the relation table of Level.
Table 2
Figure A200810247590D00151
Profile in the mpeg 4 standard comprises several classes such as Simple Profile, Simple ScalableProfile, Advanced Simple Profile, Core Profile and Main Profile.As shown in table 2, each attribute Profile X that waits to broadcast video file and Level Y system loading information simultaneously can be corresponding not different the maximum that sets in advance decoding frame number.
Step 304, obtain the frame number that this waits to broadcast video file.
Analyze video code flow to be decoded, obtain the parameter of waiting to broadcast video file that current needs are resolved, for example: this getattr is the frame number of waiting to broadcast video file of Profile X and Level Y.And the B frame number that can obtain in the video code flow is M, is N with reference to the P frame number, and is non-with reference to P frame number L.Wherein step 303 and 304 can be in no particular order on sequential.
Step 305, if wait to broadcast video file greater than the maximum frame number of decoding, then execution in step 310, otherwise execution in step 306.
Step 306, if M 〉=K, then execution in step 310, otherwise execution in step 307.
Wherein K is a difference of waiting to broadcast the maximum decoding frame number that video file and system support.Abandon the maximum decoding frame number that can satisfy the current support of system behind K the delta frame.The frame number K whether the number M of the B frame that judgement can abandon satisfies the demand and abandon.If M 〉=K, promptly abandoning K this video file of B frame can satisfy: the maximum decoding frame number of this Video Decoder current support under Profile X and Level Y condition, at this moment can random drop K execution in step 310 behind the B frame.If B1<K, promptly abandon the maximum decoding frame number that this video file behind all M the B frame still can not satisfy the current support of system, can calculate the frame number that also needs to abandon is E, i.e. E=K-M then abandons at this moment execution in step 307 behind all M the B frame.The meaning that wherein abandons the B frame is: after this frame of identification is the B frame in the system layer of code stream, this B frame is not decoded and playback process, directly skip this B frame, take off frame data and continue decoding and broadcast in code stream.
Step 307, if N 〉=E, then execution in step 310, otherwise execution in step 308.
The number whether number N of the reference P frame that judgement can abandon satisfies the frame that needs also abandon is E.Can satisfy the maximum decoding frame number of the current support of system if N 〉=E is random drop E with reference to this video file behind the P frame, then abandon E with reference to execution in step 310 behind the P frame; The frame number that also needs to abandon is F with reference to the maximum decoding frame number that still can not satisfy the current support of system behind this video file behind the P frame if N<E is random drop E, and promptly F=N-E then abandons all L with reference to execution in step 308 behind the P frame.The meaning that wherein abandons with reference to the P frame is: this frame of identification is not decoded and playback process with reference to the P frame to this for after with reference to the P frame in the system layer of code stream, directly skips this with reference to the P frame, takes off frame data and continue decoding and play in code stream.
Step 308, if L 〉=F execution in step 310 then, otherwise execution in step 309.
If whether the non-number L with reference to the P frame that can abandon is less than the number F of the frame that also needs to abandon.If to be random drop F non-can satisfy the maximum decoding frame number of the current support of system with reference to this video file behind the P frame for L 〉=F, then abandon F non-with reference to execution in step 310 behind the P frame; If it is individual non-with reference to the maximum decoding frame number that still can not satisfy the current support of system behind this video file behind the P frame that L<F promptly abandons all L, then abandon all L with reference to execution in step 309 behind the P frame.Wherein abandoning the non-meaning with reference to the P frame is: this frame of identification is non-with reference to behind the P frame in the system layer of code stream, this is not non-ly decoded and playback process with reference to the P frame, skips directly that this is non-with reference to the P frame, takes off frame data and continue decoding and play in code stream.
Step 309, write down and return current state.
Abandon all B frames of waiting to broadcast in the video file this moment, with reference to the P frame, the non-requirement that all can not satisfy the maximum decoding frame number of the current support of this Video Decoder with reference to the P frame, can by call function notify upper layer software (applications) for example current the waiting of video player broadcast the state of video file, by video player this video file to be broadcast is handled, perhaps notify the user should wait to broadcast the state of video file by call function, for example inform user's " shake may appear in this video; whether need to stop file and download the back broadcast " etc., carry out next step operation according to user's selection then by dialog box.
Step 310, current video file is decoded and play.
After Video Decoder is decoded to current video file, media player is play decoded video file, wherein current video file can be the video file to be broadcast that does not have frame losing, also can be the remaining video data of losing behind a part of delta frame.
Present embodiment is before playing video file, the maximum decoding frame number of the current support of system is obtained in detection, chooses the video data corresponding with the maximum decoding frame number of current support and decodes and play, in multi-service and when depositing, guarantee the smooth playing of video file, and improved service quality.
One of ordinary skill in the art will appreciate that: all or part of step that realizes said method embodiment can be finished by the relevant hardware of programmed instruction, aforesaid program can be stored in the computer read/write memory medium, this program is carried out the step that comprises said method embodiment when carrying out; And aforesaid storage medium comprises: various media that can be program code stored such as R0M, RAM, magnetic disc or CD.
Fig. 7 is the structural representation of file playing device first embodiment of the present invention, and as shown in Figure 7, this document playing device comprises: first acquisition module 1, second acquisition module 2 and choose module 3.Wherein first acquisition module 1 is used to obtain system loading information; Second acquisition module 2 is used for obtaining the file ability to play that corresponding system supports according to described system loading information; Choosing module 3 is used for choosing and waits to broadcast the file data corresponding with described file ability to play and play.
Particularly, system is when calling playing program file is play, can detect current system earlier, and the current system loading information of the system that obtains, and obtain the file ability to play that corresponding system supports according to this system loading information, wherein system loading information comprises: information on loads such as CPU, bus or internal memory, perhaps this combination of several.Different system loading information corresponding file ability to play can set in advance.Wherein the method to set up of corresponding relation can have multiplely between system loading information and the file ability to play, and for example: the maximum chord number according to the current support of system is provided with, or according to settings such as the maximum decoding frame number of the current support of system, video encoding capability.Therefore, file playing device can also comprise module is set, and is used to be provided with the corresponding relation of described system loading information and described file ability to play.File to be broadcast can be multifiles such as audio frequency, video.If wait to broadcast file and be frequency file to be broadcast, then second acquisition module 2 obtains the maximum chord number of this current support of system, chooses module 3 then and chooses in the frequency file of waiting to broadcast and play with the maximum chord number corresponding audio data of current support.If wait to broadcast file and be video file to be broadcast, then second acquisition module 2 obtains the maximum decoding frame number of the current support of system, chooses module 3 then and chooses to wait to broadcast in the video file with the maximum of the system current support corresponding video data of frame number of decoding and play.
Present embodiment is before played file, detect and obtain the file ability to play of playing device by acquisition module, choosing module chooses and waits to broadcast in the file data corresponding with the current file ability to play of playing device and play, guaranteed in multi-service and the smooth playing of multifile etc. when depositing, improved service quality.
Fig. 8 is the structural representation of file playing device second embodiment of the present invention, as shown in Figure 8, on the basis of file playing device first embodiment of the present invention, second acquisition module 2 of this document playing device can comprise that first obtains submodule 21 and/or second and obtain submodule 22.Wherein first obtain submodule 21 and be used for obtaining the maximum chord number that the system corresponding with the attribute of the frequency file of waiting to broadcast supports according to described system loading information; Second obtains submodule 22 is used for obtaining the maximum decoding frame number that the system corresponding with the attribute of waiting to broadcast video file supports according to described system loading information.Choosing module 3 can comprise: audio frequency chooses submodule 31 and/or video is chosen submodule 32.Its sound intermediate frequency is chosen that submodule 31 is used for and is play if the chord number of the frequency file of waiting to broadcast greater than the maximum chord number that system supports, is then chosen in the frequency file of waiting to broadcast with the maximum chord number corresponding audio data of system support; Video is chosen that submodule 32 is used for and is play if the frame number of waiting to broadcast video file greater than the maximum decoding frame number that system supports, is then selected to wait to broadcast in the video file video data corresponding with the maximum decoding frame number of system support.Further, video is chosen submodule 32 and can be comprised that first processing unit 321, second processing unit 322, the 3rd processing unit 323 and manage unit 324 everywhere.Wherein to be used for the difference of the frame number if the described frame number of waiting to broadcast video file and the maximum of system's support are decoded be K to first processing unit 321, whether judging this number M that waits to broadcast B frame in the video file more than or equal to K, is then to skip K B frame, remaining video data is play; Second processing unit 322 is used for if this number M that waits to broadcast video file B frame is E less than the difference of K and K and M, judging that whether this wait to broadcast in the video file number N with reference to the P frame more than or equal to E, is then to skip E with reference to the P frame, remaining video data is play; The 3rd processing unit 323 is used for if the number M that waits to broadcast video file B frame is F less than K, with reference to the number N of P frame less than the difference of E and E and N, judge that whether this wait to broadcast in the video file non-number L with reference to the P frame more than or equal to F, be then skip F non-with reference to the P frame, remaining video data is play; The manage everywhere that unit 324 is used for if the number M that waits to broadcast video file B frame less than K, with reference to the number N of P frame less than E and non-number L with reference to the P frame less than F, then return the state that this waits to broadcast video file, wherein M, N, L, E, F are integer.
Particularly, file to be broadcast can be for waiting to broadcast frequency file and video file to be broadcast, the file ability to play can be for synthetic, decoding, synchronously, ability such as broadcast.Waiting to broadcast file when waiting to broadcast frequency file, first obtains the submodule 21 file ability to play current according to the system loading Information Acquisition System.Different files can corresponding different file ability to play, for example: if the current file ability to play of this system is the maximum chord number of the system current support corresponding with the attribute of the frequency file of waiting to broadcast, then audio frequency is chosen submodule 31 and is chosen in the frequency file of waiting to broadcast with the maximum chord number corresponding audio data of system current support and play.For example: if the chord number T of the frequency file of waiting to broadcast is greater than the maximum chord number S of the current support of described system, then audio frequency is chosen submodule 31 and is chosen the voice data of S chord in the described frequency file of waiting to broadcast and play; If the chord number T of the described frequency file of waiting to broadcast is less than the maximum chord number S of the current support of described system, then audio frequency is chosen the voice data that submodule 31 can be play-overed T chord in the described frequency file of waiting to broadcast.The method that the frequency file of waiting in the present embodiment to broadcast is play can not repeat them here with reference to the description among document play-back method second embodiment of the present invention.
Waiting to broadcast file when waiting to broadcast video file, second obtains the submodule 22 file ability to play current according to the system loading Information Acquisition System.If the current file ability to play of system is the maximum decoding frame number of the system current support corresponding with the attribute of waiting to broadcast video file, and the frame number of waiting to broadcast video file is greater than the maximum frame number of decoding, if the difference of the two is K, then whether first processing unit 321 judges the number M that waits to broadcast B frame in the video file more than or equal to K, is then to skip K B frame, remaining video data is play; Otherwise if the difference of K and M is E, then second processing unit 322 is judged and describedly whether is waited to broadcast in the video file number N with reference to the P frame more than or equal to E, is that then to skip E individual with reference to the P frame, remaining video data is play; Otherwise if the difference of E and N is F, then the 3rd processing unit 323 is judged and describedly whether is waited to broadcast in the video file non-number L with reference to the P frame more than or equal to F, is that then to skip F individual non-with reference to the P frame, remaining video data is play; If not otherwise with reference to the number L of P frame less than F, then manage unit 324 everywhere and return the described state of waiting to broadcast video file.Wait in the present embodiment that the method for broadcasting the video file broadcast can not repeat them here with reference to the description among document play-back method the 3rd embodiment of the present invention.
Present embodiment by first obtain submodule detect obtain the file ability to play of system after, audio frequency is chosen submodule and is chosen to wait to broadcast in the file with system current file ability to play corresponding audio data and play; By second obtain submodule detect obtain the file ability to play of system after, video is chosen submodule and is chosen and wait to broadcast in the file video data corresponding with system current file ability to play and play; Guaranteed multi-service and when depositing system the smooth playing of multifiles such as audio frequency, video has been improved professional service quality such as multimedia.
It should be noted that at last: above embodiment only in order to technical scheme of the present invention to be described, is not intended to limit; Although with reference to previous embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that: it still can be made amendment to the technical scheme that aforementioned each embodiment put down in writing, and perhaps part technical characterictic wherein is equal to replacement; And these modifications or replacement do not make the essence of appropriate technical solution break away from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (12)

1, a kind of document play-back method is characterized in that, comprising:
Obtain system loading information;
Obtain the file ability to play that corresponding system supports according to described system loading information;
Choose and wait to broadcast data corresponding in the file and play with described file ability to play.
2, document play-back method according to claim 1 is characterized in that, describedly obtains the file ability to play that corresponding system supports according to described system loading information, comprising:
Obtain the maximum chord number that the system corresponding with the attribute of the frequency file of waiting to broadcast supports according to described system loading information; And/or
Obtain the maximum decoding frame number that the system corresponding with the attribute of waiting to broadcast video file supports according to described system loading information.
3, document play-back method according to claim 2 is characterized in that, described choosing waited to broadcast data corresponding with described file ability to play in the file and play, and comprising:
If the chord number of the described frequency file of waiting to broadcast is then chosen in the described frequency file of waiting to broadcast and is play with described maximum chord number corresponding audio data greater than described maximum chord number; Or
If the described frame number of waiting to broadcast video file greater than described maximum decoding frame number, is then selected describedly to wait to broadcast video data corresponding with described maximum decoding frame number in the video file and play.
4, document play-back method according to claim 3, it is characterized in that, if the described frame number of waiting to broadcast video file greater than described maximum decoding frame number, is then selected describedly to wait to broadcast video data corresponding with described maximum decoding frame number in the video file and play, and comprising:
If the described frame number of waiting to broadcast video file is K with described maximum difference of decoding frame number, whether judge the described number M that waits to broadcast B frame in the video file more than or equal to K, be then to skip K B frame, remaining video data is play;
Otherwise, if the difference of K and M is E, judges and describedly whether wait to broadcast in the video file number N with reference to the P frame more than or equal to E, be that then to skip E individual with reference to the P frame, remaining video data is play;
Otherwise, if the difference of E and N is F, judges and describedly whether wait to broadcast in the video file non-number L with reference to the P frame more than or equal to F, be that then to skip F individual non-with reference to the P frame, remaining video data is play;
Otherwise, return the described state of waiting to broadcast video file, wherein M, N, L, E, F are integer.
5, according to any described document play-back method of claim 1-4, it is characterized in that, also comprise: the corresponding relation that described system loading information and described file ability to play are set.
According to any described document play-back method of claim 1-4, it is characterized in that 6, described system loading information comprises any one or its combination in cpu load information, bus load information and the Memory Load information.
7, a kind of file playing device is characterized in that, comprising:
First acquisition module is used to obtain system loading information;
Second acquisition module is used for obtaining the file ability to play that corresponding system supports according to described system loading information;
Choose module, be used for choosing and wait to broadcast the file data corresponding and play with described file ability to play.
8, file playing device according to claim 7 is characterized in that, described second acquisition module comprises:
First obtains submodule, is used for obtaining the maximum chord number that the system corresponding with the attribute of the frequency file of waiting to broadcast supports according to described system loading information; And/or
Second obtains submodule, is used for obtaining the maximum decoding frame number that the system corresponding with the attribute of waiting to broadcast video file supports according to described system loading information.
9, file playing device according to claim 8 is characterized in that, the described module of choosing comprises:
Audio frequency is chosen submodule, is used for if the chord number of the described frequency file of waiting to broadcast greater than described maximum chord number, is then chosen in the described frequency file of waiting to broadcast and play with described maximum chord number corresponding audio data; And/or
Video is chosen submodule, is used for if the described frame number of waiting to broadcast video file greater than described maximum decoding frame number, is then selected describedly to wait to broadcast video data corresponding with described maximum decoding frame number in the video file and play.
10, file playing device according to claim 9 is characterized in that, described video is chosen submodule and comprised any one or its combination with lower unit:
First processing unit is used for whether judging the described number M that waits to broadcast B frame in the video file more than or equal to K if the described frame number of waiting to broadcast video file is K with described maximum difference of decoding frame number, is then to skip K B frame, remaining video data is play;
Second processing unit, be used for if the described number M that waits to broadcast video file B frame is E less than the difference of K and K and M, judging and describedly whether wait to broadcast in the video file number N with reference to the P frame more than or equal to E, is then to skip E with reference to the P frame, remaining video data is play;
The 3rd processing unit, be used for if the described number M that waits to broadcast video file B frame is F less than K, with reference to the number N of P frame less than the difference of E and E and N, judge and describedly whether wait to broadcast in the video file non-number L with reference to the P frame more than or equal to F, be then skip F non-with reference to the P frame, remaining video data is play;
The manages the unit everywhere, be used for if the described number M that waits to broadcast video file B frame less than K, with reference to the number N of P frame less than E and non-number L with reference to the P frame less than F, then return the described state of waiting to broadcast video file, wherein M, N, L, E, F are integer.
11, according to any described file playing device of claim 7-10, it is characterized in that, also comprise:
Module is set, is used to be provided with the corresponding relation of described system loading information and described file ability to play.
According to any described file playing device of claim 7-10, it is characterized in that 12, described system loading information comprises any one or its combination in cpu load information, bus load information and the Memory Load information.
CNA2008102475902A 2008-12-30 2008-12-30 File playing method and apparatus Pending CN101477820A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008102475902A CN101477820A (en) 2008-12-30 2008-12-30 File playing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008102475902A CN101477820A (en) 2008-12-30 2008-12-30 File playing method and apparatus

Publications (1)

Publication Number Publication Date
CN101477820A true CN101477820A (en) 2009-07-08

Family

ID=40838511

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008102475902A Pending CN101477820A (en) 2008-12-30 2008-12-30 File playing method and apparatus

Country Status (1)

Country Link
CN (1) CN101477820A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196272A (en) * 2010-03-11 2011-09-21 中国科学院微电子研究所 P frame coding method and device
CN102984587A (en) * 2011-09-05 2013-03-20 深圳市快播科技有限公司 An optimization method, an optimization device and an on-demand terminal for video playing
CN105491448A (en) * 2015-12-07 2016-04-13 广州华多网络科技有限公司 Animation data play method and device
CN105764166A (en) * 2014-12-17 2016-07-13 联芯科技有限公司 Multi-channel terminal, system MIPS control method and module thereof
CN108282696A (en) * 2018-02-07 2018-07-13 北京易讯理想科技有限公司 A kind of hardware resource distribution method that sequence frame image plays

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102196272A (en) * 2010-03-11 2011-09-21 中国科学院微电子研究所 P frame coding method and device
CN102984587A (en) * 2011-09-05 2013-03-20 深圳市快播科技有限公司 An optimization method, an optimization device and an on-demand terminal for video playing
CN102984587B (en) * 2011-09-05 2016-05-25 深圳市快播科技有限公司 A kind of optimization method, device and terminal of video playback
CN105764166A (en) * 2014-12-17 2016-07-13 联芯科技有限公司 Multi-channel terminal, system MIPS control method and module thereof
CN105491448A (en) * 2015-12-07 2016-04-13 广州华多网络科技有限公司 Animation data play method and device
CN105491448B (en) * 2015-12-07 2018-11-23 广州华多网络科技有限公司 A kind of animation data playback method and device
CN108282696A (en) * 2018-02-07 2018-07-13 北京易讯理想科技有限公司 A kind of hardware resource distribution method that sequence frame image plays

Similar Documents

Publication Publication Date Title
CN102474659B (en) Dispensing device, receiving system, sending method, method of reseptance and transmission system
CN105933724A (en) Video producing method, device and system
JP5788995B2 (en) Dynamic video switching
CN103475927B (en) Online-video real-time speed change play method and system thereof
JP6316828B2 (en) Media hardware resource allocation
CN102143382A (en) Apparatus and method for providing in a terminal a pause function for a broadcast stream
CN101477820A (en) File playing method and apparatus
CN101102326A (en) Information processing apparatus, information processing method, information processing program and recording medium
CN1770646A (en) Wireless communication terminal and its method for generating moving picture using still image
CN101416139A (en) Systems and methods for enhanced haptic effects
JP2007221323A (en) Method for processing information, method for displaying thumbnail of moving picture, decoding device, and information processor
CN101131816A (en) Audio file generation method, device and digital player
CN105992005A (en) Video decoding method and device and terminal device
CN106101766A (en) The control method for playing back of a kind of video ads, device and electronic equipment
CN101350924A (en) Encoding multi-media signal
CN104956683A (en) Adaptive noise reduction engine for streaming video
CN103139638A (en) Reproduction apparatus, reproduction method, and program
CN102724557A (en) Method and device for coding control in multi-flow audio live broadcasting
US8619873B2 (en) Media processing method and media processing program
CN101339789A (en) Implementing method of multimedia engine
JP2007036495A (en) Reproducer, compressor, recorder and reproducing method
KR101569502B1 (en) Apparatus, method and computer readable recording medium for assigning trnscording works
CN104363491A (en) Apparatus and method for reproducing multi-sound channel contents using dlna in mobile terminal
US20080058973A1 (en) Music playback system and music playback machine
CN109669691A (en) Platform universal control method and system based on built-in Linux audio player

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Open date: 20090708