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: Safely terminates the thread, and release the VideoStream resources.
code: def stop(self):
      """
      Safely terminates the thread, and release the VideoStream resources.
      """
      self.__logging and logger.debug("Terminating processes.")
      # terminate Threaded queue mode separately
      self.__threaded_queue_mode = False
  
      # indicate that the thread
      # should be terminated immediately
      self.__stream_read.set()
      self.__terminate.set()
  
      # wait until stream resources are released (producer thread might be still grabbing frame)
      if self.__thread is not None:
          if not (self.__queue is None):
              while not self.__queue.empty():
                  try:
                      self.__queue.get_nowait()
                  except queue.Empty:
                      continue
                  self.__queue.task_done()
          self.__thread.join()
  
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 5 for calling the CamGear obj's underlying member method code with example usage: obj.stop() without return types