avdevice/decklink: move general code of decklink encoder to common file