mark native sync as same-domain

This commit is contained in:
Dmitry Sergeev
2026-08-26 23:56:22 +03:00
parent 078f866234
commit e6a5e12d68
2 changed files with 6 additions and 3 deletions
+2 -2
View File
@@ -243,7 +243,7 @@ func main() {
switch { switch {
case args.VideoFlowId != "" && args.AudioFlowId != "": case args.VideoFlowId != "" && args.AudioFlowId != "":
syncSrc, err = source.OpenSync(args.Domain, args.VideoFlowId, args.AudioFlowId) syncSrc, err = source.OpenSameDomainSync(args.Domain, args.VideoFlowId, args.AudioFlowId)
if err != nil { if err != nil {
log.Fatalf("sync source: %v", err) log.Fatalf("sync source: %v", err)
} }
@@ -378,7 +378,7 @@ func main() {
// Try once. Return error if fails — caller loops back to select // Try once. Return error if fails — caller loops back to select
// and can pick up new reconnect params or a new grant. // and can pick up new reconnect params or a new grant.
if params.video != "" && params.audio != "" { if params.video != "" && params.audio != "" {
s, e := source.OpenSync(params.domain, params.video, params.audio) s, e := source.OpenSameDomainSync(params.domain, params.video, params.audio)
if e == nil { if e == nil {
if r != nil { if r != nil {
newSize := vk.DeviceSize(s.Stride()) * vk.DeviceSize(s.Height()) newSize := vk.DeviceSize(s.Stride()) * vk.DeviceSize(s.Height())
+4 -1
View File
@@ -305,7 +305,10 @@ type SyncSource struct {
width, height, stride uint32 width, height, stride uint32
} }
func OpenSync(domain, videoFlow, audioFlow string) (*SyncSource, error) { // OpenSameDomainSync opens a native MXL synchronization group.
// Both feeds must belong to the supplied domain because go-mxl sync groups
// cannot contain readers from different MXL instances.
func OpenSameDomainSync(domain, videoFlow, audioFlow string) (*SyncSource, error) {
inst, err := mxl.NewInstance(domain, "") inst, err := mxl.NewInstance(domain, "")
if err != nil { if err != nil {
return nil, fmt.Errorf("NewInstance: %w", err) return nil, fmt.Errorf("NewInstance: %w", err)