I'm going to use FFmpeg in an Android project as a JNI library and I know about the limitations of Kitkat. Since with the new release of Lollipop there is the possibility for third-party apps to access to external microsd I would like to exploit it. I've read this useful question so I use a ACTION_OPEN_DOCUMENT_TREE intent, the user chooses a folder and than I use a similar code to get a file descriptor. Then I send this UNIX file descriptor to a jni function. I've created a demo, if I use something like this:
int descriptor = a_file_descriptor;
FILE* fp = fdopen(descriptor , "w");
fprintf(fp, "Hello from Lollipop!");
fclose(fp);
everything is fine. The problem is that I would like to extract the complete file name from the file descriptor. It's possible with some tricks available for Linux but if I do an fopen and try to fprintf something in the file nothing happens. So I imagine I should use the file descriptor, but how to use it with FFmpeg? I read about the pipe option but it seems for command line only. Thanks in advance for the help.