當前位置: 首頁>>代碼示例>>Java>>正文


Java LocalSocket.setReceiveBufferSize方法代碼示例

本文整理匯總了Java中android.net.LocalSocket.setReceiveBufferSize方法的典型用法代碼示例。如果您正苦於以下問題:Java LocalSocket.setReceiveBufferSize方法的具體用法?Java LocalSocket.setReceiveBufferSize怎麽用?Java LocalSocket.setReceiveBufferSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.net.LocalSocket的用法示例。


在下文中一共展示了LocalSocket.setReceiveBufferSize方法的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		final String LOCAL_ADDR = "net.majorkernelpanic.streaming-";

		for (int i=0;i<10;i++) {
			try {
				mSocketId = new Random().nextInt();
				mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
				break;
			} catch (IOException e1) {}
		}

		mReceiver = new LocalSocket();
		mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
		mReceiver.setReceiveBufferSize(500000);
		mReceiver.setSoTimeout(3000);
		mSender = mLss.accept();
		mSender.setSendBufferSize(500000);
	}
 
開發者ID:ghazi94,項目名稱:Android_CCTV,代碼行數:20,代碼來源:MediaStream.java

示例2: init

import android.net.LocalSocket; //導入方法依賴的package包/類
public void init() {
      try {
          localLoop = new LocalServerSocket("videoserver");
          localReceiver = new LocalSocket();
          localReceiver.connect(localLoop.getLocalSocketAddress());
          localReceiver.setReceiveBufferSize(LOCAL_BUFF_SIZE);
          localReceiver.setSendBufferSize(LOCAL_BUFF_SIZE);
	
	localSender = localLoop.accept();
          localSender.setReceiveBufferSize(LOCAL_BUFF_SIZE);
          localSender.setSendBufferSize(LOCAL_BUFF_SIZE);
	
          Log.d(LOG_TAG, "Done: init()");
}catch(IOException e) {
    Log.e(LOG_TAG, "Error in initializing local socket: " + e);
}
  }
 
開發者ID:cmusatyalab,項目名稱:faceswap,代碼行數:18,代碼來源:CameraConnector.java

示例3: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		final String LOCAL_ADDR = "net.majorkernelpanic.streaming-";

		for (int i=0;i<10;i++) {
			try {
				mSocketId = new Random().nextInt();
				mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
				break;
			} catch (IOException e1) {}
		}

		mReceiver = new LocalSocket();
		mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
		mReceiver.setReceiveBufferSize(1000000);
		mReceiver.setSoTimeout(3000);
		mSender = mLss.accept();
		mSender.setSendBufferSize(1000000);
	}
 
開發者ID:Oo-Dev,項目名稱:OoDroid2,代碼行數:20,代碼來源:MediaStream.java

示例4: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		final String LOCAL_ADDR = "edu.ucsb.cs.capstone.letmypeoplecode.smartrover.streaming-";

		for (int i=0;i<10;i++) {
			try {
				mSocketId = new Random().nextInt();
				mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
				break;
			} catch (IOException e1) {}
		}

		mReceiver = new LocalSocket();
		mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
		mReceiver.setReceiveBufferSize(500000);
		mReceiver.setSoTimeout(3000);
		mSender = mLss.accept();
		mSender.setSendBufferSize(500000);
	}
 
開發者ID:sciencectn,項目名稱:SmartRover,代碼行數:20,代碼來源:MediaStream.java

示例5: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		if (sPipeApi == PIPE_API_LS) {
			
			final String LOCAL_ADDR = "com.galuu.ev3videocontrol.streaming-";
	
			for (int i=0;i<10;i++) {
				try {
					mSocketId = new Random().nextInt();
					mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
					break;
				} catch (IOException e1) {}
			}
	
			mReceiver = new LocalSocket();
			mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
			mReceiver.setReceiveBufferSize(500000);
			mReceiver.setSoTimeout(3000);
			mSender = mLss.accept();
			mSender.setSendBufferSize(500000);
			
		} else {
			Log.e(TAG, "parcelFileDescriptors createPipe version = Lollipop");
			mParcelFileDescriptors = ParcelFileDescriptor.createPipe();
			mParcelRead = new ParcelFileDescriptor(mParcelFileDescriptors[0]);
			mParcelWrite = new ParcelFileDescriptor(mParcelFileDescriptors[1]);
		}
	}
 
開發者ID:galme,項目名稱:ROLF-EV3,代碼行數:29,代碼來源:MediaStream.java

示例6: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		if (sPipeApi == PIPE_API_LS) {
			
			final String LOCAL_ADDR = "net.majorkernelpanic.streaming-";
	
			for (int i=0;i<10;i++) {
				try {
					mSocketId = new Random().nextInt();
					mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
					break;
				} catch (IOException e1) {}
			}
	
			mReceiver = new LocalSocket();
			mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
			mReceiver.setReceiveBufferSize(500000);
			mReceiver.setSoTimeout(3000);
			mSender = mLss.accept();
			mSender.setSendBufferSize(500000);
			
		} else {
			Log.e(TAG, "parcelFileDescriptors createPipe version = Lollipop");
			mParcelFileDescriptors = ParcelFileDescriptor.createPipe();
			mParcelRead = new ParcelFileDescriptor(mParcelFileDescriptors[0]);
			mParcelWrite = new ParcelFileDescriptor(mParcelFileDescriptors[1]);
		}
	}
 
開發者ID:hypeapps,項目名稱:Endoscope,代碼行數:29,代碼來源:MediaStream.java

示例7: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		if (sPipeApi == PIPE_API_LS) {
			
			final String LOCAL_ADDR = "net.majorkernelpanic.streaming-";
	
			for (int i=0;i<10;i++) {
				try {
					mSocketId = new Random().nextInt();
					mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
					break;
				} catch (IOException e1) {}
			}
	
			mReceiver = new LocalSocket();
			mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
			mReceiver.setReceiveBufferSize(500000);
			mReceiver.setSoTimeout(3000);
			mSender = mLss.accept();
			mSender.setSendBufferSize(500000);

		} else {
			Log.e(TAG, "parcelFileDescriptors createPipe version = Lollipop");
			mParcelFileDescriptors = ParcelFileDescriptor.createPipe();
			mParcelRead = new ParcelFileDescriptor(mParcelFileDescriptors[0]);
			mParcelWrite = new ParcelFileDescriptor(mParcelFileDescriptors[1]);
		}
	}
 
開發者ID:quanhua92,項目名稱:libstreaming_android_studio,代碼行數:29,代碼來源:MediaStream.java

示例8: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createSockets() throws IOException {

		if (sPipeApi == PIPE_API_LS) {
			
			final String LOCAL_ADDR = "com.jjcamera.apps.iosched.streaming-";
	
			for (int i=0;i<10;i++) {
				try {
					mSocketId = new Random().nextInt();
					mLss = new LocalServerSocket(LOCAL_ADDR+mSocketId);
					break;
				} catch (IOException e1) {}
			}
	
			mReceiver = new LocalSocket();
			mReceiver.connect( new LocalSocketAddress(LOCAL_ADDR+mSocketId));
			mReceiver.setReceiveBufferSize(500000);
			mReceiver.setSoTimeout(3000);
			mSender = mLss.accept();
			mSender.setSendBufferSize(500000);
			
		} else {
			Log.e(TAG, "parcelFileDescriptors createPipe version = Lollipop");
			mParcelFileDescriptors = ParcelFileDescriptor.createPipe();
			mParcelRead = new ParcelFileDescriptor(mParcelFileDescriptors[0]);
			mParcelWrite = new ParcelFileDescriptor(mParcelFileDescriptors[1]);
		}
	}
 
開發者ID:xunboo,項目名稱:JJCamera,代碼行數:29,代碼來源:MediaStream.java

示例9: initializeLocalSocket

import android.net.LocalSocket; //導入方法依賴的package包/類
private boolean initializeLocalSocket(){
	receiver = new LocalSocket();
	try {
		lss = new LocalServerSocket("VideoCamera");
		receiver.connect(new LocalSocketAddress("VideoCamera"));
		receiver.setReceiveBufferSize(500000);
		receiver.setSendBufferSize(500000);
		sender = lss.accept();
		sender.setReceiveBufferSize(500000);
		sender.setSendBufferSize(500000);
	} catch (IOException e) {
		return false;
	}
	return true;
}
 
開發者ID:jwzhuang,項目名稱:Android_H264Stream,代碼行數:16,代碼來源:RecordService.java

示例10: initLocalSocket

import android.net.LocalSocket; //導入方法依賴的package包/類
private void initLocalSocket() {
    LocalSocket receiver = new LocalSocket();
    try {
        LocalServerSocket lss = new LocalServerSocket("H264");
        receiver.connect(new LocalSocketAddress("H264"));
        receiver.setReceiveBufferSize(500000);
        receiver.setSendBufferSize(500000);
        sender = lss.accept();
        sender.setReceiveBufferSize(500000);
        sender.setSendBufferSize(500000);
    } catch (IOException e1) {
        e1.printStackTrace();
    }
}
 
開發者ID:rednels,項目名稱:Android-Sample,代碼行數:15,代碼來源:TextureViewActivity.java

示例11: createLocalSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
protected void createLocalSockets() throws IOException {
	Log.d(LOG_TAG, "Binding to " + localName());
	serverSocket = new LocalServerSocket(localName());
	receiverSocket = new LocalSocket();
	receiverSocket.connect(new LocalSocketAddress(localName()));
	receiverSocket.setReceiveBufferSize(BUFFER_SIZE);
	receiverSocket.setSoTimeout(SO_TIMEOUT);
	senderSocket = serverSocket.accept();
	senderSocket.setSendBufferSize(BUFFER_SIZE);
}
 
開發者ID:mywebio,項目名稱:mywebio-sdk,代碼行數:11,代碼來源:StreamingService.java

示例12: createSockets

import android.net.LocalSocket; //導入方法依賴的package包/類
private void createSockets() throws IOException {
	mReceiver = new LocalSocket();
	mReceiver.connect( new LocalSocketAddress("net.majorkernelpanic.librtp-" + mSocketId ) );
	mReceiver.setReceiveBufferSize(500000);
	mSender = mLss.accept();
	mSender.setSendBufferSize(500000);
}
 
開發者ID:jamesrdelaney,項目名稱:ecg_over_rtp,代碼行數:8,代碼來源:FileStream.java

示例13: onResume

import android.net.LocalSocket; //導入方法依賴的package包/類
@Override
  public void onResume() {
if (!Sipdroid.release) Log.i("SipUA:","on resume");
      justplay = intent.hasExtra("justplay");
      if (!justplay) {
	receiver = new LocalSocket();
	try {
		lss = new LocalServerSocket("Sipdroid");
		receiver.connect(new LocalSocketAddress("Sipdroid"));
		receiver.setReceiveBufferSize(500000);
		receiver.setSendBufferSize(500000);
		sender = lss.accept();
		sender.setReceiveBufferSize(500000);
		sender.setSendBufferSize(500000);
	} catch (IOException e1) {
		if (!Sipdroid.release) e1.printStackTrace();
		super.onResume();
		finish();
		return;
	}
       checkForCamera();
          mVideoPreview.setVisibility(View.VISIBLE);
       if (!mMediaRecorderRecording) initializeVideo();
       startVideoRecording();
      } else if (Receiver.engine(mContext).getRemoteVideo() != 0 && PreferenceManager.getDefaultSharedPreferences(this).getString(org.sipdroid.sipua.ui.Settings.PREF_SERVER, org.sipdroid.sipua.ui.Settings.DEFAULT_SERVER).equals(org.sipdroid.sipua.ui.Settings.DEFAULT_SERVER)) {
      	mVideoFrame.setVideoURI(Uri.parse("rtsp://"+Receiver.engine(mContext).getRemoteAddr()+"/"+
      		Receiver.engine(mContext).getRemoteVideo()+"/sipdroid"));
      	mVideoFrame.setMediaController(mMediaController = new MediaController(this));
      	mVideoFrame.setOnErrorListener(this);
      	mVideoFrame.requestFocus();
      	mVideoFrame.start();
      }

      mRecordingTimeView.setText("");
      mRecordingTimeView.setVisibility(View.VISIBLE);
      mHandler.removeMessages(UPDATE_RECORD_TIME);
      mHandler.sendEmptyMessage(UPDATE_RECORD_TIME);
      super.onResume();
  }
 
開發者ID:bigbn,項目名稱:phonty,代碼行數:40,代碼來源:VideoCamera.java


注:本文中的android.net.LocalSocket.setReceiveBufferSize方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。