title: Using media player and camera to realize live video chat in android,based sockets
body: <p>Yes,I have a requirement list as follows(maybe it can called simple ideas)</p>
  
  <p>1.Using <strong>Camera</strong> and <strong>MediaRecoder</strong> to recording a video 
    (Now I can record and save it to a file)<p>
  refer: <a href="http://developer.android.com/guide/topics/media/camera.html" rel="nofollow noreferrer">http://developer.android.com/guide/topics/media/camera.html</a></p>
  
  <p>2.When recording video,I need send it to my Server for transit
    (I plan to use socket[TCP] to realize)<p></p>
  
  <p>3.Server receive socket data and transit it to another client(android/PC)<p></p>
  
  <p>4.At the same time,Server send video streaming to Android client by socket<br>
  (I try to using <strong>ParcelFileDescriptor.fromSocket(client)</strong>,but it always catch IOException:setDataSourceFD failed.: status=0x80000000)<p>
  refer: <a href="https://stackoverflow.com/questions/6116880/stream-live-video-from-phone-to-phone-using-socket-fd">Stream live video from phone to phone using socket fd</a></p>
  
  <p>5.Android client receive Server's data and play it using <strong>MediaPlay</strong> and <strong>SurfaceView</strong><p></p>
  
  <p>6.In addition,I want server can switch video streaming from socket data or local file,when server transit data</p>
  
  <p>This is my idea,but don't know if feasible and don't know how to achieve it<br>
  I wonder if you can give me some references or examples, thanks</p>
  
  <hr>
  
  <p>btw, i am first time ask question in stackoverflow,before i always view questions in here,it helpful.if my question not clearly,please tell me,thank you.if i make some mistake,else i hope you tell me,thanks.</p>