gst-plugins-mythtv/src/gstmythtvsrc.h
author rosfran
Mon Jan 22 18:37:42 2007 +0000 (2007-01-22)
branchtrunk
changeset 288 44a72b1226eb
parent 118 1374c8f47f33
child 289 fdac5773d2a6
permissions -rwxr-xr-x
[svn r289] Added pause recording calls to gmyth_livetv; removed sleep calls from the MythTV plug-in, put it back to livetv_setup function call.
leo_sobral@2
     1
/* vim: set sw=2: -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2; c-indent-level: 2 -*- */
leo_sobral@2
     2
/* GStreamer
leo_sobral@2
     3
 * Copyright (C) <2006> Rosfran Borges <rosfran.borges@indt.org.br>
leo_sobral@2
     4
 *
leo_sobral@2
     5
 * This library is free software; you can redistribute it and/or
leo_sobral@2
     6
 * modify it under the terms of the GNU Library General Public
leo_sobral@2
     7
 * License as published by the Free Software Foundation; either
leo_sobral@2
     8
 * version 2 of the License, or (at your option) any later version.
leo_sobral@2
     9
 *
leo_sobral@2
    10
 * This library is distributed in the hope that it will be useful,
leo_sobral@2
    11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
leo_sobral@2
    12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
leo_sobral@2
    13
 * Library General Public License for more 
leo_sobral@2
    14
 */
leo_sobral@2
    15
leo_sobral@2
    16
#ifndef __GST_MYTHTV_SRC_H__
leo_sobral@2
    17
#define __GST_MYTHTV_SRC_H__
leo_sobral@2
    18
leo_sobral@2
    19
#include <gst/gst.h>
rosfran@98
    20
#include <gst/base/gstbasesrc.h>
rosfran@100
    21
#include <gst/base/gstpushsrc.h>
leo_sobral@2
    22
#include <stdio.h>
leo_sobral@2
    23
leo_sobral@2
    24
#include <gmyth/gmyth_socket.h>
rosfran@52
    25
#include <gmyth/gmyth_file_transfer.h>
rosfran@52
    26
#include <gmyth/gmyth_livetv.h>
rosfran@118
    27
#include <gmyth/gmyth_backendinfo.h>
leo_sobral@2
    28
leo_sobral@2
    29
G_BEGIN_DECLS
leo_sobral@2
    30
leo_sobral@2
    31
#define GST_TYPE_MYTHTV_SRC \
leo_sobral@2
    32
  (gst_mythtv_src_get_type())
leo_sobral@2
    33
#define GST_MYTHTV_SRC(obj) \
leo_sobral@2
    34
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
leo_sobral@2
    35
#define GST_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    36
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
leo_sobral@2
    37
#define GST_IS_MYTHTV_SRC(obj) \
leo_sobral@2
    38
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    39
#define GST_IS_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    40
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    41
leo_sobral@2
    42
typedef struct _GstMythtvSrc GstMythtvSrc;
leo_sobral@2
    43
typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
leo_sobral@2
    44
rosfran@81
    45
typedef enum { 
rosfran@70
    46
  GST_MYTHTV_SRC_FILE_TRANSFER,
rosfran@70
    47
  GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
rosfran@70
    48
  GST_MYTHTV_SRC_INVALID_DATA
rosfran@70
    49
} GstMythtvState;
rosfran@70
    50
leo_sobral@2
    51
struct _GstMythtvSrc {
rosfran@100
    52
  GstPushSrc element;
leo_sobral@2
    53
leo_sobral@2
    54
  /* MythFileTransfer */
rosfran@40
    55
  GMythFileTransfer *file_transfer;
leo_sobral@2
    56
rosfran@40
    57
  GMythLiveTV *spawn_livetv;
rosfran@118
    58
  
rosfran@118
    59
  GMythBackendInfo *backend_info;
rosfran@90
    60
rosfran@70
    61
  GstMythtvState state;
leo_sobral@2
    62
leo_sobral@2
    63
  gchar *uri_name;
leo_sobral@2
    64
  gchar *user_agent;
leo_sobral@2
    65
leo_sobral@2
    66
  gchar *live_chain_id;
rosfran@90
    67
leo_sobral@2
    68
  gint mythtv_version;
leo_sobral@2
    69
rosfran@52
    70
  gint64 content_size;
leo_sobral@2
    71
rosfran@63
    72
  gint64 prev_content_size;
rosfran@63
    73
rosfran@61
    74
  gint64 content_size_last;
rosfran@61
    75
leo_sobral@2
    76
  guint64 bytes_read;
leo_sobral@2
    77
rosfran@52
    78
  gint64 read_offset;
leo_sobral@2
    79
rosfran@95
    80
  /* added by melunko (buffer cache) */
rosfran@90
    81
  gint buffer_remain;
rosfran@90
    82
leo_sobral@2
    83
  gboolean eos;
rosfran@90
    84
leo_sobral@2
    85
  gboolean do_start;
leo_sobral@2
    86
leo_sobral@2
    87
  gboolean unique_setup;
leo_sobral@2
    88
leo_sobral@2
    89
  gboolean live_tv;
rosfran@90
    90
rosfran@52
    91
  gboolean enable_timing_position;
leo_sobral@2
    92
leo_sobral@2
    93
  gint live_tv_id;
rosfran@90
    94
rosfran@81
    95
  gint channel_num;  
rosfran@90
    96
rosfran@70
    97
  guint mode;
leo_sobral@2
    98
leo_sobral@2
    99
  /* MythTV capabilities */
leo_sobral@2
   100
  GstCaps *mythtv_caps;
rosfran@90
   101
rosfran@70
   102
  GstPad *sinkpad;
rosfran@90
   103
rosfran@90
   104
  GStaticRecMutex *th_mutex;
rosfran@90
   105
rosfran@98
   106
  GByteArray *bytes_queue;
leo_sobral@2
   107
leo_sobral@2
   108
  /* enable Myth TV debug messages */
leo_sobral@2
   109
  gboolean mythtv_msgs_dbg;
rosfran@40
   110
rosfran@40
   111
  gboolean update_prog_chain;
leo_sobral@2
   112
};
leo_sobral@2
   113
leo_sobral@2
   114
struct _GstMythtvSrcClass {
rosfran@100
   115
  GstPushSrcClass parent_class;
leo_sobral@2
   116
};
leo_sobral@2
   117
leo_sobral@2
   118
GType gst_mythtv_src_get_type (void);
leo_sobral@2
   119
leo_sobral@2
   120
G_END_DECLS
leo_sobral@2
   121
leo_sobral@2
   122
#endif /* __GST_MYTHTV_SRC_H__ */