-
Notifications
You must be signed in to change notification settings - Fork 2.1k
How to use pipe on Vitamio
Crossle Song edited this page Mar 25, 2014
·
1 revision
Vitamio use FFmpeg, support pipe protocol, you can create pipe on Android, and writing data to pipe.
ParcelFileDescriptor[] pipes = ParcelFileDescriptor.createPipe();
final ParcelFileDescriptor write = pipes[1];
AssetFileDescriptor afd = new AssetFileDescriptor(write, 0, -1);
OutputStream outputStream = afd.createOutputStream();
/*Create a thread write byte data to outputstream*/
// outputStream.write(buffer);
FileDescriptor fileDescriptor = pipes[0].getFileDescriptor();
mMediaPlayer.setDataSource(fileDescriptor);