package ingest

import "time"

// PCMChunk is the ingest-internal normalized PCM unit before TX conversion.
// Samples are interleaved per channel.
type PCMChunk struct {
	Samples       []int32
	Channels      int
	SampleRateHz  int
	Sequence      uint64
	Timestamp     time.Time
	SourceID      string
	Discontinuity bool
}

type SourceDescriptor struct {
	ID           string        `json:"id"`
	Kind         string        `json:"kind"`
	Family       string        `json:"family"`
	Transport    string        `json:"transport"`
	Codec        string        `json:"codec"`
	Channels     int           `json:"channels"`
	SampleRateHz int           `json:"sampleRateHz"`
	Detail       string        `json:"detail,omitempty"`
	Origin       *SourceOrigin `json:"origin,omitempty"`
}

// SourceOrigin describes where an ingest source definition came from and
// which endpoint it resolved to, so control/runtime can show provenance.
type SourceOrigin struct {
	Kind       string `json:"kind,omitempty"`
	Endpoint   string `json:"endpoint,omitempty"`
	Mode       string `json:"mode,omitempty"`
	StreamName string `json:"streamName,omitempty"`
	SDPPath    string `json:"sdpPath,omitempty"`
}
