[svn r551] GMyth API changes (GObject fixes and added inheritance).
1.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 20:07:32 2007 +0100
1.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.c Fri Apr 13 20:32:42 2007 +0100
1.3 @@ -254,7 +254,7 @@
1.4 static void
1.5 gst_mythtv_src_init (GstMythtvSrc * this, GstMythtvSrcClass * g_class)
1.6 {
1.7 - this->file_transfer = NULL;
1.8 + this->file = NULL;
1.9
1.10 this->unique_setup = FALSE;
1.11
1.12 @@ -306,9 +306,9 @@
1.13 this->spawn_livetv = NULL;
1.14 }
1.15
1.16 - if (this->file_transfer) {
1.17 - g_object_unref (this->file_transfer);
1.18 - this->file_transfer = NULL;
1.19 + if (this->file) {
1.20 + g_object_unref (this->file);
1.21 + this->file = NULL;
1.22 }
1.23
1.24 if (this->backend_info) {
1.25 @@ -346,11 +346,12 @@
1.26 * Retry whilst authentication fails and we supply it. */
1.27
1.28 while (sizetoread == size && --max_iters > 0) {
1.29 - /*if ( gmyth_backend_info_is_local_file(src->backend_info) )
1.30 - result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(src->file_transfer),
1.31 + /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */
1.32 + if ( IS_GMYTH_FILE_LOCAL(src->file) )
1.33 + result = gmyth_file_local_read ( GMYTH_FILE_LOCAL(src->file),
1.34 data_ptr, sizetoread, src->live_tv);
1.35 - else*/
1.36 - result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(src->file_transfer),
1.37 + else if ( IS_GMYTH_FILE_TRANSFER(src->file) )
1.38 + result = gmyth_file_transfer_read ( GMYTH_FILE_TRANSFER(src->file),
1.39 data_ptr, sizetoread, src->live_tv);
1.40
1.41 if (data_ptr->len > 0) {
1.42 @@ -611,12 +612,13 @@
1.43 /* verify if it needs to seek */
1.44 if (src->read_offset != actual_seek) {
1.45
1.46 - /*if ( gmyth_backend_info_is_local_file(src->backend_info) )
1.47 + /* if ( gmyth_backend_info_is_local_file(src->backend_info) ) */
1.48 + if ( IS_GMYTH_FILE_LOCAL(src->file) )
1.49 new_offset =
1.50 - gmyth_file_local_seek (src->file_transfer, segment->start, G_SEEK_SET);
1.51 - else*/
1.52 + gmyth_file_local_seek ( GMYTH_FILE_LOCAL(src->file), segment->start, G_SEEK_SET);
1.53 + else if ( IS_GMYTH_FILE_TRANSFER(src->file) )
1.54 new_offset =
1.55 - gmyth_file_transfer_seek (src->file_transfer, segment->start, SEEK_SET);
1.56 + gmyth_file_transfer_seek ( GMYTH_FILE_TRANSFER(src->file), segment->start, SEEK_SET);
1.57
1.58 GST_LOG_OBJECT (src,
1.59 "Segment offset start = %lld, SRC Offset = %lld, NEW actual backend SEEK Offset = %lld.",
1.60 @@ -640,7 +642,6 @@
1.61
1.62 eos:
1.63 {
1.64 -
1.65 GST_DEBUG_OBJECT (src, "EOS found on seeking!!!");
1.66 return FALSE;
1.67 }
1.68 @@ -689,45 +690,45 @@
1.69 goto init_failed;
1.70 }
1.71 }
1.72 -
1.73 +
1.74 /* testing change channel... */
1.75 /* gmyth_recorder_change_channel( src->spawn_livetv->recorder, CHANNEL_DIRECTION_UP ); */
1.76
1.77 - src->file_transfer = gmyth_livetv_create_file_transfer (src->spawn_livetv);
1.78 + src->file = GMYTH_FILE( gmyth_livetv_create_file_transfer (src->spawn_livetv) );
1.79
1.80 - if (NULL == src->file_transfer) {
1.81 + if (NULL == src->file) {
1.82 GST_INFO_OBJECT (src, "[LiveTV] FileTransfer equals to NULL");
1.83 ret = FALSE;
1.84 goto init_failed;
1.85 }
1.86
1.87 - if ( !gmyth_file_transfer_open( src->file_transfer, src->spawn_livetv->uri != NULL ?
1.88 + if ( !gmyth_file_transfer_open( GMYTH_FILE_TRANSFER(src->file), src->spawn_livetv->uri != NULL ?
1.89 gmyth_uri_get_path(src->spawn_livetv->uri) :
1.90 src->spawn_livetv->proginfo->pathname->str ) )
1.91 {
1.92 GST_INFO_OBJECT (src, "Error: couldn't open the FileTransfer from LiveTV source!" );
1.93 - g_object_unref( src->file_transfer );
1.94 - src->file_transfer = NULL;
1.95 + g_object_unref( src->file );
1.96 + src->file = NULL;
1.97 goto init_failed;
1.98 }
1.99 } else {
1.100
1.101 - /*if ( gmyth_uri_is_local_file(gmyth_uri) )
1.102 + if ( gmyth_uri_is_local_file(gmyth_uri) )
1.103 {
1.104 - src->file_transfer = gmyth_file_local_new(src->backend_info);
1.105 - ret = gmyth_file_local_open (src->file_transfer);
1.106 - } else {*/
1.107 - src->file_transfer = gmyth_file_transfer_new(src->backend_info);
1.108 - ret = gmyth_file_transfer_open (src->file_transfer, src->uri_name);
1.109 - //}
1.110 + src->file = GMYTH_FILE(gmyth_file_local_new(src->backend_info));
1.111 + ret = gmyth_file_local_open ( GMYTH_FILE_LOCAL( src->file ) );
1.112 + } else {
1.113 + src->file = GMYTH_FILE(gmyth_file_transfer_new(src->backend_info));
1.114 + ret = gmyth_file_transfer_open ( GMYTH_FILE_TRANSFER(src->file), src->uri_name);
1.115 + }
1.116
1.117 } /* if (else) - recorded FileTransfer */
1.118
1.119 - if (NULL == src->file_transfer) {
1.120 + if (NULL == src->file) {
1.121 GST_INFO_OBJECT (src, "FileTransfer is NULL");
1.122 goto init_failed;
1.123 }
1.124 - /*GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file_transfer); */
1.125 + /*GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file); */
1.126
1.127 if (ret == FALSE) {
1.128 #ifndef GST_DISABLE_GST_DEBUG
1.129 @@ -740,9 +741,9 @@
1.130
1.131 GST_INFO_OBJECT (src,
1.132 "MythTV FileTransfer filesize = %lld, content_size = %lld!",
1.133 - gmyth_file_transfer_get_filesize( src->file_transfer ), src->content_size);
1.134 + gmyth_file_get_filesize( src->file ), src->content_size);
1.135
1.136 - src->content_size = gmyth_file_transfer_get_filesize (src->file_transfer);
1.137 + src->content_size = gmyth_file_get_filesize (src->file);
1.138
1.139 src->do_start = FALSE;
1.140
2.1 --- a/gst-plugins-mythtv/src/gstmythtvsrc.h Fri Apr 13 20:07:32 2007 +0100
2.2 +++ b/gst-plugins-mythtv/src/gstmythtvsrc.h Fri Apr 13 20:32:42 2007 +0100
2.3 @@ -58,7 +58,7 @@
2.4 GstPushSrc element;
2.5
2.6 /* MythFileTransfer */
2.7 - GMythFileTransfer *file_transfer;
2.8 + GMythFile *file;
2.9
2.10 GMythLiveTV *spawn_livetv;
2.11