gst-plugins-mythtv/src/gstmythtvsrc.h
author morphbr
Thu Apr 12 23:17:33 2007 +0100 (2007-04-12)
branchtrunk
changeset 542 0c3e3011a942
parent 528 4a604de8eaf5
child 546 992abe7045a2
permissions -rwxr-xr-x
[svn r547] Debug messages for GMyth-Streamer
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@528
    29
#include <gmyth/gmyth_file.h>
rosfran@52
    30
#include <gmyth/gmyth_file_transfer.h>
rosfran@528
    31
#include <gmyth/gmyth_file_local.h>
rosfran@52
    32
#include <gmyth/gmyth_livetv.h>
rosfran@118
    33
#include <gmyth/gmyth_backendinfo.h>
leo_sobral@2
    34
leo_sobral@2
    35
G_BEGIN_DECLS
leo_sobral@2
    36
leo_sobral@2
    37
#define GST_TYPE_MYTHTV_SRC \
leo_sobral@2
    38
  (gst_mythtv_src_get_type())
leo_sobral@2
    39
#define GST_MYTHTV_SRC(obj) \
leo_sobral@2
    40
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
leo_sobral@2
    41
#define GST_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    42
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
leo_sobral@2
    43
#define GST_IS_MYTHTV_SRC(obj) \
leo_sobral@2
    44
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    45
#define GST_IS_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    46
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    47
leo_sobral@2
    48
typedef struct _GstMythtvSrc GstMythtvSrc;
leo_sobral@2
    49
typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
leo_sobral@2
    50
rosfran@81
    51
typedef enum { 
rosfran@70
    52
  GST_MYTHTV_SRC_FILE_TRANSFER,
rosfran@70
    53
  GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
rosfran@70
    54
  GST_MYTHTV_SRC_INVALID_DATA
rosfran@70
    55
} GstMythtvState;
rosfran@70
    56
leo_sobral@2
    57
struct _GstMythtvSrc {
rosfran@100
    58
  GstPushSrc element;
leo_sobral@2
    59
leo_sobral@2
    60
  /* MythFileTransfer */
rosfran@531
    61
  GMythFileTransfer *file_transfer;
leo_sobral@2
    62
rosfran@40
    63
  GMythLiveTV *spawn_livetv;
rosfran@118
    64
  
rosfran@118
    65
  GMythBackendInfo *backend_info;
rosfran@90
    66
rosfran@70
    67
  GstMythtvState state;
leo_sobral@2
    68
leo_sobral@2
    69
  gchar *uri_name;
leo_sobral@2
    70
  gchar *user_agent;
leo_sobral@2
    71
leo_sobral@2
    72
  gchar *live_chain_id;
rosfran@90
    73
leo_sobral@2
    74
  gint mythtv_version;
leo_sobral@2
    75
rosfran@52
    76
  gint64 content_size;
leo_sobral@2
    77
rosfran@63
    78
  gint64 prev_content_size;
rosfran@63
    79
rosfran@61
    80
  gint64 content_size_last;
rosfran@61
    81
leo_sobral@2
    82
  guint64 bytes_read;
leo_sobral@2
    83
rosfran@52
    84
  gint64 read_offset;
leo_sobral@2
    85
rosfran@90
    86
  gint buffer_remain;
rosfran@90
    87
leo_sobral@2
    88
  gboolean eos;
rosfran@90
    89
leo_sobral@2
    90
  gboolean do_start;
leo_sobral@2
    91
leo_sobral@2
    92
  gboolean unique_setup;
leo_sobral@2
    93
leo_sobral@2
    94
  gboolean live_tv;
rosfran@90
    95
rosfran@52
    96
  gboolean enable_timing_position;
leo_sobral@2
    97
leo_sobral@2
    98
  gint live_tv_id;
rosfran@90
    99
rosfran@308
   100
  gchar* channel_name;  
rosfran@90
   101
rosfran@70
   102
  guint mode;
leo_sobral@2
   103
leo_sobral@2
   104
  /* MythTV capabilities */
leo_sobral@2
   105
  GstCaps *mythtv_caps;
rosfran@90
   106
rosfran@98
   107
  GByteArray *bytes_queue;
leo_sobral@2
   108
rosfran@289
   109
#ifndef GST_DISABLE_GST_DEBUG
leo_sobral@2
   110
  /* enable Myth TV debug messages */
leo_sobral@2
   111
  gboolean mythtv_msgs_dbg;
rosfran@289
   112
#endif
rosfran@40
   113
rosfran@40
   114
  gboolean update_prog_chain;
rosfran@289
   115
rosfran@289
   116
	/* stablish a maximum iteration value to the IS_RECORDING message */
rosfran@289
   117
	guint wait_to_transfer;
rosfran@289
   118
leo_sobral@2
   119
};
leo_sobral@2
   120
leo_sobral@2
   121
struct _GstMythtvSrcClass {
rosfran@100
   122
  GstPushSrcClass parent_class;
leo_sobral@2
   123
};
leo_sobral@2
   124
leo_sobral@2
   125
GType gst_mythtv_src_get_type (void);
leo_sobral@2
   126
leo_sobral@2
   127
G_END_DECLS
leo_sobral@2
   128
leo_sobral@2
   129
#endif /* __GST_MYTHTV_SRC_H__ */