# HG changeset patch # User rosfran # Date 1176491252 -3600 # Node ID 7f0a3066f6ab3ce22d0652c1c99c1ca7aba1b095 # Parent bf01a0d2198019ee77871bbc9073d4c3073a44ac [svn r550] A lot of GObject fixes (using the GType casting), added inheritance to the GMythFile* modules, locks all the the STOP_RECORDING messages. diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_backendinfo.c --- a/gmyth/src/gmyth_backendinfo.c Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.c Fri Apr 13 20:07:32 2007 +0100 @@ -283,9 +283,9 @@ gmyth_backend_info_get_uri (GMythBackendInfo *backend_info) { GMythURI *uri = NULL; - gchar* uri_str = g_strdup(""); - gchar *user_info = g_strdup(""); - gchar *db_data = g_strdup(""); + gchar* uri_str = NULL; + gchar *user_info = NULL; + gchar *db_data = NULL; if ( ( backend_info->username != NULL && strlen(backend_info->username) > 0 ) ) user_info = g_strdup_printf( "%s:%s@", backend_info->username, backend_info->password ); @@ -293,15 +293,15 @@ if ( backend_info->db_name != NULL && strlen(backend_info->db_name) > 0 ) { if ( ( g_strrstr( backend_info->db_name, "_" ) != NULL ) ) - db_data = backend_info->db_name; + db_data = g_strdup( backend_info->db_name ); else db_data = g_strdup_printf( "?%s&", backend_info->db_name ); } //else if ( ( ( g_strrstr( backend_info->path, "livetv" ) != NULL ) || // ( g_strrstr( backend_info->path, "/?" ) != NULL ) ) - uri_str = g_strdup_printf( "myth://%s%s:%d/%s", user_info != NULL && strlen( user_info ) > 0 ? g_strdup( user_info ) : "", backend_info->hostname, - backend_info->port, db_data != NULL && strlen( db_data ) > 0 ? g_strdup( db_data ) : ""); + uri_str = g_strdup_printf( "myth://%s%s:%d/%s", user_info != NULL && strlen( user_info ) > 0 ? user_info : "", backend_info->hostname, + backend_info->port, db_data != NULL && strlen( db_data ) > 0 ? db_data : ""); uri = gmyth_uri_new_with_value (uri_str); if ( user_info != NULL ) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_backendinfo.h --- a/gmyth/src/gmyth_backendinfo.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_backendinfo.h Fri Apr 13 20:07:32 2007 +0100 @@ -39,7 +39,7 @@ #define GMYTH_BACKEND_INFO_TYPE (gmyth_backend_info_get_type ()) #define GMYTH_BACKEND_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfo)) #define GMYTH_BACKEND_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfoClass)) -#define IS_GMYTH_BACKEND_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_BACKEND_INFO_TYPE)) +#define IS_GMYTH_BACKEND_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_BACKEND_INFO_TYPE)) #define IS_GMYTH_BACKEND_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_BACKEND_INFO_TYPE)) #define GMYTH_BACKEND_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_BACKEND_INFO_TYPE, GMythBackendInfoClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_epg.h --- a/gmyth/src/gmyth_epg.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_epg.h Fri Apr 13 20:07:32 2007 +0100 @@ -39,7 +39,7 @@ #define GMYTH_EPG_TYPE (gmyth_epg_get_type ()) #define GMYTH_EPG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_EPG_TYPE, GMythEPG)) #define GMYTH_EPG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_EPG_TYPE, GMythEPGClass)) -#define IS_GMYTH_EPG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_EPG_TYPE)) +#define IS_GMYTH_EPG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_EPG_TYPE)) #define IS_GMYTH_EPG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_EPG_TYPE)) #define GMYTH_EPG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_EPG_TYPE, GMythEPGClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_file.c --- a/gmyth/src/gmyth_file.c Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_file.c Fri Apr 13 20:07:32 2007 +0100 @@ -68,6 +68,7 @@ enum { + PROP_GMYTH_FILE_DUMMY, PROP_GMYTH_FILE_FILENAME, PROP_GMYTH_FILE_OFFSET, PROP_GMYTH_FILE_FILESIZE, @@ -85,7 +86,7 @@ static void gmyth_file_dispose (GObject *object); static void gmyth_file_finalize (GObject *object); -G_DEFINE_TYPE(GMythFile, gmyth_file, GMYTH_FILE_TYPE) +G_DEFINE_TYPE(GMythFile, gmyth_file, G_TYPE_OBJECT) static void gmyth_file_class_init (GMythFileClass *klass) @@ -104,31 +105,36 @@ g_object_class_install_property (gobject_class, PROP_GMYTH_FILE_FILENAME, - g_param_spec_string ("filename", "Filename", + g_param_spec_string ("filename", "filename", "The file name.", - "", G_PARAM_READWRITE)); + "", G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | + G_PARAM_READABLE | G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_GMYTH_FILE_OFFSET, g_param_spec_int64 ("file-offset", "file-offset", - "The offset (position) of this file", 0, G_MAXINT64, 0, G_PARAM_READWRITE)); + "The offset (position) of this file", 0, G_MAXINT64, 0, G_PARAM_STATIC_NAME | + G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_GMYTH_FILE_FILESIZE, g_param_spec_uint64 ("file-size", "file-size", "The file size in bytes", - 0, G_MAXUINT64, 0, G_PARAM_READWRITE)); + 0, G_MAXUINT64, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | + G_PARAM_READABLE | G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_GMYTH_FILE_BACKEND_INFO, g_param_spec_object ("backend-info", "backend-info", "The Backend Information about the remote server", - G_TYPE_OBJECT, G_PARAM_READWRITE)); + G_TYPE_OBJECT, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | + G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); g_object_class_install_property (gobject_class, PROP_GMYTH_FILE_FILEID, g_param_spec_int ("file-id", "file-id", - "The file ID", 0, G_MAXINT, 0, G_PARAM_READWRITE)); + "The file ID", 0, G_MAXINT, 0, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | + G_PARAM_STATIC_BLURB | G_PARAM_READABLE | G_PARAM_WRITABLE)); g_type_class_add_private (gobject_class, sizeof (GMythFilePrivate)); @@ -137,10 +143,9 @@ static void gmyth_file_init (GMythFile *file) { - GMythFilePrivate *priv; g_return_if_fail( file != NULL ); - priv = GMYTH_FILE_GET_PRIVATE(file); + file->priv = GMYTH_FILE_GET_PRIVATE(file); } static void @@ -193,24 +198,28 @@ GMythFile* gmyth_file_new (GMythBackendInfo *backend_info) { - GMythFile *file = GMYTH_FILE (g_object_new (GMYTH_FILE_TYPE, NULL)); + GMythFile *file = NULL; + + g_return_val_if_fail (backend_info != NULL, NULL); - g_object_set(G_OBJECT (file), "backend-info", &backend_info, NULL); + GParameter * __params = g_new0 (GParameter, 1); + GParameter * __params_it = __params; + (__params_it->name = "backend-info", g_value_init (&__params_it->value, G_TYPE_OBJECT), + g_value_set_object (&__params_it->value, backend_info), __params_it++); + file = g_object_newv (GMYTH_FILE_TYPE, __params_it - __params, __params); + return file; } gchar* gmyth_file_get_file_name (GMythFile *file) { - gchar *filename; + GMythFilePrivate *priv = GMYTH_FILE_GET_PRIVATE(file); + + g_return_val_if_fail( file != NULL, NULL ); - g_return_val_if_fail( file != NULL, NULL ); - g_return_val_if_fail( filename != NULL, NULL ); - - g_object_get(G_OBJECT (file), "filename", &filename, NULL); - - return filename; + return priv->filename; } void @@ -219,8 +228,11 @@ g_return_if_fail( file != NULL ); g_return_if_fail( filename != NULL ); - g_object_set (G_OBJECT (file), "filename", &filename, NULL); - + gchar* __temp2 = NULL; + const gchar* __temp1 = NULL; + file->priv->filename = (__temp2 = (__temp1 = filename, (__temp1 == NULL ? + NULL : g_strdup (__temp1))), (file->priv->filename == NULL ? + NULL : (file->priv->filename = (g_free (file->priv->filename), NULL))), __temp2); } /** @@ -332,12 +344,9 @@ gint64 gmyth_file_get_offset (GMythFile *file) { - GMythFilePrivate *priv; - g_return_val_if_fail (file != NULL, 0); - priv = GMYTH_FILE_GET_PRIVATE (file); - return priv->offset; + return file->priv->offset; } /** @@ -369,10 +378,10 @@ break; } - //if (priv->filename != NULL) { - // g_free (priv->filename); - // priv->filename = NULL; - //} + if (priv->filename != NULL) { + g_free (priv->filename); + priv->filename = NULL; + } priv->filename = g_value_dup_string (value); gmyth_debug( "Changed the filename to [%s]!", priv->filename ); break; @@ -393,10 +402,10 @@ break; } - //if (priv->backend_info != NULL) { - // g_object_unref (priv->backend_info); - // priv->backend_info = NULL; - //} + if (priv->backend_info != NULL) { + g_object_unref (priv->backend_info); + priv->backend_info = NULL; + } priv->backend_info = g_value_get_object (value); gmyth_debug( "Changed the backend info to [%s]!", gmyth_backend_info_get_hostname( priv->backend_info ) ); break; diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_file.h --- a/gmyth/src/gmyth_file.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_file.h Fri Apr 13 20:07:32 2007 +0100 @@ -47,7 +47,7 @@ #define GMYTH_FILE_TYPE (gmyth_file_get_type ()) #define GMYTH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TYPE, GMythFile)) #define GMYTH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE, GMythFileClass)) -#define IS_GMYTH_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TYPE)) +#define IS_GMYTH_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TYPE)) #define IS_GMYTH_FILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TYPE)) #define GMYTH_FILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TYPE, GMythFileClass)) @@ -65,6 +65,7 @@ struct _GMythFile { GObject parent; + GMythFilePrivate *priv; }; struct _GMythFileClass diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_file_local.h --- a/gmyth/src/gmyth_file_local.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_file_local.h Fri Apr 13 20:07:32 2007 +0100 @@ -48,7 +48,7 @@ #define GMYTH_FILE_LOCAL_TYPE (gmyth_file_local_get_type ()) #define GMYTH_FILE_LOCAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_LOCAL_TYPE, GMythFileLocal)) #define GMYTH_FILE_LOCAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_LOCAL_TYPE, GMythFileLocalClass)) -#define IS_GMYTH_FILE_LOCAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_LOCAL_TYPE)) +#define IS_GMYTH_FILE_LOCAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_LOCAL_TYPE)) #define IS_GMYTH_FILE_LOCAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_LOCAL_TYPE)) #define GMYTH_FILE_LOCAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_LOCAL_TYPE, GMythFileLocalClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_file_transfer.c --- a/gmyth/src/gmyth_file_transfer.c Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_file_transfer.c Fri Apr 13 20:07:32 2007 +0100 @@ -69,26 +69,20 @@ }; struct _GMythFileTransferPrivate { - GMythRecorder *recorder; + GMythRecorder *recorder; - gboolean do_next_program_chain; - gboolean disposed; - gboolean livetv_wait; - gint64 offset; - guint64 filesize; + gboolean do_next_program_chain; + gboolean disposed; + gboolean livetv_wait; - /* Myth URI structure */ - gchar *filename; - GMythBackendInfo *backend_info; - /* MythTV version number */ - gint mythtv_version; + gint mythtv_version; /* socket descriptors */ - GMythSocket *control_sock; - GMythSocket *sock; - GMutex *mutex; - gint file_id; + GMythSocket *control_sock; + GMythSocket *sock; + GMutex *mutex; + gint file_id; }; static void gmyth_file_transfer_class_init (GMythFileTransferClass *klass); @@ -101,7 +95,7 @@ static gboolean _control_acquire_context (GMythFileTransfer *transfer, gboolean do_wait); static gboolean _control_release_context (GMythFileTransfer *transfer); -G_DEFINE_TYPE(GMythFileTransfer, gmyth_file_transfer, G_TYPE_OBJECT) +G_DEFINE_TYPE(GMythFileTransfer, gmyth_file_transfer, GMYTH_FILE_TYPE) static void gmyth_file_transfer_class_init (GMythFileTransferClass *klass) @@ -137,11 +131,10 @@ static void gmyth_file_transfer_init (GMythFileTransfer *transfer) { - GMythFileTransferPrivate *priv; g_return_if_fail( transfer != NULL ); - priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer); - priv->mutex = g_mutex_new(); + transfer->priv = GMYTH_FILE_TRANSFER_GET_PRIVATE(transfer); + transfer->priv->mutex = g_mutex_new(); g_signal_connect ( G_OBJECT (transfer), "program-info-changed", (GCallback)(GMYTH_FILE_TRANSFER_GET_CLASS(transfer)->program_info_changed_handler), @@ -181,21 +174,11 @@ priv->sock = NULL; } - if (priv->backend_info != NULL ) { - g_object_unref (priv->backend_info ); - priv->backend_info = NULL; - } - if (priv->recorder != NULL ) { g_object_unref (priv->recorder ); priv->recorder = NULL; } - - if (priv->filename != NULL ) { - g_free (priv->filename ); - priv->filename = NULL; - } - + G_OBJECT_CLASS (gmyth_file_transfer_parent_class)->dispose (object); } @@ -218,20 +201,27 @@ GMythFileTransfer* gmyth_file_transfer_new (GMythBackendInfo *backend_info) { - GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL)); - GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); + GMythFileTransfer *transfer = g_object_new (GMYTH_FILE_TRANSFER_TYPE, + "backend-info", backend_info, NULL); + //GValue val = {0,}; + //backend_info = g_object_ref( backend_info ); + gmyth_debug( "Creating FileTransfer BackendInfo hostname = %s", gmyth_backend_info_get_hostname(backend_info) ); + //GMythBackendInfo *backend_info = gmyth_backend_info_new_with_uri (uri_str); + //g_value_init (&val, G_TYPE_OBJECT); + //g_value_set_object (&val, backend_info); + //g_object_set (G_OBJECT (transfer), "backend-info", &val, NULL); - priv->backend_info = g_object_ref (backend_info); - return transfer; + return transfer; } - gchar* gmyth_file_transfer_get_file_name (GMythFileTransfer *transfer) { - GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); + gchar *filename; + + g_object_get( G_OBJECT(transfer), "filename", &filename, NULL ); - return g_strdup (priv->filename); + return filename; } /** @@ -244,18 +234,22 @@ GMythFileTransfer* gmyth_file_transfer_new_with_uri (const gchar* uri_str) { - GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL)); - GMythFileTransferPrivate *priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); + GMythFileTransfer *transfer = GMYTH_FILE_TRANSFER (g_object_new (GMYTH_FILE_TRANSFER_TYPE, NULL)); + gmyth_debug( "URI str = %s", uri_str ); + //GMythBackendInfo *backend_info = gmyth_backend_info_new_with_uri (uri_str); + GValue val = {0,}; + g_value_init (&val, G_TYPE_OBJECT); + g_value_set_object (&val, gmyth_backend_info_new_with_uri (uri_str)); + g_object_set(G_OBJECT (transfer), "backend-info", &val, NULL); - priv->backend_info = gmyth_backend_info_new_with_uri (uri_str); - return transfer; + return transfer; } /** * Open a File Transfer connection in order to get a remote file. * * @param transfer The actual File Transfer instance. - * @param filename The file name of the remote file to be transfered to the client. + * @param filename The file name of the remote file to be transferred to the client. * * @return true, if the connection opening had been done successfully. */ @@ -269,25 +263,23 @@ g_return_val_if_fail (filename != NULL && strlen(filename) > 0, FALSE); priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); - - if (priv->filename != NULL) - { - gmyth_file_transfer_close (transfer); - } - - priv->filename = g_strdup( filename ); + + //if ( ) + gmyth_debug( "Opening the FileTransfer... (%s)", filename ); + + g_object_set( GMYTH_FILE(transfer), "filename", filename, NULL ); /* configure the control socket */ if (priv->control_sock == NULL) { if (!_connect_to_backend (transfer)) { - gmyth_debug ("Connection to backend failed (Control Socket).\n"); + gmyth_debug ("Connection to backend failed (Control Socket)."); ret = FALSE; } } else { - gmyth_debug("Remote transfer control socket already created.\n"); + gmyth_debug("Remote transfer control socket already created."); } - gmyth_debug ("Got file with size = %lld.\n", priv->filesize); + gmyth_debug ("Got file with size = %lld.\n", gmyth_file_get_filesize(GMYTH_FILE(transfer))); return ret; } @@ -307,13 +299,15 @@ GMythStringList *strlist = NULL; gboolean ret = TRUE; GMythFileTransferPrivate *priv; + GMythBackendInfo *backend_info; g_return_val_if_fail (transfer != NULL, FALSE ); + + g_object_get( GMYTH_FILE(transfer), "backend-info", &backend_info, NULL ); priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); _control_acquire_context (transfer, TRUE); - /* Creates the control socket */ if (priv->control_sock != NULL) { @@ -326,7 +320,7 @@ priv->control_sock = gmyth_socket_new(); // Connects the socket, send Mythtv ANN command and verify Mythtv protocol version if (!gmyth_socket_connect_to_backend (priv->control_sock, - priv->backend_info->hostname, priv->backend_info->port, TRUE)) { + backend_info->hostname, backend_info->port, TRUE)) { g_object_unref (priv->control_sock); priv->control_sock = NULL; @@ -340,8 +334,8 @@ } priv->sock = gmyth_socket_new (); - gmyth_socket_connect (priv->sock, priv->backend_info->hostname, priv->backend_info->port); - gmyth_debug ("Connecting file transfer... (%s, %d)", priv->backend_info->hostname, priv->backend_info->port); + gmyth_socket_connect (priv->sock, backend_info->hostname, backend_info->port); + gmyth_debug ("Connecting file transfer... (%s, %d)", backend_info->hostname, backend_info->port); strlist = gmyth_string_list_new(); hostname = gmyth_socket_get_local_hostname(); @@ -352,7 +346,7 @@ g_string_printf (base_str, "ANN FileTransfer %s", hostname->str); gmyth_string_list_append_string (strlist, base_str ); - gmyth_string_list_append_char_array (strlist, priv->filename); + gmyth_string_list_append_char_array (strlist, gmyth_file_get_file_name(GMYTH_FILE(transfer))); gmyth_socket_write_stringlist (priv->sock, strlist ); gmyth_socket_read_stringlist (priv->sock, strlist ); @@ -361,13 +355,14 @@ priv->file_id = gmyth_string_list_get_int (strlist, 1); /* Myth URI stream file size - decoded using two 8-bytes sequences (64 bits/long long types) */ - priv->filesize = gmyth_util_decode_long_long (strlist, 2); + gmyth_file_set_filesize( GMYTH_FILE(transfer), gmyth_util_decode_long_long (strlist, 2) ); - gmyth_debug ( "[%s] ***** Received: recordernum = %d, filesize = %" G_GUINT64_FORMAT "\n", __FUNCTION__, - priv->file_id, priv->filesize ); + gmyth_debug ( "***** Received: recordernum = %d, filesize = %" G_GUINT64_FORMAT "\n", + priv->file_id, gmyth_file_get_filesize(GMYTH_FILE(transfer)) ); - if (priv->filesize < 0 ) { - gmyth_debug ( "[%s] Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", __FUNCTION__, priv->filesize); + if ( gmyth_file_get_filesize(GMYTH_FILE(transfer)) < 0 ) { + gmyth_debug ( "Got filesize equals to %llu is lesser than 0 [invalid stream file]\n", + gmyth_file_get_filesize(GMYTH_FILE(transfer)) ); g_object_unref (priv->sock); priv->sock = NULL; ret = FALSE; @@ -494,11 +489,6 @@ priv->control_sock = NULL; } - if (priv->filename) { - g_free (priv->filename); - priv->filename = NULL; - } - _control_release_context (transfer); } @@ -539,14 +529,13 @@ if (pos > 0 ) gmyth_string_list_append_uint64 (strlist, pos); else - gmyth_string_list_append_uint64 (strlist, priv->offset); + gmyth_string_list_append_uint64 (strlist, gmyth_file_get_offset( GMYTH_FILE(transfer) ) ); gmyth_socket_sendreceive_stringlist (priv->control_sock, strlist); gint64 retval = gmyth_string_list_get_int64 (strlist, 0); - priv->offset = retval; - gmyth_debug ( "[%s] got reading position pointer from the streaming = %lld\n", - __FUNCTION__, retval ); + gmyth_file_set_offset( GMYTH_FILE(transfer), retval ); + gmyth_debug ( "Got reading position pointer from the streaming = %lld\n", retval ); g_object_unref (strlist); g_string_free (query, TRUE); @@ -611,13 +600,13 @@ * @return The actual block size (in bytes) returned by REQUEST_BLOCK message, * or the error code. */ -GMythFileTransferReadResult +GMythFileReadResult gmyth_file_transfer_read(GMythFileTransfer *transfer, GByteArray *data, gint size, gboolean read_unlimited) { gint bytes_sent = 0; gsize bytes_read = 0; gint64 total_read = 0; - GMythFileTransferReadResult retval = GMYTH_FILE_TRANSFER_READ_OK; + GMythFileReadResult retval = GMYTH_FILE_READ_OK; GMythFileTransferPrivate *priv; GError *error = NULL; @@ -636,7 +625,7 @@ GString *query; g_return_val_if_fail (transfer != NULL, FALSE); - g_return_val_if_fail (data != NULL, GMYTH_FILE_TRANSFER_READ_ERROR); + g_return_val_if_fail (data != NULL, GMYTH_FILE_READ_ERROR); priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); @@ -654,12 +643,12 @@ io_cond_control = g_io_channel_get_buffer_condition( io_channel ); if (priv->sock == NULL || ( io_status == G_IO_STATUS_ERROR ) ) { g_printerr( "gmyth_file_transfer_read(): Called with no raw socket.\n" ); - return GMYTH_FILE_TRANSFER_READ_ERROR; + return GMYTH_FILE_READ_ERROR; } if (priv->control_sock == NULL || ( io_status_control == G_IO_STATUS_ERROR ) ) { g_printerr( "gmyth_file_transfer_read(): Called with no control socket.\n" ); - return GMYTH_FILE_TRANSFER_READ_ERROR; + return GMYTH_FILE_READ_ERROR; } query = g_string_new (GMYTHTV_QUERY_HEADER); @@ -708,22 +697,24 @@ gmyth_debug ("Error on io_channel"); g_free (data_buffer); g_object_unref (strlist); - retval = GMYTH_FILE_TRANSFER_READ_ERROR; + retval = GMYTH_FILE_READ_ERROR; goto error; } /* append new data to the increasing byte array */ data = g_byte_array_append (data, (const guint8*)data_buffer, bytes_read); - priv->offset += bytes_read; + gmyth_file_set_offset( GMYTH_FILE(transfer), + gmyth_file_get_offset( GMYTH_FILE(transfer) ) + bytes_read ); - if (!read_unlimited && (priv->filesize > 0) && (priv->offset == priv->filesize)) { - retval = GMYTH_FILE_TRANSFER_READ_EOF; + if ( !read_unlimited && ( gmyth_file_get_filesize( GMYTH_FILE(transfer) ) > 0 ) && + ( gmyth_file_get_offset( GMYTH_FILE(transfer) ) == gmyth_file_get_filesize( GMYTH_FILE(transfer) ) ) ) { + retval = GMYTH_FILE_READ_EOF; goto error; } g_free (data_buffer); } else { - retval = GMYTH_FILE_TRANSFER_READ_ERROR; + retval = GMYTH_FILE_READ_ERROR; } if (strlist!=NULL) @@ -744,11 +735,12 @@ if (priv->recorder != NULL && priv->do_next_program_chain) { - retval = GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN; + retval = GMYTH_FILE_READ_NEXT_PROG_CHAIN; GMythProgramInfo *prog_info = gmyth_recorder_get_current_program_info (priv->recorder); if (prog_info != NULL && prog_info->pathname != NULL && strlen( prog_info->pathname->str ) > 0 && - g_ascii_strcasecmp( prog_info->pathname->str, priv->filename ) != 0 ) + g_ascii_strcasecmp( prog_info->pathname->str, + gmyth_file_get_file_name( GMYTH_FILE(transfer) ) ) != 0 ) ret = gmyth_file_transfer_open (transfer, g_strrstr( prog_info->pathname->str, "/" ) ); if (prog_info != NULL ) @@ -758,7 +750,7 @@ gmyth_debug( "Cannot change to the next program info!" ); else gmyth_debug( "OK!!! MOVED to the next program info [%s]!", - priv->filename ); + gmyth_file_get_file_name( GMYTH_FILE(transfer) ) ); } } /* if */ @@ -775,12 +767,12 @@ } if ( total_read > 0 ) - priv->offset += total_read; + gmyth_file_set_offset( GMYTH_FILE(transfer), + gmyth_file_get_offset( GMYTH_FILE(transfer) ) + total_read ); return retval; } - static void _file_transfer_program_info_changed( GMythFileTransfer *transfer, gint msg_code, gpointer livetv_recorder ) @@ -864,10 +856,11 @@ guint64 gmyth_file_transfer_get_filesize (GMythFileTransfer *transfer) { - GMythFileTransferPrivate *priv; + guint64 filesize; + + g_return_val_if_fail (transfer != NULL, 0); + + g_object_get( GMYTH_FILE(transfer), "file-size", &filesize, NULL ); - g_return_val_if_fail (transfer != NULL, 0); - - priv = GMYTH_FILE_TRANSFER_GET_PRIVATE (transfer); - return priv->filesize; + return filesize; } diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_file_transfer.h --- a/gmyth/src/gmyth_file_transfer.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_file_transfer.h Fri Apr 13 20:07:32 2007 +0100 @@ -32,6 +32,7 @@ #include #include +#include "gmyth_file.h" #include "gmyth_socket.h" #include "gmyth_uri.h" #include "gmyth_backendinfo.h" @@ -48,31 +49,23 @@ #define GMYTH_FILE_TRANSFER_TYPE (gmyth_file_transfer_get_type ()) #define GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransfer)) #define GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass)) -#define IS_GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_FILE_TRANSFER_TYPE)) +#define IS_GMYTH_FILE_TRANSFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_FILE_TRANSFER_TYPE)) #define IS_GMYTH_FILE_TRANSFER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_FILE_TRANSFER_TYPE)) #define GMYTH_FILE_TRANSFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_FILE_TRANSFER_TYPE, GMythFileTransferClass)) -typedef enum { - GMYTH_FILE_TRANSFER_READ_OK = 0, - GMYTH_FILE_TRANSFER_READ_NEXT_PROG_CHAIN = 1, - GMYTH_FILE_TRANSFER_READ_ERROR = 2, - GMYTH_FILE_TRANSFER_READ_EOF = 3 -} GMythFileTransferReadResult; - - typedef struct _GMythFileTransfer GMythFileTransfer; typedef struct _GMythFileTransferClass GMythFileTransferClass; typedef struct _GMythFileTransferPrivate GMythFileTransferPrivate; struct _GMythFileTransfer { - GObject parent; + GMythFile parent; + GMythFileTransferPrivate *priv; }; - struct _GMythFileTransferClass { - GObjectClass parent_class; + GMythFileClass parent_class; /* callbacks */ guint program_info_changed_handler_signal_id; @@ -90,7 +83,7 @@ const gchar* filename); void gmyth_file_transfer_close (GMythFileTransfer *transfer); gboolean gmyth_file_transfer_is_open (GMythFileTransfer *transfer); -GMythFileTransferReadResult +GMythFileReadResult gmyth_file_transfer_read (GMythFileTransfer *transfer, GByteArray *data, gint size, diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_livetv.h --- a/gmyth/src/gmyth_livetv.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_livetv.h Fri Apr 13 20:07:32 2007 +0100 @@ -43,7 +43,7 @@ #define GMYTH_LIVETV_TYPE (gmyth_livetv_get_type ()) #define GMYTH_LIVETV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_LIVETV_TYPE, GMythLiveTV)) #define GMYTH_LIVETV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_LIVETV_TYPE, GMythLiveTVClass)) -#define IS_GMYTH_LIVETV(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_LIVETV_TYPE)) +#define IS_GMYTH_LIVETV(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_LIVETV_TYPE)) #define IS_GMYTH_LIVETV_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_LIVETV_TYPE)) #define GMYTH_LIVETV_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_LIVETV_TYPE, GMythLiveTVClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_monitor_handler.c --- a/gmyth/src/gmyth_monitor_handler.c Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_monitor_handler.c Fri Apr 13 20:07:32 2007 +0100 @@ -149,18 +149,19 @@ monitor->allow_msgs_listener = FALSE; + /* mutex to control access to the event socket consumer thread */ + if ( monitor->mutex != NULL ) + { + g_mutex_unlock( monitor->mutex ); + g_mutex_free( monitor->mutex ); + monitor->mutex = NULL; + } + if (monitor->sid_io_watch != -1) { g_source_remove (monitor->sid_io_watch); } - /* mutex to control access to the event socket consumer thread */ - if ( monitor->mutex != NULL ) - { - g_mutex_free( monitor->mutex ); - monitor->mutex = NULL; - } - if ( monitor->event_sock != NULL ) { g_object_unref( monitor->event_sock ); diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_monitor_handler.h --- a/gmyth/src/gmyth_monitor_handler.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_monitor_handler.h Fri Apr 13 20:07:32 2007 +0100 @@ -48,7 +48,7 @@ #define GMYTH_MONITOR_HANDLER_TYPE (gmyth_monitor_handler_get_type ()) #define GMYTH_MONITOR_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_MONITOR_HANDLER_TYPE, GMythMonitorHandler)) #define GMYTH_MONITOR_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_MONITOR_HANDLER_TYPE, GMythMonitorHandlerClass)) -#define IS_GMYTH_MONITOR_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_MONITOR_HANDLER_TYPE)) +#define IS_GMYTH_MONITOR_HANDLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_MONITOR_HANDLER_TYPE)) #define IS_GMYTH_MONITOR_HANDLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_MONITOR_HANDLER_TYPE)) #define GMYTH_MONITOR_HANDLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_MONITOR_HANDLER_TYPE, GMythMonitorHandlerClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_programinfo.h --- a/gmyth/src/gmyth_programinfo.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_programinfo.h Fri Apr 13 20:07:32 2007 +0100 @@ -41,7 +41,7 @@ #define GMYTH_PROGRAM_INFO_TYPE (gmyth_program_info_get_type ()) #define GMYTH_PROGRAM_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfo)) #define GMYTH_PROGRAM_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass)) -#define IS_GMYTH_PROGRAM_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_PROGRAM_INFO_TYPE)) +#define IS_GMYTH_PROGRAM_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_PROGRAM_INFO_TYPE)) #define IS_GMYTH_PROGRAM_INFO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_PROGRAM_INFO_TYPE)) #define GMYTH_PROGRAM_INFO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_PROGRAM_INFO_TYPE, GMythProgramInfoClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_query.h --- a/gmyth/src/gmyth_query.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_query.h Fri Apr 13 20:07:32 2007 +0100 @@ -41,7 +41,7 @@ #define GMYTH_QUERY_TYPE (gmyth_query_get_type ()) #define GMYTH_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE, GMythQuery)) #define GMYTH_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE, GMythQueryClass)) -#define IS_GMYTH_QUERY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_QUERY_TYPE)) +#define IS_GMYTH_QUERY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_QUERY_TYPE)) #define IS_GMYTH_QUERY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_QUERY_TYPE)) #define GMYTH_QUERY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_QUERY_TYPE, GMythQueryClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_recorder.c --- a/gmyth/src/gmyth_recorder.c Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_recorder.c Fri Apr 13 20:07:32 2007 +0100 @@ -106,9 +106,14 @@ { if ( recorder != NULL && recorder->recorder_num != -1 ) { + g_mutex_lock( recorder->mutex ); + gmyth_recorder_stop_playing(recorder); + gmyth_recorder_stop_livetv(recorder); gmyth_recorder_finish_recording(recorder); gmyth_recorder_free_tuner(recorder); + + g_mutex_unlock( recorder->mutex ); } } @@ -283,8 +288,6 @@ str_list = gmyth_string_list_new (); - g_mutex_lock( recorder->mutex ); - g_string_append_printf ( tmp_str, " %d", recorder->recorder_num ); gmyth_string_list_append_string (str_list, tmp_str); @@ -303,7 +306,6 @@ } cleanup: - g_mutex_unlock( recorder->mutex ); g_string_free (tmp_str, TRUE); g_object_unref (str_list); @@ -1033,8 +1035,6 @@ GMythStringList *str_list = gmyth_string_list_new(); GString *message = g_string_new(""); - g_mutex_lock( recorder->mutex ); - g_string_printf( message, "%s %d", GMYTHTV_RECORDER_HEADER, recorder->recorder_num); gmyth_string_list_append_string(str_list, message); @@ -1057,8 +1057,6 @@ gmyth_debug( "%s, stream is %s finished!\n", ret ? "YES" : "NO", ret ? "" : "NOT" ); //g_static_mutex_unlock (&mutex); - - g_mutex_unlock( recorder->mutex ); if ( str_list != NULL ) g_object_unref (str_list); @@ -1085,8 +1083,6 @@ GMythStringList *str_list = gmyth_string_list_new(); GString *message = g_string_new(""); - g_mutex_lock( recorder->mutex ); - g_string_printf( message, "%s %d", GMYTHTV_RECORDER_HEADER, recorder->recorder_num); gmyth_string_list_append_string(str_list, message); @@ -1108,7 +1104,6 @@ } gmyth_debug( "%s, stream is %s stopped!\n", ret ? "YES" : "NO", ret ? "" : "NOT" ); - g_mutex_unlock ( recorder->mutex ); if ( str_list != NULL ) g_object_unref (str_list); @@ -1134,8 +1129,6 @@ GMythStringList *str_list = gmyth_string_list_new(); GString *message = g_string_new(""); - g_mutex_lock( recorder->mutex ); - g_string_printf( message, "%s %d", "FREE_TUNER", recorder->recorder_num ); gmyth_string_list_append_string(str_list, message); @@ -1155,7 +1148,6 @@ } gmyth_debug( "%s, tuner is %s freed!\n", ret ? "YES" : "NO", ret ? "" : "NOT" ); - g_mutex_unlock ( recorder->mutex ); if ( str_list != NULL ) g_object_unref (str_list); diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_recorder.h --- a/gmyth/src/gmyth_recorder.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_recorder.h Fri Apr 13 20:07:32 2007 +0100 @@ -48,7 +48,7 @@ #define GMYTH_RECORDER_TYPE (gmyth_recorder_get_type ()) #define GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE, GMythRecorder)) #define GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE, GMythRecorderClass)) -#define IS_GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECORDER_TYPE)) +#define IS_GMYTH_RECORDER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_RECORDER_TYPE)) #define IS_GMYTH_RECORDER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECORDER_TYPE)) #define GMYTH_RECORDER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECORDER_TYPE, GMythRecorderClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_recprofile.h --- a/gmyth/src/gmyth_recprofile.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_recprofile.h Fri Apr 13 20:07:32 2007 +0100 @@ -41,7 +41,7 @@ #define GMYTH_RECPROFILE_TYPE (gmyth_recprofile_get_type ()) #define GMYTH_RECPROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECPROFILE_TYPE, GMythRecProfile)) #define GMYTH_RECPROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECPROFILE_TYPE, GMythRecProfileClass)) -#define IS_GMYTH_RECPROFILE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_RECPROFILE_TYPE)) +#define IS_GMYTH_RECPROFILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_RECPROFILE_TYPE)) #define IS_GMYTH_RECPROFILE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_RECPROFILE_TYPE)) #define GMYTH_RECPROFILE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_RECPROFILE_TYPE, GMythRecProfileClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_scheduler.h --- a/gmyth/src/gmyth_scheduler.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_scheduler.h Fri Apr 13 20:07:32 2007 +0100 @@ -41,7 +41,7 @@ #define GMYTH_SCHEDULER_TYPE (gmyth_scheduler_get_type ()) #define GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE, GMythScheduler)) #define GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass)) -#define IS_GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SCHEDULER_TYPE)) +#define IS_GMYTH_SCHEDULER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_SCHEDULER_TYPE)) #define IS_GMYTH_SCHEDULER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SCHEDULER_TYPE)) #define GMYTH_SCHEDULER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SCHEDULER_TYPE, GMythSchedulerClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_socket.h --- a/gmyth/src/gmyth_socket.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_socket.h Fri Apr 13 20:07:32 2007 +0100 @@ -48,7 +48,7 @@ #define GMYTH_SOCKET_TYPE (gmyth_socket_get_type ()) #define GMYTH_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SOCKET_TYPE, GMythSocket)) #define GMYTH_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SOCKET_TYPE, GMythSocketClass)) -#define IS_GMYTH_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_SOCKET_TYPE)) +#define IS_GMYTH_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_SOCKET_TYPE)) #define IS_GMYTH_SOCKET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_SOCKET_TYPE)) #define GMYTH_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_SOCKET_TYPE, GMythSocketClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_stringlist.h --- a/gmyth/src/gmyth_stringlist.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_stringlist.h Fri Apr 13 20:07:32 2007 +0100 @@ -43,7 +43,7 @@ #define GMYTH_STRING_LIST_TYPE (gmyth_string_list_get_type ()) #define GMYTH_STRING_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_STRING_LIST_TYPE, GMythStringList)) #define GMYTH_STRING_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_STRING_LIST_TYPE, GMythStringListClass)) -#define IS_GMYTH_STRING_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_STRING_LIST_TYPE)) +#define IS_GMYTH_STRING_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_STRING_LIST_TYPE)) #define IS_GMYTH_STRING_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_STRING_LIST_TYPE)) #define GMYTH_STRING_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_STRING_LIST_TYPE, GMythStringListClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_transcoder.h --- a/gmyth/src/gmyth_transcoder.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_transcoder.h Fri Apr 13 20:07:32 2007 +0100 @@ -43,7 +43,7 @@ #define GMYTH_TRANSCODER_TYPE (gmyth_transcoder_get_type ()) #define GMYTH_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TRANSCODER_TYPE, GMythTranscoder)) #define GMYTH_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TRANSCODER_TYPE, GMythTranscoderClass)) -#define IS_GMYTH_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TRANSCODER_TYPE)) +#define IS_GMYTH_TRANSCODER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_TRANSCODER_TYPE)) #define IS_GMYTH_TRANSCODER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TRANSCODER_TYPE)) #define GMYTH_TRANSCODER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TRANSCODER_TYPE, GMythTranscoderClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_tvchain.h --- a/gmyth/src/gmyth_tvchain.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_tvchain.h Fri Apr 13 20:07:32 2007 +0100 @@ -40,7 +40,7 @@ #define GMYTH_TVCHAIN_TYPE (gmyth_tvchain_get_type ()) #define GMYTH_TVCHAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChain)) #define GMYTH_TVCHAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE, GMythTVChainClass)) -#define IS_GMYTH_TVCHAIN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TVCHAIN_TYPE)) +#define IS_GMYTH_TVCHAIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_TVCHAIN_TYPE)) #define IS_GMYTH_TVCHAIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TVCHAIN_TYPE)) #define GMYTH_TVCHAIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TVCHAIN_TYPE, GMythTVChainClass)) diff -r bf01a0d21980 -r 7f0a3066f6ab gmyth/src/gmyth_uri.h --- a/gmyth/src/gmyth_uri.h Fri Apr 13 14:54:52 2007 +0100 +++ b/gmyth/src/gmyth_uri.h Fri Apr 13 20:07:32 2007 +0100 @@ -42,7 +42,7 @@ #define GMYTH_URI_TYPE (gmyth_uri_get_type ()) #define GMYTH_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_URI_TYPE, GMythURI)) #define GMYTH_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_URI_TYPE, GMythURIClass)) -#define IS_GMYTH_URI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_URI_TYPE)) +#define IS_GMYTH_URI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GMYTH_URI_TYPE)) #define IS_GMYTH_URI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_URI_TYPE)) #define GMYTH_URI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_URI_TYPE, GMythURIClass))