- Posts: 16
- Joined: Wed Apr 14, 2021 11:53 am
- Real Name: Marco Könemann
Hello,
i write a little program depending on the Blackmagic Decklink SDK which should capture incoming video and audio. When I use the DeckLinkInput interface I get the read access violation message "this->dl_input was nulltr". After hours of debugging I have no idea how to fix this issue.
The callback function is only a sample. I also have a function for enabeling the input and for checking the display mode - there I got this message too.
Maybe someone have a advice why dl_input is a nullpointer?
Regards
Marco
i write a little program depending on the Blackmagic Decklink SDK which should capture incoming video and audio. When I use the DeckLinkInput interface I get the read access violation message "this->dl_input was nulltr". After hours of debugging I have no idea how to fix this issue.
- Code: Select all
class ControlVideo {
public:
HRESULT result;
IDeckLink *deckLink;
IDeckLinkInput *dl_input;
IDeckLinkInputCallback *theCallback;
IDeckLinkDisplayMode *dl_displayMode;
IDeckLinkDisplayModeIterator* dl_displayModeIterator;
bool inputCallback(IDeckLinkInput* dl_input);
bool startCapture();
};
/**
* Function that initializes the input callback
* The callback will be called for each incoming frame
*/
bool ControlVideo::inputCallback(IDeckLinkInput *dl_input) {
if (dl_input->SetCallback(theCallback) == S_OK) {
std::cout << "Input Callback called. \n";
return true;
}
else {
std::cout << "DeckLink Callback fails. \n";
return false;
}
}
/**
* Function that start the stream
*/
bool ControlVideo::startCapture() {
ControlVideo ctrlVideo;
//make a callback for each incoming frame
ctrlVideo.inputCallback(dl_input);
if (dl_input->StartStreams() == S_OK) {
std::cout << "Stream has been started. \n";
return true;
}
else {
throw std::runtime_error("Error: Stream can not been started. \n");
return false;
}
}
int main() {
//Create object and initialize the DeckLink
InitializeDecklink init;
init.initializeDevice();
init.printDevice();
ControlVideo ctrlVideo;
ctrlVideo.startCapture();
return 0;
}
The callback function is only a sample. I also have a function for enabeling the input and for checking the display mode - there I got this message too.
Maybe someone have a advice why dl_input is a nullpointer?
Regards
Marco