Release all recording-specific resources.
The Encoder, EGLCore and FullFrameRect are tied to capture resolution,
and other parameters.
18386
private void releaseEglResources() {
        mReadyForFrames = false;
        if (mInputWindowSurface != null) {
            mInputWindowSurface.release();
            mInputWindowSurface = null;
        }
        if (mFullScreen != null) {
            mFullScreen.release();
            mFullScreen = null;
        }
        if (mEglCore != null) {
            mEglCore.release();
            mEglCore = null;
        }

        mSurfaceTexture = null;
    }
370810
public synchronized void removeAllSceneObjects() {
        final GVRCameraRig rig = getMainCameraRig();
        final GVRSceneObject head = rig.getOwnerObject();
        rig.removeAllChildren();

        NativeScene.removeAllSceneObjects(getNative());
        for (final GVRSceneObject child : mSceneRoot.getChildren()) {
            child.getParent().removeChildObject(child);
        }

        if (null != head) {
            mSceneRoot.addChildObject(head);
        }

        final int numControllers = getGVRContext().getInputManager().clear();
        if (numControllers > 0)
        {
            getGVRContext().getInputManager().selectController();
        }

        getGVRContext().runOnGlThread(new Runnable() {
            @Override
            public void run() {
                NativeScene.deleteLightsAndDepthTextureOnRenderThread(getNative());
            }
        });
    }
948176
function () {
      this.idle();

      delete this.recording;

      this.recording = new Recording({
        timeBetweenLoops:       this.options.timeBetweenLoops,
        loop:                   this.options.loop,
        requestProtocolVersion: this.controller.connection.opts.requestProtocolVersion,
        serviceVersion:         this.controller.connection.protocol.serviceVersion
      });

      this.controller.emit('playback.stop', this);
    }
474775
public void stopRecording() {
        IRecordingListener listener = null;
        if (recordingListener != null && (listener = recordingListener.get()).isRecording()) {
            sendRecordStopNotify();
            notifyRecordingStop();
            // remove the listener
            removeStreamListener(listener);
            // stop the recording listener
            listener.stop();
            // clear and null-out the thread local
            recordingListener.clear();
            recordingListener = null;
        }
    }
1205453
function destroyCameraPreview() {
        capturePreview.pause();
        capturePreview.src = null;
        if (previewContainer) {
            document.body.removeChild(previewContainer);
        }
        if (capture) {
            capture.stopRecordAsync();
            capture = null;
        }
    }
195678
def start_recording(self):
        """"""
        self._recording = True
        self._stop_recording.clear()
        self._source.start()
266052
private void releaseAllChannelResources() {
		for (int i = 0; i < this.inputGates.size(); i++) {
			this.inputGates.get(i).releaseAllChannelResources();
		}

		for (int i = 0; i < this.outputGates.size(); i++) {
			this.outputGates.get(i).releaseAllChannelResources();
		}
	}
449058
public void stop() {
        if (tape == null) {
            throw new IllegalStateException("stop called when Recorder is not started");
        }

        for (RecorderListener listener : listeners) {
            listener.onRecorderStop();
        }
        getTapeLoader().writeTape(tape);
        tape = null;
    }
477629
def stop(self):
        
        self.camera._get_config()['actions']['movie'].set(False)
        self.videofile = self.camera._wait_for_event(
            event_type=lib.GP_EVENT_FILE_ADDED)
        if self._old_captarget != "Memory card":
            self.camera.config['settings']['capturetarget'].set(
                self._old_captarget)
1018757
private void stop() {
        //unregister and free all resources;
        if (updateTask != null)
            updateTask.cancel();
        for (GenericStatsProducer producer : producers) {
            producer.genericStats.destroy();
            ProducerRegistryFactory.getProducerRegistryInstance().unregisterProducer(producer);
        }
        producers.clear();
    }
1303272
public void close() {
		if (formatContext != null && !formatContext.isNull()) {
			avformat_close_input(formatContext);
			formatContext = null;
		}

		/*
		 * Set codec context explicitly to null since avformat_close_input already released it.
		 * This way the decoder knows the context is already closed.
		 */
		for (Integer index : videoDecoders.keySet()) {
			videoDecoders.get(index).getCodec().getContext().setNull();
			videoDecoders.get(index).close();
		}
		for (Integer index : audioDecoders.keySet()) {
			audioDecoders.get(index).getCodec().getContext().setNull();
			audioDecoders.get(index).close();
		}

		videoDecoders = null;
		audioDecoders = null;
	}
1096074
@Override
   public void release() {
    	rewind();
        try {
            this.dataLogger.prepareForWrite(this.getXADataRecorderId());
        } catch (Exception e) {
            throw new DelegatedRuntimeException(e);
        }

   	 if (dataRecorderLifycycleListner != null) {
            this.dataRecorderLifycycleListner.recorderDataRecorderReleased(this);
        }

    }
65360
def cleanup_video(self):
        '''
        
        '''
        if self.video_source_process is not None:
            self.video_source_process.terminate()
            logger.info('Terminated video process: %s',
                        self.video_source_process.pid)
            self.video_source_process = None
296018
def start_recording(recorded_events_queue=None):
    
    recorded_events_queue = recorded_events_queue or _queue.Queue()
    global _recording
    _recording = (recorded_events_queue, hook(recorded_events_queue.put))
    return _recording
452299
protected void release() {
        Log.d(TAG, "release");
        releaseObjects();

        if (this.mediaPlayer != null) {
            this.mediaPlayer.setOnBufferingUpdateListener(null);
            this.mediaPlayer.setOnPreparedListener(null);
            this.mediaPlayer.setOnErrorListener(null);
            this.mediaPlayer.setOnSeekCompleteListener(null);
            this.mediaPlayer.setOnCompletionListener(null);
            this.mediaPlayer.setOnInfoListener(null);
            this.mediaPlayer.setOnVideoSizeChangedListener(null);
            this.mediaPlayer.release();
            this.mediaPlayer = null;
        }

        this.currentState = State.END;
    }
1268251
private void releaseDisplayView() {
        if (mDisplayView instanceof GLCameraEncoderView) {
            ((GLCameraEncoderView) mDisplayView).releaseCamera();
        } else if (mDisplayView instanceof GLCameraView)
            ((GLCameraView) mDisplayView).releaseCamera();
    }
1027445
public void releaseMemory()
    {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "releaseMemory");

        synchronized (this)
        {

            // v is unused
            //ArrayList v = new ArrayList();

            // Create a new stream to replace old one
            // as set latest ls prefix
            oststream = new StateStream();
            oststream.init();
            oststream.setCompletedPrefix(oack);

        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "releaseMemory");
    }