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