public RecorderBranchBase()

in src/main/java/com/aws/iot/edgeconnectorforkvs/videorecorder/base/RecorderBranchBase.java [84:118]


    public RecorderBranchBase(RecorderCapability cap, GstDao dao, Pipeline pipeline) {
        this.capability = cap;
        this.gstCore = dao;
        this.pipeline = pipeline;
        this.teeSrc2Que = new HashMap<>();
        this.teeSrcPad2Tee = new HashMap<>();
        this.condLock = new ReentrantLock();
        this.padProbeUnlink = this.condLock.newCondition();
        this.detachCnt = new AtomicInteger(0);
        this.bindLock = new ReentrantLock();
        this.branchAttached = new AtomicBoolean();
        this.attachExplicitly = new AtomicBoolean();

        this.teeBlockProbe = (teePadSrc, info) -> {
            Pad quePadSink = this.gstCore.getPadPeer(teePadSrc);

            if (this.gstCore.isPadLinked(teePadSrc)) {
                this.gstCore.unlinkPad(teePadSrc, quePadSink);
                log.info("queue is detached");
            }

            this.gstCore.sendPadEvent(quePadSink, this.gstCore.newEosEvent());

            if (this.detachCnt.incrementAndGet() == this.teeSrc2Que.size()) {
                this.condLock.lock();
                try {
                    this.padProbeUnlink.signal();
                } finally {
                    this.condLock.unlock();
                }
            }

            return PadProbeReturn.REMOVE;
        };
    }