|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2014-2017 Petri Hintukainen <phintuka@users.sourceforge.net>
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is free software; you can redistribute it and/or
|
|
Packit |
5e46da |
* modify it under the terms of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License as published by the Free Software Foundation; either
|
|
Packit |
5e46da |
* version 2.1 of the License, or (at your option) any later version.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* This library is distributed in the hope that it will be useful,
|
|
Packit |
5e46da |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
5e46da |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
5e46da |
* Lesser General Public License for more details.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* You should have received a copy of the GNU Lesser General Public
|
|
Packit |
5e46da |
* License along with this library. If not, see
|
|
Packit |
5e46da |
* <http://www.gnu.org/licenses/>.
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#if !defined(_BD_DISC_H_)
|
|
Packit |
5e46da |
#define _BD_DISC_H_
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "util/attributes.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include <stdint.h>
|
|
Packit |
5e46da |
#include <stddef.h> /* size_t */
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
struct bd_file_s;
|
|
Packit |
5e46da |
struct bd_dir_s;
|
|
Packit |
5e46da |
struct bd_enc_info;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* application provided file system access (optional) */
|
|
Packit |
5e46da |
typedef struct fs_access {
|
|
Packit |
5e46da |
void *fs_handle;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* method 1: block (device) access */
|
|
Packit |
5e46da |
int (*read_blocks)(void *fs_handle, void *buf, int lba, int num_blocks);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* method 2: file access */
|
|
Packit |
5e46da |
struct bd_dir_s *(*open_dir) (void *fs_handle, const char *rel_path);
|
|
Packit |
5e46da |
struct bd_file_s *(*open_file)(void *fs_handle, const char *rel_path);
|
|
Packit |
5e46da |
} fs_access;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* BluRay Virtual File System
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Map file access to BD-ROM file system or binding unit data area
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
typedef struct bd_disc BD_DISC;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE BD_DISC *disc_open(const char *device_path,
|
|
Packit |
5e46da |
fs_access *p_fs,
|
|
Packit |
5e46da |
struct bd_enc_info *enc_info,
|
|
Packit |
5e46da |
const char *keyfile_path,
|
|
Packit |
5e46da |
void *regs, void *psr_read, void *psr_write);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE void disc_close(BD_DISC **);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Get BD-ROM root path */
|
|
Packit |
5e46da |
BD_PRIVATE const char *disc_root(BD_DISC *disc);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Get UDF volume ID */
|
|
Packit |
5e46da |
BD_PRIVATE const char *disc_volume_id(BD_DISC *);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Generate pseudo disc ID */
|
|
Packit |
5e46da |
BD_PRIVATE void disc_pseudo_id(BD_DISC *, uint8_t *id/*[20]*/);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Open VFS file (relative to disc root) */
|
|
Packit |
5e46da |
BD_PRIVATE struct bd_file_s *disc_open_file(BD_DISC *disc, const char *dir, const char *file);
|
|
Packit |
5e46da |
BD_PRIVATE struct bd_file_s *disc_open_path(BD_DISC *disc, const char *path);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Open VFS directory (relative to disc root) */
|
|
Packit |
5e46da |
BD_PRIVATE struct bd_dir_s *disc_open_dir (BD_DISC *disc, const char *dir);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Read VFS file */
|
|
Packit |
5e46da |
BD_PRIVATE size_t disc_read_file(BD_DISC *disc, const char *dir, const char *file,
|
|
Packit |
5e46da |
uint8_t **data);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* Update virtual package */
|
|
Packit |
5e46da |
BD_PRIVATE void disc_update(BD_DISC *disc, const char *overlay_root);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int disc_cache_bdrom_file(BD_DISC *p, const char *rel_path, const char *cache_path);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* open BD-ROM directory (relative to disc root) */
|
|
Packit |
5e46da |
BD_PRIVATE struct bd_dir_s *disc_open_bdrom_dir(BD_DISC *disc, const char *path);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* m2ts stream interface
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE struct bd_file_s *disc_open_stream(BD_DISC *disc, const char *file);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* Store / fetch persistent properties for disc.
|
|
Packit |
5e46da |
* Data is stored in cache directory and persists between playback sessions.
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
* Property name is ASCII string. '=' or '\n' is not allowed in name.
|
|
Packit |
5e46da |
* property data is UTF8 string without line feeds.
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE int disc_property_put(BD_DISC *disc, const char *property, const char *value);
|
|
Packit |
5e46da |
BD_PRIVATE char *disc_property_get(BD_DISC *disc, const char *property);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/* "Known" playlists */
|
|
Packit |
5e46da |
#define DISC_PROPERTY_PLAYLISTS "Playlists"
|
|
Packit |
5e46da |
#define DISC_PROPERTY_MAIN_FEATURE "MainFeature"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
*
|
|
Packit |
5e46da |
*/
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE const uint8_t *disc_get_data(BD_DISC *, int type);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
enum {
|
|
Packit |
5e46da |
DISC_EVENT_START, /* param: number of titles, 0 if playing with menus */
|
|
Packit |
5e46da |
DISC_EVENT_TITLE, /* param: title number */
|
|
Packit |
5e46da |
DISC_EVENT_APPLICATION, /* param: app data */
|
|
Packit |
5e46da |
};
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
BD_PRIVATE void disc_event(BD_DISC *, uint32_t event, uint32_t param);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#endif /* _BD_DISC_H_ */
|