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