35 lines
927 B
Go
35 lines
927 B
Go
package playback
|
|
|
|
import "context"
|
|
|
|
// SyncFrame contains one video frame and its corresponding audio batch.
|
|
//
|
|
// Both payloads may borrow reader-owned memory and are valid only until the
|
|
// next ReadSync call or until the reader is closed.
|
|
type SyncFrame struct {
|
|
Video VideoFrame
|
|
Audio AudioFrame
|
|
}
|
|
|
|
// SyncReader reads synchronized audio/video pairs.
|
|
//
|
|
// ReadSync must not be called again until both frame payloads have been
|
|
// consumed.
|
|
type SyncReader interface {
|
|
ReadSync(context.Context) (SyncFrame, error)
|
|
Close() error
|
|
}
|
|
|
|
// SyncReaderFactory opens one synchronized reader for two configured feeds.
|
|
//
|
|
// Native MXL implementations may require the feeds to use the same domain.
|
|
// Future manual synchronization may support different domains behind another
|
|
// implementation of this interface.
|
|
type SyncReaderFactory interface {
|
|
OpenSync(
|
|
context.Context,
|
|
FeedConfig,
|
|
FeedConfig,
|
|
) (SyncReader, error)
|
|
}
|