mirror of https://bitbucket.org/ausocean/av.git
Merge branch 'master' into treatment
This commit is contained in:
commit
6ab9b145d8
|
@ -95,19 +95,24 @@ func (s *httpSender) Write(d []byte) (int, error) {
|
||||||
func (s *httpSender) Close() error { return nil }
|
func (s *httpSender) Close() error { return nil }
|
||||||
|
|
||||||
func httpSend(d []byte, client *netsender.Sender, log func(lvl int8, msg string, args ...interface{})) error {
|
func httpSend(d []byte, client *netsender.Sender, log func(lvl int8, msg string, args ...interface{})) error {
|
||||||
// Only send if "V0" is configured as an input.
|
// Only send if "V0" or "S0" are configured as input.
|
||||||
send := false
|
send := false
|
||||||
ip := client.Param("ip")
|
ip := client.Param("ip")
|
||||||
log(logger.Debug, "making pins, and sending recv request", "ip", ip)
|
log(logger.Debug, "making pins, and sending recv request", "ip", ip)
|
||||||
pins := netsender.MakePins(ip, "V")
|
pins := netsender.MakePins(ip, "V,S")
|
||||||
for i, pin := range pins {
|
for i, pin := range pins {
|
||||||
if pin.Name == "V0" {
|
switch pin.Name {
|
||||||
send = true
|
case "V0":
|
||||||
pins[i].Value = len(d)
|
|
||||||
pins[i].Data = d
|
|
||||||
pins[i].MimeType = "video/mp2t"
|
pins[i].MimeType = "video/mp2t"
|
||||||
break
|
case "S0":
|
||||||
|
pins[i].MimeType = "audio/x-wav"
|
||||||
|
default:
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
|
pins[i].Value = len(d)
|
||||||
|
pins[i].Data = d
|
||||||
|
send = true
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if !send {
|
if !send {
|
||||||
|
|
Loading…
Reference in New Issue