// New allocates a Converter.
New allocates a Converter.
// New allocates a Converter .
func New(
	ctxParent context.Context,
	hlsSegmentCount int,
	hlsSegmentDuration time.Duration,
	readBufferCount int,
	wg *sync.WaitGroup,
	stats *stats.Stats,
	pathName string,
	pathMan PathMan,
	parent Parent) *Converter {
	ctx, ctxCancel := context.WithCancel(ctxParent)
	c := &Converter{
		hlsSegmentCount:    hlsSegmentCount,
		hlsSegmentDuration: hlsSegmentDuration,
		readBufferCount:    readBufferCount,
		wg:                 wg,
		stats:              stats,
		pathName:           pathName,
		pathMan:            pathMan,
		parent:             parent,
		ctx:                ctx,
		ctxCancel:          ctxCancel,
		lastRequestTime:    time.Now().Unix(),
		tsByName:           make(map[string]*tsFile),
		request:            make(chan Request),
	}
	c.log(logger.Info, "opened")
	c.wg.Add(1)
	go c.run()
	return c
}
func New ( ctxParent context . Context , hlsSegmentCount int , hlsSegmentDuration time . Duration , readBufferCount int , wg * sync . WaitGroup , stats * stats . Stats , pathName string , pathMan PathMan , parent Parent ) * Converter { ctx , ctxCancel := context . WithCancel ( ctxParent ) c := & Converter { hlsSegmentCount : hlsSegmentCount , hlsSegmentDuration : hlsSegmentDuration , readBufferCount : readBufferCount , wg : wg , stats : stats , pathName : pathName , pathMan : pathMan , parent : parent , ctx : ctx , ctxCancel : ctxCancel , lastRequestTime : time . Now ( ) . Unix ( ) , tsByName : make ( map [ string ] * tsFile ) , request : make ( chan Request ) , } c . log ( logger . Info , " " ) c . wg . Add ( 1 ) go c . run ( ) return c }
New allocates a Converter.
New allocates a Converter .