2008-06-17 01:08:14 +00:00
|
|
|
/* GStreamer
|
|
|
|
* Copyright (C) 2008 Jan Schmidt <thaytan@noraisin.net>
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
#ifndef __RESINDVDSRC_H__
|
|
|
|
#define __RESINDVDSRC_H__
|
|
|
|
|
|
|
|
#include <gst/gst.h>
|
|
|
|
|
2009-11-01 18:21:38 +00:00
|
|
|
#include "rsnbasesrc.h"
|
2008-06-17 01:08:14 +00:00
|
|
|
|
|
|
|
#include "_stdint.h"
|
|
|
|
|
2008-06-17 10:53:35 +00:00
|
|
|
#include <dvdnav/dvdnav.h>
|
|
|
|
#include <dvdread/ifo_read.h>
|
2008-06-20 13:07:56 +00:00
|
|
|
#include <dvdread/nav_read.h>
|
2008-06-17 10:53:35 +00:00
|
|
|
|
2008-06-17 01:08:14 +00:00
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
#define RESIN_TYPE_DVDSRC (rsn_dvdsrc_get_type())
|
|
|
|
#define RESINDVDSRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),RESIN_TYPE_DVDSRC,resinDvdSrc))
|
|
|
|
#define RESINDVDSRC_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),RESIN_TYPE_DVDSRC,resinDvdSrcClass))
|
|
|
|
#define IS_RESINDVDSRC(obj) \
|
|
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),RESIN_TYPE_DVDSRC))
|
|
|
|
#define IS_RESINDVDSRC_CLASS(klass) \
|
|
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),RESIN_TYPE_DVDSRC))
|
|
|
|
|
|
|
|
typedef struct _resinDvdSrc resinDvdSrc;
|
|
|
|
typedef struct _resinDvdSrcClass resinDvdSrcClass;
|
|
|
|
|
|
|
|
struct _resinDvdSrc
|
|
|
|
{
|
2009-11-01 18:21:38 +00:00
|
|
|
RsnBaseSrc parent;
|
2008-06-17 01:08:14 +00:00
|
|
|
|
2009-03-24 01:02:28 +00:00
|
|
|
gboolean faststart;
|
|
|
|
|
2008-06-17 01:08:14 +00:00
|
|
|
GMutex *dvd_lock;
|
|
|
|
GCond *still_cond;
|
|
|
|
GMutex *branch_lock;
|
|
|
|
gboolean branching;
|
|
|
|
|
|
|
|
gchar *device;
|
|
|
|
dvdnav_t *dvdnav;
|
|
|
|
|
2009-05-06 20:19:13 +00:00
|
|
|
const char *disc_name;
|
|
|
|
|
2008-06-17 01:08:14 +00:00
|
|
|
/* dvd_reader instance is used to load and cache VTS/VMG ifo info */
|
|
|
|
dvd_reader_t *dvdread;
|
|
|
|
|
|
|
|
/* vmgi_mat_t from the VMG ifo: */
|
|
|
|
vmgi_mat_t vmgm_attr; /* VMGM domain info */
|
|
|
|
/* Array of cached vtsi_mat_t strctures from each IFO: */
|
|
|
|
GArray *vts_attrs;
|
|
|
|
|
|
|
|
ifo_handle_t *vmg_file;
|
|
|
|
ifo_handle_t *vts_file;
|
|
|
|
|
|
|
|
/* Current playback location: VTS 0 = VMG, plus in_menu or not */
|
|
|
|
gint vts_n;
|
|
|
|
gboolean in_menu;
|
2009-05-06 20:19:13 +00:00
|
|
|
gint title_n; /* Title num */
|
|
|
|
gint part_n; /* Part num */
|
2009-05-08 13:20:32 +00:00
|
|
|
gint n_angles; /* number of angles */
|
|
|
|
gint cur_angle; /* current angle */
|
2008-06-17 01:08:14 +00:00
|
|
|
|
|
|
|
gboolean running;
|
|
|
|
gboolean discont;
|
2009-01-08 12:42:18 +00:00
|
|
|
gboolean first_seek;
|
2008-06-20 13:07:56 +00:00
|
|
|
gboolean flushing_seek;
|
2008-06-17 01:08:14 +00:00
|
|
|
gboolean need_segment;
|
|
|
|
gboolean active_highlight;
|
2008-07-11 14:06:08 +00:00
|
|
|
gboolean in_still_state;
|
2008-10-30 13:38:19 +00:00
|
|
|
gboolean in_playing;
|
2008-06-17 01:08:14 +00:00
|
|
|
|
2009-04-01 01:23:20 +00:00
|
|
|
gboolean was_mouse_over;
|
|
|
|
|
2009-05-11 13:17:42 +00:00
|
|
|
/* Remaining time to wait in a timed still: */
|
|
|
|
GstClockTime still_time_remaining;
|
|
|
|
|
2008-06-17 01:08:14 +00:00
|
|
|
GstBuffer *alloc_buf;
|
|
|
|
GstBuffer *next_buf;
|
2008-06-20 13:07:56 +00:00
|
|
|
/* TRUE if the next_buf is a nav block that needs enqueueing */
|
|
|
|
gboolean next_is_nav_block;
|
|
|
|
/* PTS for activating the pending nav block in next_buf */
|
|
|
|
GstClockTime next_nav_ts;
|
|
|
|
/* Track accumulated segment position, cleared by flushing */
|
|
|
|
GstSegment src_segment;
|
2008-06-17 01:08:14 +00:00
|
|
|
|
|
|
|
/* Start timestamp of the previous NAV block */
|
|
|
|
GstClockTime cur_start_ts;
|
|
|
|
/* End timestamp of the previous NAV block */
|
|
|
|
GstClockTime cur_end_ts;
|
2008-06-20 13:07:56 +00:00
|
|
|
/* base ts is cur_start_ts - cell_time for each VOBU */
|
|
|
|
GstClockTime cur_vobu_base_ts;
|
2008-06-17 01:08:14 +00:00
|
|
|
/* Position info of the previous NAV block */
|
|
|
|
GstClockTime cur_position;
|
|
|
|
/* Duration of the current PGC */
|
|
|
|
GstClockTime pgc_duration;
|
|
|
|
|
|
|
|
gint active_button;
|
|
|
|
dvdnav_highlight_area_t area;
|
|
|
|
|
|
|
|
/* Pending events to output */
|
|
|
|
GstEvent *streams_event;
|
|
|
|
GstEvent *clut_event;
|
|
|
|
GstEvent *spu_select_event;
|
|
|
|
GstEvent *audio_select_event;
|
|
|
|
GstEvent *highlight_event;
|
2008-06-20 13:07:56 +00:00
|
|
|
|
2009-05-05 12:14:47 +00:00
|
|
|
gboolean angles_changed;
|
2009-05-08 09:43:27 +00:00
|
|
|
gboolean commands_changed;
|
2009-05-05 12:14:47 +00:00
|
|
|
|
2008-06-20 13:07:56 +00:00
|
|
|
/* GList of NAV packets awaiting activation, and the
|
|
|
|
* running times to activate them. */
|
|
|
|
GSList *pending_nav_blocks;
|
|
|
|
GSList *pending_nav_blocks_end;
|
|
|
|
|
|
|
|
GstClockID nav_clock_id;
|
|
|
|
|
|
|
|
gboolean have_pci;
|
|
|
|
pci_t cur_pci;
|
2008-07-11 14:06:08 +00:00
|
|
|
|
|
|
|
/* Current state tracking */
|
|
|
|
gint8 cur_audio_phys_stream;
|
|
|
|
gint8 cur_spu_phys_stream;
|
|
|
|
gboolean cur_spu_forced_only;
|
|
|
|
guint32 cur_clut[16];
|
2009-05-12 22:42:00 +00:00
|
|
|
|
|
|
|
guint32 cur_btn_mask;
|
2008-06-17 01:08:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _resinDvdSrcClass
|
|
|
|
{
|
2009-11-01 18:21:38 +00:00
|
|
|
RsnBaseSrcClass parent_class;
|
2008-06-17 01:08:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
GType rsn_dvdsrc_get_type (void);
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __RESINDVDSRC_H__ */
|