Add read/write to appdata and properly use HAVE_MEDIA_APPLICATION
appdata: Signal readable/writable in main context and keep track of number of available samples