-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the ability to playback remote DVD and Blu-ray directory images a…
…nd DVD ISO files via MythTV's streaming protocol. The full implementation is an interim solution, parts of it will be changed in the future. Post 0.24, we'll probably be moving the libraries into the new 'external' subdir. The desire is to coordinate a standard 'plugable' layout where can plug in our RingBuffer wrapper routines without having to modify the upstream library in any way. the Blu-ray library already has partial support for this, but it will need extending to fully allow us to use the library for remote streaming without making any of our own changes to the code. URI Examples (substitute in your favorite Storage Group and subdirectory): Blu-ray image (BDMV subdirectory is under a 'Demos/x264_bluray_demo' directory in Storage Group) mythavtest myth://MyDiscImages@192.168.1.100/Demos/x264_bluray_demo DVD image (VIDEO_TS subdirectory is under the 'Hot_Dogs_II' directory) mythavtest myth://MyDiscImages@192.168.1.100/Hot_Dogs_II DVD ISO (ISO is in a 'Documentaries' sudirectory of the Storage Group mythavtest myth://MyISOs@192.168.1.100/Documentaries/Hot_Dogs_II.iso ISO playback is by far the fastest, the libs do a lot of seeking around which exposes some inefficiencies in our RingBuffer. These are being looked at, so performance should improve. Directory image playback does take longer to startup than ISO playback, but once playback has started, they should both perform about the same since the RingBuffer has a built-in read-ahead buffer. Encrypted DVDs are not supported for remote streaming. In other words, you can't currently point a Backend's Storage Group at /dev/dvd or a directory where you have a DVD mounted and expect to be able to watch it on a remote frontend. NOTE: This does modify the binary API, AND the protocol version, so make clean, upgrade everything, etc.. git-svn-id: http://svn.mythtv.org/svn/trunk@25858 7dbf422c-18fa-0310-86e9-fd20926502f2
- Loading branch information
Showing
28 changed files
with
769 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#if HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include "file.h" | ||
#include "util/macro.h" | ||
#include "util/logging.h" | ||
|
||
#include "mythiowrapper.h" | ||
|
||
static void dir_close_mythiowrapper(BD_DIR_H *dir) | ||
{ | ||
if (dir) { | ||
mythdir_closedir((int)dir->internal); | ||
|
||
DEBUG(DBG_DIR, "Closed mythdir dir (%p)\n", dir); | ||
|
||
X_FREE(dir); | ||
} | ||
} | ||
|
||
static int dir_read_mythiowrapper(BD_DIR_H *dir, BD_DIRENT *entry) | ||
{ | ||
char *filename = mythdir_readdir((int)dir->internal); | ||
if (filename) | ||
{ | ||
strncpy(entry->d_name, filename, 256); | ||
free(filename); | ||
return 0; | ||
} | ||
|
||
return 1; | ||
} | ||
|
||
BD_DIR_H *dir_open_mythiowrapper(const char* dirname) | ||
{ | ||
BD_DIR_H *dir = malloc(sizeof(BD_DIR_H)); | ||
|
||
DEBUG(DBG_DIR, "Opening mythdir dir %s... (%p)\n", dirname, dir); | ||
dir->close = dir_close_mythiowrapper; | ||
dir->read = dir_read_mythiowrapper; | ||
|
||
int dirID = 0; | ||
if ((dirID = mythdir_opendir(dirname))) { | ||
dir->internal = (void *)dirID; | ||
|
||
return dir; | ||
} | ||
|
||
DEBUG(DBG_DIR, "Error opening dir! (%p)\n", dir); | ||
|
||
X_FREE(dir); | ||
|
||
return NULL; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
#if HAVE_CONFIG_H | ||
#include "config.h" | ||
#endif | ||
|
||
#include <fcntl.h> | ||
|
||
#include "file.h" | ||
#include "util/macro.h" | ||
#include "util/logging.h" | ||
|
||
#include "mythiowrapper.h" | ||
|
||
static void file_close_mythiowrapper(BD_FILE_H *file) | ||
{ | ||
if (file) { | ||
mythfile_close((int)file->internal); | ||
|
||
DEBUG(DBG_FILE, "Closed mythfile file (%p)\n", file); | ||
|
||
X_FREE(file); | ||
} | ||
} | ||
|
||
static int64_t file_seek_mythiowrapper(BD_FILE_H *file, int64_t offset, int32_t origin) | ||
{ | ||
return mythfile_seek((int)file->internal, offset, origin); | ||
} | ||
|
||
static int64_t file_tell_mythiowrapper(BD_FILE_H *file) | ||
{ | ||
return mythfile_tell((int)file->internal); | ||
} | ||
|
||
static int file_eof_mythiowrapper(BD_FILE_H *file) | ||
{ | ||
// FIXME | ||
// return mythfile_eof((FILE *)file->internal); | ||
|
||
fprintf(stderr, "file_eof_mythiowrapper() ERROR UNIMPLEMENTED\n"); | ||
return 0; | ||
} | ||
|
||
static int64_t file_read_mythiowrapper(BD_FILE_H *file, uint8_t *buf, int64_t size) | ||
{ | ||
return mythfile_read((int)file->internal, buf, size); | ||
} | ||
|
||
static int64_t file_write_mythiowrapper(BD_FILE_H *file, const uint8_t *buf, int64_t size) | ||
{ | ||
return mythfile_write((int)file->internal, buf, size); | ||
} | ||
|
||
BD_FILE_H *file_open_mythiowrapper(const char* filename, const char *mode) | ||
{ | ||
FILE *fp = NULL; | ||
BD_FILE_H *file = malloc(sizeof(BD_FILE_H)); | ||
|
||
DEBUG(DBG_FILE, "Opening mythfile file %s... (%p)\n", filename, file); | ||
file->close = file_close_mythiowrapper; | ||
file->seek = file_seek_mythiowrapper; | ||
file->read = file_read_mythiowrapper; | ||
file->write = file_write_mythiowrapper; | ||
file->tell = file_tell_mythiowrapper; | ||
file->eof = file_eof_mythiowrapper; | ||
|
||
int fd; | ||
int intMode = O_RDONLY; | ||
if (!strcasecmp(mode, "wb")) | ||
intMode = O_WRONLY; | ||
|
||
if ((fd = mythfile_open(filename, intMode)) >= 0) { | ||
file->internal = (void *)fd; | ||
|
||
return file; | ||
} | ||
|
||
DEBUG(DBG_FILE, "Error opening file! (%p)\n", file); | ||
|
||
X_FREE(file); | ||
|
||
return NULL; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#ifndef __FILE_MYTHIOWRAPPER__ | ||
#define __FILE_MYTHIOWRAPPER__ | ||
|
||
#include "file.h" | ||
|
||
BD_FILE_H *file_open_mythiowrapper(const char* filename, const char *mode); | ||
BD_DIR_H *dir_open_mythiowrapper(const char* dirname); | ||
|
||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.