gst-gmyth/mythsrc/gstmythtvsrc.h
author renatofilho
Wed May 16 23:53:02 2007 +0100 (2007-05-16)
branchtrunk
changeset 679 c9757033ccc6
child 751 3cf3c6019e3b
permissions -rwxr-xr-x
[svn r685] fixed destructor
     1 /* GStreamer
     2  * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
     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., 59 Temple Place - Suite 330,
    17  * Boston, MA 02111-1307, USA.
    18  */
    19 
    20 #ifndef __GST_MYTHTV_SRC_H__
    21 #define __GST_MYTHTV_SRC_H__
    22 
    23 #include <gst/gst.h>
    24 #include <gst/base/gstbasesrc.h>
    25 #include <gst/base/gstpushsrc.h>
    26 #include <stdio.h>
    27 
    28 #include <gmyth/gmyth_socket.h>
    29 #include <gmyth/gmyth_file.h>
    30 #include <gmyth/gmyth_file_transfer.h>
    31 #include <gmyth/gmyth_file_local.h>
    32 #include <gmyth/gmyth_livetv.h>
    33 #include <gmyth/gmyth_backendinfo.h>
    34 
    35 G_BEGIN_DECLS
    36 
    37 #define GST_TYPE_MYTHTV_SRC \
    38   (gst_mythtv_src_get_type())
    39 #define GST_MYTHTV_SRC(obj) \
    40   (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
    41 #define GST_MYTHTV_SRC_CLASS(klass) \
    42   (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
    43 #define GST_IS_MYTHTV_SRC(obj) \
    44   (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
    45 #define GST_IS_MYTHTV_SRC_CLASS(klass) \
    46   (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
    47 
    48 typedef struct _GstMythtvSrc GstMythtvSrc;
    49 typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
    50 
    51 typedef enum { 
    52   GST_MYTHTV_SRC_FILE_TRANSFER,
    53   GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
    54   GST_MYTHTV_SRC_INVALID_DATA
    55 } GstMythtvState;
    56 
    57 struct _GstMythtvSrc {
    58   GstPushSrc element;
    59 
    60   /* MythFileTransfer */
    61   GMythFile *file;
    62 
    63   GMythLiveTV *spawn_livetv;
    64   
    65   GMythBackendInfo *backend_info;
    66 
    67   GstMythtvState state;
    68 
    69   gchar *uri_name;
    70   gchar *user_agent;
    71 
    72   gchar *live_chain_id;
    73 
    74   gint mythtv_version;
    75 
    76   gint64 content_size;
    77 
    78   gint64 prev_content_size;
    79 
    80   gint64 content_size_last;
    81 
    82   guint64 bytes_read;
    83 
    84   gint64 read_offset;
    85 
    86   gint buffer_remain;
    87 
    88   gboolean eos;
    89 
    90   gboolean do_start;
    91 
    92   gboolean unique_setup;
    93 
    94   gboolean live_tv;
    95 
    96   gboolean enable_timing_position;
    97 
    98   gint live_tv_id;
    99 
   100   gchar* channel_name;  
   101 
   102   guint mode;
   103 
   104   /* MythTV capabilities */
   105   GstCaps *mythtv_caps;
   106 
   107   GByteArray *bytes_queue;
   108 
   109 #ifndef GST_DISABLE_GST_DEBUG
   110   /* enable Myth TV debug messages */
   111   gboolean mythtv_msgs_dbg;
   112 #endif
   113 
   114   gboolean update_prog_chain;
   115 
   116   /* stablish a maximum iteration value to the IS_RECORDING message */
   117   guint wait_to_transfer;
   118 
   119   /* max try number to get freerecorder */
   120   gint max_try;
   121   gint try_number;
   122 
   123 };
   124 
   125 struct _GstMythtvSrcClass {
   126   GstPushSrcClass parent_class;
   127 };
   128 
   129 GType gst_mythtv_src_get_type (void);
   130 
   131 G_END_DECLS
   132 
   133 #endif /* __GST_MYTHTV_SRC_H__ */