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 7, 2024
1 parent bad9de1 commit 860ba73
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
2 changes: 2 additions & 0 deletions xbmc/addons/interfaces/Filesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,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
9 changes: 8 additions & 1 deletion 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 Down Expand Up @@ -93,7 +96,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
31 changes: 18 additions & 13 deletions xbmc/filesystem/IFileTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,39 +14,44 @@ 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;
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;
/*
* Indicate that caller support read in the minimum defined chunk size, this disables internal cache then.
* This flag is deprecated, instead use READ_NO_CACHE to disable FileCache and 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.
*/
static const unsigned int READ_CHUNKED = 0x02;

/* 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;
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 860ba73

Please sign in to comment.