class_docstr: CamGear supports a diverse range of video streams which can handle/control video stream almost any IP/USB Cameras, multimedia video file format (upto 4k tested),
  any network stream URL such as http(s), rtp, rtsp, rtmp, mms, etc. It also supports Gstreamer's RAW pipelines.
  
  CamGear API provides a flexible, high-level multi-threaded wrapper around OpenCV's VideoCapture API with direct access to almost all of its available parameters.
  It relies on Threaded Queue mode for threaded, error-free and synchronized frame handling.
  
  CamGear internally implements `yt_dlp` backend class for seamlessly pipelining live video-frames and metadata from various streaming services like YouTube, Dailymotion,
  Twitch, and [many more ➶](https://github.com/yt-dlp/yt-dlp/blob/master/supportedsites.md#supported-sites)
docstr: A **Threaded Frames Extractor**, that keep iterating frames from OpenCV's VideoCapture API to a internal monitored queue,
  until the thread is terminated, or frames runs out.
code: def __update(self):
      """
      A **Threaded Frames Extractor**, that keep iterating frames from OpenCV's VideoCapture API to a internal monitored queue,
      until the thread is terminated, or frames runs out.
      """
  
      # keep iterating infinitely
      # until the thread is terminated
      # or frames runs out
      # if the thread indicator variable is set, stop the thread
      while not self.__terminate.is_set():
          # stream not read yet
          self.__stream_read.clear()
  
          # otherwise, read the next frame from the stream
          (grabbed, frame) = self.stream.read()
  
          # stream read completed
          self.__stream_read.set()
  
          # check for valid frame if received
          if not grabbed:
              # no frames received, then safely exit
              if self.__threaded_queue_mode:
                  if self.__queue.empty():
                      break
                  else:
                      continue
              else:
                  break
  
          # apply colorspace to frames if valid
          if not (self.color_space is None):
              color_frame = None
              try:
                  if isinstance(self.color_space, int):
                      color_frame = cv2.cvtColor(
                          frame, self.color_space
                      )
                  else:
                      raise ValueError(
                          "Global color_space parameter value `{}` is not a valid!".format(
                              self.color_space
                          )
                      )
              except Exception as e:
                  # Catch if any error occurred
                  self.color_space = None
                  if self.__logging:
                      logger.exception(str(e))
                      logger.warning(
                          "Input colorspace is not a valid colorspace!"
                      )
              if not (color_frame is None):
                  self.frame = color_frame
              else:
                  self.frame = frame
          else:
              self.frame = frame
  
          # append to queue
          if self.__threaded_queue_mode:
              self.__queue.put(self.frame)
  
      # signal queue we're done
      self.__threaded_queue_mode and self.__queue.put(None)
      self.__threaded_queue_mode = False
  
      # indicate immediate termination
      self.__terminate.set()
      self.__stream_read.set()
  
      # release resources
      self.stream.release()
  
file_path: vidgear/vidgear/gears/camgear.py
imports: import cv2
  import time
  import queue
  import logging
  from threading import Thread, Event
  from .helper import capPropId, logger_handler, check_CV_version, get_supported_resolution, check_gstreamer_support, import_dependency_safe, logcurr_vidgear_ver
label_desc: Use image node_id 3 for calling the CamGear obj's underlying member method code with example usage: obj.__update() without return types