Background technology
When coming the flow-medium performance of automatic network, the IPTV terminal plays to use two functional modules: network receiver module and playout software module.The broadcast of flow-medium performance divided for three steps, and the first step is a receiving media flow data from the streaming media server; Second step was the pretreatment operation of the media stream data that receives being carried out out of order rearrangement, dithering process, packet loss processing etc., and the media stream data pretreatment operation need be used buffering area; The 3rd step was that media stream data is decoded and play.Wherein, the described first step is realized that by the network receiver module the 3rd step was realized by the playout software module that second step was to be realized by network receiver module or playout software module according to the host-host protocol decision that streaming media server adopts then.
The media stream data host-host protocol that different streaming media servers adopts is also inconsistent, as: the streaming media server that has adopts RTP (Real Time Transport Protocol, RTP), the streaming media server employing User Datagram Protoco (UDP) that has (User Datagram Protocol, UDP).If adopt Real-time Transport Protocol to carry out the media stream data transmission, the network receiver module can carry out the media stream data pretreatment operation according to the information that Real-time Transport Protocol carries when the receiving media flow data, do not need the playout software module to be provided for the buffering area of medium flow data; If adopt udp protocol to carry out the media stream data transmission, then can only carry out the pretreatment operation of media stream data according to the information that media stream data itself carries, and this can only be realized by the playout software module, therefore the playout software module need possess the function that buffering area is provided, to realize the media stream data pretreatment operation.Therefore, the playout software module will consider whether need to be provided with buffering area with realization media stream data pretreatment operation when designing and developing, thereby can be adaptive with specific streaming media server.
Stream media terminal is having following two kinds of schemes to the media stream data pretreatment operation at present: a kind of scheme is in the playout software module buffering area to be set, no matter dock with the streaming media server that adopts which kind of media stream data host-host protocol, the playout software module all distributes buffering area to realize the pretreatment operation of media stream data.But at the streaming media server that need in the playout software module, not carry out the pretreatment operation of media stream data to this class of employing Real-time Transport Protocol, can distribute buffering area too one time, therefore the media stream data pretreatment operation can be carried out one time, and this must cause the significant wastage of resource more.Second kind of scheme is that buffering area is not set in the playout software module, promptly do not carry out the pretreatment operation of media stream data in the playout software module.But the playback terminal that adopts this scheme is when docking with the streaming media server that adopts udp protocol to carry out the media stream data transmission, owing to do not carry out the pretreatment operation of media stream data, media stream data may be chaotic, has a strong impact on the result of broadcast of Media Stream.
By technique scheme as can be seen, just need when the development and Design of streaming media playing terminal at present to consider that playout software module and particular network receiver module are arranged in pairs or groups just can realize adaptive to specific streaming media server, there is great coupling between playout software module and the network receiver module, cause the playout software module in the streaming media playing terminal that the Media Stream that needs the media stream data buffering and do not need Media Stream to cushion is all carried out same processing, can't differentiating and processing, make stream media terminal can only play the flow-medium performance that specific streaming media server provides, the intercommunication poor performance of stream media terminal causes the wasting of resources or has a strong impact on result of broadcast.
Summary of the invention
The purpose of this invention is to provide a kind of flow media playing method and terminal, the broadcast of the flow-medium performance that realization provides the various flows media server, make same streaming media playing terminal can realize to needing buffering area and not needing the various flows media server of buffering area to dock and realize high-quality, at a high speed result of broadcast, the intercommunication ability of enhanced flow media broadcast terminal improves resource utilization.
For achieving the above object, the invention provides a kind of flow media playing method comprises:
Obtain media stream data according to default mode of operation sign;
Described media stream data is resolved, obtain the original coding data and the associated ancillary information of media stream data;
Judge according to default mode of operation sign and to play whether needs buffering area of described media stream data, if, then the original coding data of described media stream data are carried out corresponding buffered, to the broadcast of decoding through the original coding data after the buffered according to described associated ancillary information; Otherwise, to the broadcast of directly decoding of the original coding data of described media stream data.
The default mode of operation sign of described basis also comprises before obtaining media stream data:
Create and play example, the mode of operation sign of default described media stream data, described mode of operation sign comprise band buffer mode sign and do not have the buffer mode sign.
The present invention also provides a kind of streaming media playing terminal, comprises the network receiver module and the playout software module that is used for the playing media flow data of the media stream data that is used for the transmission of receiving stream media server, and described playout software module comprises:
Acquiring unit is used for obtaining media stream data according to default mode of operation sign;
Resolution unit is used for described media stream data is resolved, and obtains the original coding data and the associated ancillary information of media stream data;
Broadcast unit, be used for judging and play whether needs buffering area of described media stream data according to default mode of operation sign, if, then the original coding data of described media stream data are carried out corresponding buffered, to the broadcast of decoding through the original coding data after the buffered according to described associated ancillary information; Otherwise, to the broadcast of decoding of the original coding data of described media stream data.
Described playout software module also comprises: creating unit, and be used for creating and play example, the mode of operation of default described media stream data identifies.
Flow media playing method of the present invention and terminal can receive and play the flow-medium performance that needs buffering area and do not need buffering area, realized adaptive with the various flows media server, make that the broadcast of Media Stream is more flexible, strengthened the intercommunication ability of stream media terminal product, improved the utilance of resource, the playout software module of stream media terminal need not too much be considered when development and Design and the collocation problem of various heterogeneous networks receiver modules simultaneously, makes that the exploitation of stream media terminal is more flexible.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Embodiment
As shown in Figure 1, be the flow chart of flow media playing method embodiment one of the present invention.Present embodiment may further comprise the steps after receiving the media stream data that the streaming media server biography is come on the network:
Step 50, streaming media playing terminal are obtained media stream data according to default mode of operation sign;
Step 60, streaming media playing terminal are resolved the media stream data that obtains, as carry out MEPG-TS decoding, obtain Streaming Media original coding data (as the audio/video coding data) and relevant supplementary etc.;
Step 70, streaming media playing terminal are judged according to default mode of operation sign and are play whether needs buffering area of described media stream data, if, then the original coding data of described media stream data are carried out corresponding buffered, to the broadcast of decoding through the original coding data after the buffered according to described associated ancillary information; Otherwise, to the broadcast of decoding of the original coding data of described media stream data.
In the present embodiment, the streaming media playing terminal can be play the media stream data that needs buffering area and do not need buffering area, has improved the adaptation ability with the various flows media server, has strengthened the flexibility of streaming media playing.
As shown in Figure 2, be the flow chart of flow media playing method embodiment two of the present invention.Compare with the foregoing description one, present embodiment is further comprising the steps of before step 50:
Step 10, streaming media playing terminal are created and are play example, and the mode of operation of default described media stream data identifies when creating the broadcast example, described mode of operation sign comprises band buffer mode sign and do not have the buffer mode sign, and according to described mode of operation sign decidable media stream data needs buffering area whether;
Step 20, streaming media playing terminal judge according to default mode of operation sign whether Media Stream needs buffering area, if, execution in step 30, otherwise, execution in step 40;
Step 30, streaming media playing terminal are provided with a buffering area, are used for the medium flow data, execution in step 501;
Step 40, streaming media playing terminal are provided with a call back function, are used to obtain media stream data, execution in step 502;
Make those not need the media stream data of buffering area can buffering area be set, improved the resource utilization of streaming media playing terminal.
Step 50 specifically comprises:
Step 501, the passive wait media stream data of streaming media playing terminal are brought and are received;
Step 502, streaming media playing terminal are initiatively obtained media stream data by call back function when needed.
Present embodiment is by default mode of operation sign when creating the broadcast example, realized obtaining the media stream data that needs buffering area and do not need buffering area with diverse ways, realized the media stream data of different stream medium data acquisition methods is received, can be more flexibly and various flows media server adaptive.
As shown in Figure 3, be the flow chart of flow media playing method the 3rd embodiment of the present invention.On the basis of the foregoing description two, step 70 specifically comprises the steps:
Step 701, streaming media playing terminal judge according to default mode of operation sign and play whether needs buffering area of described media stream data, if, execution in step 702, otherwise execution in step 705;
The associated ancillary information that step 702, streaming media playing terminal obtain after resolving according to step 60 carries out out of order rearrangement, dithering process and packet loss processing etc. are promptly carried out in corresponding preliminary treatment to media stream data operation to the original coding data of media stream data;
Step 703, streaming media playing terminal will be through the original coding storage of the pretreated media stream data of step 702 in buffering areas;
Step 704, streaming media playing terminal judge whether the data in the described buffering area reach the broadcast thresholding, if reach, then execution in step 705, if do not reach, wait for, up to reaching the data that can send in the buffering area;
The media stream data that step 705, streaming media playing end-on are received, the broadcast of decoding.
In the present embodiment, realized the need buffering area and do not needed the media stream data differentiation playback process of buffering area according to default mode of operation, by the media stream data that needs buffering area being carried out the broadcast of preliminary treatment realization to Media Stream, guaranteed the effect of playing, simultaneously the Media Stream that does not need buffering area is not then carried out preliminary treatment, directly play, the wasting of resources of having avoided repeating preliminary treatment in the prior art and having caused, improved broadcasting speed, guaranteed play quality simultaneously, realized the high-quality of Media Stream that the various flows media server is provided, result of broadcast has at a high speed been saved resource.
As shown in Figure 4, be the structure chart of streaming media playing terminal embodiment one of the present invention.Present embodiment comprises network receiver module 1 and playout software module 2, and wherein playout software module 2 comprises acquiring unit 23, resolution unit 24 and broadcast unit 25.Wherein acquiring unit 23, are used for obtaining media stream data according to default mode of operation sign; Resolution unit 24 is used for media stream data is resolved, and obtains the original coding data and the associated ancillary information of media stream data; Broadcast unit 25, be used for judging and play whether needs buffering area of described media stream data according to default mode of operation sign, if, then the original coding data of described media stream data are carried out corresponding buffered, to the broadcast of decoding through the original coding data after the buffered according to described associated ancillary information; Otherwise, to the broadcast of decoding of the original coding data of described media stream data.
Present embodiment has been realized the broadcast to the need buffering area and the Media Stream that need not cushion, and makes that the streaming media playing terminal can adaptive different streaming media server, has improved the intercommunication ability of streaming media playing terminal.
As shown in Figure 5, be the structure chart of streaming media playing terminal embodiment two of the present invention.On the basis of the foregoing description one, playout software module 2 also comprises creating unit 21, is used for creating playing example, and the mode of operation of default described media stream data identifies; Unit 22 is set, is used for the buffering area of medium flow data being set, call back function perhaps is set, for obtaining media stream data according to described default mode of operation sign.
Further, acquiring unit 23 specifically comprises: first judging unit 231 is used to judge that whether mode of operation according to described media stream data identifies the described buffering area of needs; Receiving element 232 is used for passive receipts media stream data; Receive control unit 233, be used for control and utilize described call back function initiatively to obtain media stream data.Broadcast unit 25 specifically comprises: second judging unit 251 is used to judge that whether mode of operation according to described media stream data identifies the described buffering area of needs; Pretreatment unit 252 carries out corresponding pretreatment operation according to described associated ancillary information to the original coding data of described media stream data, and the original coding data of the media stream data of process pretreatment operation are deposited in the described buffering area; Play thresholding identifying unit 253, be used for judging whether the data of described buffering area reach the broadcast thresholding; Decoding broadcast unit 254 is used for the broadcast of decoding of the original coding data of the media stream data that receives.
Present embodiment is by judging whether Media Stream needs buffering area that buffering area or call back function are set, realization has been carried out corresponding reception, processing and broadcast to the different media flows data, improved resource utilization, guaranteed play quality, improved broadcasting speed, the collocation problem of playout software module and network receiver module need not be too much considered in the flexibility that has simultaneously also improved the development and Design of streaming media playing terminal, has strengthened the intercommunication ability of streaming media playing terminal.
It should be noted that at last: above embodiment is only in order to technical scheme of the present invention to be described but not limit it, although the present invention is had been described in detail with reference to preferred embodiment, those of ordinary skill in the art is to be understood that: it still can make amendment or be equal to replacement technical scheme of the present invention, and these modifications or be equal to replacement and also can not make amended technical scheme break away from the spirit and scope of technical solution of the present invention.