Hi Glenn,
I was trying something today... Since OpenSL can take a file descriptor as a DataSource. I attempted to use ashmem to get a file descriptor and then mmap() to write the data into there. Everything was looking okay except that in SfPlayer::setDataSource(fd, offset, length), the code is retrieving the size of the "file" via fstat(). This is returning 0 for the file descriptor returned from ashmem_create_region(). If I call ashmem_get_size_region(), it returns the correct size. Is there something I can do in user-land to resolve this?
In file android_SfPlayer.cpp, line 141, method SfPlayer::setDatatSource()
sb.st_size is 0, so it always produces an error.
Shouldn't ashmem appropriately set the stat.st_size when returned from fstat()? I feel like if we can just get pass this check (since the size of the reserved memory is actually valid), everything would work...
Any insights would greatly be appreciated! Thanks!