2 * Copyright (C) 2008 Jan Schmidt <thaytan@noraisin.net>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
19 #ifndef __RESINDVDSRC_H__
20 #define __RESINDVDSRC_H__
24 #include <gst/base/gstbasesrc.h>
30 #include <dvdnav/dvdnav.h>
31 #include <dvdread/ifo_read.h>
32 #include <dvdread/nav_read.h>
36 #define RESIN_TYPE_DVDSRC (rsn_dvdsrc_get_type())
37 #define RESINDVDSRC(obj) \
38 (G_TYPE_CHECK_INSTANCE_CAST((obj),RESIN_TYPE_DVDSRC,resinDvdSrc))
39 #define RESINDVDSRC_CLASS(klass) \
40 (G_TYPE_CHECK_CLASS_CAST((klass),RESIN_TYPE_DVDSRC,resinDvdSrcClass))
41 #define IS_RESINDVDSRC(obj) \
42 (G_TYPE_CHECK_INSTANCE_TYPE((obj),RESIN_TYPE_DVDSRC))
43 #define IS_RESINDVDSRC_CLASS(klass) \
44 (G_TYPE_CHECK_CLASS_TYPE((klass),RESIN_TYPE_DVDSRC))
46 typedef struct _resinDvdSrc resinDvdSrc;
47 typedef struct _resinDvdSrcClass resinDvdSrcClass;
65 /* dvd_reader instance is used to load and cache VTS/VMG ifo info */
66 dvd_reader_t *dvdread;
68 /* vmgi_mat_t from the VMG ifo: */
69 vmgi_mat_t vmgm_attr; /* VMGM domain info */
70 /* Array of cached vtsi_mat_t strctures from each IFO: */
73 ifo_handle_t *vmg_file;
74 ifo_handle_t *vts_file;
76 /* Current playback location: VTS 0 = VMG, plus in_menu or not */
79 gint title_n; /* Title num */
80 gint part_n; /* Part num */
81 gint n_angles; /* number of angles */
82 gint cur_angle; /* current angle */
87 gboolean flushing_seek;
88 gboolean need_segment;
89 gboolean need_tag_update;
90 gboolean active_highlight;
91 gboolean in_still_state;
94 gboolean was_mouse_over;
96 /* Remaining time to wait in a timed still: */
97 GstClockTime still_time_remaining;
101 /* TRUE if the next_buf is a nav block that needs enqueueing */
102 gboolean next_is_nav_block;
103 /* PTS for activating the pending nav block in next_buf */
104 GstClockTime next_nav_ts;
105 /* Track accumulated segment position, cleared by flushing */
106 GstSegment src_segment;
108 /* Start timestamp of the previous NAV block */
109 GstClockTime cur_start_ts;
110 /* End timestamp of the previous NAV block */
111 GstClockTime cur_end_ts;
112 /* base ts is cur_start_ts - cell_time for each VOBU */
113 GstClockTime cur_vobu_base_ts;
114 /* Position info of the previous NAV block */
115 GstClockTime cur_position;
116 /* Duration of the current PGC */
117 GstClockTime pgc_duration;
120 dvdnav_highlight_area_t area;
122 /* Pending events to output */
123 GstEvent *streams_event;
124 GstEvent *clut_event;
125 GstEvent *spu_select_event;
126 GstEvent *audio_select_event;
127 GstEvent *highlight_event;
129 gboolean angles_changed;
130 gboolean commands_changed;
132 /* GList of NAV packets awaiting activation, and the
133 * running times to activate them. */
134 GSList *pending_nav_blocks;
135 GSList *pending_nav_blocks_end;
137 GstClockID nav_clock_id;
142 /* Current state tracking */
143 gint8 cur_audio_phys_stream;
144 gint8 cur_spu_phys_stream;
145 gboolean cur_spu_forced_only;
146 guint32 cur_clut[16];
148 guint32 cur_btn_mask;
151 struct _resinDvdSrcClass
153 GstBaseSrcClass parent_class;
156 GType rsn_dvdsrc_get_type (void);
160 #endif /* __RESINDVDSRC_H__ */