std::string get_card_description(unsigned card_index) const {
assert(card_index < num_cards);
- return cards[card_index].usb->get_description();
+ return cards[card_index].capture->get_description();
}
+ std::map<uint32_t, VideoMode> get_available_video_modes(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_available_video_modes();
+ }
+
+ uint32_t get_current_video_mode(unsigned card_index) const {
+ assert(card_index < num_cards);
+ return cards[card_index].capture->get_current_video_mode();
+ }
+
+ void set_video_mode(unsigned card_index, uint32_t mode) {
+ assert(card_index < num_cards);
+ cards[card_index].capture->set_video_mode(mode);
+ }
+
+ void start_mode_scanning(unsigned card_index);
+
private:
+ void configure_card(unsigned card_index, const QSurfaceFormat &format, CaptureInterface *capture);
void bm_frame(unsigned card_index, uint16_t timecode,
- FrameAllocator::Frame video_frame, size_t video_offset, uint16_t video_format,
- FrameAllocator::Frame audio_frame, size_t audio_offset, uint16_t audio_format);
+ FrameAllocator::Frame video_frame, size_t video_offset, VideoFormat video_format,
+ FrameAllocator::Frame audio_frame, size_t audio_offset, AudioFormat audio_format);
void place_rectangle(movit::Effect *resample_effect, movit::Effect *padding_effect, float x0, float y0, float x1, float y1);
void thread_func();
void audio_thread_func();
std::mutex bmusb_mutex;
struct CaptureCard {
- BMUSBCapture *usb;
+ CaptureInterface *capture;
std::unique_ptr<PBOFrameAllocator> frame_allocator;
// Stuff for the OpenGL context (for texture uploading).
std::mutex audio_mutex;
std::condition_variable audio_task_queue_changed;
std::queue<AudioTask> audio_task_queue; // Under audio_mutex.
+
+ // For mode scanning.
+ bool is_mode_scanning[MAX_CARDS]{ false };
+ std::vector<uint32_t> mode_scanlist[MAX_CARDS];
+ unsigned mode_scanlist_index[MAX_CARDS]{ 0 };
+ timespec last_mode_scan_change[MAX_CARDS];
};
extern Mixer *global_mixer;