6#include <udfread/udfread.h>
7#include <udfread/blockinput.h>
10#include "blockinput.h"
23#elif defined(Q_OS_FREEBSD)
25#elif defined(Q_OS_DARWIN)
45 bool SuperMount,
bool AllowEject)
47#if defined(Q_OS_LINUX) && !defined(Q_OS_ANDROID)
49#elif defined(Q_OS_FREEBSD)
51#elif defined(Q_OS_DARWIN)
54 return new MythCDROM(par, devicePath, SuperMount, AllowEject);
68 LOG(VB_GENERAL, LOG_ERR, QString(
"Mountpoint '%1' doesn't exist")
90 LOG(VB_MEDIA, LOG_INFO,
"Probable DVD detected.");
96 LOG(VB_MEDIA, LOG_INFO,
"Probable Blu-ray detected.");
100 else if (audio.exists())
102 LOG(VB_MEDIA, LOG_INFO,
"Probable Audio CD detected.");
106 else if (vcd.exists() || svcd.exists())
108 LOG(VB_MEDIA, LOG_INFO,
"Probable VCD/SVCD detected.");
112 else if (bad_dvd.exists())
114 LOG(VB_GENERAL, LOG_ERR,
115 "DVD incorrectly mounted? (ISO9660 instead of UDF)");
119 LOG(VB_GENERAL, LOG_ERR,
120 QString(
"CD/DVD '%1' contained none of\n").arg(
m_mountPath) +
121 QString(
"\t\t\t%1, %2, %3 or %4")
124 LOG(VB_GENERAL, LOG_INFO,
"Searching CD statistically - file by file!");
143 LOG(VB_MEDIA, LOG_INFO,
144 QString(
"SetDeviceSpeed(%1,%2) - not implemented on this OS.")
145 .arg(devicePath).arg(speed));
169static uint32_t
def_size(udfread_block_input *p_gen)
173 return (uint32_t)(
p->m_file->GetRealFileSize() / UDF_BLOCK_SIZE);
176static int def_read(udfread_block_input *p_gen, uint32_t lba,
177 void *buf, uint32_t nblocks,
178 [[maybe_unused]]
int flags)
183 if (
p &&
p->m_file && (
p->m_file->Seek(
static_cast<long long>(lba) * UDF_BLOCK_SIZE, SEEK_SET) != -1))
184 result =
p->m_file->Read(buf, nblocks * UDF_BLOCK_SIZE) / UDF_BLOCK_SIZE;
193 if (path.startsWith(
"bd:"))
195 else if (path.startsWith(
"dvd:"))
206 if (blockInput.m_file->isOpen())
208 udfread *udf = udfread_init();
209 if (udfread_open_input(udf, &blockInput.m_input) == 0)
211 UDFDIR *dir = udfread_opendir(udf,
"/BDMV");
215 LOG(VB_MEDIA, LOG_INFO, QString(
"Found Bluray at %1").arg(path));
220 dir = udfread_opendir(udf,
"/VIDEO_TS");
224 LOG(VB_MEDIA, LOG_INFO, QString(
"Found DVD at %1").arg(path));
229 LOG(VB_MEDIA, LOG_ERR, QString(
"inspectImage - unknown"));
235 udfread_closedir(dir);
243 delete blockInput.m_file;
248 LOG(VB_MEDIA, LOG_ERR, QString(
"inspectImage - unable to open \"%1\"").arg(path));
249 delete blockInput.m_file;
static MythCDROM * get(QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject)
MythCDROM(QObject *par, const QString &DevicePath, bool SuperMount, bool AllowEject)
void setDeviceSpeed(const char *devicePath, int speed) override
static ImageType inspectImage(const QString &path)
void onDeviceMounted() override
Override this to perform any post mount logic.
MythCDROM * GetMythCDROMDarwin(QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject)
MythCDROM * GetMythCDROMFreeBSD(QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject)
MythCDROM * GetMythCDROMLinux(QObject *par, const QString &devicePath, bool SuperMount, bool AllowEject)
static int def_close(udfread_block_input *p_gen)
static constexpr const char * PATHTO_VCD_DETECT
static constexpr const char * PATHTO_DVD_DETECT
static uint32_t def_size(udfread_block_input *p_gen)
static int def_read(udfread_block_input *p_gen, uint32_t lba, void *buf, uint32_t nblocks, int flags)
static constexpr const char * PATHTO_SVCD_DETECT
static constexpr const char * PATHTO_BD_DETECT
static constexpr const char * PATHTO_AUDIO_DETECT
static constexpr const char * PATHTO_BAD_DVD_MOUNT
#define LOG(_MASK_, _LEVEL_, _QSTRING_)