SDK and "Ref IN" sync

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

Iakov Pustilnik

  • Posts: 6
  • Joined: Sun Jun 07, 2015 1:37 pm

SDK and "Ref IN" sync

PostSun Jun 07, 2015 1:45 pm

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
Offline

Iakov Pustilnik

  • Posts: 6
  • Joined: Sun Jun 07, 2015 1:37 pm

Re: SDK and "Ref IN" sync

PostMon Jun 08, 2015 8:38 pm

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.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 11 guests