You can use LocalServerSocket and LocalSocket to implement what you want.
LocalServerSocket, which provides a FileDescriptor through LocalServerSocket.getFileDescriptor ()
- Initiate LocalServerSocket.
- Initiate a LocalSocket object and connect to LocalServerSocket.
- Call LocalServerSocket.accept () to accept the connection to LocalSocket.
- When the connection is established, you can get the FileDescriptor from LocalServerSocket.
- Each byte that the camera writes to LocalServerSocket can be obtained from LocalSocket.getInputStream (), you can use the for-loop to get the byte stream and write to CipherOutputStream.
Remember to put all the steps in a new thread.
I used these APIs to create a stream processor with a stream as a stream source.
Hope this helps.
yrulee
source share