gst-plugins-mythtv/src/gstmythtvsrc.h
author rosfran
Fri Nov 17 15:20:28 2006 +0000 (2006-11-17)
branchtrunk
changeset 93 ae73b4837eed
parent 81 56e39289fa96
child 95 51d013028674
permissions -rwxr-xr-x
[svn r94] Changed to use GstAdapter, instead of using the guint pointer.
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>
leo_sobral@2
    20
#include <gst/base/gstpushsrc.h>
rosfran@70
    21
#include <gst/base/gstadapter.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>
leo_sobral@2
    27
leo_sobral@2
    28
G_BEGIN_DECLS
leo_sobral@2
    29
leo_sobral@2
    30
#define GST_TYPE_MYTHTV_SRC \
leo_sobral@2
    31
  (gst_mythtv_src_get_type())
leo_sobral@2
    32
#define GST_MYTHTV_SRC(obj) \
leo_sobral@2
    33
  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
leo_sobral@2
    34
#define GST_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    35
  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
leo_sobral@2
    36
#define GST_IS_MYTHTV_SRC(obj) \
leo_sobral@2
    37
  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    38
#define GST_IS_MYTHTV_SRC_CLASS(klass) \
leo_sobral@2
    39
  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
leo_sobral@2
    40
leo_sobral@2
    41
typedef struct _GstMythtvSrc GstMythtvSrc;
leo_sobral@2
    42
typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
leo_sobral@2
    43
rosfran@81
    44
typedef enum { 
rosfran@70
    45
  GST_MYTHTV_SRC_FILE_TRANSFER,
rosfran@70
    46
  GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
rosfran@70
    47
  GST_MYTHTV_SRC_INVALID_DATA
rosfran@70
    48
} GstMythtvState;
rosfran@70
    49
leo_sobral@2
    50
struct _GstMythtvSrc {
rosfran@81
    51
  GstPushSrc element;
leo_sobral@2
    52
leo_sobral@2
    53
  /* MythFileTransfer */
rosfran@40
    54
  GMythFileTransfer *file_transfer;
leo_sobral@2
    55
rosfran@40
    56
  GMythLiveTV *spawn_livetv;
rosfran@90
    57
rosfran@70
    58
  GstMythtvState state;
leo_sobral@2
    59
leo_sobral@2
    60
  gchar *uri_name;
leo_sobral@2
    61
  gchar *user_agent;
leo_sobral@2
    62
leo_sobral@2
    63
  gchar *live_chain_id;
rosfran@90
    64
leo_sobral@2
    65
  gint mythtv_version;
leo_sobral@2
    66
rosfran@52
    67
  gint64 content_size;
leo_sobral@2
    68
rosfran@63
    69
  gint64 prev_content_size;
rosfran@63
    70
rosfran@61
    71
  gint64 content_size_last;
rosfran@61
    72
leo_sobral@2
    73
  guint64 bytes_read;
leo_sobral@2
    74
rosfran@52
    75
  gint64 read_offset;
rosfran@81
    76
  gint64 adapter_offset;
leo_sobral@2
    77
rosfran@90
    78
  //guint64 file_size;
rosfran@90
    79
  /* added by melunko */
rosfran@90
    80
  guint8* buffer;
rosfran@90
    81
rosfran@90
    82
  gint buffer_offset;
rosfran@90
    83
  gint buffer_remain;
rosfran@90
    84
leo_sobral@2
    85
  gboolean eos;
rosfran@90
    86
leo_sobral@2
    87
  gboolean do_start;
leo_sobral@2
    88
leo_sobral@2
    89
  gboolean unique_setup;
leo_sobral@2
    90
leo_sobral@2
    91
  gboolean live_tv;
rosfran@90
    92
rosfran@52
    93
  gboolean enable_timing_position;
leo_sobral@2
    94
leo_sobral@2
    95
  gint live_tv_id;
rosfran@90
    96
rosfran@81
    97
  gint channel_num;  
rosfran@90
    98
rosfran@70
    99
  guint mode;
leo_sobral@2
   100
leo_sobral@2
   101
  /* MythTV capabilities */
leo_sobral@2
   102
  GstCaps *mythtv_caps;
rosfran@90
   103
rosfran@70
   104
  GstPad *sinkpad;
rosfran@70
   105
  GstPad *srcpad;
rosfran@90
   106
rosfran@81
   107
  GstTask *th_read_ahead;
rosfran@90
   108
rosfran@90
   109
  GStaticRecMutex *th_mutex;
rosfran@90
   110
rosfran@70
   111
  GstAdapter *adapter;
leo_sobral@2
   112
leo_sobral@2
   113
  /* enable Myth TV debug messages */
leo_sobral@2
   114
  gboolean mythtv_msgs_dbg;
rosfran@40
   115
rosfran@40
   116
  gboolean update_prog_chain;
leo_sobral@2
   117
};
leo_sobral@2
   118
leo_sobral@2
   119
struct _GstMythtvSrcClass {
rosfran@81
   120
  GstPushSrcClass parent_class;
leo_sobral@2
   121
};
leo_sobral@2
   122
leo_sobral@2
   123
GType gst_mythtv_src_get_type (void);
leo_sobral@2
   124
leo_sobral@2
   125
G_END_DECLS
leo_sobral@2
   126
leo_sobral@2
   127
#endif /* __GST_MYTHTV_SRC_H__ */