Mercurial > libdvdnav.hg
annotate dvdnav.c @ 89:0fbef4901e2c src
Add a comment so I can tell which version of the CVS a user is using.
Also add a FIXME to remind me to fix the Chapter number display.
author | jcdutton |
---|---|
date | Tue, 03 Sep 2002 00:41:48 +0000 |
parents | ba1121a07120 |
children | 82af243658bd |
rev | line source |
---|---|
0 | 1 /* |
2 * Copyright (C) 2000 Rich Wareham <richwareham@users.sourceforge.net> | |
3 * | |
4 * This file is part of libdvdnav, a DVD navigation library. | |
5 * | |
6 * libdvdnav is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * libdvdnav is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License | |
17 * along with this program; if not, write to the Free Software | |
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA | |
19 * | |
20 * $Id$ | |
21 * | |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
25 #include "config.h" | |
26 #endif | |
27 | |
31 | 28 /* |
29 #define LOG_DEBUG | |
30 */ | |
31 | |
0 | 32 #include <pthread.h> |
33 #include <dvdnav.h> | |
34 #include "dvdnav_internal.h" | |
35 #include "read_cache.h" | |
36 | |
37 #include <dvdread/nav_read.h> | |
38 | |
39 #include <stdlib.h> | |
40 #include <stdio.h> | |
84 | 41 #include <sys/time.h> |
0 | 42 |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
43 /* |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
44 * NOTE: |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
45 * All NLCK_*() function are not mutex locked, this made them reusable in |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
46 * a locked context. Take care. |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
47 * |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
48 */ |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
49 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
50 /* Current domain (backend to dvdnav_is_domain_() funcs) */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
51 static int8_t NLCK_dvdnav_is_domain(dvdnav_t *this, domain_t domain) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
52 dvd_state_t *state; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
53 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
54 if((!this) || (!this->started) || (!this->vm)) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
55 return -1; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
56 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
57 state = &(this->vm->state); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
58 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
59 if(!state) |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
60 return -1; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
61 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
62 return (state->domain == domain) ? 1 : 0; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
63 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
64 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
65 static int8_t _dvdnav_is_domain(dvdnav_t *this, domain_t domain) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
66 int8_t retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
67 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
68 pthread_mutex_lock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
69 retval = NLCK_dvdnav_is_domain(this, domain); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
70 pthread_mutex_unlock(&this->vm_lock); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
71 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
72 return retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
73 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
74 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
75 static int8_t NCLK_dvdnav_get_audio_logical_stream(dvdnav_t *this, uint8_t audio_num) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
76 dvd_state_t *state; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
77 int8_t logical = -1; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
78 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
79 if(!NLCK_dvdnav_is_domain(this, VTS_DOMAIN)) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
80 audio_num = 0; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
81 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
82 state = &(this->vm->state); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
83 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
84 if(audio_num < 8) { |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
85 if(state->pgc->audio_control[audio_num] & (1 << 15)) { |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
86 logical = (state->pgc->audio_control[audio_num] >> 8) & 0x07; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
87 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
88 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
89 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
90 return logical; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
91 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
92 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
93 static int8_t NCLK_dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
94 dvd_state_t *state; |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
95 ifo_handle_t *vtsi; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
96 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
97 if(!this) |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
98 return -1; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
99 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
100 state = &(this->vm->state); |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
101 vtsi = this->vm->vtsi; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
102 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
103 if(subp_num >= vtsi->vtsi_mat->nr_of_vts_subp_streams) |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
104 return -1; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
105 |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
106 return vm_get_subp_stream(this->vm, subp_num, 0); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
107 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
108 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
109 static int8_t NLCK_dvdnav_get_active_spu_stream(dvdnav_t *this) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
110 dvd_state_t *state; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
111 int8_t subp_num; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
112 int stream_num; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
113 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
114 state = &(this->vm->state); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
115 subp_num = state->SPST_REG & ~0x40; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
116 stream_num = NCLK_dvdnav_get_spu_logical_stream(this, subp_num); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
117 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
118 if(stream_num == -1) |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
119 for(subp_num = 0; subp_num < 32; subp_num++) |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
120 if(state->pgc->subp_control[subp_num] & (1 << 31)) { |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
121 stream_num = NCLK_dvdnav_get_spu_logical_stream(this, subp_num); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
122 break; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
123 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
124 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
125 return stream_num; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
126 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
127 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
128 uint8_t dvdnav_get_video_aspect(dvdnav_t *this) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
129 uint8_t retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
130 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
131 pthread_mutex_lock(&this->vm_lock); |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
132 retval = (uint8_t) vm_get_video_aspect(this->vm); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
133 pthread_mutex_unlock(&this->vm_lock); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
134 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
135 return retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
136 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
137 |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
138 uint8_t dvdnav_get_video_scale_permission(dvdnav_t *this) { |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
139 uint8_t retval; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
140 |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
141 pthread_mutex_lock(&this->vm_lock); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
142 retval = (uint8_t) vm_get_video_scale_permission(this->vm); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
143 pthread_mutex_unlock(&this->vm_lock); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
144 |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
145 return retval; |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
146 } |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
147 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
148 dvdnav_status_t dvdnav_clear(dvdnav_t * this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
149 if (!this) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
150 printerr("Passed a NULL pointer"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
151 return S_ERR; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
152 } |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
153 /* clear everything except path, file, vm, mutex, readahead */ |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
154 |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
155 /* path */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
156 if (this->file) DVDCloseFile(this->file); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
157 this->file = NULL; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
158 this->open_vtsN = -1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
159 this->open_domain = -1; |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
160 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
161 memset(&this->pci,0,sizeof(this->pci)); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
162 memset(&this->dsi,0,sizeof(this->dsi)); |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
163 |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
164 /* Set initial values of flags */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
165 this->position_current.still = 0; |
23 | 166 this->skip_still = 0; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
167 this->stop = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
168 this->spu_clut_changed = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
169 this->started=0; |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
170 /* this->use_read_ahead */ |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
171 |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
172 dvdnav_read_cache_clear(this->cache); |
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
173 |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
174 return S_OK; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
175 } |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
176 |
17 | 177 dvdnav_status_t dvdnav_open(dvdnav_t** dest, char *path) { |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
178 dvdnav_t *this; |
84 | 179 struct timeval time; |
0 | 180 |
181 /* Create a new structure */ | |
89
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
84
diff
changeset
|
182 fprintf(MSG_OUT, "libdvdnav: Using dvdnav version (devel-ref:jcd1) from http://dvd.sf.net\n"); |
82 | 183 |
184 /* FIXME: We malloc() here, but if an error occurs inside dvdnav_open(), | |
185 * we return but never free() it. | |
186 */ | |
0 | 187 (*dest) = NULL; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
188 this = (dvdnav_t*)malloc(sizeof(dvdnav_t)); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
189 if(!this) |
0 | 190 return S_ERR; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
191 memset(this, 0, (sizeof(dvdnav_t) ) ); /* Make sure this structure is clean */ |
82 | 192 (*dest) = this; |
0 | 193 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
194 pthread_mutex_init(&this->vm_lock, NULL); |
0 | 195 /* Initialise the error string */ |
196 printerr(""); | |
197 | |
198 /* Initialise the VM */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
199 this->vm = vm_new_vm(); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
200 if(!this->vm) { |
0 | 201 printerr("Error initialising the DVD VM"); |
202 return S_ERR; | |
203 } | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
204 if(vm_reset(this->vm, path) == -1) { |
0 | 205 printerr("Error starting the VM / opening the DVD device"); |
206 return S_ERR; | |
207 } | |
208 | |
209 /* Set the path. FIXME: Is a deep copy 'right' */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
210 strncpy(this->path, path, MAX_PATH_LEN); |
0 | 211 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
212 dvdnav_clear(this); |
0 | 213 |
214 /* Pre-open and close a file so that the CSS-keys are cached. */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
215 this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), 0, DVD_READ_MENU_VOBS); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
216 if (this->file) DVDCloseFile(this->file); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
217 this->file = NULL; |
0 | 218 |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
219 /* Start the read-ahead cache. */ |
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
220 this->cache = dvdnav_read_cache_new(this); |
84 | 221 |
222 /* Seed the random numbers. So that the DVD VM Command rand()i | |
223 * gives a different start value each time a DVD is played. | |
224 */ | |
225 gettimeofday(&time,NULL); | |
226 srand(time.tv_usec); | |
227 | |
0 | 228 return S_OK; |
229 } | |
230 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
231 dvdnav_status_t dvdnav_close(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
232 if(!this) { |
0 | 233 printerr("Passed a NULL pointer"); |
234 return S_ERR; | |
235 } | |
31 | 236 #ifdef LOG_DEBUG |
76 | 237 fprintf(MSG_OUT, "libdvdnav: close:called\n"); |
31 | 238 #endif |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
239 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
240 if (this->file) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
241 DVDCloseFile(this->file); |
31 | 242 #ifdef LOG_DEBUG |
76 | 243 fprintf(MSG_OUT, "libdvdnav: close:file closing\n"); |
31 | 244 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
245 this->file = NULL; |
0 | 246 } |
247 | |
248 /* Free the VM */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
249 if(this->vm) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
250 vm_free_vm(this->vm); |
0 | 251 } |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
252 if (this->file) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
253 DVDCloseFile(this->file); |
31 | 254 #ifdef LOG_DEBUG |
76 | 255 fprintf(MSG_OUT, "libdvdnav: close2:file closing\n"); |
31 | 256 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
257 this->file = NULL; |
0 | 258 } |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
259 pthread_mutex_destroy(&this->vm_lock); |
60 | 260 |
261 /* We leave the final freeing of the entire structure to the cache, | |
262 * because we don't know, if there are still buffers out in the wild, | |
263 * that must return first. */ | |
264 if(this->cache) { | |
265 dvdnav_read_cache_free(this->cache); | |
266 } else free(this); | |
0 | 267 |
268 return S_OK; | |
269 } | |
270 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
271 dvdnav_status_t dvdnav_reset(dvdnav_t *this) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
272 dvdnav_status_t result; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
273 |
31 | 274 #ifdef LOG_DEBUG |
76 | 275 fprintf(MSG_OUT, "libdvdnav: reset:called\n"); |
31 | 276 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
277 if(!this) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
278 printerr("Passed a NULL pointer"); |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
279 return S_ERR; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
280 } |
31 | 281 #ifdef LOG_DEBUG |
76 | 282 fprintf(MSG_OUT, "libdvdnav: getting lock\n"); |
31 | 283 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
284 pthread_mutex_lock(&this->vm_lock); |
31 | 285 #ifdef LOG_DEBUG |
76 | 286 fprintf(MSG_OUT, "libdvdnav: reseting vm\n"); |
31 | 287 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
288 if(vm_reset(this->vm, NULL) == -1) { |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
289 printerr("Error restarting the VM"); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
290 pthread_mutex_unlock(&this->vm_lock); |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
291 return S_ERR; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
292 } |
31 | 293 #ifdef LOG_DEBUG |
76 | 294 fprintf(MSG_OUT, "libdvdnav: clearing dvdnav\n"); |
31 | 295 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
296 result=dvdnav_clear(this); |
31 | 297 #ifdef LOG_DEBUG |
76 | 298 fprintf(MSG_OUT, "libdvdnav: unlocking\n"); |
31 | 299 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
300 pthread_mutex_unlock(&this->vm_lock); |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
301 return result; |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
302 } |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
303 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
304 dvdnav_status_t dvdnav_path(dvdnav_t *this, char** path) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
305 if(!this || !path || !(*path)) { |
0 | 306 return S_ERR; |
307 } | |
308 | |
309 /* FIXME: Is shallow copy 'right'? */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
310 (*path) = this->path; |
0 | 311 |
312 return S_OK; | |
313 } | |
314 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
315 char* dvdnav_err_to_string(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
316 if(!this) { |
0 | 317 /* Shold this be "passed a NULL pointer?" */ |
3
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
318 return "Hey! You gave me a NULL pointer you naughty person!"; |
0 | 319 } |
320 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
321 return this->err_str; |
0 | 322 } |
323 | |
324 /** | |
325 * Returns 1 if block contains NAV packet, 0 otherwise. | |
326 * Precesses said NAV packet if present. | |
327 * | |
328 * Most of the code in here is copied from xine's MPEG demuxer | |
329 * so any bugs which are found in that should be corrected here also. | |
330 */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
331 int dvdnav_decode_packet(dvdnav_t *this, uint8_t *p, dsi_t* nav_dsi, pci_t* nav_pci) { |
0 | 332 int bMpeg1=0; |
333 uint32_t nHeaderLen; | |
334 uint32_t nPacketLen; | |
335 uint32_t nStreamID; | |
336 /* uint8_t *p_start=p; */ | |
337 | |
338 | |
339 if (p==NULL) { | |
76 | 340 fprintf(MSG_OUT, "libdvdnav: Passed a NULL pointer.\n"); |
0 | 341 return 0; |
342 } | |
343 | |
344 /* dprint("Checking packet...\n"); */ | |
345 | |
346 if (p[3] == 0xBA) { /* program stream pack header */ | |
347 | |
348 int nStuffingBytes; | |
349 | |
350 /* xprintf (VERBOSE|DEMUX, "program stream pack header\n"); */ | |
351 | |
352 bMpeg1 = (p[4] & 0x40) == 0; | |
353 | |
354 if (bMpeg1) { | |
355 p += 12; | |
356 } else { /* mpeg2 */ | |
357 nStuffingBytes = p[0xD] & 0x07; | |
358 p += 14 + nStuffingBytes; | |
359 } | |
360 } | |
361 | |
362 | |
363 if (p[3] == 0xbb) { /* program stream system header */ | |
364 int nHeaderLen; | |
365 | |
366 nHeaderLen = (p[4] << 8) | p[5]; | |
367 p += 6 + nHeaderLen; | |
368 } | |
369 | |
370 /* we should now have a PES packet here */ | |
371 | |
372 if (p[0] || p[1] || (p[2] != 1)) { | |
76 | 373 fprintf(MSG_OUT, "libdvdnav: demux error! %02x %02x %02x (should be 0x000001) \n",p[0],p[1],p[2]); |
0 | 374 return 0; |
375 } | |
376 | |
377 nPacketLen = p[4] << 8 | p[5]; | |
378 nStreamID = p[3]; | |
379 | |
380 nHeaderLen = 6; | |
381 p += nHeaderLen; | |
382 | |
383 if (nStreamID == 0xbf) { /* Private stream 2 */ | |
384 /* | |
385 * int i; | |
76 | 386 * fprintf(MSG_OUT, "libdvdnav: nav packet=%u\n",p-p_start-6); |
0 | 387 * for(i=0;i<80;i++) { |
76 | 388 * fprintf(MSG_OUT, "%02x ",p[i-6]); |
0 | 389 * } |
76 | 390 * fprintf(MSG_OUT, "\n"); |
0 | 391 */ |
392 if(p[0] == 0x00) { | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
393 navRead_PCI(nav_pci, p+1); |
0 | 394 } |
395 | |
396 p += nPacketLen; | |
397 | |
398 /* We should now have a DSI packet. */ | |
399 if(p[6] == 0x01) { | |
400 nPacketLen = p[4] << 8 | p[5]; | |
401 p += 6; | |
402 /* dprint("NAV DSI packet\n"); */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
403 navRead_DSI(nav_dsi, p+1); |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
404 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
405 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
406 return 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
407 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
408 return 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
409 } |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
410 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
411 /* DSI is used for most angle stuff. |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
412 * PCI is used for only non-seemless angle stuff |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
413 */ |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
414 int dvdnav_get_vobu(dvdnav_t *self, dsi_t* nav_dsi, pci_t* nav_pci, dvdnav_vobu_t* vobu) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
415 uint32_t next; |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
416 int angle, num_angle; |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
417 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
418 vobu->vobu_start = nav_dsi->dsi_gi.nv_pck_lbn; /* Absolute offset from start of disk */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
419 vobu->vobu_length = nav_dsi->dsi_gi.vobu_ea; /* Relative offset from vobu_start */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
420 |
43
0ba15bf3dc25
Biiiiiiig change to let doxygen generate some docs for the library. Note that I'm in no way sure that the autoconf stuff plays nice.
richwareham
parents:
42
diff
changeset
|
421 /* |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
422 * If we're not at the end of this cell, we can determine the next |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
423 * VOBU to display using the VOBU_SRI information section of the |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
424 * DSI. Using this value correctly follows the current angle, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
425 * avoiding the doubled scenes in The Matrix, and makes our life |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
426 * really happy. |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
427 * |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
428 * vobu_next is an offset value, 0x3fffffff = SRI_END_OF_CELL |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
429 * DVDs are about 6 Gigs, which is only up to 0x300000 blocks |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
430 * Should really assert if bit 31 != 1 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
431 */ |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
432 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
433 /* Relative offset from vobu_start */ |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
434 vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff ); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
435 |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
436 /* Old code -- may still be sueful one day |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
437 if(nav_dsi->vobu_sri.next_vobu != SRI_END_OF_CELL ) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
438 vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff ); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
439 } else { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
440 vobu->vobu_next = vobu->vobu_length; |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
441 } */ |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
442 |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
443 dvdnav_get_angle_info(self, &angle, &num_angle); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
444 #if 0 |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
445 /* FIMXE: The angle reset doesn't work for some reason for the moment */ |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
446 |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
447 if((num_angle < angle) && (angle != 1)) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
448 printf("OOOOOOO angle ends!\n"); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
449 |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
450 /* This is to switch back to angle one when we |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
451 * finish with angles. */ |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
452 dvdnav_angle_change(self, 1); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
453 } |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
454 #endif |
0 | 455 |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
456 if(num_angle != 0) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
457 next = nav_pci->nsml_agli.nsml_agl_dsta[angle-1]; |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
458 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
459 if(next != 0) { |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
460 if((next & 0x3fffffff) != 0) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
461 if(next & 0x80000000) { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
462 vobu->vobu_next = - (int32_t)(next & 0x3fffffff); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
463 } else { |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
464 vobu->vobu_next = + (int32_t)(next & 0x3fffffff); |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
465 } |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
466 } |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
467 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
468 } else if( nav_dsi->sml_agli.data[angle-1].address != 0 ) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
469 next = nav_dsi->sml_agli.data[angle-1].address; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
470 vobu->vobu_length = nav_dsi->sml_pbi.ilvu_ea; |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
471 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
472 if((next & 0x80000000) && (next != 0x7fffffff)) { |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
473 vobu->vobu_next = - (int32_t)(next & 0x3fffffff); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
474 } else { |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
475 vobu->vobu_next = + (int32_t)(next & 0x3fffffff); |
0 | 476 } |
477 } | |
478 } | |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
479 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
480 return 1; |
0 | 481 } |
60 | 482 |
28 | 483 /* This is the main get_next_block function which actually gets the media stream video and audio etc. |
484 * The use of this function is optional, with the application programmer | |
485 * free to implement their own version of this function | |
486 * FIXME: Make the function calls from here public API calls. | |
487 */ | |
60 | 488 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
489 dvdnav_status_t dvdnav_get_next_block(dvdnav_t *this, unsigned char *buf, |
0 | 490 int *event, int *len) { |
60 | 491 unsigned char *block; |
492 dvdnav_status_t status; | |
493 | |
494 block = buf; | |
495 status = dvdnav_get_next_cache_block(this, &block, event, len); | |
496 if (block != buf) { | |
497 /* we received a block from the cache, copy it, so we can give it back */ | |
498 memcpy(buf, block, DVD_VIDEO_LB_LEN); | |
499 dvdnav_free_cache_block(this, block); | |
500 } | |
501 return status; | |
502 } | |
503 | |
504 dvdnav_status_t dvdnav_get_next_cache_block(dvdnav_t *this, unsigned char **buf, | |
505 int *event, int *len) { | |
0 | 506 dvd_state_t *state; |
507 int result; | |
60 | 508 if(!this || !event || !len || !buf || !*buf) { |
0 | 509 printerr("Passed a NULL pointer"); |
510 return S_ERR; | |
511 } | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
512 pthread_mutex_lock(&this->vm_lock); |
0 | 513 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
514 if(!this->started) { |
0 | 515 /* Start the VM */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
516 vm_start(this->vm); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
517 this->started = 1; |
0 | 518 } |
519 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
520 state = &(this->vm->state); |
0 | 521 (*event) = DVDNAV_NOP; |
522 (*len) = 0; | |
523 | |
524 /* Check the STOP flag */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
525 if(this->stop) { |
0 | 526 (*event) = DVDNAV_STOP; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
527 pthread_mutex_unlock(&this->vm_lock); |
0 | 528 return S_OK; |
529 } | |
530 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
531 /* Check the STILLFRAME flag */ |
42 | 532 /* FIXME: Still cell, not still frame */ |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
533 if(this->position_current.still != 0) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
534 dvdnav_still_event_t still_event; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
535 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
536 still_event.length = this->position_current.still; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
537 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
538 (*event) = DVDNAV_STILL_FRAME; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
539 (*len) = sizeof(dvdnav_still_event_t); |
60 | 540 memcpy(*buf, &(still_event), sizeof(dvdnav_still_event_t)); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
541 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
542 pthread_mutex_unlock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
543 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
544 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
545 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
546 vm_position_get(this->vm,&this->position_next); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
547 /********** |
76 | 548 fprintf(MSG_OUT, "libdvdnav: POS-NEXT "); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
549 vm_position_print(this->vm, &this->position_next); |
76 | 550 fprintf(MSG_OUT, "libdvdnav: POS-CUR "); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
551 vm_position_print(this->vm, &this->position_current); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
552 **********/ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
553 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
554 if(this->position_current.hop_channel != this->position_next.hop_channel) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
555 this->position_current.hop_channel = this->position_next.hop_channel; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
556 (*event) = DVDNAV_HOP_CHANNEL; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
557 (*len) = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
558 pthread_mutex_unlock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
559 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
560 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
561 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
562 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
563 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
564 if(this->spu_clut_changed) { |
0 | 565 (*event) = DVDNAV_SPU_CLUT_CHANGE; |
31 | 566 #ifdef LOG_DEBUG |
76 | 567 fprintf(MSG_OUT, "libdvdnav: SPU_CLUT_CHANGE\n"); |
31 | 568 #endif |
73
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
569 (*len) = 16 * sizeof(uint32_t); |
60 | 570 memcpy(*buf, &(state->pgc->palette), 16 * sizeof(uint32_t)); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
571 this->spu_clut_changed = 0; |
31 | 572 #ifdef LOG_DEBUG |
76 | 573 fprintf(MSG_OUT, "libdvdnav: SPU_CLUT_CHANGE returning S_OK\n"); |
31 | 574 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
575 pthread_mutex_unlock(&this->vm_lock); |
0 | 576 return S_OK; |
577 } | |
578 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
579 if(this->position_current.spu_channel != this->position_next.spu_channel) { |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
580 dvdnav_spu_stream_change_event_t stream_change; |
0 | 581 (*event) = DVDNAV_SPU_STREAM_CHANGE; |
31 | 582 #ifdef LOG_DEBUG |
76 | 583 fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE\n"); |
31 | 584 #endif |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
585 (*len) = sizeof(dvdnav_spu_stream_change_event_t); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
586 stream_change.physical_wide = vm_get_subp_active_stream(this->vm, 0); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
587 stream_change.physical_letterbox = vm_get_subp_active_stream(this->vm, 1); |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
588 stream_change.physical_pan_scan = vm_get_subp_active_stream(this->vm, 2); |
60 | 589 memcpy(*buf, &(stream_change), sizeof( dvdnav_spu_stream_change_event_t)); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
590 this->position_current.spu_channel = this->position_next.spu_channel; |
31 | 591 #ifdef LOG_DEBUG |
76 | 592 fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_wide=%d\n",stream_change.physical_wide); |
593 fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_letterbox=%d\n",stream_change.physical_letterbox); | |
594 fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE stream_id_pan_scan=%d\n",stream_change.physical_pan_scan); | |
31 | 595 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
596 pthread_mutex_unlock(&this->vm_lock); |
58 | 597 if (stream_change.physical_wide != -1 && |
598 stream_change.physical_letterbox != -1 && | |
599 stream_change.physical_pan_scan != -1) { | |
600 #ifdef LOG_DEBUG | |
76 | 601 fprintf(MSG_OUT, "libdvdnav: SPU_STREAM_CHANGE returning S_OK\n"); |
58 | 602 #endif |
603 return S_OK; | |
604 } | |
0 | 605 } |
606 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
607 if(this->position_current.audio_channel != this->position_next.audio_channel) { |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
608 dvdnav_audio_stream_change_event_t stream_change; |
0 | 609 (*event) = DVDNAV_AUDIO_STREAM_CHANGE; |
31 | 610 #ifdef LOG_DEBUG |
76 | 611 fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE\n"); |
31 | 612 #endif |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
613 (*len) = sizeof(dvdnav_audio_stream_change_event_t); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
614 stream_change.physical= vm_get_audio_active_stream( this->vm ); |
60 | 615 memcpy(*buf, &(stream_change), sizeof( dvdnav_audio_stream_change_event_t)); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
616 this->position_current.audio_channel = this->position_next.audio_channel; |
31 | 617 #ifdef LOG_DEBUG |
76 | 618 fprintf(MSG_OUT, "libdvdnav: AUDIO_STREAM_CHANGE stream_id=%d returning S_OK\n",stream_change.physical); |
31 | 619 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
620 pthread_mutex_unlock(&this->vm_lock); |
0 | 621 return S_OK; |
622 } | |
623 | |
624 /* Check the HIGHLIGHT flag */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
625 /* FIXME: Use BUTTON instead of HIGHLIGHT. */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
626 if(this->position_current.button != this->position_next.button) { |
0 | 627 dvdnav_highlight_event_t hevent; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
628 |
30 | 629 hevent.display = 1; |
630 hevent.buttonN = this->position_next.button; | |
0 | 631 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
632 this->position_current.button = this->position_next.button; |
0 | 633 |
30 | 634 (*event) = DVDNAV_HIGHLIGHT; |
635 (*len) = sizeof(hevent); | |
60 | 636 memcpy(*buf, &(hevent), sizeof(hevent)); |
30 | 637 pthread_mutex_unlock(&this->vm_lock); |
638 return S_OK; | |
0 | 639 } |
640 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
641 /* Check to see if we need to change the currently opened VOB */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
642 if((this->position_current.vts != this->position_next.vts) || |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
643 (this->position_current.domain != this->position_next.domain)) { |
0 | 644 dvd_read_domain_t domain; |
645 int vtsN; | |
646 dvdnav_vts_change_event_t vts_event; | |
647 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
648 if(this->file) { |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
649 dvdnav_read_cache_clear(this->cache); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
650 DVDCloseFile(this->file); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
651 this->file = NULL; |
0 | 652 } |
653 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
654 vts_event.old_vtsN = this->open_vtsN; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
655 vts_event.old_domain = this->open_domain; |
0 | 656 |
657 /* Use the current DOMAIN to find whether to open menu or title VOBs */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
658 switch(this->position_next.domain) { |
0 | 659 case FP_DOMAIN: |
660 case VMGM_DOMAIN: | |
661 domain = DVD_READ_MENU_VOBS; | |
662 vtsN = 0; | |
663 break; | |
664 case VTSM_DOMAIN: | |
665 domain = DVD_READ_MENU_VOBS; | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
666 vtsN = this->position_next.vts; |
0 | 667 break; |
668 case VTS_DOMAIN: | |
669 domain = DVD_READ_TITLE_VOBS; | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
670 vtsN = this->position_next.vts; |
0 | 671 break; |
672 default: | |
673 printerr("Unknown domain when changing VTS."); | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
674 pthread_mutex_unlock(&this->vm_lock); |
0 | 675 return S_ERR; |
676 } | |
677 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
678 this->position_current.vts = this->position_next.vts; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
679 this->position_current.domain = this->position_next.domain; |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
680 dvdnav_read_cache_clear(this->cache); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
681 this->file = DVDOpenFile(vm_get_dvd_reader(this->vm), vtsN, domain); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
682 vts_event.new_vtsN = this->position_next.vts; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
683 vts_event.new_domain = this->position_next.domain; |
0 | 684 |
685 /* If couldn't open the file for some reason, moan */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
686 if(this->file == NULL) { |
0 | 687 printerrf("Error opening vtsN=%i, domain=%i.", vtsN, domain); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
688 pthread_mutex_unlock(&this->vm_lock); |
0 | 689 return S_ERR; |
690 } | |
691 | |
692 /* File opened successfully so return a VTS change event */ | |
693 (*event) = DVDNAV_VTS_CHANGE; | |
60 | 694 memcpy(*buf, &(vts_event), sizeof(vts_event)); |
0 | 695 (*len) = sizeof(vts_event); |
696 | |
697 /* On a VTS change, we want to disable any highlights which | |
698 * may have been shown (FIXME: is this valid?) */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
699 this->spu_clut_changed = 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
700 this->position_current.cell = -1; /* Force an update */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
701 this->position_current.spu_channel = -1; /* Force an update */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
702 this->position_current.audio_channel = -1; /* Force an update */; |
0 | 703 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
704 pthread_mutex_unlock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
705 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
706 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
707 /* FIXME: Don't really need "cell", we only need vobu_start */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
708 if( (this->position_current.cell != this->position_next.cell) || |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
709 (this->position_current.cell_restart != this->position_next.cell_restart) || |
24 | 710 (this->position_current.vobu_start != this->position_next.vobu_start) || |
711 (this->position_current.vobu_next != this->position_next.vobu_next) ) { | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
712 this->position_current.cell = this->position_next.cell; |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
713 this->position_current.cell_restart = this->position_next.cell_restart; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
714 /* vobu_start changes when PGC or PG changes. */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
715 this->position_current.vobu_start = this->position_next.vobu_start; |
24 | 716 this->position_current.vobu_next = this->position_next.vobu_next; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
717 /* FIXME: Need to set vobu_start, vobu_next */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
718 this->vobu.vobu_start = this->position_next.vobu_start; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
719 /* vobu_next is use for mid cell resumes */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
720 this->vobu.vobu_next = this->position_next.vobu_next; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
721 this->vobu.vobu_length = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
722 this->vobu.blockN = this->vobu.vobu_length + 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
723 /* Make blockN > vobu_lenght to do expected_nav */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
724 (*event) = DVDNAV_CELL_CHANGE; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
725 (*len) = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
726 pthread_mutex_unlock(&this->vm_lock); |
0 | 727 return S_OK; |
728 } | |
729 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
730 |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
731 if (this->vobu.blockN > this->vobu.vobu_length) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
732 /* End of VOBU */ |
0 | 733 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
734 if(this->vobu.vobu_next == SRI_END_OF_CELL) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
735 /* End of Cell from NAV DSI info */ |
31 | 736 #ifdef LOG_DEBUG |
76 | 737 fprintf(MSG_OUT, "libdvdnav: Still set to %x\n", this->position_next.still); |
31 | 738 #endif |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
739 this->position_current.still = this->position_next.still; |
0 | 740 |
23 | 741 if( this->position_current.still == 0 || this->skip_still ) { |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
742 vm_get_next_cell(this->vm); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
743 vm_position_get(this->vm,&this->position_next); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
744 /* FIXME: Need to set vobu_start, vobu_next */ |
23 | 745 this->position_current.still = 0; /* still gets activated at end of cell */ |
746 this->skip_still = 0; | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
747 this->position_current.cell = this->position_next.cell; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
748 this->position_current.vobu_start = this->position_next.vobu_start; |
24 | 749 this->position_current.vobu_next = this->position_next.vobu_next; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
750 this->vobu.vobu_start = this->position_next.vobu_start; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
751 /* vobu_next is use for mid cell resumes */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
752 this->vobu.vobu_next = this->position_next.vobu_next; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
753 this->vobu.vobu_length = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
754 this->vobu.blockN = this->vobu.vobu_length + 1; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
755 /* Make blockN > vobu_next to do expected_nav */ |
73
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
756 /* update the spu palette on PGC changes */ |
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
757 this->spu_clut_changed = 1; |
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
758 this->position_current.spu_channel = -1; /* Force an update */ |
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
759 this->position_current.audio_channel = -1; /* Force an update */; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
760 (*event) = DVDNAV_CELL_CHANGE; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
761 (*len) = 0; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
762 pthread_mutex_unlock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
763 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
764 } else { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
765 dvdnav_still_event_t still_event; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
766 still_event.length = this->position_current.still; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
767 (*event) = DVDNAV_STILL_FRAME; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
768 (*len) = sizeof(dvdnav_still_event_t); |
60 | 769 memcpy(*buf, &(still_event), sizeof(dvdnav_still_event_t)); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
770 pthread_mutex_unlock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
771 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
772 } |
0 | 773 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
774 /* Only set still after whole VOBU has been output. */ |
42 | 775 /* |
776 if(this->position_next.still != 0) { | |
777 this->position_current.still = this->position_next.still; | |
778 } | |
779 */ | |
0 | 780 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
781 } |
0 | 782 /* Perform the jump if necessary (this is always a |
783 * VOBU boundary). */ | |
784 | |
45 | 785 //result = DVDReadBlocks(this->file, this->vobu.vobu_start + this->vobu.vobu_next, 1, buf); |
786 result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.vobu_next, 1, buf); | |
0 | 787 |
788 if(result <= 0) { | |
789 printerr("Error reading NAV packet."); | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
790 pthread_mutex_unlock(&this->vm_lock); |
0 | 791 return S_ERR; |
792 } | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
793 /* Decode nav into pci and dsi. */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
794 /* Then get next VOBU info. */ |
60 | 795 if(dvdnav_decode_packet(this, *buf, &this->dsi, &this->pci) == 0) { |
0 | 796 printerr("Expected NAV packet but none found."); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
797 pthread_mutex_unlock(&this->vm_lock); |
0 | 798 return S_ERR; |
799 } | |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
800 dvdnav_get_vobu(this, &this->dsi,&this->pci, &this->vobu); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
801 this->vobu.blockN=1; |
28 | 802 /* FIXME: We need to update the vm state->blockN with which VOBU we are in. |
803 * This is so RSM resumes to the VOBU level and not just the CELL level. | |
804 * This should be implemented with a new Public API call. | |
805 */ | |
45 | 806 /* We cache one past the end of the VOBU, |
807 * in the hope it might catch the next NAV packet as well. | |
808 * This reduces the amount of read commands sent to the DVD device. | |
809 * A cache miss will only happen for 3 reasons. | |
810 * 1) Seeking | |
811 * 2) Menu change | |
812 * 3) The next VOBU does not immeadiately follow the current one. E.g. Multi Angles, ILVU. | |
813 */ | |
814 dvdnav_pre_cache_blocks(this->cache, this->vobu.vobu_start+1, this->vobu.vobu_length+1); | |
0 | 815 |
816 /* Successfully got a NAV packet */ | |
817 (*event) = DVDNAV_NAV_PACKET; | |
3
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
818 (*len) = 2048; |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
819 pthread_mutex_unlock(&this->vm_lock); |
0 | 820 return S_OK; |
821 } | |
822 | |
823 /* If we've got here, it must just be a normal block. */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
824 if(!this->file) { |
0 | 825 printerr("Attempting to read without opening file"); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
826 pthread_mutex_unlock(&this->vm_lock); |
0 | 827 return S_ERR; |
828 } | |
829 | |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
830 result = dvdnav_read_cache_block(this->cache, this->vobu.vobu_start + this->vobu.blockN, 1, buf); |
0 | 831 if(result <= 0) { |
832 printerr("Error reading from DVD."); | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
833 pthread_mutex_unlock(&this->vm_lock); |
0 | 834 return S_ERR; |
835 } | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
836 this->vobu.blockN++; |
0 | 837 (*len) = 2048; |
838 (*event) = DVDNAV_BLOCK_OK; | |
839 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
840 pthread_mutex_unlock(&this->vm_lock); |
0 | 841 return S_OK; |
842 } | |
843 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
844 uint16_t dvdnav_audio_stream_to_lang(dvdnav_t *this, uint8_t stream) { |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
845 audio_attr_t attr; |
0 | 846 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
847 if(!this) |
0 | 848 return -1; |
849 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
850 pthread_mutex_lock(&this->vm_lock); |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
851 attr = vm_get_audio_attr(this->vm, stream); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
852 pthread_mutex_unlock(&this->vm_lock); |
0 | 853 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
854 if(attr.lang_type != 1) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
855 return 0xffff; |
0 | 856 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
857 return attr.lang_code; |
0 | 858 } |
859 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
860 int8_t dvdnav_get_audio_logical_stream(dvdnav_t *this, uint8_t audio_num) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
861 int8_t retval; |
0 | 862 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
863 if(!this) |
0 | 864 return -1; |
865 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
866 pthread_mutex_lock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
867 retval = NCLK_dvdnav_get_audio_logical_stream(this, audio_num); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
868 pthread_mutex_unlock(&this->vm_lock); |
0 | 869 |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
870 return retval; |
0 | 871 } |
872 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
873 uint16_t dvdnav_spu_stream_to_lang(dvdnav_t *this, uint8_t stream) { |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
874 subp_attr_t attr; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
875 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
876 if(!this) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
877 return -1; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
878 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
879 pthread_mutex_lock(&this->vm_lock); |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
880 attr = vm_get_subp_attr(this->vm, stream); |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
881 pthread_mutex_unlock(&this->vm_lock); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
882 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
883 if(attr.type != 1) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
884 return 0xffff; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
885 |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
886 return attr.lang_code; |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
887 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
888 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
889 int8_t dvdnav_get_spu_logical_stream(dvdnav_t *this, uint8_t subp_num) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
890 int8_t retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
891 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
892 if(!this) |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
893 return -1; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
894 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
895 pthread_mutex_lock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
896 retval = NCLK_dvdnav_get_spu_logical_stream(this, subp_num); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
897 pthread_mutex_unlock(&this->vm_lock); |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
898 |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
899 return retval; |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
900 } |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
901 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
902 int8_t dvdnav_get_active_spu_stream(dvdnav_t *this) { |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
903 int8_t retval; |
0 | 904 |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
905 if(!this) |
0 | 906 return -1; |
907 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
908 pthread_mutex_lock(&this->vm_lock); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
909 retval = NLCK_dvdnav_get_active_spu_stream(this); |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
910 pthread_mutex_unlock(&this->vm_lock); |
0 | 911 |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
912 return retval; |
0 | 913 } |
914 | |
915 /* First Play domain. (Menu) */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
916 int8_t dvdnav_is_domain_fp(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
917 return _dvdnav_is_domain(this, FP_DOMAIN); |
0 | 918 } |
919 /* Video management Menu domain. (Menu) */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
920 int8_t dvdnav_is_domain_vmgm(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
921 return _dvdnav_is_domain(this, VMGM_DOMAIN); |
0 | 922 } |
923 /* Video Title Menu domain (Menu) */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
924 int8_t dvdnav_is_domain_vtsm(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
925 return _dvdnav_is_domain(this, VTSM_DOMAIN); |
0 | 926 } |
927 /* Video Title domain (playing movie). */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
928 int8_t dvdnav_is_domain_vts(dvdnav_t *this) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
929 return _dvdnav_is_domain(this, VTS_DOMAIN); |
0 | 930 } |
931 | |
932 /* Generally delegate angle information handling to | |
933 * VM */ | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
934 dvdnav_status_t dvdnav_angle_change(dvdnav_t *this, int angle) { |
0 | 935 int num, current; |
936 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
937 if(!this) { |
0 | 938 return S_ERR; |
939 } | |
940 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
941 if(dvdnav_get_angle_info(this, ¤t, &num) != S_OK) { |
0 | 942 printerr("Error getting angle info"); |
943 return S_ERR; | |
944 } | |
945 | |
946 /* Set angle SPRM if valid */ | |
947 if((angle > 0) && (angle <= num)) { | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
948 this->vm->state.AGL_REG = angle; |
0 | 949 } else { |
950 printerr("Passed an invalid angle number"); | |
951 return S_ERR; | |
952 } | |
953 | |
954 return S_OK; | |
955 } | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
956 /* FIXME: change order of current_angle, number_of_angles */ |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
957 dvdnav_status_t dvdnav_get_angle_info(dvdnav_t *this, int* current_angle, |
0 | 958 int *number_of_angles) { |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
959 if(!this || !this->vm) { |
0 | 960 return S_ERR; |
961 } | |
962 | |
963 if(!current_angle || !number_of_angles) { | |
964 printerr("Passed a NULL pointer"); | |
965 return S_ERR; | |
966 } | |
967 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
968 vm_get_angle_info(this->vm, number_of_angles, current_angle); |
0 | 969 |
970 return S_OK; | |
971 } | |
972 | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
973 dvdnav_status_t dvdnav_get_cell_info(dvdnav_t *this, int* current_angle, |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
974 int *number_of_angles) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
975 if(!this || !this->vm) { |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
976 return S_ERR; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
977 } |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
978 *current_angle=this->position_next.cell; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
979 return S_OK; |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
980 } |
0 | 981 |
67
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
982 pci_t* dvdnav_get_current_nav_pci(dvdnav_t *this) { |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
983 if(!this || !this->vm) return 0; |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
984 return &this->pci; |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
985 } |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
986 |
66
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
987 dsi_t* dvdnav_get_current_nav_dsi(dvdnav_t *this) { |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
988 if(!this || !this->vm) return 0; |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
989 return &this->dsi; |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
990 } |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
991 |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
992 uint32_t dvdnav_get_next_still_flag(dvdnav_t *this) { |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
993 if(!this || !this->vm) { |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
994 return S_ERR; |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
995 } |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
996 return this->position_next.still; |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
997 } |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
998 |
0 | 999 /* |
1000 * $Log$ | |
89
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
84
diff
changeset
|
1001 * Revision 1.34 2002/09/03 00:41:48 jcdutton |
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
84
diff
changeset
|
1002 * Add a comment so I can tell which version of the CVS a user is using. |
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
84
diff
changeset
|
1003 * Also add a FIXME to remind me to fix the Chapter number display. |
0fbef4901e2c
Add a comment so I can tell which version of the CVS a user is using.
jcdutton
parents:
84
diff
changeset
|
1004 * |
84 | 1005 * Revision 1.33 2002/08/31 11:05:27 jcdutton |
1006 * Properly seed the DVD VM Instruction rand(). | |
1007 * | |
82 | 1008 * Revision 1.32 2002/08/31 02:50:27 jcdutton |
1009 * Improve some debug messages. | |
1010 * Add some comments about dvdnav_open memory leaks. | |
1011 * | |
76 | 1012 * Revision 1.31 2002/08/27 19:15:08 mroi |
1013 * more consistent console output | |
1014 * | |
73
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
1015 * Revision 1.30 2002/08/09 21:34:27 mroi |
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
1016 * update spu clut, spu channel and audio channel more often |
a23d50ba81d3
update spu clut, spu channel and audio channel more often
mroi
parents:
67
diff
changeset
|
1017 * |
67
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
1018 * Revision 1.29 2002/07/25 14:51:40 richwareham |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
1019 * Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled' |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
1020 * check_packet. |
61c0ee1bbb7a
Moved get_current_nav_pci into dvdnac.c, changed example to use it instead of 'home-rolled'
richwareham
parents:
66
diff
changeset
|
1021 * |
66
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
1022 * Revision 1.28 2002/07/25 14:42:33 richwareham |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
1023 * Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead' |
2bd4a78eefce
Patch from aschultz@cs.uni-magdeburg.de to allow for still-frame 'peek-ahead'
richwareham
parents:
60
diff
changeset
|
1024 * |
60 | 1025 * Revision 1.27 2002/07/12 15:46:44 mroi |
1026 * use new memcopy'less read ahead cache | |
1027 * | |
58 | 1028 * Revision 1.26 2002/07/06 16:24:54 mroi |
1029 * * fix debug messages | |
1030 * * send spu stream change event only, when there are new streams | |
1031 * (should fix problems with Terminator disk 2) | |
1032 * | |
55
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1033 * Revision 1.25 2002/07/05 14:18:54 mroi |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1034 * report all spu types (widescreen, letterbox and pan&scan), not widescreen |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1035 * only and report the stream's scale permissions to detect pan&scan material |
5674fbd44f26
report all spu types (widescreen, letterbox and pan&scan), not widescreen
mroi
parents:
54
diff
changeset
|
1036 * |
54 | 1037 * Revision 1.24 2002/07/05 01:42:30 jcdutton |
1038 * Add more debug info for Menu language selection. | |
1039 * Only do vm_start when we have to. | |
1040 * | |
50
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
1041 * Revision 1.23 2002/07/02 22:57:09 jcdutton |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
1042 * Rename some of the functions in vm.c to help readability. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
1043 * Hopefully fix __FUNCTION__ problem. Use __func_ as recommended in C99. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
1044 * Fix bug where libdvdnav would not immeadiately replay the same cell due to menu buttons. |
578ce1d41479
Rename some of the functions in vm.c to help readability.
jcdutton
parents:
45
diff
changeset
|
1045 * |
45 | 1046 * Revision 1.22 2002/06/25 13:37:11 jcdutton |
1047 * Revert back to old read_cache method. | |
1048 * Some new optimizations added to the old read_cache method, thus reducing the amount of calls to read blocks from the DVD device. | |
1049 * | |
43
0ba15bf3dc25
Biiiiiiig change to let doxygen generate some docs for the library. Note that I'm in no way sure that the autoconf stuff plays nice.
richwareham
parents:
42
diff
changeset
|
1050 * Revision 1.21 2002/06/06 15:03:09 richwareham |
0ba15bf3dc25
Biiiiiiig change to let doxygen generate some docs for the library. Note that I'm in no way sure that the autoconf stuff plays nice.
richwareham
parents:
42
diff
changeset
|
1051 * Biiiiiiig change to let doxygen generate some docs for the library. Note that I'm in no way sure that the autoconf stuff plays nice. |
0ba15bf3dc25
Biiiiiiig change to let doxygen generate some docs for the library. Note that I'm in no way sure that the autoconf stuff plays nice.
richwareham
parents:
42
diff
changeset
|
1052 * |
42 | 1053 * Revision 1.20 2002/06/04 13:35:16 richwareham |
1054 * Removed more C++ style comments | |
1055 * | |
39 | 1056 * Revision 1.19 2002/05/30 23:15:14 richwareham |
1057 * First draft of removing HAVE_DVDREAD9 | |
1058 * | |
34
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
1059 * Revision 1.18 2002/05/30 09:52:29 richwareham |
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
1060 * 'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book. |
1f29402ef2ef
'Objectified' the read-ahead cache in preparation to implement a 'proper' threaded cache a-la that recommended in the DVD Demystified book.
richwareham
parents:
33
diff
changeset
|
1061 * |
33
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
1062 * Revision 1.17 2002/05/09 11:57:24 richwareham |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
1063 * Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus) |
ef2136c4e7b2
Angles now work (still a few wrinkles though -- e.g. angle does not reset to '1' when returning to menus)
richwareham
parents:
31
diff
changeset
|
1064 * |
31 | 1065 * Revision 1.16 2002/04/24 21:15:25 jcdutton |
1066 * Quiet please!!! | |
1067 * | |
30 | 1068 * Revision 1.15 2002/04/24 00:47:46 jcdutton |
1069 * Some more cleanups. | |
1070 * Improve button passing. | |
1071 * | |
28 | 1072 * Revision 1.14 2002/04/23 13:26:08 jcdutton |
1073 * Add some comments, FIXMEs. | |
1074 * The main point being that dvdnav_get_next_block is almost in a state where it can be optional whether the application programmer uses it, or implements their own version of the function. That is been the main reason for the re-write of this function recently. | |
1075 * | |
26 | 1076 * Revision 1.13 2002/04/23 12:55:40 jcdutton |
1077 * Removed un-needed variables. | |
1078 * General Clean up. | |
1079 * | |
25
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1080 * Revision 1.12 2002/04/23 12:34:39 f1rmb |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1081 * Why rewrite vm function, use it instead (this remark is for me, of course ;-) ). |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1082 * Comment unused var, shut compiler warnings. |
df024077cbc1
Why rewrite vm function, use it instead (this remark is for me, of course ;-) ).
f1rmb
parents:
24
diff
changeset
|
1083 * |
24 | 1084 * Revision 1.11 2002/04/23 02:12:27 jcdutton |
1085 * Re-implemented seeking. | |
1086 * | |
23 | 1087 * Revision 1.10 2002/04/23 00:07:16 jcdutton |
1088 * Name stills work better. | |
1089 * | |
22
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
1090 * Revision 1.9 2002/04/22 22:00:48 jcdutton |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
1091 * Start of rewrite of libdvdnav. Still need to re-implement seeking. |
3c1df0cb3aee
Start of rewrite of libdvdnav. Still need to re-implement seeking.
jcdutton
parents:
21
diff
changeset
|
1092 * |
21
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
1093 * Revision 1.8 2002/04/22 20:57:14 f1rmb |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
1094 * Change/fix SPU active stream id. Same for audio. Few new functions, largely |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
1095 * inspired from libogle ;-). |
d2d73f2ad8d3
Change/fix SPU active stream id. Same for audio. Few new functions, largely
f1rmb
parents:
17
diff
changeset
|
1096 * |
17 | 1097 * Revision 1.7 2002/04/10 16:45:57 jcdutton |
1098 * Actually fix the const this time! | |
1099 * | |
8
66708b4a1b5e
Stop C++ bitching about some things and extend the menus example
richwareham
parents:
7
diff
changeset
|
1100 * Revision 1.6 2002/04/07 14:10:11 richwareham |
66708b4a1b5e
Stop C++ bitching about some things and extend the menus example
richwareham
parents:
7
diff
changeset
|
1101 * Stop C++ bitching about some things and extend the menus example |
66708b4a1b5e
Stop C++ bitching about some things and extend the menus example
richwareham
parents:
7
diff
changeset
|
1102 * |
7
7fdefafa624f
Slight correction to handle quicker menu transitions.
jcdutton
parents:
6
diff
changeset
|
1103 * Revision 1.5 2002/04/06 18:42:05 jcdutton |
7fdefafa624f
Slight correction to handle quicker menu transitions.
jcdutton
parents:
6
diff
changeset
|
1104 * Slight correction to handle quicker menu transitions. |
7fdefafa624f
Slight correction to handle quicker menu transitions.
jcdutton
parents:
6
diff
changeset
|
1105 * |
6 | 1106 * Revision 1.4 2002/04/06 18:31:50 jcdutton |
1107 * Some cleaning up. | |
1108 * changed exit(1) to assert(0) so they actually get seen by the user so that it helps developers more. | |
1109 * | |
4
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1110 * Revision 1.3 2002/04/02 18:22:27 richwareham |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1111 * Added reset patch from Kees Cook <kees@outflux.net> |
99bed5d6db2f
Added reset patch from Kees Cook <kees@outflux.net>
richwareham
parents:
3
diff
changeset
|
1112 * |
3
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1113 * Revision 1.2 2002/04/01 18:56:28 richwareham |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1114 * Added initial example programs directory and make sure all debug/error output goes to stderr. |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1115 * |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1116 * Revision 1.1.1.1 2002/03/12 19:45:57 richwareham |
328eadb3f37e
Added initial example programs directory and make sure all debug/error output goes to stderr.
richwareham
parents:
0
diff
changeset
|
1117 * Initial import |
0 | 1118 * |
1119 * Revision 1.28 2002/02/02 23:26:20 richwareham | |
1120 * Restored title selection | |
1121 * | |
1122 * Revision 1.27 2002/02/01 15:48:10 richwareham | |
1123 * Re-implemented angle selection and title/chapter display | |
1124 * | |
1125 * Revision 1.26 2002/01/31 16:53:49 richwareham | |
1126 * Big patch from Daniel Caujolle-Bert to (re)implement SPU/Audio language display | |
1127 * | |
1128 * Revision 1.25 2002/01/24 20:53:50 richwareham | |
1129 * Added option to _not_ use DVD read-ahead to options | |
1130 * | |
1131 * Revision 1.24 2002/01/20 15:54:59 jcdutton | |
1132 * Implement seeking. | |
1133 * It is still a bit buggy, but works sometimes. | |
1134 * I need to find out how to make the jump clean. | |
1135 * At the moment, some corruption of the mpeg2 stream occurs, | |
1136 * which causes libmpeg2 to crash. | |
1137 * | |
1138 * Revision 1.23 2002/01/18 00:23:52 jcdutton | |
1139 * Support Ejecting of DVD. | |
1140 * It will first un-mount the DVD, then eject it. | |
1141 * | |
1142 * Revision 1.22 2002/01/17 14:50:32 jcdutton | |
1143 * Fix corruption of stream during menu transitions. | |
1144 * Menu transitions are now clean. | |
1145 * | |
1146 * Revision 1.21 2002/01/15 00:37:03 jcdutton | |
1147 * Just a few cleanups, and a assert fix. (memset fixed it) | |
1148 * | |
1149 * Revision 1.20 2002/01/13 22:17:57 jcdutton | |
1150 * Change logging. | |
1151 * | |
1152 * | |
1153 */ |