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