dec.h 2.04 KB
Newer Older
npzacs's avatar
npzacs committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
/*
 * This file is part of libbluray
 * Copyright (C) 2014  VideoLAN
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library. If not, see
 * <http://www.gnu.org/licenses/>.
 */

#if !defined(_BD_DISC_DEC_H_)
#define _BD_DISC_DEC_H_

/*
 * low-level stream decoding
 */

#include "util/attributes.h"

#include <stdint.h>

struct bd_file_s;
struct bd_enc_info;

34 35
typedef struct bd_file_s * (*file_openFp)(void *, const char *);

npzacs's avatar
npzacs committed
36 37
/* device to use */
struct dec_dev {
38
    void          *file_open_bdrom_handle;
39
    file_openFp   pf_file_open_bdrom;
40
    void          *file_open_vfs_handle;
41
    file_openFp   pf_file_open_vfs;
42 43
    const char    *root;   /* may be NULL if disc is not mounted */
    const char    *device; /* may be null if not reading from real device */
npzacs's avatar
npzacs committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
};

typedef struct bd_dec BD_DEC;

BD_PRIVATE BD_DEC *dec_init(struct dec_dev *dev,
                            struct bd_enc_info *enc_info,
                            const char *keyfile_path,
                            void *regs, void *psr_read, void *psr_write);
BD_PRIVATE void dec_close(BD_DEC **);

/* get decoder data */
BD_PRIVATE const uint8_t *dec_data(BD_DEC *, int type);

/* status events from upper layers */
BD_PRIVATE void dec_start(BD_DEC *, uint32_t num_titles);
BD_PRIVATE void dec_title(BD_DEC *, uint32_t title);
BD_PRIVATE void dec_application(BD_DEC *, uint32_t data);

/* open low-level stream */
BD_PRIVATE struct bd_file_s *dec_open_stream(BD_DEC *dec, struct bd_file_s *fp, uint32_t clip_id);


#endif /* _BD_DISC_DEC_H_ */