leo_sobral@2: /* GStreamer
leo_sobral@2:  * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
leo_sobral@2:  *
leo_sobral@2:  * This library is free software; you can redistribute it and/or
leo_sobral@2:  * modify it under the terms of the GNU Library General Public
leo_sobral@2:  * License as published by the Free Software Foundation; either
leo_sobral@2:  * version 2 of the License, or (at your option) any later version.
leo_sobral@2:  *
leo_sobral@2:  * This library is distributed in the hope that it will be useful,
leo_sobral@2:  * but WITHOUT ANY WARRANTY; without even the implied warranty of
leo_sobral@2:  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rosfran@289:  * Library General Public License for more details.
rosfran@289:  *
rosfran@289:  * You should have received a copy of the GNU Library General Public
rosfran@289:  * License along with this library; if not, write to the
rosfran@289:  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rosfran@289:  * Boston, MA 02111-1307, USA.
leo_sobral@2:  */
leo_sobral@2: 
leo_sobral@2: #ifndef __GST_MYTHTV_SRC_H__
leo_sobral@2: #define __GST_MYTHTV_SRC_H__
leo_sobral@2: 
leo_sobral@2: #include <gst/gst.h>
rosfran@98: #include <gst/base/gstbasesrc.h>
rosfran@100: #include <gst/base/gstpushsrc.h>
leo_sobral@2: #include <stdio.h>
leo_sobral@2: 
leo_sobral@2: #include <gmyth/gmyth_socket.h>
rosfran@52: #include <gmyth/gmyth_file_transfer.h>
rosfran@52: #include <gmyth/gmyth_livetv.h>
rosfran@118: #include <gmyth/gmyth_backendinfo.h>
leo_sobral@2: 
leo_sobral@2: G_BEGIN_DECLS
leo_sobral@2: 
leo_sobral@2: #define GST_TYPE_MYTHTV_SRC \
leo_sobral@2:   (gst_mythtv_src_get_type())
leo_sobral@2: #define GST_MYTHTV_SRC(obj) \
leo_sobral@2:   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
leo_sobral@2: #define GST_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2:   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
leo_sobral@2: #define GST_IS_MYTHTV_SRC(obj) \
leo_sobral@2:   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
leo_sobral@2: #define GST_IS_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2:   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
leo_sobral@2: 
leo_sobral@2: typedef struct _GstMythtvSrc GstMythtvSrc;
leo_sobral@2: typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
leo_sobral@2: 
rosfran@81: typedef enum { 
rosfran@70:   GST_MYTHTV_SRC_FILE_TRANSFER,
rosfran@70:   GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
rosfran@70:   GST_MYTHTV_SRC_INVALID_DATA
rosfran@70: } GstMythtvState;
rosfran@70: 
leo_sobral@2: struct _GstMythtvSrc {
rosfran@100:   GstPushSrc element;
leo_sobral@2: 
leo_sobral@2:   /* MythFileTransfer */
rosfran@40:   GMythFileTransfer *file_transfer;
leo_sobral@2: 
rosfran@40:   GMythLiveTV *spawn_livetv;
rosfran@118:   
rosfran@118:   GMythBackendInfo *backend_info;
rosfran@90: 
rosfran@70:   GstMythtvState state;
leo_sobral@2: 
leo_sobral@2:   gchar *uri_name;
leo_sobral@2:   gchar *user_agent;
leo_sobral@2: 
leo_sobral@2:   gchar *live_chain_id;
rosfran@90: 
leo_sobral@2:   gint mythtv_version;
leo_sobral@2: 
rosfran@52:   gint64 content_size;
leo_sobral@2: 
rosfran@63:   gint64 prev_content_size;
rosfran@63: 
rosfran@61:   gint64 content_size_last;
rosfran@61: 
leo_sobral@2:   guint64 bytes_read;
leo_sobral@2: 
rosfran@52:   gint64 read_offset;
leo_sobral@2: 
rosfran@90:   gint buffer_remain;
rosfran@90: 
leo_sobral@2:   gboolean eos;
rosfran@90: 
leo_sobral@2:   gboolean do_start;
leo_sobral@2: 
leo_sobral@2:   gboolean unique_setup;
leo_sobral@2: 
leo_sobral@2:   gboolean live_tv;
rosfran@90: 
rosfran@52:   gboolean enable_timing_position;
leo_sobral@2: 
leo_sobral@2:   gint live_tv_id;
rosfran@90: 
rosfran@308:   gchar* channel_name;  
rosfran@90: 
rosfran@70:   guint mode;
leo_sobral@2: 
leo_sobral@2:   /* MythTV capabilities */
leo_sobral@2:   GstCaps *mythtv_caps;
rosfran@90: 
rosfran@98:   GByteArray *bytes_queue;
leo_sobral@2: 
rosfran@289: #ifndef GST_DISABLE_GST_DEBUG
leo_sobral@2:   /* enable Myth TV debug messages */
leo_sobral@2:   gboolean mythtv_msgs_dbg;
rosfran@289: #endif
rosfran@40: 
rosfran@40:   gboolean update_prog_chain;
rosfran@289: 
rosfran@289: 	/* stablish a maximum iteration value to the IS_RECORDING message */
rosfran@289: 	guint wait_to_transfer;
rosfran@289: 
leo_sobral@2: };
leo_sobral@2: 
leo_sobral@2: struct _GstMythtvSrcClass {
rosfran@100:   GstPushSrcClass parent_class;
leo_sobral@2: };
leo_sobral@2: 
leo_sobral@2: GType gst_mythtv_src_get_type (void);
leo_sobral@2: 
leo_sobral@2: G_END_DECLS
leo_sobral@2: 
leo_sobral@2: #endif /* __GST_MYTHTV_SRC_H__ */