maemo-ui-old/src/mmyth_tvplayer.h
author melunko
Fri Oct 26 22:09:47 2007 +0100 (2007-10-26)
branchtrunk
changeset 875 db0d117be7d5
parent 754 cb885ee44618
permissions -rw-r--r--
[svn r881] gmyth-dbus debian/control updated to gmyth 0.4.1
     1 /**
     2  * GMyth Library
     3  *
     4  * @file gmyth/mmyth_tvplayer.h
     5  * 
     6  * @brief <p> This component provides playback of the remote A/V using
     7  * GStreamer.
     8  * 
     9  * Copyright (C) 2006 INdT - Instituto Nokia de Tecnologia.
    10  * @author Hallyson Luiz de Morais Melo <hallyson.melo@indt.org.br>
    11  *
    12     *//*
    13     * 
    14     * This program is free software; you can redistribute it and/or modify
    15     * it under the terms of the GNU Lesser General Public License as published by
    16     * the Free Software Foundation; either version 2 of the License, or
    17     * (at your option) any later version.
    18     *
    19     * This program is distributed in the hope that it will be useful,
    20     * but WITHOUT ANY WARRANTY; without even the implied warranty of
    21     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    22     * GNU General Public License for more details.
    23     *
    24     * You should have received a copy of the GNU Lesser General Public License
    25     * along with this program; if not, write to the Free Software
    26     * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    27     */
    28 
    29 #ifndef MMYTH_TVPLAYER_H_
    30 #define MMYTH_TVPLAYER_H_
    31 
    32 #include <glib-object.h>
    33 #include <gtk/gtk.h>
    34 
    35 /*
    36  * GStreamer includes 
    37  */
    38 #include <gst/gst.h>
    39 #include <gst/interfaces/xoverlay.h>
    40 
    41 #include <gmyth/gmyth_recorder.h>
    42 #include <gmyth/gmyth_tvchain.h>
    43 #include <gmyth/gmyth_common.h>
    44 #include <gmyth/gmyth_livetv.h>
    45 
    46 G_BEGIN_DECLS
    47 #define MMYTH_TVPLAYER_TYPE               (mmyth_tvplayer_get_type ())
    48 #define MMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayer))
    49 #define MMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
    50 #define IS_MMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE))
    51 #define IS_MMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE))
    52 #define MMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
    53 typedef struct _MMythTVPlayer MMythTVPlayer;
    54 typedef struct _MMythTVPlayerClass MMythTVPlayerClass;
    55 
    56 struct _MMythTVPlayerClass {
    57     GObjectClass    parent_class;
    58 
    59     /*
    60      * callbacks 
    61      */
    62     /*
    63      * no one for now 
    64      */
    65 };
    66 
    67 struct _MMythTVPlayer {
    68     GObject         parent;
    69 
    70     GstElement     *gst_pipeline;
    71     GstElement     *gst_source;
    72     GstElement     *gst_videodec;
    73     GstElement     *gst_videosink;
    74     GstElement     *gst_videocolortrs;
    75     GstElement     *videoqueue1;
    76     GstElement     *videoqueue2;
    77     GstElement     *audioqueue1;
    78     GstElement     *audioqueue2;
    79 
    80     gulong          expose_handler;
    81     // GMainLoop *loop;
    82 
    83     GtkWidget      *videow;
    84 
    85     /*
    86      * Backend connection related variables 
    87      */
    88     GString        *backend_hostname;
    89     gint            backend_port;
    90     GString        *local_hostname;
    91 
    92     GMythRecorder  *recorder;
    93     GMythTVChain   *tvchain;
    94     GMythProgramInfo *proginfo;
    95     GMythLiveTV    *livetv;
    96 
    97     GMythBackendInfo *backend_info;
    98 
    99     gboolean        is_livetv;
   100 };
   101 
   102 
   103 GType           mmyth_tvplayer_get_type(void);
   104 
   105 MMythTVPlayer  *mmyth_tvplayer_new();
   106 gboolean        mmyth_tvplayer_initialize(MMythTVPlayer * tvplayer,
   107                                           GMythBackendInfo * backend_info);
   108 
   109 void            mmyth_tvplayer_start_playing(MMythTVPlayer * tvplayer);
   110 void            mmyth_tvplayer_stop_playing(MMythTVPlayer * tvplayer);
   111 
   112 gboolean        mmyth_tvplayer_set_widget(MMythTVPlayer * tvplayer,
   113                                           GtkWidget * videow);
   114 
   115 gboolean        mmyth_tvplayer_is_playing(MMythTVPlayer * tvplayer);
   116 
   117 gboolean        mmyth_tvplayer_record_setup(MMythTVPlayer * tvplayer,
   118                                             const gchar * filename);
   119 gboolean        mmyth_tvplayer_livetv_setup(MMythTVPlayer * tvplayer);
   120 
   121 G_END_DECLS
   122 #endif                          /* MMYTH_TVPLAYER_H_ */