Embodiment
Hereinafter will and combine embodiment to specify the present invention with reference to accompanying drawing.Need to prove that under the situation of not conflicting, embodiment and the characteristic among the embodiment among the application can make up each other.
The flow chart of the method for the Streaming Media recorded broadcast that provides for preferred embodiment according to the present invention shown in Figure 1.As shown in Figure 1, the method for the Streaming Media recorded broadcast that preferred embodiment of the present invention provides comprises step 101 ~ 103.
Step 101: after transmitting terminal and server connected, said transmitting terminal sent stream medium data to said server.
Particularly, transmitting terminal foundation is connected with server, and sends stream medium data to server.In addition, at least one receiving terminal foundation is connected with server and controller, and receiving terminal is set self buffer limiting value and buffering area initial value and notified said controller, and said receiving terminal setting self buffer size is the buffering area initial value.Wherein, the time that said receiving terminal connects, can be before transmitting terminal and server connect, also can be after transmitting terminal and server connect or when transmitting terminal and server connect, this present invention is not limited.
Step 102: the said stream medium data of said server buffer; And the said stream medium data size and the said server buffers district size of buffer memory sent to controller; Said controller is formulated and transmission processing policy to server and receiving terminal according to said stream medium data size and said server buffers district size, and perhaps said controller sends said processing policy to server.
Particularly, behind the stream medium data that the server receiving end/sending end sends, be buffered in the buffering area of server.Server sends to controller with the stream medium data size and the server buffers district size of self buffer memory.Wherein, the buffer size of said server is no more than the memory size of server self, and said buffer size accounts for the concrete ratio of server memory size, can be provided with voluntarily according to actual needs by server, and this present invention is not limited.Controller is the stream medium data size and the server buffers district size of server buffer relatively; According to said comparative result and above the stream medium data size in server buffers district and the comparative result of rx-side buffering district initial value and buffering area limiting value; Said controller is formulated four kinds of different processing policies, and is sent to server and receiving terminal respectively or only sends to server.
As stated; When the stream medium data size of server buffer buffer size greater than server; And when the stream medium data size that surpasses the server buffers district was less than or equal to the buffering area initial value of receiving terminal, controller sent first processing policy to server and receiving terminal, promptly; Controller directly sends to receiving terminal and downloads notice, and the stream medium data of announcement server in receiving terminal send server buffering area.
When the stream medium data size of server buffer buffer size greater than server; And the stream medium data size that surpasses the server buffers district is greater than the buffering area initial value of receiving terminal and when being less than or equal to the buffering area limiting value of receiving terminal; Controller sends second processing policy to server and receiving terminal: after controller is set rx-side buffering district size; With the rx-side buffering district size information notice receiving terminal of setting, and the stream medium data of announcement server in receiving terminal send server buffering area; Perhaps controller will be notified receiving terminal above the stream medium data size information in server buffers district, and the stream medium data of announcement server in receiving terminal send server buffering area.
When the stream medium data size of server buffer buffer size greater than server; And the stream medium data size that surpasses the server buffers district is during greater than the buffering area limiting value of receiving terminal; Controller sends the 3rd processing policy to server and receiving terminal: controller resets rx-side buffering district size and is the buffering area limiting value; And with the rx-side buffering district size information notice receiving terminal of setting, and the stream medium data of announcement server in receiving terminal send server buffering area; Perhaps controller will be notified receiving terminal above the stream medium data size information in server buffers district, and the stream medium data of announcement server in receiving terminal send server buffering area.
If the stream medium data size of server buffer is less than or equal to the buffer size of server, controller sends the reason strategy everywhere to server: announcement server directly sends to receiving terminal with the stream medium data in the server buffers district.In this, controller can be set the broadcast value in server buffers district, and the broadcast value is less than or equal to the buffer size of server.When the stream medium data size of server buffer reached the broadcast value, the controller announcement server sent to receiving terminal with the stream medium data in the said server buffers district.
In the foregoing description; The method that said controller is set rx-side buffering district size is: the streaming media data cache time of the preset receiving terminal of said controller, said cache-time multiply by the rx-side buffering district size that said streaming media data transmission speed is setting.In addition, said controller also can directly be set rx-side buffering district size and notify said receiving terminal.Wherein, the buffering area of said server and receiving terminal can measure by memory space, also can measure by memory time, and this present invention is not limited.
Step 103: said server and said receiving terminal, perhaps said server carries out handled according to the said processing policy that receives.
Particularly; According to step 102; If server and receiving terminal receive first processing policy; Said server sends the stream medium data in the said server buffers district to said receiving terminal, and said receiving terminal is notified server to download according to said download saidly to surpass the stream medium data in server buffers district and play the stream medium data in the said server buffers district.
If server and receiving terminal receive second processing policy; Said server sends the stream medium data in the said server buffers district to said receiving terminal; The rx-side buffering district size information that said receiving terminal is set according to the controller that receives; Self buffer is adjusted into the rx-side buffering district size of said setting, and plays the stream medium data in the said server buffers district.Perhaps said server sends the stream medium data in the said server buffers district to said receiving terminal; Said receiving terminal is adjusted rx-side buffering district size voluntarily according to the said stream medium data size information that surpasses the server buffers district, and plays the stream medium data in the said server buffers district.
If server and receiving terminal receive the 3rd processing policy; Said server sends the stream medium data in the said server buffers district to said receiving terminal; The rx-side buffering district limiting value that said receiving terminal is set according to the controller that receives; Self buffer is adjusted into said buffering area limiting value, and plays the stream medium data in the said server buffers district.Perhaps said receiving terminal is adjusted into the buffering area limiting value according to the said stream medium data size information that surpasses the server buffers district from being about to rx-side buffering district size, and plays the stream medium data in the said server buffers district.
If server receives the reason strategy everywhere, said server sends the stream medium data in the said server buffers district to said receiving terminal, and receiving terminal is play the stream medium data in the said server buffers district.
In this, the stream medium data that surpasses said server buffers district that above-mentioned receiving terminal is downloaded from server is meant: when receiving terminal begins the download stream media data to server, begin to download from the current part that surpasses said server buffers district of said stream medium data.In present embodiment, receiving terminal is downloaded the stream medium data that surpasses said server buffers district from server, and in other embodiment, controller is after receiving terminal sends notice, and said server also can send said stream medium data to said receiving terminal.
In the foregoing description; If the stream medium data size that surpasses the server buffers district is less than or equal to the buffering area initial value of receiving terminal; Then when the stream medium data size of receiving terminal buffer memory reached the buffering area initial value of receiving terminal, receiving terminal began to play the stream medium data of buffer memory.If the big young pathbreaker's self buffer in rx-side buffering district that receiving terminal is set according to controller is adjusted into the rx-side buffering district size of said setting; Then when the stream medium data size of receiving terminal buffer memory reaches that controller sets rx-side buffering district size, receiving terminal begins to play the stream medium data of buffer memory.If receiving terminal is adjusted rx-side buffering district size voluntarily according to the stream medium data size information that surpasses the server buffers district; Then when the stream medium data size of receiving terminal buffer memory reached receiving terminal and adjusts rx-side buffering district size voluntarily, receiving terminal began to play the stream medium data of buffer memory.Said receiving terminal is downloaded said above behind the stream medium data in server buffers district, plays said stream medium data by the timestamp of said stream medium data.Above-mentioned each operation is accomplished by the API that calls Flash respectively.
For example, transmitting terminal call Flash function C onnection.conn (url, port) set up with being connected of server after, said transmitting terminal call function NetStream.publish (name) transmission stream medium data is to server.It is that 500M and buffering area initial value are 300M and notification controller that receiving terminal is set the self buffer limiting value respectively, and receiving terminal setting self buffer size is 300M.If server memory is after 4G and said server sets 1G are the server buffers district, with said server buffers district size information notification controller, the broadcast value that said controller is set the server buffers district is 1G.If A constantly, the stream medium data size that server receives is 1.1G and notification controller.In this; The stream medium data size that surpasses the server buffers district is 0.1G; Be no more than the buffering area initial value 300M of said receiving terminal; Then controller directly sends to receiving terminal and downloads notice, and announcement server sends the said stream medium data in the said server buffers district to said receiving terminal, the stream medium data that receiving terminal receives and Play Server sends.After receiving terminal receives said download notice, call Flash function NetStream.play and download the stream medium data that surpasses the server buffers district from server.If transmission of flow media data speed is 10M/S; Is 0.1S from said controller to the time that receiving terminal is given notice to receiving terminal to the server data download; Then receiving terminal begins to download from stream medium data 1G+ (10*0.1) M of said server reception; Promptly in the moment of A+0.1S, the stream medium data size that receiving terminal is downloaded from server is 1.1G-[1G+ (10*0.1) M]=0.1G-1M=102.4M-1M=101.4M.Receiving terminal is buffered in the stream medium data (101.4M) of said download in the local buffer, and the data in the rx-side buffering district reach said buffering area initial value, and (that is, in the time of 300M), receiving terminal begins to play the stream medium data in the self buffer.
The sketch map of the system of the Streaming Media recorded broadcast that provides for preferred embodiment according to the present invention shown in Figure 2.As shown in Figure 2; The system of the Streaming Media recorded broadcast that preferred embodiment of the present invention provides comprises transmitting terminal 201, server 202, controller 203 and receiving terminal 204; Said transmitting terminal 201 connects said server 202; Said server 202 connects said controller 203 and said receiving terminal 204 respectively, and said controller 203 connects said receiving terminal 204.Said transmitting terminal 201 after being used for connecting with server 202, sends stream medium datas to said server 202.Said server 202 is used for the said stream medium data of buffer memory, and the said stream medium data size and said server 202 buffer size of buffer memory are sent to controller 203, and after receiving said processing policy, carries out handled.Said controller 203 is used for according to said stream medium data size and said server 202 buffer size are formulated and transmission processing policy to server 202 and receiving terminal 204, perhaps sends said processing policy to server 202.Said receiving terminal 204 is used for carrying out handled according to the said processing policy that receives.Operating process about said system is said with above-mentioned method, so repeat no more in this.
In sum; The method and system of the Streaming Media recorded broadcast that preferred embodiment provides according to the present invention; Transmitting terminal sends stream medium data to server, behind the stream medium data that server receives and the said transmitting terminal of buffer memory sends, the stream medium data size and the said server buffers district size of buffer memory is sent to controller; Above-mentioned data by controller sends according to server are formulated and transmission processing policy to server and receiving terminal, perhaps send said processing policy to server.Server and receiving terminal, or server carries out handled according to the processing policy that controller sends.So, controller sends the handled strategy according to the data and the server buffers district size of server buffer to server and receiving terminal (or only to server), has guaranteed the Streaming Media smooth playing under the different situations, has promoted the play quality of audio frequency and video.
The above is merely the preferred embodiments of the present invention, is not limited to the present invention, and for a person skilled in the art, the present invention can have various changes and variation.All within spirit of the present invention and principle, any modification of being done, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.