gst-plugins-mythtv/src/gstmythtvsrc.h
author melunko
Tue Jan 30 22:27:59 2007 +0000 (2007-01-30)
branchtrunk
changeset 316 43dc23e931b6
parent 289 fdac5773d2a6
child 371 ea8b127de178
permissions -rwxr-xr-x
[svn r317] Fixed program info to string conversion bug
leo_sobral@2
     1
/* GStreamer
leo_sobral@2
     2
 * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
leo_sobral@2
     3
 *
leo_sobral@2
     4
 * This library is free software; you can redistribute it and/or
leo_sobral@2
     5
 * modify it under the terms of the GNU Library General Public
leo_sobral@2
     6
 * License as published by the Free Software Foundation; either
leo_sobral@2
     7
 * version 2 of the License, or (at your option) any later version.
leo_sobral@2
     8
 *
leo_sobral@2
     9
 * This library is distributed in the hope that it will be useful,
leo_sobral@2
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
leo_sobral@2
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
rosfran@289
    12
 * Library General Public License for more details.
rosfran@289
    13
 *
rosfran@289
    14
 * You should have received a copy of the GNU Library General Public
rosfran@289
    15
 * License along with this library; if not, write to the
rosfran@289
    16
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
rosfran@289
    17
 * Boston, MA 02111-1307, USA.
leo_sobral@2
    18
 */
leo_sobral@2
    19
leo_sobral@2
    20
#ifndef __GST_MYTHTV_SRC_H__
leo_sobral@2
    21
#define __GST_MYTHTV_SRC_H__
leo_sobral@2
    22
leo_sobral@2
    23
#include <gst/gst.h>
rosfran@98
    24
#include <gst/base/gstbasesrc.h>
rosfran@100
    25
#include <gst/base/gstpushsrc.h>
leo_sobral@2
    26
#include <stdio.h>
leo_sobral@2
    27
leo_sobral@2
    28
#include <gmyth/gmyth_socket.h>
rosfran@52
    29
#include <gmyth/gmyth_file_transfer.h>
rosfran@52
    30
#include <gmyth/gmyth_livetv.h>
rosfran@118
    31
#include <gmyth/gmyth_backendinfo.h>
leo_sobral@2
    32
leo_sobral@2
    33
G_BEGIN_DECLS
leo_sobral@2
    34
leo_sobral@2
    35
#define GST_TYPE_MYTHTV_SRC \
leo_sobral@2
    36
  (gst_mythtv_src_get_type())
leo_sobral@2
    37
#define GST_MYTHTV_SRC(obj) \
leo_sobral@2
    38
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
leo_sobral@2
    39
#define GST_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    40
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
leo_sobral@2
    41
#define GST_IS_MYTHTV_SRC(obj) \
leo_sobral@2
    42
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    43
#define GST_IS_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    44
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    45
leo_sobral@2
    46
typedef struct _GstMythtvSrc GstMythtvSrc;
leo_sobral@2
    47
typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
leo_sobral@2
    48
rosfran@81
    49
typedef enum { 
rosfran@70
    50
  GST_MYTHTV_SRC_FILE_TRANSFER,
rosfran@70
    51
  GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
rosfran@70
    52
  GST_MYTHTV_SRC_INVALID_DATA
rosfran@70
    53
} GstMythtvState;
rosfran@70
    54
leo_sobral@2
    55
struct _GstMythtvSrc {
rosfran@100
    56
  GstPushSrc element;
leo_sobral@2
    57
leo_sobral@2
    58
  /* MythFileTransfer */
rosfran@40
    59
  GMythFileTransfer *file_transfer;
leo_sobral@2
    60
rosfran@40
    61
  GMythLiveTV *spawn_livetv;
rosfran@118
    62
  
rosfran@118
    63
  GMythBackendInfo *backend_info;
rosfran@90
    64
rosfran@70
    65
  GstMythtvState state;
leo_sobral@2
    66
leo_sobral@2
    67
  gchar *uri_name;
leo_sobral@2
    68
  gchar *user_agent;
leo_sobral@2
    69
leo_sobral@2
    70
  gchar *live_chain_id;
rosfran@90
    71
leo_sobral@2
    72
  gint mythtv_version;
leo_sobral@2
    73
rosfran@52
    74
  gint64 content_size;
leo_sobral@2
    75
rosfran@63
    76
  gint64 prev_content_size;
rosfran@63
    77
rosfran@61
    78
  gint64 content_size_last;
rosfran@61
    79
leo_sobral@2
    80
  guint64 bytes_read;
leo_sobral@2
    81
rosfran@52
    82
  gint64 read_offset;
leo_sobral@2
    83
rosfran@90
    84
  gint buffer_remain;
rosfran@90
    85
leo_sobral@2
    86
  gboolean eos;
rosfran@90
    87
leo_sobral@2
    88
  gboolean do_start;
leo_sobral@2
    89
leo_sobral@2
    90
  gboolean unique_setup;
leo_sobral@2
    91
leo_sobral@2
    92
  gboolean live_tv;
rosfran@90
    93
rosfran@52
    94
  gboolean enable_timing_position;
leo_sobral@2
    95
leo_sobral@2
    96
  gint live_tv_id;
rosfran@90
    97
rosfran@308
    98
  gchar* channel_name;  
rosfran@90
    99
rosfran@70
   100
  guint mode;
leo_sobral@2
   101
leo_sobral@2
   102
  /* MythTV capabilities */
leo_sobral@2
   103
  GstCaps *mythtv_caps;
rosfran@90
   104
rosfran@70
   105
  GstPad *sinkpad;
rosfran@90
   106
rosfran@90
   107
  GStaticRecMutex *th_mutex;
rosfran@90
   108
rosfran@98
   109
  GByteArray *bytes_queue;
leo_sobral@2
   110
rosfran@289
   111
#ifndef GST_DISABLE_GST_DEBUG
leo_sobral@2
   112
  /* enable Myth TV debug messages */
leo_sobral@2
   113
  gboolean mythtv_msgs_dbg;
rosfran@289
   114
#endif
rosfran@40
   115
rosfran@40
   116
  gboolean update_prog_chain;
rosfran@289
   117
rosfran@289
   118
	/* stablish a maximum iteration value to the IS_RECORDING message */
rosfran@289
   119
	guint wait_to_transfer;
rosfran@289
   120
leo_sobral@2
   121
};
leo_sobral@2
   122
leo_sobral@2
   123
struct _GstMythtvSrcClass {
rosfran@100
   124
  GstPushSrcClass parent_class;
leo_sobral@2
   125
};
leo_sobral@2
   126
leo_sobral@2
   127
GType gst_mythtv_src_get_type (void);
leo_sobral@2
   128
leo_sobral@2
   129
G_END_DECLS
leo_sobral@2
   130
leo_sobral@2
   131
#endif /* __GST_MYTHTV_SRC_H__ */