File tree 1 file changed +18
-1
lines changed
1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
+ "errors"
4
5
"fmt"
6
+ "net"
5
7
"time"
6
8
"unsafe"
7
9
10
+ "github.com/go-gst/go-glib/glib"
8
11
"github.com/go-gst/go-gst/gst"
9
12
)
10
13
@@ -68,7 +71,8 @@ type srtCallerStats struct {
68
71
69
72
negotiatedLatencyMS int
70
73
71
- // callerAddress net.IP
74
+ callerAddress net.IP
75
+ callerPort uint16
72
76
}
73
77
74
78
// Retrieve value from name and convert it to the correct time (known at compile time)
@@ -148,6 +152,19 @@ func (s *srtStats) convertCallerStats(arr []interface{}) error {
148
152
return fmt .Errorf ("struct has wrong mimetype '%s'" , name )
149
153
}
150
154
155
+ socketAddress , err := gs .GetValue ("caller-address" )
156
+ if err != nil {
157
+ return err
158
+ }
159
+ socketAddressObj , ok := socketAddress .(* glib.Object )
160
+ if ok != true {
161
+ return errors .New ("caller-address is not a glib object" )
162
+ }
163
+ sc .callerAddress , sc .callerPort , err = inetSocketAddressIP (socketAddressObj .Unsafe ())
164
+ if err != nil {
165
+ return err
166
+ }
167
+
151
168
intProps := []struct {
152
169
dest * int
153
170
name string
You can’t perform that action at this time.
0 commit comments