|
Packit |
5e46da |
/*
|
|
Packit |
5e46da |
* This file is part of libbluray
|
|
Packit |
5e46da |
* Copyright (C) 2010 hpi1
|
|
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 |
#include <stdio.h>
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
#include "bluray.h"
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
static void _indx_print_title(const BLURAY_TITLE *title, int normal_title)
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
printf(" object type : %s\n", title->bdj ? "BD-J" : "HDMV");
|
|
Packit |
5e46da |
printf(" playback type : %s\n", title->interactive ? "Interactive" : "Movie");
|
|
Packit |
5e46da |
printf(title->bdj ?
|
|
Packit |
5e46da |
" name : %05d.bdjo\n" :
|
|
Packit |
5e46da |
" id_ref : %u\n",
|
|
Packit |
5e46da |
title->id_ref);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
if (normal_title) {
|
|
Packit |
5e46da |
printf(" access type : %s%s\n", title->accessible ? "Accessible" : "Prohibited", title->hidden ? ", Hidden" : "");
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
static void _indx_print(const BLURAY_DISC_INFO *info)
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
uint32_t i;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
printf("\nFirst playback:\n");
|
|
Packit |
5e46da |
if (info->first_play) {
|
|
Packit |
5e46da |
_indx_print_title(info->first_play, 0);
|
|
Packit |
5e46da |
} else {
|
|
Packit |
5e46da |
printf(" (not present)\n");
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
printf("\nTop menu:\n");
|
|
Packit |
5e46da |
if (info->top_menu) {
|
|
Packit |
5e46da |
_indx_print_title(info->titles[0], 0);
|
|
Packit |
5e46da |
} else {
|
|
Packit |
5e46da |
printf(" (not present)\n");
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
printf("\nTitles: %d\n", info->num_titles);
|
|
Packit |
5e46da |
for (i = 1; i <= info->num_titles; i++) {
|
|
Packit |
5e46da |
printf("%02d %s\n", i, info->titles[i]->name ? info->titles[i]->name : "");
|
|
Packit |
5e46da |
_indx_print_title(info->titles[i], 1);
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
int main(int argc, const char *argv[])
|
|
Packit |
5e46da |
{
|
|
Packit |
5e46da |
BLURAY *bd;
|
|
Packit |
5e46da |
const BLURAY_DISC_INFO *info;
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
if (argc != 2) {
|
|
Packit |
5e46da |
fprintf(stderr, "usage: %s <disc_root>\n", argv[0]);
|
|
Packit |
5e46da |
return 1;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
bd = bd_open(argv[1], NULL);
|
|
Packit |
5e46da |
if (!bd) {
|
|
Packit |
5e46da |
fprintf(stderr, "error opening BD disc %s\n", argv[1]);
|
|
Packit |
5e46da |
return -1;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
info = bd_get_disc_info(bd);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
if (!info->bluray_detected) {
|
|
Packit |
5e46da |
fprintf(stderr, "no BD disc detected in %s\n", argv[1]);
|
|
Packit |
5e46da |
bd_close(bd);
|
|
Packit |
5e46da |
return -1;
|
|
Packit |
5e46da |
}
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
_indx_print(info);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
bd_close(bd);
|
|
Packit |
5e46da |
|
|
Packit |
5e46da |
return 0;
|
|
Packit |
5e46da |
}
|