Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The purpose of the decklinksrc module is to return “return” a constant stream of frames from the default webcam. By providing frames at a fast rate, a video interface can be developed and passed into other functions such as the QR Scanner or Video Display. In a forever loop, frames are repetitively grabbed from an OpenCV VideoCapture() and updated as assigned to the variable in the function’s parameter.

...

The decklinkSrcWorker_taxi file contains the decklinkSrc_worker_taxi() method called by main.py that takes pipelineOut as a parameter. Python parameters are pass by reference, so whatever the pipelineOut variable is changed to in the function is also changed in the main program, main.py. In decklinkSrcWorker_taxi(), a DeckLinkSRC object is created and this object has functions that are defined in decklinksrc.py. Using this object, functions from decklinksrc.py are called in a forever loop to store and update a frame frames into a variable called curr_frame.

The decklinksrc.py file uses OpenCV to start a webcam video capture for the DeckLinkSRC object, and uses the grab() function to store the current webcam frame and return it to the curr_frame variable in decklinkSrcWorker_taxi. Finally, the parameter pipelineOut is set as the curr_frame. Note that decklinksrc is always used in parallel with other functions such as qr_worker or videoDisplayWorker. The pipelineOut parameter containing the current frame is constantly grabbed and updated to a new webcam frame at a high speed. This frame is then passed into the parameter of functions like qr_worker or videoDisplayWorker, and used to display the camera and call its corresponding functions.

...