• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* GStreamer
2  * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
3  *
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.
8  *
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.
13  *
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.
18  */
19 
20 
21 #ifndef __GST_DVDEMUX_H__
22 #define __GST_DVDEMUX_H__
23 
24 #include <gst/gst.h>
25 #include <libdv/dv.h>
26 #include <gst/base/gstadapter.h>
27 
28 G_BEGIN_DECLS
29 
30 #define GST_TYPE_DVDEMUX (gst_dvdemux_get_type())
31 G_DECLARE_FINAL_TYPE (GstDVDemux, gst_dvdemux, GST, DVDEMUX, GstElement)
32 
33 typedef gboolean (*GstDVDemuxSeekHandler) (GstDVDemux *demux, GstPad * pad, GstEvent * event);
34 
35 struct _GstDVDemux {
36   GstElement     element;
37 
38   GstPad        *sinkpad;
39   GstPad        *videosrcpad;
40   GstPad        *audiosrcpad;
41 
42   gboolean       have_group_id;
43   guint          group_id;
44 
45   dv_decoder_t  *decoder;
46 
47   GstAdapter    *adapter;
48   gint           frame_len;
49 
50   /* video params */
51   gint           framerate_numerator;
52   gint           framerate_denominator;
53   gint           height;
54   gboolean       wide;
55   /* audio params */
56   gint           frequency;
57   gint           channels;
58 
59   gboolean       discont;
60   gint64         frame_offset;
61   gint64         audio_offset;
62   gint64         video_offset;
63 
64   GstDVDemuxSeekHandler seek_handler;
65   GstSegment     byte_segment;
66   gboolean       upstream_time_segment;
67   GstSegment     time_segment;
68   gboolean       need_segment;
69   guint32        segment_seqnum;
70   gboolean       new_media;
71   int            frames_since_new_media;
72 
73   gint           found_header; /* ATOMIC */
74   GstEvent      *seek_event;
75   GstEvent	*pending_segment;
76   GstEvent      *tag_event;
77 
78   gint16        *audio_buffers[4];
79 };
80 
81 G_END_DECLS
82 
83 #endif /* __GST_DVDEMUX_H__ */
84