});
}
-bool DeckLinkOutput::set_device(IDeckLink *decklink)
+bool DeckLinkOutput::set_device(IDeckLink *decklink, IDeckLinkInput *input_arg)
{
- if (decklink->QueryInterface(IID_IDeckLinkInput, (void**)&input) != S_OK) {
- input = nullptr;
- }
+ input = input_arg;
if (decklink->QueryInterface(IID_IDeckLinkOutput, (void**)&output) != S_OK) {
fprintf(stderr, "Warning: Card %u has no outputs\n", card_index);
return false;
{
lock_guard<mutex> lock(frame_queue_mutex);
frame_freelist.push(unique_ptr<Frame>(frame));
- assert(scheduled_frames.front() == frame);
- scheduled_frames.pop_front();
+ assert(scheduled_frames.count(frame));
+ scheduled_frames.erase(frame);
--metric_decklink_output_inflight_frames;
}
HRESULT res = output->ScheduleVideoFrame(frame.get(), pts, duration, TIMEBASE);
lock_guard<mutex> lock(frame_queue_mutex);
if (res == S_OK) {
- scheduled_frames.push_back(frame.release()); // Owned by the driver now.
+ scheduled_frames.insert(frame.release()); // Owned by the driver now.
++metric_decklink_output_inflight_frames;
} else {
fprintf(stderr, "Could not schedule video frame! (error=0x%08x)\n", res);