Page 1 of 1

SDK and "Ref IN" sync

PostPosted: Sun Jun 07, 2015 1:45 pm
by Iakov Pustilnik
Hello board.

I'm trying to make a very simple program that reads "Ref IN" signal from DeckLink 4k Extreme Ref-IN and sends and outputs a dot to screen on each reference clock tick.

By now i've only found one way to make this, but it's quite complicated: that is to pass my callback to IDeckLink::SetScheduledFrameCompletionCallback(...) call. Then when my callback is called that means that Decklink just finished a frame output.

Is there any way i can get Ref-IN signal more precisely?

Any comments greatly appreciated

Re: SDK and "Ref IN" sync

PostPosted: Mon Jun 08, 2015 8:38 pm
by Iakov Pustilnik
To whom it may concern.

It seems that IDeckLinkOutput::GetHardwareReferenceClock(...) method is almost what I need. So my solution for now is to register an object as a callback handler by IDeckLink::SetScheduledFrameCompletionCallback(...), then get frame age within current output format timescale using IDeckLinkOutput::GetHardwareReferenceClock(...).

As far as I get it the 3rd parameter (timeInFrame) to GetHardwareReferenceClock would ticks count passed from last Ref-IN signal received, and the 4th parameter (ticksPerFrame) is number of that ticks in one frame.
So dividing timeInFrame / (ticksPerFrame * fps) I can get time passed since last Ref-IN signal.