maemo-ui/src/mmyth_tvplayer.h
author rosfran
Fri Nov 24 18:51:42 2006 +0000 (2006-11-24)
branchtrunk
changeset 110 ce35e2e839f4
parent 20 7174e23f7617
child 208 c3c073032757
permissions -rw-r--r--
[svn r111] Put the gmyth_livetv calls in the right place...
     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 /* GStreamer includes */
    36 #include <gst/gst.h>
    37 #include <gst/interfaces/xoverlay.h>
    38 
    39 #include "gmyth_recorder.h"
    40 #include "gmyth_tvchain.h"
    41 #include "gmyth_common.h"
    42 
    43 G_BEGIN_DECLS
    44 
    45 #define MMYTH_TVPLAYER_TYPE               (mmyth_tvplayer_get_type ())
    46 #define MMYTH_TVPLAYER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayer))
    47 #define MMYTH_TVPLAYER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
    48 #define IS_MMYTH_TVPLAYER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), MMYTH_TVPLAYER_TYPE))
    49 #define IS_MMYTH_TVPLAYER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), MMYTH_TVPLAYER_TYPE))
    50 #define MMYTH_TVPLAYER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), MMYTH_TVPLAYER_TYPE, MMythTVPlayerClass))
    51 
    52 
    53 typedef struct _MMythTVPlayer         MMythTVPlayer;
    54 typedef struct _MMythTVPlayerClass    MMythTVPlayerClass;
    55 
    56 struct _MMythTVPlayerClass
    57 {
    58     GObjectClass parent_class;
    59 
    60       /* callbacks */
    61       /*  no one for now */
    62 };
    63 
    64 struct _MMythTVPlayer
    65 {
    66     GObject parent;
    67     
    68     GstElement *gst_pipeline;
    69     GstElement *gst_source;
    70     GstElement *gst_videodec;
    71     GstElement *gst_videosink;
    72     GstElement *gst_videocolortrs; 
    73     GstElement *videoqueue1;
    74     GstElement *videoqueue2;
    75     GstElement *audioqueue1;
    76     GstElement *audioqueue2;
    77    
    78     gulong expose_handler;
    79 //    GMainLoop *loop;
    80     
    81     GtkWidget *videow;
    82 
    83 	/* Backend connection related variables */
    84 	GString *backend_hostname;
    85 	gint backend_port;
    86 	GString *local_hostname;
    87 
    88 	GMythRecorder *recorder;
    89 	GMythTVChain *tvchain;
    90 	GMythProgramInfo *proginfo;
    91 	
    92 	gboolean is_livetv;
    93 };
    94 
    95 
    96 GType          mmyth_tvplayer_get_type (void);
    97 
    98 MMythTVPlayer* mmyth_tvplayer_new ();
    99 gboolean       mmyth_tvplayer_initialize (MMythTVPlayer *tvplayer);
   100 
   101 void           mmyth_tvplayer_start_playing   (MMythTVPlayer *tvplayer);
   102 void           mmyth_tvplayer_stop_playing    (MMythTVPlayer *tvplayer);
   103 
   104 gboolean       mmyth_tvplayer_set_widget   (MMythTVPlayer *tvplayer, 
   105                                             GtkWidget *videow);
   106 
   107 gboolean       mmyth_tvplayer_is_playing   (MMythTVPlayer *tvplayer);
   108 
   109 gboolean       mmyth_tvplayer_record_setup (MMythTVPlayer *tvplayer, 
   110                                             gchar *filename);
   111 gboolean       mmyth_tvplayer_livetv_setup (MMythTVPlayer *tvplayer);
   112 
   113 G_END_DECLS
   114 
   115 #endif /*MMYTH_TVPLAYER_H_*/