Detailed description of the invention
Refer to Fig. 1, a kind of net based on Android that it provides for embodiment of the present inventionThe network switched system 100 of televising, it is for playing network television on Intelligent set top box, instituteState switched system 100 and comprise a channel information acquisition module 110, a live URL(UniformResourceLocator, URL) determination module 120 and oneLive creation module 140.
Wherein, in IP network, Intelligent set top box generally adopts multicast form to receive packet,Also sending to certain definite node set by packet with the form transmitting as possible (is multicastGroup), Set Top Box will receive packet will add multicast group, and multicast is source host and multiple orderMain frame between communication, clean culture is source host (platform flow media server) and object masterPoint-to-point communication between machine (Intelligent set top box).
Described channel information acquisition module 110 for taking from platform in the time that Intelligent set top box is started shootingIn the page info that business device issues, obtain channel nodal information, also according to channel ID(Identification) obtain channel nodal information, if channel nodal information corresponding to channel IDFor sky cannot add this channel, directly exit live flow process. If channel list information is not empty,Channel information acquisition module 110 obtains channel nodal information, and described channel nodal information should wrapContaining ChannelURL and the ChannelSDP (ChannelSessionDescription of this channelProtocol, channel session announcement protocol) and the value of flag bit, wherein, flag bit is to representMulticast turns the flag bit (bLiveRTSPflag) of clean culture. In present embodiment, server issuesThe ChannelURL of channel be IGMP (InternetGroupManagementProtocol,Igmpinternet) type, also, with the URL of IGMP beginning, the ChannelSDP issuing isRTSP (RealTimeStreamingProtocol, real time streaming transport protocol) type, also withThe URL of RTSP beginning.
Described live URL determination module 120 is for according to channel nodal information flag bitValue is determined the value of live URL, and in the time of the value representation multicast of flag bit, channelURL is trueBe decided to be live URL, channelSDP be defined as live in the time of the value representation clean culture of flag bitURL. In present embodiment, the value of flag bit represents that multicast is live while being " 0 ", markThe value of position represents that clean culture is live while being " 1 ". If multicast turns the value of the flag bit of unicast featureBe 0 o'clock, live URL determination module 120 using the ChannelURL of channel node asCurrent live URL, if the value of flag bit is 1, live URL determination module 120 willChannelSDP, as current live URL, is also that multicast protocol is IGMP, clean culture associationView is RTSP. Be understandable that, the value of flag bit bLiveRTSPflag is defaulted as 0.
Described live creation module 140 judges the type of live URL and according to live URL'sType create corresponding live connection, the type of described live URL comprise RTSP type andIGMP type, live creation module 140 in the time that the type of described live URL is RTSP typeCreate RTSP and connect, live establishment mould in the time that the type of described live URL is IGMP typePiece 140 creates IGMP and connects.
Create IGMP connection procedure and comprise that sending IGMPJoin order adds multicast group, opensMoving IGMP data receiver thread receives and processes IGMP data, live creation module 140In the time creating IGMP connection, if do not create successfully in first Preset Time, be alsoIGMP multicast data flow does not issue or does not receive, group broadcasting video frequency cannot be play, and mustSend IGMPleave order and leave current multicast group, flag bit is set to represent single simultaneouslyThe value of broadcasting, rejoins direct broadcast band corresponding to current live ID, in present embodiment, and willThe value of flag bit bLiveRTSPflag is set to 1. The first Preset Time can need to establish voluntarilyFixed, in present embodiment, Preset Time is 3 seconds. After second Preset Time, liveThe value of creation module 140 flag bits is set to represent the value of multicast, in present embodiment, theTwo preset the value of flag bit after 10 minutes is set to 0.
Refer to Fig. 2, a kind of net based on Android that it provides for embodiment of the present inventionThe network changing method of televising, it is for playing network television on Set Top Box, described switching sideMethod comprises the following steps:
S110: obtain channel node letter in the time of set-top-box opening the information issuing from serverBreath;
S120: the value of determining live URL according to the value of flag bit in channel nodal information;
S130: create live accordingly according to the type of determined live URL value.
In step S110, utilize channel information acquisition module 110 to start shooting at Intelligent set top boxTime obtain channel nodal information, channel nodal information the page info that issues from Platform ServerComprise channelURL, channelSDP and flag bit.
As shown in Figure 3, in step S120, the step of described definite URL comprises followingStep:
S121: the value of obtaining flag bit;
S122: whether the value of judgement symbol position is multicast, if so, enters step S123,If not, enter step S124;
S123: channelURL is defined as to live URL;
S124: channelSDP is defined as to live URL.
In step S121, utilize live URL determination module 120 to obtain mould from channel informationIn the nodal information that piece 110 obtains, obtain the value of flag bit.
In step S122, in present embodiment, utilize live URL determination module 120 to sentenceThe value of disconnected flag bit is 0 or 1.
In step S123, if flag bit is 0, utilize live URL determination module 120Using the ChannelURL of channel node as current live URL.
In step S124, if flag bit is 1, utilize live URL determination module 120Using ChannelSDP as current live URL, the ChannelURL that server issues isIGMP type represents that the value of URL is the URL with IGMP beginning, the ChannelSDP issuingThat RTSP type represents that the value of URL is the URL with RTSP beginning.
In step S130, in present embodiment, if the type of described live URL is RTSPWhen type, create RTSP and connect, if live creation module in the type of described live URL isWhen IGMP type, creating IGMP connects.
Create RTSP connect time, this process comprise send Describe, Setup,, PlayThe process of order is based on TCP by the RTSP data that send while generally receiving RTSP dataOr UDP is divided into tcp data reception & disposal and UDP message reception & disposal.
As shown in Figure 4, in establishment IGMP Connection Step, comprise the following steps:
S131: send the bind command that IGMP adds multicast;
S132: receive IGMP bind command;
S133: while not creating successfully in the first Preset Time, flag bit is set to represent clean cultureValue;
S134: flag bit is set to represent the value of multicast after the second Preset Time.
In step S131, utilize URL that live creation module 140 analyzes IGMP type withObtain IP address and the port numbers of multicast, and send out according to the multicast ip address of obtaining and port numbersSend IGMP bind command to add multicast group.
In step S132, utilize live creation module 140 to receive IGMP data, first separateCode data writes data to hardware, comprise resolve pat table (ProgramAssociationTable,Program Association Table) and pmt table (ProgramMapTable, Program Map Table), sound obtainedVideo PID (PacketIdentifier, packet identifier) and audio frequency and video type, arrange hardware solutionCode device, puts into by the data of receiving the process that hardware is decoded.
In step S133, in present embodiment, first scheduled time be set to one 3 secondsTimer, carries out the operation that timer is corresponding for 3 seconds afterwards. As shown in Figure 5, at 3 seconds timersConcrete operations flow process comprise the following steps:
S1331: judge whether to get pat table and pmt table, if so, enter step S1332,If not, enter step S1333;
S1332: add multicast;
S1333: preserve current channel ID;
S1334: multicast is turned to unicast feature mark position 1;
S1335: transmission IGMP exits (leave) message and leaves current multicast group;
S1336: rejoin the channel that current channel ID is corresponding.
In step S1336, repeating step S120, due to mark position 1, so liveURL can make clean culture ChannelSDP into, becomes clean culture live.
In step S134, in present embodiment, add 10 minutes timers, this timerEffect be after 10 minutes by mark position 0, allow multicast turn unicast feature reset.
Web TV based on Android provided by the invention is play and is switched systemIn system and method, utilize live URL determination module to determine current live URL, and utilizeLive creation module create corresponding URL carry out live, thereby push up at Android intelligent machineIPTV player on box is realized direct broadcast function, and Set Top Box is first attempted adding by IGMP agreementMulticast group receives data, if when adding multicast group failure or can not receive multicast packet, just logicalCrossing live creation module 140 adopts RTSP agreement to come to consult to receive number with streaming media serverAccording to, live with clean culture is live directly switches at multicast, thus avoid Intelligent set top box connecingWhen can not receive multicast data flow data or adding multicast group failure, there is blank screen phenomenon.
Be understandable that, for the person of ordinary skill of the art, can be according to thisBright technical conceive is made other various corresponding changes and distortion, and all these change and changeShape all should belong to the protection domain of the claims in the present invention.