CN105142004B - Multimedia file read method and device - Google Patents
Multimedia file read method and device Download PDFInfo
- Publication number
- CN105142004B CN105142004B CN201510543847.9A CN201510543847A CN105142004B CN 105142004 B CN105142004 B CN 105142004B CN 201510543847 A CN201510543847 A CN 201510543847A CN 105142004 B CN105142004 B CN 105142004B
- Authority
- CN
- China
- Prior art keywords
- read
- multimedia file
- region
- read buffer
- data
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
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)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of multimedia file read methods, when detecting that the play position of the broadcast interface input based on multimedia file adjusts operation, determine that the adjustment operates corresponding reading position whether in buffer circle;When the reading position is in the non-read buffer region of the buffer circle, from the reading position in the non-read buffer region read required data;And in the update buffer circle the position in read buffer region and the non-read buffer region so that be read it is described needed for data be located in the read buffer region, when the corresponding capacity in the region of read buffer is more than the first capacity, removing partial data makes the corresponding capacity in read buffer region remain first capacity.The invention also discloses a kind of multimedia file reading devices.The present invention improves the operational efficiency of terminal in multimedia file reading process.
Description
Technical field
The present invention relates to multimedia technology field more particularly to a kind of multimedia file read methods and device.
Background technology
With the development of multimedia technology, every business of multimedia technology field is also more and more ripe, in multimedia text
In the playing process of part, the broadcasting of multimedia file, which is generally inputted by data, reads, and the source of data input can be player
Local multimedia file, can also be the multimedia file of network flow.Present player is when playing multimedia file, all
Can caching first be established to multimedia file to be played, multimedia file then be read in the caching, under normal circumstances, all
It is just to empty the cache after multimedia file is read, and empty all data cached all removings every time all.And work as
When user's played file carries out drag operation, played data are read it is possible that may require that, but be required for each time again
Write-in caching, thereby results in and is repeatedly written.Also, when the multimedia file of reading is video file, the appearance of required caching
Magnitude is also larger, and the memory space that occupancy is cached in terminal is larger, causes the operational efficiency of terminal low.
Invention content
It is a primary object of the present invention to propose a kind of multimedia file read method and device, it is intended to solve multimedia text
In part reading process, the memory space for caching occupancy is larger, the technical problem for causing the operational efficiency of terminal low.
To achieve the above object, a kind of multimedia file read method provided by the invention, the multimedia file are read
Method includes the following steps:
When detecting that the play position of the broadcast interface input based on multimedia file adjusts operation, the adjustment is determined
Corresponding reading position is operated whether in buffer circle;
When the reading position is in the non-read buffer region of the buffer circle, from the non-read buffer region
The reading position at start to read required data;And
Update in the buffer circle the position in read buffer region and the non-read buffer region so as to be read
It is described needed for data be located in the read buffer region, when the corresponding capacity in the region of read buffer is more than the first capacity
When, removing partial data makes the corresponding capacity in read buffer region remain first capacity.
It is preferably, described when detecting that the play position of the broadcast interface input based on multimedia file adjusts operation,
Determine that the adjustment operates corresponding reading position whether after the step in buffer circle, the multimedia file is read
Method further includes:
When the reading position is in the region of read buffer, the reading position from the region of read buffer
The place of setting starts to read the required data.
It is preferably, described when detecting that the play position of the broadcast interface input based on multimedia file adjusts operation,
Determine that the adjustment operates corresponding reading position whether after the step in buffer circle, the multimedia file is read
Method further includes:
When the reading position is not in the buffer circle, the reading position is obtained in the multimedia file
In first position and the non-read buffer region in one end far from the read buffer region in the multimedia file
In the second position;
It is pre- to determine whether the second capability value in the multimedia file between first position and the second position is less than first
If capability value;
If second capability value is less than or equal to the first preset capacity value, chosen from the non-read buffer region
Capacity is data in read buffer region described in the data of first capacity are replaced;
The data in the non-read buffer region are deleted, and are continued in the free memory in the buffer circle
The data in the multimedia file after the second position are written to update the non-read buffer region;
When the reading position is located in the non-read buffer region, the reading position from the non-read buffer region
It sets and starts to read the required data.
Preferably, whether the second capability value in the determination multimedia file between first position and the second position
After the step of less than the first preset capacity value, the multimedia file read method further includes:
If second capability value is more than the first preset capacity value, determine the reading position in multimedia text
The corresponding storage location of part;
Start to directly read the required data in the corresponding storage location of multimedia file.
Preferably, the multimedia file read method further includes:
When the data capacity in the non-read buffer region is less than the second preset capacity value, in the buffer circle
The data continued to write in free memory in the multimedia file are to update the non-read buffer region.
In addition, to achieve the above object, the present invention also proposes a kind of multimedia file reading device, the multimedia file
Reading device includes:
Determining module, in the play position adjustment operation for detecting the broadcast interface input based on multimedia file
When, determine that the adjustment operates corresponding reading position whether in buffer circle;
Read module, for when the reading position is in the non-read buffer region of the buffer circle, from described
Start to read required data at the reading position in non-read buffer region;
Processing module, for updating in the buffer circle position in read buffer region and the non-read buffer region
So that the required data being read are located in the read buffer region, when the corresponding capacity in the region of read buffer
When more than the first capacity, removing partial data makes the corresponding capacity in read buffer region remain first capacity.
Preferably, the read module is additionally operable to when the reading position is in the region of read buffer, from described
Start to read the required data at the reading position in read buffer region.
Preferably, the multimedia file reading device further includes:
Acquisition module, for when the reading position is not in the buffer circle, obtaining the reading position and existing
One end far from the read buffer region in first position and the non-read buffer region in the multimedia file exists
The second position in the multimedia file;
The determining module is additionally operable to determine in the multimedia file that second between first position and the second position is held
Whether magnitude is less than the first preset capacity value;
Replacement module is not read if being less than or equal to the first preset capacity value for second capability value from described
Chosen in buffer zone the data that capacity is first capacity replace described in data in read buffer region;
The processing module is additionally operable to delete the data in the non-read buffer region, and in the buffer circle
Free memory in continue to write to the data in the multimedia file after the second position to update the non-read buffer
Region;
The read module is additionally operable to, when the reading position is located in the non-read buffer region, not read from described
The reading position of buffer zone starts to read the required data.
Preferably, the determining module determines if being additionally operable to second capability value is more than the first preset capacity value
The reading position is in the corresponding storage location of the multimedia file;
The read module is additionally operable to start to directly read the required number in the corresponding storage location of multimedia file
According to.
Preferably, the multimedia file reading device further includes:
Update module is used for when the data capacity in the non-read buffer region is less than the second preset capacity value, described
The data continued to write in free memory in buffer circle in the multimedia file are to update the non-read buffer
Region.
Multimedia file read method and device proposed by the present invention read multimedia text in preset buffer circle
Number of packages evidence, and when reading position is in the non-read buffer region of the buffer circle, the reading from the non-read buffer region
The fetch bit place of setting starts to read required data, and update when data needed for reading in the buffer circle read buffer region and
The position in the non-read buffer region make to be read it is described needed for data be located in the read buffer region, when it is described
When the corresponding capacity in read buffer region is more than the first capacity, removing partial data makes described in it corresponding capacity in read buffer region
The first capacity is remained, rather than in multimedia file reading process, multimedia file data has been read and has just been emptied the cache,
When this programme reads multimedia file data in the buffer circle, by emptying elder generation in buffer multimedia file data
The part multimedia file data of caching reduces the memory space that caching occupies, improves the operational efficiency of terminal.
Description of the drawings
Fig. 1 is the flow diagram of multimedia file read method first embodiment of the present invention;
Fig. 2 is the flow diagram of multimedia file read method second embodiment of the present invention;
Fig. 3 is the flow diagram of multimedia file read method 3rd embodiment of the present invention;
Fig. 4 is the high-level schematic functional block diagram of multimedia file reading device first embodiment of the present invention;
Fig. 5 is the high-level schematic functional block diagram of multimedia file reading device second embodiment of the present invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The present invention provides a kind of multimedia file read method.
Referring to Fig.1, Fig. 1 is the flow diagram of multimedia file read method first embodiment of the present invention.
The present embodiment proposes that a kind of multimedia file read method, the multimedia file read method include:
Step S10 is determined when detecting that the play position of the broadcast interface input based on multimedia file adjusts operation
The adjustment operates corresponding reading position whether in buffer circle;
In the present embodiment, before the step S10, including step:In the reading instruction for receiving multimedia file,
The corresponding third capability value of free memory in preset buffer circle is obtained, and is written corresponding with the third capability value
Required data.The multimedia file reading instruction triggering mode include:A, user's broadcasting in the multimedia file
Put interface click start play when, trigger the multimedia file reading instruction.B, in broadcasting circle of the multimedia file
Face receive input speech play instruction such as voice broadcast start play when, trigger the multimedia file reading instruction.
It is understood that creating buffer circle in the present embodiment in advance, the memory space of the buffer circle is according to specific need
Be configured, as multimedia file be audio file when, the memory space of the buffer circle may be configured as 1M, described more
When media file is video file, the memory space of the buffer circle may be configured as 30M, and the multimedia file is picture
When file, the memory space of the buffer circle may be configured as 200K.Wherein, the buffer circle preferably includes to have read to delay
Region, non-read buffer region and Free Region are deposited, the Free Region is it can be appreciated that white space, that is, entire ring
Shape buffering divides into three regions, and logically its head and the tail can be regarded as and is connected in three regions, read buffer region table
Show that the data in these regions be read, still preserving now is not read for the possible backward reading requirement of player
Buffer zone is the data read inside network flow or local file, is not yet read at present, and Free Region indicates not
The memory space being written into.To be best understood from this programme, its section can be divided using 3 pointers in the buffer circle,
It is the start pointer Begin of caching respectively, has read storage pointer Done, had been written into buffer pointers End, Begin and Done structure
At read buffer region, Done and End constitute non-read buffer region, and End and Begin constitute Free Region, due to being that annular is slow
Area is rushed, then is returned to the head of caching when End pointers are moved to end, i.e., is overlapped with the Begin pointers.Each region
The update of position can be realized by the corresponding pointer of movement.
Step S20 does not read to delay when the reading position is in the non-read buffer region of the buffer circle from described
It deposits and starts to read required data at the reading position in region;
In the present embodiment, the play position adjustment operation inputted based on broadcast interface where multimedia file is being detected
When, first determine that the adjustment operates corresponding reading position whether in the buffer circle, if in the buffer circle
It is interior, further determine that the adjustment operates whether corresponding reading position does not read in buffer zone described, if the reading
Position is not read in buffer zone described, then can directly from the reading position in the non-read buffer region needed for reading
Data.
Step S30, update in the buffer circle position in read buffer region and the non-read buffer region so that
The required data being read are located in the read buffer region, and when the region of read buffer, corresponding capacity is more than
When the first capacity, removing partial data makes the corresponding capacity in read buffer region remain first capacity.
In the present embodiment, in order to improve the operational efficiency of terminal in multimedia file reading process, preferably ring is being created
When shape buffering area, corresponding first capability value in read buffer region is first set, and first capability value is for ensureing in multimedia
In file reading process, only retain the multimedia file data of the capability value length, beyond first capability value
Multimedia file data can be emptied, that is, in multimedia file in reading process, first update read buffer region
The required data being read are made to be located in the read buffer region with the position in the non-read buffer region, when described
When the corresponding capacity in read buffer region is more than the first capacity, removing partial data makes described in it corresponding appearance in read buffer region
Amount remains the first capacity.The free space that the buffer circle keeps enough in real time is realized, is not written with caching more
Media file data, even if the memory space of the buffer circle is less than multimedia file to be read, also due to clear in real time
Sky caching so that the space of the multimedia file data actually read is more than the memory space of the buffer circle, improves
The utilization rate of buffer circle reads multimedia file number without being gone because of inadequate buffer space in memory or local file
According to also improving the reading efficiency of multimedia file.In the present embodiment, the step S30 can be regarded as from pointer angle:First
The reading position is determined, using the reading position as storage pointer Done has been read, then according to first capability value
Adjust start pointer Begin so that the start pointer Begin and the memory space read between storage pointer Done
First capability value is remained, at this point, since the start pointer Begin is moved, then the End pointers and Begin refer to
Needle constitutes Free Region and also accordingly increases, that is, increases the free space of buffer circle.It is understood that along with
Begin pointers are moved to new position from original position.The data being initially positioned between this two positions have been cleared, i.e., have been read described in original
The partial data of buffer zone has been eliminated.
Further, it is the flexibility of raising multimedia file reading, after the step S10, the multimedia file
Read method further includes step:When the reading position is in the region of read buffer, from the region of read buffer
The reading position at start to read it is described needed for data.It is understood that detecting broadcasting based on multimedia file
The play position adjustment operation of interface input is put, and when the reading position is in the region of read buffer, then can directly be existed
Start to read the required data in the read buffer region at the reading position, realizes user in multimedia file
To when operation before being had input in reading process, required data are stated without repeating to be repeatedly written data to caching also directly read.
The multimedia file read method that the present embodiment proposes reads multimedia file number in preset buffer circle
According to, and when reading position is in the non-read buffer region of the buffer circle, the reading position from the non-read buffer region
The place of setting starts to read required data, and read buffer region and described is updated needed for reading in the buffer circle when data
The position in non-read buffer region makes the required data being read be located in the read buffer region, has read to delay when described
When depositing the corresponding capacity in region more than the first capacity, removing partial data makes the corresponding capacity holding in read buffer region described in it
For the first capacity, rather than in multimedia file reading process, multimedia file data is read and has just been emptied the cache, we
When case reads multimedia file data in the buffer circle, first cached by being emptied in buffer multimedia file data
Part multimedia file data, reduce caching occupy memory space, improve the operational efficiency of terminal.
Further, in order to improve the flexibility of multimedia file reading, the more matchmakers of the present invention are proposed based on first embodiment
The second embodiment of body file reading, with reference to Fig. 2, in the present embodiment, the multimedia file read method and first
Difference lies in after the step S10, the multimedia file read method further includes method described in embodiment:
Step S40 obtains the reading position described more when the reading position is not in the buffer circle
One end far from the read buffer region in first position and the non-read buffer region in media file is described more
The second position in media file;
Step S50 determines whether the second capability value in the multimedia file between first position and the second position is small
In the first preset capacity value;
Step S60, if second capability value is less than or equal to the first preset capacity value, from the non-read buffer area
Chosen in domain the data that capacity is first capacity replace described in data in read buffer region;
Step S70 deletes the data in the non-read buffer region, and the available storage in the buffer circle is empty
It is interior to continue to write to the data in the multimedia file after the second position to update the non-read buffer region;
Step S80, when the reading position is located in the non-read buffer region, the institute from the non-read buffer region
Reading position is stated to start to read the required data.
In the present embodiment, if the reading position is not in the buffer circle, illustrate multimedia text to be read
Number of packages, when detecting that the adjustment inputted based on broadcast interface where multimedia file is operated, is first obtained according to not being written also successfully
The adjustment operates in first position and the non-read buffer region of the corresponding reading position in the multimedia file
The second position of the one end far from read buffer region in the multimedia file, then will be first in the multimedia file
The second capability value between position and the second position is compared with the first preset capacity value, finally according to comparison result, you can
Determine the magnitude relationship of second capability value and the first preset capacity value, in the present embodiment, preferably described first is default
Capability value is the capability value of Free Region in the buffer circle, when second capability value is less than or equal to described first in advance
If capability value, illustrate that the distance far from the one end in read buffer region is small in the reading position distance non-read buffer region
In or equal to the Free Region, then the data that capacity is first capacity can be first chosen from the non-read buffer region and are replaced
The data in the read buffer region are changed, then delete the data in the non-read buffer region, and in the loop buffer
The data in the multimedia file after the second position are continued to write in free memory in area described not to be read with updating
Buffer zone, when the reading position is located in the non-read buffer region, the reading from the non-read buffer region
Position starts to read the required data.
Further, in order to improve the flexibility of multimedia file reading, the more matchmakers of the present invention are proposed based on second embodiment
The 3rd embodiment of body file reading, in the present embodiment, after reference Fig. 3, the step S50, the multimedia text
Part read method further includes:
Step S90 determines the reading position described if second capability value is more than the first preset capacity value
The corresponding storage location of multimedia file;
Step S100 starts to directly read the required data in the corresponding storage location of multimedia file.
In the present embodiment, if second capability value is more than the first preset capacity value, illustrate the reading position
The distance far from the one end in read buffer region is more than the Free Region in the distance non-read buffer region, determines the reading
Storage location corresponding in the multimedia file is set in fetch bit, directly starts to read institute in the corresponding storage location of multimedia file
Required data are stated, and no longer writes data into caching and is read again from caching.For larger data amount reading directly from network-side
Or local multimedia file is read, it can be excessive to avoid spatial cache, or frequently write caused by inadequate buffer space
Enter and read, causes inefficiency.At this point, the multimedia file data cached in the buffer circle can also be emptied, or
It is that only reservation size is that the data of the first capability value are stored in the read buffer region.
Further, in order to improve the intelligent of multimedia file reading, the multimedia file read method further includes
Step:When having read the multimedia file data in the buffer circle, deletes and cache in the buffer circle
Multimedia file data.It realizes when having read multimedia file data, the buffer circle is emptied, for reading next time
When multimedia file, multimedia file data to be read is cached.
Further, when the data in the non-read buffer region are less than the second preset capacity value, in the loop buffer
Data are continued to write in the multimedia file in free memory in area to update the non-read buffer region.It is equivalent to
When reading data, find not read data (i.e. data available) already less than the second preset capacity value in buffer circle every time
When, data are continued to write in the multimedia file in the free memory in the buffer circle immediately to update
Non- read buffer region is stated, i.e. also instant supplementary data while clearing data, to avoid stand-by period process when reading data,
The memory space utilization rate for also ensuring that Circular buffer region simultaneously, avoids most of memory space from being in idle condition.
The present invention further provides a kind of multimedia file reading devices.
It is the high-level schematic functional block diagram of multimedia file reading device first embodiment of the present invention with reference to Fig. 4, Fig. 4.
It is emphasized that it will be apparent to those skilled in the art that functional block diagram shown in Fig. 4 is only one preferably real
The exemplary plot of example is applied, those skilled in the art surrounds the function module of multimedia file reading device shown in Fig. 4, can be easily
Carry out the supplement of new function module;The title of each function module is self-defined title, is only used for auxiliary and understands multimedia text
Each program function block of part reading device is not used in restriction technical scheme of the present invention, and the core of technical solution of the present invention is,
The function to be reached of the function module of each self-defined title.
The present embodiment proposes that a kind of multimedia file reading device, the multimedia file reading device include:
Determining module 10, in the play position adjustment operation for detecting the broadcast interface input based on multimedia file
When, determine that the adjustment operates corresponding reading position whether in buffer circle;
In the present embodiment, the multimedia file reading device includes processing module, and the processing module is for connecing
When receiving the reading instruction of multimedia file, the corresponding third capacity of free memory in preset buffer circle is obtained
Value, and required data corresponding with the third capability value are written.The triggering mode packet of the reading instruction of the multimedia file
It includes:A, when the broadcast interface click of the multimedia file starts to play, the reading for triggering the multimedia file refers to user
It enables.B, the broadcast interface of the multimedia file receive input speech play instruction such as voice broadcast start play when,
Trigger the reading instruction of the multimedia file.It is understood that buffer circle is created in the present embodiment in advance, the ring
The memory space of shape buffering area is configured according to specific needs, as multimedia file be audio file when, the loop buffer
The memory space in area may be configured as 1M, and when the multimedia file is video file, the memory space of the buffer circle can
It is set as 30M, when the multimedia file is picture file, the memory space of the buffer circle may be configured as 200K.Its
In, the buffer circle preferably includes read buffer region, non-read buffer region and Free Region, the Free Region
It can be understood as white space, that is, entire loop buffer divides into three regions, and three regions logically its head and the tail
Can regard as and be connected to, read buffer region indicates that the data in these regions be read, still preserve now be for
Player possible backward reading requirement, non-read buffer region are the data read inside network flow or local file,
It was not yet read at present, Free Region indicates the memory space being not written into.It, can be in the annular to be best understood from this programme
Its section is divided using 3 pointers in buffering area, is the start pointer Begin of caching respectively, has read storage pointer Done,
Buffer pointers End, Begin and Done is written and constitutes read buffer region, Done and End constitute non-read buffer region, End and
Begin constitutes Free Region and is returned to the head of caching when then End pointers are moved to end due to being buffer circle,
Overlapped with the Begin pointers.The update of each region position can be realized by the corresponding pointer of movement.
Read module 20 is used for when the reading position is in the non-read buffer region of the buffer circle, from institute
It states and starts to read required data at the reading position in non-read buffer region;
In the present embodiment, the play position adjustment operation inputted based on broadcast interface where multimedia file is being detected
When, the determining module 10 first determines that the adjustment operates corresponding reading position whether in the buffer circle, if
In the buffer circle, the determining module 10 further determines that whether the adjustment operates corresponding reading position described
It does not read in buffer zone, if the reading position is not read in buffer zone described, the read module 20 can be direct
Required data are read from the reading position in the non-read buffer region.
Processing module 30, for updating in the buffer circle position in read buffer region and the non-read buffer region
It sets so that the required data being read are located in the read buffer region, when the corresponding appearance in the region of read buffer
When amount is more than the first capacity, removing partial data makes the corresponding capacity in read buffer region remain first capacity.
In the present embodiment, in order to improve the operational efficiency of terminal in multimedia file reading process, preferably ring is being created
When shape buffering area, corresponding first capability value in read buffer region is first set, and first capability value is for ensureing in multimedia
In file reading process, only retain the multimedia file data of the capability value length, beyond first capability value
Multimedia file data can be emptied, that is, in multimedia file in reading process, and the processing module 30 is first more
Newly the position in read buffer region and the non-read buffer region makes the required data being read read to delay positioned at described
It deposits in region, when the corresponding capacity in the region of read buffer is more than the first capacity, the processing module 30 removes part number
According to making described in it, the corresponding capacity in read buffer region has remained the first capacity.It realizes the buffer circle and keeps foot in real time
Enough free spaces are waited for caching the multimedia file data not being written even if the memory space of the buffer circle is less than
The multimedia file of reading, also due to emptying the cache in real time so that the space of the multimedia file data actually read is more than institute
The memory space for stating buffer circle improves the utilization rate of buffer circle, without in being gone because of inadequate buffer space
Deposit or local file in read multimedia file data, also improve the reading efficiency of multimedia file.In the present embodiment, institute
Stating the update of processing module 30, the position in read buffer region and the non-read buffer region makes the required data being read
In the region of read buffer, when the corresponding capacity in the region of read buffer is more than the first capacity, part number is removed
According to make described in it the corresponding capacity in read buffer region remain the first capacity and can be regarded as from pointer angle:The determining module
10 first determine the reading position, and pointer Done, the then processing module 30 are stored using the reading position as having read
Start pointer Begin is adjusted according to first capability value so that the start pointer Begin and described has read storage pointer
Memory space between Done remains first capability value, at this point, since the start pointer Begin is moved, then institute
It states End pointers and Begin pointers constitutes Free Region and also accordingly increase, that is, increase the free space of buffer circle.It can
With understanding, new position is moved to from original position along with Begin pointers.Be initially positioned at data between this two positions by
It empties, i.e., the partial data in read buffer region has been eliminated described in original.
Further, the read module 20 is additionally operable to when the reading position is in the region of read buffer, from
Start to read the required data at the reading position in the region of read buffer.It is understood that detecting
The play position adjustment operation of broadcast interface input based on multimedia file, it is to be understood that be based on more matchmakers detecting
The play position adjustment operation of the broadcast interface input of body file, and when the reading position is in the region of read buffer,
Then the read module 20 can directly start to read at the reading position several needed for described in the read buffer region
According to realizing before user has input in multimedia file reading process to when operation, to caching number be repeatedly written without repeating
Required data are stated according to can also directly read.
The multimedia file reading device that the present embodiment proposes reads multimedia file number in preset buffer circle
According to, and when reading position is in the non-read buffer region of the buffer circle, the reading position from the non-read buffer region
The place of setting starts to read required data, and read buffer region and described is updated needed for reading in the buffer circle when data
The position in non-read buffer region makes the required data being read be located in the read buffer region, has read to delay when described
When depositing the corresponding capacity in region more than the first capacity, removing partial data makes the corresponding capacity holding in read buffer region described in it
For the first capacity, rather than in multimedia file reading process, multimedia file data is read and has just been emptied the cache, we
When case reads multimedia file data in the buffer circle, first cached by being emptied in buffer multimedia file data
Part multimedia file data, reduce caching occupy memory space, improve the operational efficiency of terminal.
Further, in order to improve the flexibility of multimedia file reading, the more matchmakers of the present invention are proposed based on first embodiment
The second embodiment of body document reading apparatus, with reference to Fig. 5, in the present embodiment, the multimedia file reading device and first
Difference lies in the multimedia file reading device further includes device described in embodiment:
Acquisition module 40, for when the reading position is not in the buffer circle, obtaining the reading position
One end far from the read buffer region in first position and the non-read buffer region in the multimedia file
The second position in the multimedia file;
The determining module 10 is additionally operable to determine second in the multimedia file between first position and the second position
Whether capability value is less than the first preset capacity value;
Replacement module 50, if for second capability value be less than or equal to the first preset capacity value, from it is described not
Chosen in read buffer region the data that capacity is first capacity replace described in data in read buffer region;
The processing module 30 is additionally operable to delete the data in the non-read buffer region, and in the buffer circle
The data in the multimedia file after the second position are continued to write in interior free memory described not to be read to delay to update
Deposit region;
The read module 20 is additionally operable to when the reading position is located in the non-read buffer region, from it is described not
The reading position in read buffer region starts to read the required data.
In the present embodiment, if the reading position is not in the buffer circle, illustrate multimedia text to be read
Number of packages evidence is not written also successfully, described to obtain when detecting that the adjustment inputted based on broadcast interface where multimedia file is operated
Modulus block 40 first obtains the adjustment and operates first position in the multimedia file of corresponding reading position and described
The second position of the one end in the multimedia file far from read buffer region in non-read buffer region, the then determination
Module 10 by the multimedia file between first position and the second position the second capability value and the first preset capacity value into
Row compares, finally according to comparison result, you can determine the magnitude relationship of second capability value and the first preset capacity value,
In the present embodiment, the preferably described first preset capacity value is the capability value of Free Region in the buffer circle, when described the
Two capability values are less than or equal to the first preset capacity value, illustrate remote in the reading position distance non-read buffer region
With a distance from the one end in read buffer region be less than or equal to the Free Region, then the replacement module 50 can first from it is described not
Choose the data that capacity is first capacity in read buffer region and replace data in the read buffer region, then described in
Processing module 30 deletes the data in the non-read buffer region, and in the free memory in the buffer circle after
The data in the multimedia file after the second position are continued to update the non-read buffer region, when the reading position
When in the non-read buffer region, the read module 20 is read since the reading position in the non-read buffer region
Take the required data.
Further, in order to improve the flexibility of multimedia file reading, the more matchmakers of the present invention are proposed based on second embodiment
The 3rd embodiment of body document reading apparatus, in the present embodiment,
The determining module 10, if be additionally operable to second capability value be more than the first preset capacity value, determine described in
Reading position is in the corresponding storage location of the multimedia file;
The read module 20 is additionally operable to start to directly read the required number in the corresponding storage location of multimedia file
According to.
In the present embodiment, if second capability value is more than the first preset capacity value, illustrate the reading position
The distance far from the one end in read buffer region is more than the Free Region, the determining mould in the distance non-read buffer region
Block 10 determines the reading position in the corresponding storage location of the multimedia file, and the read module 20 is directly in multimedia
The corresponding storage location of file starts to read the required data, and no longer writes data into caching and read again from caching.For
The reading of larger data amount is directly read from the multimedia file of network-side or local, can be excessive to avoid spatial cache, or
It frequently writes into and reads caused by inadequate buffer space, cause inefficiency.At this point, can also will be in the buffer circle
The multimedia file data of caching empties, or only reservation size is that the data of the first capability value are stored in the read buffer area
Domain.
Further, in order to improve the intelligent of multimedia file reading, the multimedia file reading device further includes
Removing module, the removing module is for when having read the multimedia file data in the buffer circle, deleting institute
State the multimedia file data cached in buffer circle.It realizes when having read multimedia file data, empties the annular
Buffering area when for reading multimedia file next time, caches multimedia file data to be read.
Further, the multimedia file reading device further includes:
Update module is used for when the data capacity in the non-read buffer region is less than the second preset capacity value, described
The data continued to write in free memory in buffer circle in the multimedia file are to update the non-read buffer
Region.It is equivalent to when reading data, finds not read data (i.e. data available) already less than the in buffer circle every time
When two preset capacity values, continued to write in the multimedia file in the free memory in the buffer circle immediately
Data are to update the non-read buffer region, i.e. also instant supplementary data while clearing data, when to avoid reading data
Stand-by period process, while also ensuring that the memory space utilization rate in Circular buffer region, avoid most of memory space from being in sky
Not busy state.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that process, method, article or device including a series of elements include not only those elements, and
And further include the other elements being not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this
There is also other identical elements in the process of element, method, article or device.
The embodiments of the present invention are for illustration only, can not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical scheme of the present invention substantially in other words does the prior art
Going out the part of contribution can be expressed in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, computer, clothes
Be engaged in device, air conditioner or the network equipment etc.) execute method described in each embodiment of the present invention.
It these are only the preferred embodiment of the present invention, be not intended to limit the scope of the invention, it is every to utilize this hair
Equivalent structure or equivalent flow shift made by bright specification and accompanying drawing content is applied directly or indirectly in other relevant skills
Art field, is included within the scope of the present invention.
Claims (8)
1. a kind of multimedia file read method, which is characterized in that the multimedia file read method includes the following steps:
When detecting that the play position of the broadcast interface input based on multimedia file adjusts operation, the adjustment operation is determined
Whether corresponding reading position is in buffer circle;
When the reading position is in the non-read buffer region of the buffer circle, the institute from the non-read buffer region
It states and starts to read required data at reading position;And
Update in the buffer circle the position in read buffer region and the non-read buffer region so that the institute being read
Required data are stated to be located in the read buffer region, when the corresponding capacity in the region of read buffer is more than the first capacity,
Removing partial data makes the corresponding capacity in read buffer region remain first capacity;
When the reading position is not in the buffer circle, the reading position is obtained in the multimedia file
One end far from the read buffer region in first position and the non-read buffer region is in the multimedia file
The second position;
Determine whether the second capability value in the multimedia file between first position and the second position is less than the first default appearance
Magnitude;
If second capability value is less than or equal to the first preset capacity value, capacity is chosen from the non-read buffer region
For first capacity data replace described in data in read buffer region;
The data in the non-read buffer region are deleted, and are continued to write in the free memory in the buffer circle
Data in the multimedia file after the second position are to update the non-read buffer region;
When the reading position is located in the non-read buffer region, opened from the reading position in the non-read buffer region
Begin to read the required data.
2. multimedia file read method as described in claim 1, which is characterized in that described to detect based on multimedia text
When the play position adjustment operation of the broadcast interface input of part, determine that whether the adjustment operates corresponding reading position in annular
After step in buffering area, the multimedia file read method further includes:
When the reading position is in the region of read buffer, from the reading position in the region of read buffer
Start to read the required data.
3. multimedia file read method as described in claim 1, which is characterized in that in the determination multimedia file
After the step of whether the second capability value between first position and the second position is less than the first preset capacity value, the multimedia
File reading further includes:
If second capability value is more than the first preset capacity value, determine the reading position in the multimedia file pair
The storage location answered;
Start to directly read the required data in the corresponding storage location of multimedia file.
4. multimedia file read method as described in any one of claims 1-3, which is characterized in that the multimedia file is read
The method is taken to further include:
It is available in the buffer circle when the data capacity in the non-read buffer region is less than the second preset capacity value
The data continued to write in memory space in the multimedia file are to update the non-read buffer region.
5. a kind of multimedia file reading device, which is characterized in that the multimedia file reading device includes:
Determining module, when for adjusting operation in the play position for detecting that the broadcast interface based on multimedia file inputs, really
The fixed adjustment operates corresponding reading position whether in buffer circle;
Read module, for when the reading position is in the non-read buffer region of the buffer circle, not read from described
Start to read required data at the reading position in buffer zone;
Processing module, for updating in the buffer circle position in read buffer region and the non-read buffer region so that
The required data being read are located in the read buffer region, and when the region of read buffer, corresponding capacity is more than
When the first capacity, removing partial data makes the corresponding capacity in read buffer region remain first capacity;
Acquisition module, for when the reading position is not in the buffer circle, obtaining the reading position described
One end far from the read buffer region in first position and the non-read buffer region in multimedia file is described
The second position in multimedia file;
The determining module is additionally operable to determine the second capability value in the multimedia file between first position and the second position
Whether the first preset capacity value is less than;
Replacement module, if being less than or equal to the first preset capacity value for second capability value, from the non-read buffer
Chosen in region the data that capacity is first capacity replace described in data in read buffer region;
The processing module, is additionally operable to delete the data in the non-read buffer region, and in the buffer circle can
With the data continued to write in memory space in the multimedia file after the second position to update the non-read buffer region;
The read module is additionally operable to when the reading position is located in the non-read buffer region, from the non-read buffer
The reading position in region starts to read the required data.
6. multimedia file reading device as claimed in claim 5, which is characterized in that the read module is additionally operable to described
When reading position is in the region of read buffer, from the reading position in the region of read buffer read institute
State required data.
7. multimedia file reading device as claimed in claim 5, which is characterized in that the determining module, if being additionally operable to institute
It states the second capability value and is more than the first preset capacity value, determine the reading position in the corresponding storage of the multimedia file
Position;
The read module is additionally operable to start to directly read the required data in the corresponding storage location of multimedia file.
8. such as claim 5-7 any one of them multimedia file reading devices, which is characterized in that the multimedia file is read
The device is taken to further include:
Update module is used for when the data capacity in the non-read buffer region is less than the second preset capacity value, in the annular
The data continued to write in free memory in buffering area in the multimedia file are to update the non-read buffer region.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510543847.9A CN105142004B (en) | 2015-08-28 | 2015-08-28 | Multimedia file read method and device |
PCT/CN2016/084845 WO2017036218A1 (en) | 2015-08-28 | 2016-06-03 | Multimedia file reading method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510543847.9A CN105142004B (en) | 2015-08-28 | 2015-08-28 | Multimedia file read method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105142004A CN105142004A (en) | 2015-12-09 |
CN105142004B true CN105142004B (en) | 2018-09-04 |
Family
ID=54727189
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510543847.9A Active CN105142004B (en) | 2015-08-28 | 2015-08-28 | Multimedia file read method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN105142004B (en) |
WO (1) | WO2017036218A1 (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105142004B (en) * | 2015-08-28 | 2018-09-04 | 深圳Tcl数字技术有限公司 | Multimedia file read method and device |
CN106528302A (en) * | 2016-10-18 | 2017-03-22 | 广州视睿电子科技有限公司 | Method and device for sharing files of multi-system all-in-one machine |
CN108415667B (en) * | 2018-01-31 | 2021-06-25 | 惠州华阳通用电子有限公司 | Audio file loading method |
CN109547335B (en) * | 2018-12-28 | 2021-06-25 | 天津字节跳动科技有限公司 | Session message processing method and device |
CN111866419B (en) * | 2019-04-24 | 2022-05-31 | 杭州海康微影传感科技有限公司 | Thermal imaging image display method and device and thermal imaging equipment |
CN112379844A (en) * | 2020-11-25 | 2021-02-19 | 深圳市华宝电子科技有限公司 | Data protection method and device, electronic terminal and storage medium |
CN114679624B (en) * | 2022-03-08 | 2024-09-13 | 上海连尚网络科技有限公司 | Method and equipment for determining read state information of video information |
CN115098454B (en) * | 2022-07-26 | 2024-08-27 | 北京天融信网络安全技术有限公司 | Data processing method and system |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6124868A (en) * | 1998-03-24 | 2000-09-26 | Ati Technologies, Inc. | Method and apparatus for multiple co-processor utilization of a ring buffer |
CN101447994A (en) * | 2008-12-30 | 2009-06-03 | 深圳市迅雷网络技术有限公司 | Method for downloading and playing multimedia file and equipment thereof |
CN103391468A (en) * | 2012-05-08 | 2013-11-13 | 安凯(广州)微电子技术有限公司 | Network video data buffer control method and system based on mobile terminal |
CN103744621A (en) * | 2013-12-31 | 2014-04-23 | 深圳英飞拓科技股份有限公司 | Circular read-write method and device for buffer |
CN103974013A (en) * | 2013-01-24 | 2014-08-06 | 杭州海康威视数字技术股份有限公司 | Method for playing back video recording and video recording device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105142004B (en) * | 2015-08-28 | 2018-09-04 | 深圳Tcl数字技术有限公司 | Multimedia file read method and device |
-
2015
- 2015-08-28 CN CN201510543847.9A patent/CN105142004B/en active Active
-
2016
- 2016-06-03 WO PCT/CN2016/084845 patent/WO2017036218A1/en active Application Filing
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6124868A (en) * | 1998-03-24 | 2000-09-26 | Ati Technologies, Inc. | Method and apparatus for multiple co-processor utilization of a ring buffer |
CN101447994A (en) * | 2008-12-30 | 2009-06-03 | 深圳市迅雷网络技术有限公司 | Method for downloading and playing multimedia file and equipment thereof |
CN103391468A (en) * | 2012-05-08 | 2013-11-13 | 安凯(广州)微电子技术有限公司 | Network video data buffer control method and system based on mobile terminal |
CN103974013A (en) * | 2013-01-24 | 2014-08-06 | 杭州海康威视数字技术股份有限公司 | Method for playing back video recording and video recording device |
CN103744621A (en) * | 2013-12-31 | 2014-04-23 | 深圳英飞拓科技股份有限公司 | Circular read-write method and device for buffer |
Also Published As
Publication number | Publication date |
---|---|
WO2017036218A1 (en) | 2017-03-09 |
CN105142004A (en) | 2015-12-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105142004B (en) | Multimedia file read method and device | |
CN105100876B (en) | A kind of playback method and device of Streaming Media | |
JP4375305B2 (en) | Information processing apparatus, information processing method, recording medium, and program | |
US7826793B2 (en) | Digital broadcast system and method for a mobile terminal | |
CN102541538B (en) | Picture displaying method and device based on mobile terminal | |
US8295875B2 (en) | Apparatus and method for mobile communication by using non-volatile memory device | |
CN110312156A (en) | A kind of video cache method, apparatus and readable storage medium storing program for executing | |
CN107197393A (en) | A kind of implementation method of singleton video player | |
CN109996104A (en) | A kind of video broadcasting method, device and electronic equipment | |
CN104219555B (en) | Video display devices and method in a kind of Android system terminal | |
CN107484009A (en) | A kind of flow media playing method and device suitable for network direct broadcasting | |
CN105915985A (en) | Method for performing watch-back in live broadcasting and device thereof | |
CN1913685A (en) | Mobile communication terminal for downloading contents and method thereof | |
CN110062274A (en) | A kind of video file caching method, device, equipment and readable storage medium storing program for executing | |
CN104601535B (en) | Method for processing video frequency and system | |
CN109062537A (en) | A kind of reduction method, apparatus, medium and the equipment of audio frequency delay | |
KR20150079950A (en) | SYSTEMS and METHODS for DYNAMIC DATA STORAGE | |
CN103974013B (en) | Carry out the method and video record equipment of video record playback | |
CN107273310A (en) | A kind of read method of multi-medium data, device, medium and equipment | |
CN106775811A (en) | A kind of animation playing method and device | |
CN106227679B (en) | A kind of data buffer storage replacement method and device | |
CN114374875A (en) | MP4 file recording method and device and readable storage medium | |
CN104967770A (en) | Video shooting method and apparatus thereof | |
CN109600662A (en) | A kind of video broadcasting method and system | |
CN102819495B (en) | Data storage method and data storage device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |