mirror of
https://github.com/aler9/gortsplib
synced 2025-10-05 23:26:54 +08:00
client: rename ClientTransportMulticast into ClientTransportUDPMulticast
This commit is contained in:
@@ -41,7 +41,7 @@ type ClientTransport int
|
|||||||
// standard client transports.
|
// standard client transports.
|
||||||
const (
|
const (
|
||||||
ClientTransportUDP ClientTransport = iota
|
ClientTransportUDP ClientTransport = iota
|
||||||
ClientTransportMulticast
|
ClientTransportUDPMulticast
|
||||||
ClientTransportTCP
|
ClientTransportTCP
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@@ -397,7 +397,7 @@ func TestClientRead(t *testing.T) {
|
|||||||
return &v
|
return &v
|
||||||
|
|
||||||
case "multicast":
|
case "multicast":
|
||||||
v := ClientTransportMulticast
|
v := ClientTransportUDPMulticast
|
||||||
return &v
|
return &v
|
||||||
|
|
||||||
default: // tcp, tls
|
default: // tcp, tls
|
||||||
|
@@ -449,7 +449,7 @@ func (cc *ClientConn) backgroundClose(isSwitchingProtocol bool) {
|
|||||||
func (cc *ClientConn) runBackground() {
|
func (cc *ClientConn) runBackground() {
|
||||||
cc.backgroundInnerDone <- func() error {
|
cc.backgroundInnerDone <- func() error {
|
||||||
if cc.state == clientConnStatePlay {
|
if cc.state == clientConnStatePlay {
|
||||||
if *cc.protocol == ClientTransportUDP || *cc.protocol == ClientTransportMulticast {
|
if *cc.protocol == ClientTransportUDP || *cc.protocol == ClientTransportUDPMulticast {
|
||||||
return cc.runBackgroundPlayUDP()
|
return cc.runBackgroundPlayUDP()
|
||||||
}
|
}
|
||||||
return cc.runBackgroundPlayTCP()
|
return cc.runBackgroundPlayTCP()
|
||||||
@@ -1257,7 +1257,7 @@ func (cc *ClientConn) doSetup(
|
|||||||
rtcpListener.port(),
|
rtcpListener.port(),
|
||||||
}
|
}
|
||||||
|
|
||||||
case ClientTransportMulticast:
|
case ClientTransportUDPMulticast:
|
||||||
v1 := base.StreamDeliveryMulticast
|
v1 := base.StreamDeliveryMulticast
|
||||||
th.Delivery = &v1
|
th.Delivery = &v1
|
||||||
th.Protocol = base.StreamProtocolUDP
|
th.Protocol = base.StreamProtocolUDP
|
||||||
@@ -1337,7 +1337,7 @@ func (cc *ClientConn) doSetup(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case ClientTransportMulticast:
|
case ClientTransportUDPMulticast:
|
||||||
if thRes.Delivery == nil || *thRes.Delivery != base.StreamDeliveryMulticast {
|
if thRes.Delivery == nil || *thRes.Delivery != base.StreamDeliveryMulticast {
|
||||||
return nil, liberrors.ErrClientTransportHeaderInvalidDelivery{}
|
return nil, liberrors.ErrClientTransportHeaderInvalidDelivery{}
|
||||||
}
|
}
|
||||||
@@ -1422,7 +1422,7 @@ func (cc *ClientConn) doSetup(
|
|||||||
rtcpListener.streamType = StreamTypeRTCP
|
rtcpListener.streamType = StreamTypeRTCP
|
||||||
cct.udpRTCPListener = rtcpListener
|
cct.udpRTCPListener = rtcpListener
|
||||||
|
|
||||||
case ClientTransportMulticast:
|
case ClientTransportUDPMulticast:
|
||||||
rtpListener.remoteReadIP = cc.nconn.RemoteAddr().(*net.TCPAddr).IP
|
rtpListener.remoteReadIP = cc.nconn.RemoteAddr().(*net.TCPAddr).IP
|
||||||
rtpListener.remoteWriteIP = *thRes.Destination
|
rtpListener.remoteWriteIP = *thRes.Destination
|
||||||
rtpListener.remoteZone = ""
|
rtpListener.remoteZone = ""
|
||||||
@@ -1700,7 +1700,7 @@ func (cc *ClientConn) WriteFrame(trackID int, streamType StreamType, payload []b
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch *cc.protocol {
|
switch *cc.protocol {
|
||||||
case ClientTransportUDP, ClientTransportMulticast:
|
case ClientTransportUDP, ClientTransportUDPMulticast:
|
||||||
if streamType == StreamTypeRTP {
|
if streamType == StreamTypeRTP {
|
||||||
return cc.tracks[trackID].udpRTPListener.write(payload)
|
return cc.tracks[trackID].udpRTPListener.write(payload)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user