MediaFS Structure

This chapter describes:

Filesystem location

When a MediaFS implementation learns of a new media device, it registers a path with the path space manager to the location of the MediaFS filesystem; this path is called the mountpoint. The MediaFS implementation then:

The first device discovered has an instance number of 0. For example, if a device is an iPod it is mounted as /fs/ipod0; while a PFS/MTP device is mounted as /fs/pfs0.

Multiple instances of a device are identified by their numeric suffixes. Thus, for example two iPods, one PFS device, and one UPnP device would be mounted as follows:

/fs/ipod0
/fs/ipod1
/fs/pfs0
/fs/upnp0

For more information about how to represent a media device to MediaFS, see the chapter MediaFS Entities.

For more information about resource managers, see the Writing a Resource Manager in the QNX Neutrino documentation set.

The MediaFS filesystem structure

Located under the MediaFS mountpoint, the .FS_info. directory is the MediaFS standardized structure of files and directories that contain the control and state information of a media device. Every device instance has its own MediaFS filesystem structure.

The basic MediaFS filesystem structure is as follows:

Directories
Files
mountpoint
mountpoint/.FS_info.
mountpoint/.FS_info./info.xml
mountpoint/.FS_info./dev
mountpoint/.FS_info./current
mountpoint/.FS_info./control
mountpoint/.FS_info./playback

Media device controllers must populate the the device-specific files in the .FS.info. directory, according to the specifications presented in the chapter MediaFS Entities.

The figure below shows a MediaFS hierarchy with a Bluetooth device.


The io-fs-media MediaFS module hierarchy


The MediaFS module hierarchy with a Bluetooth device

Files and directories outside the .FS_info. directory are device dependent and, therefore, do not have a standardized, defined structure in MediaFS. See Directories and files outside the .FS_info. directory in the chapter MediaFS Entities.

Required POSIX function support

All files and folders in the MediaFS representation adhere to the POSIX standard, and the following POSIX functions must be supported on all directories and files in the MediaFS representation:

Directories and files can be identified by using the standard POSIX stat() function, and the S_ISDIR and S_ISREG macros on the returned stat structure.

For speed optimizations, MediaFS should support the ability to retrieve extra stat() information as part of the readdir() operation, if the D_FLAG_STAT flag is set.

For more information about these functions and data structures, see the QNX Neutrino Library Reference.