gst-plugins-mythtv/src/gstmythtvsrc.h
author rosfran
Tue Nov 07 22:53:53 2006 +0000 (2006-11-07)
branchtrunk
changeset 71 55c7f31b85aa
parent 63 957b55b3f630
child 81 56e39289fa96
permissions -rwxr-xr-x
[svn r72] Added some LiveTV performance optimizations.
     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 
    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   GstBaseSrc element;
    53 
    54   /* MythFileTransfer */
    55   GMythFileTransfer *file_transfer;
    56 
    57   GMythLiveTV *spawn_livetv;
    58   
    59   GstMythtvState state;
    60 
    61   gchar *uri_name;
    62   gchar *user_agent;
    63 
    64   gchar *live_chain_id;
    65   
    66   gint mythtv_version;
    67 
    68   gint64 content_size;
    69 
    70   gint64 prev_content_size;
    71 
    72   gint64 content_size_last;
    73 
    74   guint64 bytes_read;
    75 
    76   gint64 read_offset;
    77   gint64 old_offset;
    78 
    79   gboolean eos;
    80   
    81   gboolean do_start;
    82 
    83   gboolean unique_setup;
    84 
    85   gboolean live_tv;
    86   
    87   gboolean enable_timing_position;
    88 
    89   gint live_tv_id;
    90   
    91   gint channel_num;
    92   
    93   guint mode;
    94 
    95   /* MythTV capabilities */
    96   GstCaps *mythtv_caps;
    97   
    98   GstPad *sinkpad;
    99   GstPad *srcpad;
   100   
   101   GstAdapter *adapter;
   102 
   103   /* enable Myth TV debug messages */
   104   gboolean mythtv_msgs_dbg;
   105 
   106   gboolean update_prog_chain;
   107 };
   108 
   109 struct _GstMythtvSrcClass {
   110   GstBaseSrcClass parent_class;
   111 };
   112 
   113 GType gst_mythtv_src_get_type (void);
   114 
   115 G_END_DECLS
   116 
   117 #endif /* __GST_MYTHTV_SRC_H__ */