gst-plugins-mythtv/src/gmyth_file_transfer.h
author rosfran
Mon Oct 23 16:02:15 2006 +0100 (2006-10-23)
branchtrunk
changeset 41 686549eb5657
parent 13 f3cdc7844178
permissions -rwxr-xr-x
[svn r42] Added FileTransfer, URI and LiveTV functionalities (moved from the MythTV plug-in).
leo_sobral@2
     1
/* vim: set sw=2: -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2; c-indent-level: 2-*- */
leo_sobral@2
     2
rosfran@40
     3
#ifndef __GMYTH_FILE_TRANSFER_H__
rosfran@40
     4
#define __GMYTH_FILE_TRANSFER_H__
leo_sobral@2
     5
leo_sobral@2
     6
#include <glib-object.h>
leo_sobral@2
     7
leo_sobral@2
     8
#include <gmyth/gmyth_socket.h>
rosfran@40
     9
#include "gmyth_uri.h"
rosfran@40
    10
#include "gmyth_livetv.h"
leo_sobral@2
    11
leo_sobral@2
    12
#include <stdio.h>
leo_sobral@2
    13
#include <stdlib.h>
leo_sobral@2
    14
#include <string.h>
leo_sobral@2
    15
#include <netdb.h>
leo_sobral@2
    16
#include <sys/socket.h>
leo_sobral@2
    17
#include <unistd.h>
leo_sobral@2
    18
leo_sobral@2
    19
#define G_BEGIN_DECLS
leo_sobral@2
    20
rosfran@40
    21
#define GMYTH_FILE_TRANSFER_TYPE               (gmyth_file_transfer_get_type ())
rosfran@40
    22
#define GMYTH_FILE_TRANSFER(obj)               (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransfer))
rosfran@40
    23
#define GMYTH_FILE_TRANSFER_CLASS(klass)       (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
rosfran@40
    24
#define IS_GMYTH_FILE_TRANSFER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE))
rosfran@40
    25
#define IS_GMYTH_FILE_TRANSFER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE))
rosfran@40
    26
#define GMYTH_FILE_TRANSFER_GET_CLASS(obj)     (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass))
leo_sobral@2
    27
leo_sobral@2
    28
rosfran@40
    29
typedef struct _GMythFileTransfer         GMythFileTransfer;
rosfran@40
    30
typedef struct _GMythFileTransferClass    GMythFileTransferClass;
leo_sobral@2
    31
rosfran@40
    32
struct _GMythFileTransferClass
leo_sobral@2
    33
{
leo_sobral@2
    34
	GObjectClass parent_class;
leo_sobral@2
    35
leo_sobral@2
    36
	/* callbacks */
leo_sobral@2
    37
	/* no one for now */
leo_sobral@2
    38
};
leo_sobral@2
    39
rosfran@40
    40
struct _GMythFileTransfer
leo_sobral@2
    41
{
leo_sobral@2
    42
	GObject parent;
leo_sobral@2
    43
leo_sobral@2
    44
	/* Myth URI structure */
rosfran@40
    45
	const GMythURI *uri;
leo_sobral@2
    46
	
leo_sobral@2
    47
	/* MythTV version number */	
leo_sobral@2
    48
	gint mythtv_version;
leo_sobral@2
    49
leo_sobral@2
    50
	/* socket descriptors */
leo_sobral@2
    51
	GMythSocket *control_sock;
leo_sobral@2
    52
	GMythSocket *event_sock;
leo_sobral@2
    53
	GMythSocket *sock;
leo_sobral@2
    54
leo_sobral@2
    55
	guint64 readposition;
leo_sobral@2
    56
	guint64 filesize;
leo_sobral@2
    57
	gboolean timeoutisfast;
leo_sobral@2
    58
	gboolean userreadahead;
leo_sobral@2
    59
	gboolean live_tv;
leo_sobral@2
    60
	gint retries;
leo_sobral@2
    61
leo_sobral@2
    62
	GString *query;
leo_sobral@2
    63
leo_sobral@2
    64
	gint rec_id;
leo_sobral@2
    65
	gint recordernum;
leo_sobral@2
    66
	gint card_id;
leo_sobral@2
    67
	GString *hostname;
leo_sobral@2
    68
	gint port;
leo_sobral@2
    69
};
leo_sobral@2
    70
rosfran@40
    71
GType          gmyth_file_transfer_get_type        (void);
leo_sobral@2
    72
rosfran@40
    73
GMythFileTransfer* gmyth_file_transfer_new (gint num, GString *hostname, gshort port, gint mythtv_version );
leo_sobral@2
    74
rosfran@40
    75
gint gmyth_file_transfer_read(GMythFileTransfer *transfer, void *data, gint size, gboolean read_unlimited);
leo_sobral@2
    76
rosfran@40
    77
gint64 gmyth_file_transfer_seek(GMythFileTransfer *transfer, guint64 pos, gint whence);
leo_sobral@2
    78
rosfran@40
    79
gboolean gmyth_file_transfer_playback_setup( GMythFileTransfer **transfer, gboolean live_tv );
leo_sobral@2
    80
rosfran@40
    81
gboolean gmyth_file_transfer_setup( GMythFileTransfer **transfer, gboolean live_tv );
leo_sobral@2
    82
rosfran@40
    83
gboolean gmyth_file_transfer_livetv_setup( GMythFileTransfer **transfer, GMythSocket *live_sock );
leo_sobral@2
    84
rosfran@40
    85
void gmyth_file_transfer_spawntv ( GMythFileTransfer *file_transfer, GString *tvchain_id );
leo_sobral@2
    86
rosfran@40
    87
gboolean gmyth_file_transfer_is_recording( GMythFileTransfer *file_transfer );
leo_sobral@2
    88
rosfran@40
    89
gint64  gmyth_file_transfer_get_file_position( GMythFileTransfer *file_transfer );
leo_sobral@2
    90
leo_sobral@2
    91
#define G_END_DECLS
leo_sobral@2
    92
rosfran@40
    93
#endif /* __GMYTH_FILE_TRANSFER_H__ */