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