Skip to content

Commit

Permalink
[FileSystem] Update read flags documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thexai committed May 11, 2024
1 parent 23a9b81 commit 2d501e3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions xbmc/addons/interfaces/Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ unsigned int Interface_Filesystem::TranslateFileReadBitsToKodi(unsigned int addo

if (addonFlags & ADDON_READ_TRUNCATED)
kodiFlags |= READ_TRUNCATED;
if (addonFlags & ADDON_READ_CHUNKED)
kodiFlags |= READ_CHUNKED;
if (addonFlags & ADDON_READ_CACHED)
kodiFlags |= READ_CACHED;
if (addonFlags & ADDON_READ_NO_CACHE)
Expand All @@ -153,6 +151,8 @@ unsigned int Interface_Filesystem::TranslateFileReadBitsToKodi(unsigned int addo
kodiFlags |= READ_AFTER_WRITE;
if (addonFlags & READ_REOPEN)
kodiFlags |= READ_REOPEN;
if (addonFlags & ADDON_READ_NO_BUFFER)
kodiFlags |= READ_NO_BUFFER;

return kodiFlags;
}
Expand Down
14 changes: 11 additions & 3 deletions xbmc/addons/kodi-dev-kit/include/kodi/c-api/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ extern "C"
/// @brief **0000 0000 0010** :\n
/// Indicate that that caller support read in the minimum defined
/// chunk size, this disables internal cache then.
/// This flag is deprecated, instead use ADDON_READ_NO_CACHE to disable FileCache and
/// ADDON_READ_NO_BUFFER to disable StreamBuffer. On the contrary to explicitly indicate that
/// the file has audio/video content (suitable for caching), use the READ_AUDIO_VIDEO flag.
ADDON_READ_CHUNKED = 0x02,

/// @brief **0000 0000 0100** :\n
Expand All @@ -83,8 +86,9 @@ extern "C"
ADDON_READ_MULTI_STREAM = 0x20,

/// @brief **0000 0100 0000** :\n
/// indicate to the caller file is audio and/or video (and e.g. may
/// grow).
/// Indicate to the caller file is audio and/or video and is suitable for caching with FileCache or StreamBuffer.
/// The final method used will depend on the user's settings and file location, e.g. user can disable FileCache.
/// This flag ensures that at least the buffer size necessary to read with the appropriate chunk size will be used.
ADDON_READ_AUDIO_VIDEO = 0x40,

/// @brief **0000 1000 0000** :\n
Expand All @@ -93,7 +97,11 @@ extern "C"

/// @brief **0001 0000 0000** :\n
/// Indicate that caller want to reopen a file if its already open.
ADDON_READ_REOPEN = 0x100
ADDON_READ_REOPEN = 0x100,

/// @brief **0010 0000 0000** :\n
/// Indicate that caller want open a file without intermediate buffer regardless to file type.
ADDON_READ_NO_BUFFER = 0x200,
} OpenFileFlags;
///@}
//----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion xbmc/addons/kodi-dev-kit/include/kodi/versions.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define ADDON_GLOBAL_VERSION_AUDIOENGINE_DEPENDS "AudioEngine.h" \
"c-api/audio_engine.h"

#define ADDON_GLOBAL_VERSION_FILESYSTEM "1.1.8"
#define ADDON_GLOBAL_VERSION_FILESYSTEM "1.1.9"
#define ADDON_GLOBAL_VERSION_FILESYSTEM_MIN "1.1.7"
#define ADDON_GLOBAL_VERSION_FILESYSTEM_XML_ID "kodi.binary.global.filesystem"
#define ADDON_GLOBAL_VERSION_FILESYSTEM_DEPENDS "Filesystem.h" \
Expand Down
29 changes: 14 additions & 15 deletions xbmc/filesystem/IFileTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,38 @@ namespace XFILE
{

/* indicate that caller can handle truncated reads, where function returns before entire buffer has been filled */
static const unsigned int READ_TRUNCATED = 0x01;

/* indicate that that caller support read in the minimum defined chunk size, this disables internal cache then */
static const unsigned int READ_CHUNKED = 0x02;
static const unsigned int READ_TRUNCATED = 0x01;

/* use cache to access this file */
static const unsigned int READ_CACHED = 0x04;
static const unsigned int READ_CACHED = 0x04;

/* open without caching. regardless to file type. */
static const unsigned int READ_NO_CACHE = 0x08;
static const unsigned int READ_NO_CACHE = 0x08;

/* calculate bitrate for file while reading */
static const unsigned int READ_BITRATE = 0x10;
static const unsigned int READ_BITRATE = 0x10;

/* indicate to the caller we will seek between multiple streams in the file frequently */
static const unsigned int READ_MULTI_STREAM = 0x20;
static const unsigned int READ_MULTI_STREAM = 0x20;

/* indicate to the caller file is audio and/or video (and e.g. may grow) */
static const unsigned int READ_AUDIO_VIDEO = 0x40;
// Indicate to the caller file is audio and/or video and is suitable for caching with FileCache or StreamBuffer.
// The final method used will depend on the user's settings and file location, e.g. user can disable FileCache.
// This flag ensures that at least the buffer size necessary to read with the appropriate chunk size will be used.
static const unsigned int READ_AUDIO_VIDEO = 0x40;

/* indicate that caller will do write operations before reading */
static const unsigned int READ_AFTER_WRITE = 0x80;
static const unsigned int READ_AFTER_WRITE = 0x80;

/* indicate that caller want to reopen a file if its already open */
static const unsigned int READ_REOPEN = 0x100;
static const unsigned int READ_REOPEN = 0x100;

/* indicate that caller want open a file without intermediate buffer regardless to file type */
static const unsigned int READ_NO_BUFFER = 0x200;
static const unsigned int READ_NO_BUFFER = 0x200;

struct SNativeIoControl
{
unsigned long int request;
void* param;
unsigned long int request;
void* param;
};

struct SCacheStatus
Expand Down

0 comments on commit 2d501e3

Please sign in to comment.