Go to the documentation of this file.
10 #include <sys/types.h>
14 #include <libbluray/filesystem.h>
16 #include "file/filesystem.h"
19 #define LOC QString("BDIOWrapper: ")
28 MythDirClose(
static_cast<int>(
reinterpret_cast<intptr_t
>(Dir->internal)));
29 LOG(VB_FILE, LOG_DEBUG,
LOC +
"Closed mythdir dir");
39 Entry->d_name[255] =
'\0';
40 strncpy(Entry->d_name,
filename, 255);
50 if ((strncmp(DirName,
"myth://", 7) != 0) && (
sDefaultDirOpen !=
nullptr))
57 auto *dir =
static_cast<BD_DIR_H*
>(calloc(1,
sizeof(BD_DIR_H)));
59 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Opening mythdir '%1'").arg(DirName));
66 dir->internal =
reinterpret_cast<void*
>(
static_cast<intptr_t
>(dirID));
70 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Error opening dir '%1'").arg(DirName));
80 MythfileClose(
static_cast<int>(
reinterpret_cast<intptr_t
>(File->internal)));
81 LOG(VB_FILE, LOG_DEBUG,
LOC +
"Closed mythfile file");
86 static int64_t
MythBDFileSeek(BD_FILE_H *File, int64_t Offset, int32_t Origin)
88 return MythFileSeek(
static_cast<int>(
reinterpret_cast<intptr_t
>(File->internal)), Offset, Origin);
93 return MythFileTell(
static_cast<int>(
reinterpret_cast<intptr_t
>(File->internal)));
98 return MythFileRead(
static_cast<int>(
reinterpret_cast<intptr_t
>(File->internal)),
99 Buffer,
static_cast<size_t>(Size));
104 return MythFileWrite(
static_cast<int>(
reinterpret_cast<intptr_t
>(File->internal)),
105 reinterpret_cast<void*
>(
const_cast<uint8_t*
>(
Buffer)),
106 static_cast<size_t>(Size));
111 if ((strncmp(FileName,
"myth://", 7) != 0) && (
sDefaultFileOpen !=
nullptr))
118 auto *
file =
static_cast<BD_FILE_H*
>(calloc(1,
sizeof(BD_FILE_H)));
120 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Opening mythfile file '%1'").arg(FileName));
128 int intMode = O_RDONLY;
129 if (strcasecmp(CMode,
"wb") == 0)
135 file->internal =
reinterpret_cast<void*
>(
static_cast<intptr_t
>(fd));
139 LOG(VB_FILE, LOG_DEBUG,
LOC + QString(
"Error opening file '%1'").arg(FileName));
static BD_FILE_H * MythBDFileOpen(const char *FileName, const char *CMode)
int MythDirClose(int DirID)
static BD_DIR_H * MythBDDirOpen(const char *DirName)
char * MythDirRead(int DirID)
int MythfileClose(int FileID)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
ssize_t MythFileRead(int FileID, void *Buffer, size_t Count)
static int64_t MythBDFileRead(BD_FILE_H *File, uint8_t *Buffer, int64_t Size)
static BD_DIR_OPEN sDefaultDirOpen
static int64_t MythBDFileTell(BD_FILE_H *File)
off_t MythFileTell(int FileID)
static void MythBDDirClose(BD_DIR_H *Dir)
static int64_t MythBDFileWrite(BD_FILE_H *File, const uint8_t *Buffer, int64_t Size)
int MythFileOpen(const char *Pathname, int Flags)
static void MythBDFileClose(BD_FILE_H *File)
int MythDirOpen(const char *DirName)
static BD_FILE_OPEN sDefaultFileOpen
static int MythBDDirRead(BD_DIR_H *Dir, BD_DIRENT *Entry)
ssize_t MythFileWrite(int FileID, void *Buffer, size_t Count)
void MythBDIORedirect(void)
off_t MythFileSeek(int FileID, off_t Offset, int Whence)
static int64_t MythBDFileSeek(BD_FILE_H *File, int64_t Offset, int32_t Origin)