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