# HG changeset patch # User melunko # Date 1164922294 0 # Node ID 106adb6883dc6b3283128179abbe9fae5f6889d7 # Parent 2db0e1da044ad93a1acdd43a42e5558c19a9bbf1 [svn r161] Filetransfer interface now receives GMythBackendInfo and file name instead of URI diff -r 2db0e1da044a -r 106adb6883dc libgnomevfs2-mythtv/modules/mythtv-method.c --- a/libgnomevfs2-mythtv/modules/mythtv-method.c Thu Nov 30 21:29:54 2006 +0000 +++ b/libgnomevfs2-mythtv/modules/mythtv-method.c Thu Nov 30 21:31:34 2006 +0000 @@ -28,6 +28,7 @@ #include #include "gmyth_file_transfer.h" +#include "gmyth_backendinfo.h" #define GST_MYTHTV_ID_NUM 1 #define MYTHTV_VERSION_DEFAULT 30 @@ -61,11 +62,8 @@ GnomeVFSOpenMode mode, GnomeVFSContext *context) { - - gchar *transfer_uri; MythtvHandle *myth_handle; - - GString *uri_str; + GMythBackendInfo *backend_info; gboolean ret; _GNOME_VFS_METHOD_PARAM_CHECK (method_handle != NULL); @@ -83,30 +81,29 @@ return GNOME_VFS_ERROR_INVALID_HOST_NAME; } - transfer_uri = gnome_vfs_uri_to_string (uri, - GNOME_VFS_URI_HIDE_USER_NAME | GNOME_VFS_URI_HIDE_PASSWORD); - /* Initialize mythtv handler*/ myth_handle->file_transfer = NULL; myth_handle->mythtv_version = MYTHTV_VERSION_DEFAULT; myth_handle->bytes_read = 0; myth_handle->content_size = -1; + /* Creates and fills out the backend info structure */ + backend_info = gmyth_backend_info_new_full ( + gnome_vfs_uri_get_host_name (uri), + NULL, NULL, NULL, + gnome_vfs_uri_get_host_port (uri)); + /* Connect to the backend */ - myth_handle->file_transfer = gmyth_file_transfer_new (); + myth_handle->file_transfer = gmyth_file_transfer_new (backend_info); g_return_val_if_fail (myth_handle->file_transfer != NULL, GNOME_VFS_ERROR_NOT_OPEN); /* sets the Playback monitor connection */ - uri_str = g_string_new (transfer_uri); - g_free (transfer_uri); - transfer_uri = NULL; - ret = gmyth_file_transfer_open (myth_handle->file_transfer, uri_str); + ret = gmyth_file_transfer_open (myth_handle->file_transfer, gnome_vfs_uri_get_path (uri)); if (ret == FALSE) { g_printerr ("Mythtv FileTransfer open error\n"); return GNOME_VFS_ERROR_NOT_OPEN; } - g_string_free (uri_str, TRUE); // TODO: Verify if file exists in the backend @@ -137,6 +134,7 @@ *bytes_read = 0; + printf ("XXXXXXXXXXXXXXXXXXXX bytes_read: %d, content_size: %d\n", (int)myth_handle->bytes_read, (int)myth_handle->content_size); if (myth_handle->bytes_read >= myth_handle->content_size) return GNOME_VFS_ERROR_EOF;