X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=decklink_capture.h;h=59c3b02e6096528098e315a64d98034ecfa1b2cf;hb=8d575ed1bf8c01daaeb4bdf87de53d089448ba93;hp=322adb5b0d6c62352f0397c4a357c7c66fc837ec;hpb=96943efedcea66dab5ab6500358951e9f249aef2;p=nageru diff --git a/decklink_capture.h b/decklink_capture.h index 322adb5..59c3b02 100644 --- a/decklink_capture.h +++ b/decklink_capture.h @@ -17,7 +17,7 @@ class IDeckLinkDisplayMode; class DeckLinkCapture : public CaptureInterface, IDeckLinkInputCallback { public: - DeckLinkCapture(IDeckLink *card, int card_index); + DeckLinkCapture(IDeckLink *card, int card_index); // Takes ownership of . ~DeckLinkCapture(); // IDeckLinkInputCallback. @@ -36,6 +36,9 @@ public: void set_video_frame_allocator(FrameAllocator *allocator) override { video_frame_allocator = allocator; + if (owned_video_frame_allocator.get() != allocator) { + owned_video_frame_allocator.reset(); + } } FrameAllocator *get_video_frame_allocator() override @@ -47,6 +50,9 @@ public: void set_audio_frame_allocator(FrameAllocator *allocator) override { audio_frame_allocator = allocator; + if (owned_audio_frame_allocator.get() != allocator) { + owned_audio_frame_allocator.reset(); + } } FrameAllocator *get_audio_frame_allocator() override @@ -79,6 +85,14 @@ public: void set_video_mode(uint32_t video_mode_id) override; uint32_t get_current_video_mode() const override { return current_video_mode; } + std::map get_available_video_inputs() const override { return video_inputs; } + void set_video_input(uint32_t video_input_id) override; + uint32_t get_current_video_input() const override { return current_video_input; } + + std::map get_available_audio_inputs() const override { return audio_inputs; } + void set_audio_input(uint32_t audio_input_id) override; + uint32_t get_current_audio_input() const override { return current_audio_input; } + private: void set_video_mode_no_restart(uint32_t video_mode_id); @@ -94,14 +108,25 @@ private: FrameAllocator *video_frame_allocator = nullptr; FrameAllocator *audio_frame_allocator = nullptr; + std::unique_ptr owned_video_frame_allocator; + std::unique_ptr owned_audio_frame_allocator; frame_callback_t frame_callback = nullptr; + IDeckLinkConfiguration *config = nullptr; + + IDeckLink *card = nullptr; IDeckLinkInput *input = nullptr; BMDTimeValue frame_duration; BMDTimeScale time_scale; std::map video_modes; BMDDisplayMode current_video_mode; + + std::map video_inputs; + BMDVideoConnection current_video_input; + + std::map audio_inputs; + BMDAudioConnection current_audio_input; }; #endif // !defined(_DECKLINK_CAPTURE_H)