return theme->map_signal(channel);
}
+ unsigned get_audio_source() const
+ {
+ return audio_source_channel;
+ }
+
+ void set_audio_source(unsigned channel)
+ {
+ audio_source_channel = channel;
+ }
+
void set_signal_mapping(int signal, int card)
{
return theme->set_signal_mapping(signal, card);
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();
}
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();
QSurface *mixer_surface, *h264_encoder_surface;
std::unique_ptr<movit::ResourcePool> resource_pool;
std::unique_ptr<Theme> theme;
+ std::atomic<unsigned> audio_source_channel{0};
std::unique_ptr<movit::EffectChain> display_chain;
GLuint cbcr_program_num; // Owned by <resource_pool>.
+ GLuint cbcr_vbo; // Holds position and texcoord data.
+ GLuint cbcr_position_attribute_index, cbcr_texcoord_attribute_index;
std::unique_ptr<H264Encoder> h264_encoder;
// Effects part of <display_chain>. Owned by <display_chain>.
std::mutex bmusb_mutex;
struct CaptureCard {
- BMUSBCapture *usb;
+ CaptureInterface *capture;
std::unique_ptr<PBOFrameAllocator> frame_allocator;
// Stuff for the OpenGL context (for texture uploading).