NewMessageProcessor creates a new MessageProcessor that will write answers to the given UsbWriter, forward extracted CMSampleBuffers to the CMSampleBufConsumer and wait for the stopSignal.
(usbWriter UsbWriter, stopSignal chan interface{}, consumer CmSampleBufConsumer, audioOnly bool)
| 36 | //NewMessageProcessor creates a new MessageProcessor that will write answers to the given UsbWriter, |
| 37 | // forward extracted CMSampleBuffers to the CMSampleBufConsumer and wait for the stopSignal. |
| 38 | func NewMessageProcessor(usbWriter UsbWriter, stopSignal chan interface{}, consumer CmSampleBufConsumer, audioOnly bool) MessageProcessor { |
| 39 | clockBuilder := func(ID uint64) coremedia.CMClock { return coremedia.NewCMClockWithHostTime(ID) } |
| 40 | return NewMessageProcessorWithClockBuilder(usbWriter, stopSignal, consumer, clockBuilder, audioOnly) |
| 41 | } |
| 42 | |
| 43 | //NewMessageProcessorWithClockBuilder lets you inject a clockBuilder for the sake of testability. |
| 44 | func NewMessageProcessorWithClockBuilder(usbWriter UsbWriter, stopSignal chan interface{}, consumer CmSampleBufConsumer, clockBuilder func(uint64) coremedia.CMClock, audioOnly bool) MessageProcessor { |