Code example for LocalSocket

Methods: getFileDescriptor

0
        mMediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
        mMediaRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.DEFAULT);
        mMediaRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
         
        // Step 4: Set output file 
        mMediaRecorder.setOutputFile(ls.getFileDescriptor());
         
        // Step 5: Set the preview output 
        //mMediaRecorder.setPreviewDisplay(mPreview.getHolder().getSurface()); 
        mMediaRecorder.setPreviewDisplay(holder.getSurface());
         
        Log.i(TAG, "Surface valid: "+holder.getSurface().isValid());
         
        // Step 6: Prepare configured MediaRecorder 
        try { 
            mMediaRecorder.prepare();
        } catch (Exception e) {
            Log.d(TAG, "Exception preparing MediaRecorder: " + e.getMessage());
            releaseMediaRecorder(); 
            return false; 
        }