DeckLinkOutputAdapter(unsigned int card_index = 0, unsigned int norm_ = 0, RawFrame::PixelFormat pf_ = RawFrame::CbYCrY8422, bool enable_audio = false) : deckLink(NULL), deckLinkOutput(NULL), frame_counter(0), last_frame(NULL), in_pipe(OUT_PIPE_SIZE), audio_in_pipe(NULL) { norm = norm_; assert(norm < sizeof(norms) / sizeof(struct decklink_norm)); time_base = norms[norm].time_base; frame_duration = norms[norm].frame_duration; pf = pf_; bpf = convert_pf(pf_); deckLink = find_card(card_index); configure_card( ); open_card( ); preroll_video_frames(16); if (enable_audio) { setup_audio( ); } start_video( ); thread_priority_hack( ); fprintf(stderr, "DeckLink: initialized using norm %s\n", norms[norm].name); }
DeckLinkInputAdapter(unsigned int card_index = 0, unsigned int norm_ = 0, unsigned int input_ = 0, RawFrame::PixelFormat pf_ = RawFrame::CbYCrY8422, bool enable_audio = false) : deckLink(NULL), out_pipe(IN_PIPE_SIZE) { audio_pipe = NULL; pf = pf_; bpf = convert_pf(pf_); deckLink = find_card(card_index); select_input_connection(input_); open_input(norm_); if (enable_audio) { n_channels = 2; select_audio_input_connection( ); open_audio_input( ); } start_capture( ); }
DeckLinkInputAdapter(unsigned int card_index = 0, unsigned int norm_ = 0, unsigned int input_ = 0, RawFrame::PixelFormat pf_ = RawFrame::CbYCrY8422, bool enable_audio = false, unsigned int n_channels = 2, bool enable_video = true) : deckLink(NULL), out_pipe(IN_PIPE_SIZE) { audio_pipe = NULL; started = false; signal_lost = false; rotate = false; this->enable_video = enable_video; n_frames = 0; start_time = 0; avsync = 0; drop_audio = 0; pf = pf_; bpf = convert_pf(pf_); deckLink = find_card(card_index); select_input_connection(input_); open_input(norm_); if (enable_audio) { audio_pipe = new Pipe<IOAudioPacket *>(IN_PIPE_SIZE); } this->n_channels = n_channels; select_audio_input_connection( ); open_audio_input( ); start_capture( ); }