# Path: MAVProxy/modules/lib/multiproc.py
# class PipeQueue(object):
#     def __init__(self):
#     def close(self):
#     def put(self, *args):
#     def fill(self):
#     def get(self):
#     def qsize(self):
#     def empty(self):


import sys
import time
import math
import cv2
import sc_config
from os.path import expanduser
from MAVProxy.modules.lib import multiproc
        # clear latest image
        latest_image = None

        while True:
            # constantly get the image from the webcam
            success_flag, image=camera.read()

            # if successful overwrite our latest image
            if success_flag:
                latest_image = image

            # check if the parent wants the image
            if imgcap_connection.poll():
                recv_obj = imgcap_connection.recv()
                # if -1 is received we exit
                if recv_obj == -1:
                    break

                # otherwise we return the latest image
                imgcap_connection.send(latest_image)

        # release camera when exiting
        camera.release()

    # start_background_capture - starts background image capture
    def start_background_capture(self):
        # create pipe
        self.parent_conn, imgcap_conn = multiproc.Pipe()

        # create and start the sub process and pass it it's end of the pipe

# Path: MAVProxy/modules/lib/multiproc.py
# class PipeQueue(object):
#     def __init__(self):
#     def close(self):
#     def put(self, *args):
#     def fill(self):
#     def get(self):
#     def qsize(self):
#     def empty(self):


# Path: MAVProxy/modules/mavproxy_smartcamera/sc_video.py
import sys
import time
import math
import cv2
import sc_config
from os.path import expanduser
from MAVProxy.modules.lib import multiproc

        # clear latest image
        latest_image = None

        while True:
            # constantly get the image from the webcam
            success_flag, image=camera.read()

            # if successful overwrite our latest image
            if success_flag:
                latest_image = image

            # check if the parent wants the image
            if imgcap_connection.poll():
                recv_obj = imgcap_connection.recv()
                # if -1 is received we exit
                if recv_obj == -1:
                    break

                # otherwise we return the latest image
                imgcap_connection.send(latest_image)

        # release camera when exiting
        camera.release()

    # start_background_capture - starts background image capture
    def start_background_capture(self):
        # create pipe
        self.parent_conn, imgcap_conn = multiproc.Pipe()

        # create and start the sub process and pass it it's end of the pipe

        self.proc = multiproc.Process(target=self.image_capture_background, args=(imgcap_conn,))