void preroll_video_frames(unsigned int n_frames) { IDeckLinkMutableVideoFrame *frame; IDeckLinkVideoFrameAncillary *anc; for (unsigned int i = 0; i < n_frames; i++) { if (deckLinkOutput->CreateVideoFrame(norms[norm].w, norms[norm].h, 2*norms[norm].w, bpf, bmdFrameFlagDefault, &frame) != S_OK) { throw std::runtime_error("Failed to create frame"); } if (deckLinkOutput->CreateAncillaryData(bpf, &anc) != S_OK) { throw std::runtime_error("failed to set frame ancillary data"); } if (frame->SetAncillaryData(anc) != S_OK) { throw std::runtime_error("failed to set frame ancillary data"); } schedule_frame(frame); } }