6 #include "mythconfig.h"
8 #include "blockinput.h"
12 #elif defined(__FreeBSD__)
24 #define PATHTO_BAD_DVD_MOUNT "/video_ts"
26 #define PATHTO_DVD_DETECT "/VIDEO_TS"
27 #define PATHTO_BD_DETECT "/BDMV"
28 #define PATHTO_VCD_DETECT "/vcd"
29 #define PATHTO_SVCD_DETECT "/svcd"
32 #define PATHTO_AUDIO_DETECT "/.TOC.plist"
36 bool SuperMount,
bool AllowEject)
38 #if defined(linux) && !defined(Q_OS_ANDROID)
40 #elif defined(__FreeBSD__)
45 return new MythCDROM(par, devicePath, SuperMount, AllowEject);
59 LOG(VB_GENERAL, LOG_ERR, QString(
"Mountpoint '%1' doesn't exist")
81 LOG(VB_MEDIA, LOG_INFO,
"Probable DVD detected.");
87 LOG(VB_MEDIA, LOG_INFO,
"Probable Blu-ray detected.");
91 else if (audio.exists())
93 LOG(VB_MEDIA, LOG_INFO,
"Probable Audio CD detected.");
97 else if (vcd.exists() || svcd.exists())
99 LOG(VB_MEDIA, LOG_INFO,
"Probable VCD/SVCD detected.");
103 else if (bad_dvd.exists())
105 LOG(VB_GENERAL, LOG_ERR,
106 "DVD incorrectly mounted? (ISO9660 instead of UDF)");
110 LOG(VB_GENERAL, LOG_ERR,
115 LOG(VB_GENERAL, LOG_INFO,
"Searching CD statistically - file by file!");
134 LOG(VB_MEDIA, LOG_INFO,
135 QString(
"SetDeviceSpeed(%1,%2) - not implemented on this OS.")
136 .
arg(devicePath).
arg(speed));
160 static uint32_t
def_size(udfread_block_input *p_gen)
164 return (uint32_t)(
p->m_file->GetRealFileSize() / UDF_BLOCK_SIZE);
167 static int def_read(udfread_block_input *p_gen, uint32_t lba,
void *buf, uint32_t nblocks,
int flags)
173 if (
p &&
p->m_file && (
p->m_file->Seek(lba * UDF_BLOCK_SIZE, SEEK_SET) != -1))
174 result =
p->m_file->Read(buf, nblocks * UDF_BLOCK_SIZE) / UDF_BLOCK_SIZE;
183 if (path.startsWith(
"bd:"))
185 else if (path.startsWith(
"dvd:"))
196 if (blockInput.m_file->isOpen())
198 udfread *udf = udfread_init();
199 if (udfread_open_input(udf, &blockInput.m_input) == 0)
201 UDFDIR *
dir = udfread_opendir(udf,
"/BDMV");
205 LOG(VB_MEDIA, LOG_INFO, QString(
"Found Bluray at %1").
arg(path));
210 dir = udfread_opendir(udf,
"/VIDEO_TS");
214 LOG(VB_MEDIA, LOG_INFO, QString(
"Found DVD at %1").
arg(path));
219 LOG(VB_MEDIA, LOG_ERR, QString(
"inspectImage - unknown"));
225 udfread_closedir(
dir);
233 delete blockInput.m_file;
238 LOG(VB_MEDIA, LOG_ERR, QString(
"inspectImage - unable to open \"%1\"").
arg(path));
239 delete blockInput.m_file;