From d31179982e59235ca9a25eadcce7cc28f52585af Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sat, 27 Feb 2016 02:27:39 +0100 Subject: [PATCH] Interact with BMUSBCapture through CaptureInterface. --- mixer.cpp | 14 +++++++------- mixer.h | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/mixer.cpp b/mixer.cpp index 21c3f69..9c5c853 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -138,12 +138,12 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) for (unsigned card_index = 0; card_index < num_cards; ++card_index) { printf("Configuring card %d...\n", card_index); CaptureCard *card = &cards[card_index]; - card->usb = new BMUSBCapture(card_index); - card->usb->set_frame_callback(bind(&Mixer::bm_frame, this, card_index, _1, _2, _3, _4, _5, _6, _7)); + card->capture = new BMUSBCapture(card_index); + card->capture->set_frame_callback(bind(&Mixer::bm_frame, this, card_index, _1, _2, _3, _4, _5, _6, _7)); card->frame_allocator.reset(new PBOFrameAllocator(8 << 20, WIDTH, HEIGHT)); // 8 MB. - card->usb->set_video_frame_allocator(card->frame_allocator.get()); + card->capture->set_video_frame_allocator(card->frame_allocator.get()); card->surface = create_surface(format); - card->usb->set_dequeue_thread_callbacks( + card->capture->set_dequeue_thread_callbacks( [card]{ eglBindAPI(EGL_OPENGL_API); card->context = create_context(card->surface); @@ -156,13 +156,13 @@ Mixer::Mixer(const QSurfaceFormat &format, unsigned num_cards) resource_pool->clean_context(); }); card->resampling_queue.reset(new ResamplingQueue(OUTPUT_FREQUENCY, OUTPUT_FREQUENCY, 2)); - card->usb->configure_card(); + card->capture->configure_card(); } BMUSBCapture::start_bm_thread(); for (unsigned card_index = 0; card_index < num_cards; ++card_index) { - cards[card_index].usb->start_bm_capture(); + cards[card_index].capture->start_bm_capture(); } // Set up stuff for NV12 conversion. @@ -232,7 +232,7 @@ Mixer::~Mixer() cards[card_index].should_quit = true; // Unblock thread. cards[card_index].new_data_ready_changed.notify_all(); } - cards[card_index].usb->stop_dequeue_thread(); + cards[card_index].capture->stop_dequeue_thread(); } h264_encoder.reset(nullptr); diff --git a/mixer.h b/mixer.h index 821ceb2..d59b6a3 100644 --- a/mixer.h +++ b/mixer.h @@ -238,7 +238,7 @@ public: 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: @@ -273,7 +273,7 @@ private: std::mutex bmusb_mutex; struct CaptureCard { - BMUSBCapture *usb; + CaptureInterface *capture; std::unique_ptr frame_allocator; // Stuff for the OpenGL context (for texture uploading). -- 2.39.2