[svn r384] - Added gmyth_jobqueue to handle messages between gmyth and mythbackend
regarding the use of mythbackend's jobqueue
- Added gmyth_transcode to handle remote video transcoding
1.1 --- a/gmyth/src/Makefile.am Mon Feb 26 23:00:35 2007 +0000
1.2 +++ b/gmyth/src/Makefile.am Wed Feb 28 14:22:25 2007 +0000
1.3 @@ -18,14 +18,16 @@
1.4 gmyth_query.c \
1.5 gmyth_socket.c \
1.6 gmyth_stringlist.c \
1.7 - gmyth_monitor_handler.c \
1.8 - gmyth_file_transfer.c \
1.9 + gmyth_monitor_handler.c \
1.10 + gmyth_file_transfer.c \
1.11 gmyth_livetv.c \
1.12 gmyth_backendinfo.c \
1.13 gmyth_programinfo.c \
1.14 - gmyth_uri.c \
1.15 + gmyth_uri.c \
1.16 gmyth_http.c \
1.17 - gmyth_vlc.c \
1.18 + gmyth_vlc.c \
1.19 + gmyth_jobqueue.c \
1.20 + gmyth_transcode.c \
1.21 $(BUILT_SOURCES)
1.22
1.23
1.24 @@ -42,16 +44,16 @@
1.25 mv gmyth_marshal.c.tmp gmyth_marshal.c
1.26
1.27 libgmyth_la_CFLAGS = \
1.28 - -DDATADIR=\"$(pkgdatadir)\" \
1.29 + -DDATADIR=\"$(pkgdatadir)\" \
1.30 $(GLIB_CFLAGS) \
1.31 $(GOBJECT_CFLAGS) \
1.32 $(GST_CFLAGS) \
1.33 $(GSTBASE_CFLAGS) \
1.34 - $(GSTPLUGINSBASE_CFLAGS) \
1.35 + $(GSTPLUGINSBASE_CFLAGS) \
1.36 $(MYSQL_CFLAGS) \
1.37 $(LIBXML_CFLAGS)
1.38
1.39 -libgmyth_la_LDFLAGS = \
1.40 +libgmyth_la_LDFLAGS = \
1.41 -export-dynamic \
1.42 $(MYSQL_LIBS) \
1.43 $(GST_LIBS) \
1.44 @@ -63,7 +65,7 @@
1.45 $(pkgincludedir)
1.46
1.47 libgmyth_include_HEADERS = \
1.48 - gmyth.h \
1.49 + gmyth.h \
1.50 gmyth_common.h \
1.51 gmyth_debug.h \
1.52 gmyth_epg.h \
1.53 @@ -75,13 +77,15 @@
1.54 gmyth_socket.h \
1.55 gmyth_remote_util.h \
1.56 gmyth_stringlist.h \
1.57 - gmyth_monitor_handler.h \
1.58 - gmyth_file_transfer.h \
1.59 + gmyth_monitor_handler.h \
1.60 + gmyth_file_transfer.h \
1.61 gmyth_livetv.h \
1.62 gmyth_backendinfo.h \
1.63 gmyth_programinfo.h \
1.64 - gmyth_uri.h \
1.65 + gmyth_uri.h \
1.66 gmyth_http.h \
1.67 - gmyth_vlc.h
1.68 + gmyth_vlc.h \
1.69 + gmyth_jobqueue.h \
1.70 + gmyth_transcode.h
1.71
1.72 CLEANFILES = $(BUILT_SOURCES)
2.1 --- a/gmyth/src/gmyth.h Mon Feb 26 23:00:35 2007 +0000
2.2 +++ b/gmyth/src/gmyth.h Wed Feb 28 14:22:25 2007 +0000
2.3 @@ -48,5 +48,7 @@
2.4 #include <gmyth_util.h>
2.5 #include <gmyth_http.h>
2.6 #include <gmyth_vlc.h>
2.7 +#include <gmyth_jobqueue.h>
2.8 +#include <gmyth_transcode.h>
2.9
2.10 #endif /* _GMYTH_H_ */
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/gmyth/src/gmyth_jobqueue.c Wed Feb 28 14:22:25 2007 +0000
3.3 @@ -0,0 +1,171 @@
3.4 +/**
3.5 + * GMyth Library
3.6 + *
3.7 + * @file gmyth/gmyth_jobqueue.c
3.8 + *
3.9 + * @brief <p> Library to use JobQueue from mythbackend
3.10 + *
3.11 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
3.12 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
3.13 + *
3.14 + *
3.15 + * This program is free software; you can redistribute it and/or modify
3.16 + * it under the terms of the GNU Lesser General Public License as published by
3.17 + * the Free Software Foundation; either version 2 of the License, or
3.18 + * (at your option) any later version.
3.19 + *
3.20 + * This program is distributed in the hope that it will be useful,
3.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
3.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3.23 + * GNU General Public License for more details.
3.24 + *
3.25 + * You should have received a copy of the GNU Lesser General Public License
3.26 + * along with this program; if not, write to the Free Software
3.27 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3.28 + */
3.29 +
3.30 +#ifdef HAVE_CONFIG_H
3.31 +#include "config.h"
3.32 +#endif
3.33 +
3.34 +#include "gmyth_jobqueue.h"
3.35 +#include "gmyth_http.h"
3.36 +#include "gmyth_debug.h"
3.37 +#include "gmyth_socket.h"
3.38 +
3.39 +/** Function to connect
3.40 + *
3.41 + * @param backend_info the backendinfo
3.42 + * @return gboolean - result of connection
3.43 + *
3.44 + */
3.45 +GMythSocket*
3.46 +backend_connect (GMythBackendInfo *backend_info)
3.47 +{
3.48 + GMythSocket *socket = gmyth_socket_new ();
3.49 + if (gmyth_socket_connect_to_backend (socket,
3.50 + gmyth_backend_info_get_hostname (backend_info),
3.51 + gmyth_backend_info_get_port (backend_info), TRUE) == TRUE) {
3.52 + g_debug ("Backend socket connection success");
3.53 + return socket;
3.54 + } else {
3.55 + g_debug ("Connection failed");
3.56 + return NULL;
3.57 + }
3.58 +}
3.59 +
3.60 +
3.61 +/** Function to send a command to the backend
3.62 + *
3.63 + * @param socket pointer to a socket
3.64 + * @param action the action itself
3.65 + * @param job the action itself
3.66 + * @param chanid the action itself
3.67 + * @param starttime the action itself
3.68 + * @param options the action itself
3.69 + * @return the value returned by the backend
3.70 + *
3.71 + */
3.72 +GString* send_command(GMythSocket *socket, gchar* action,
3.73 + gchar* job, gint chanid, gchar* starttime,
3.74 + gchar* options)
3.75 +{
3.76 + GString* command = g_string_new ("");
3.77 + GMythStringList *retlist = gmyth_string_list_new();
3.78 +
3.79 + g_string_printf(command, "JOBQUEUE %s %s %d %s %s", action, job,
3.80 + chanid, starttime, options);
3.81 +
3.82 + gmyth_string_list_append_string (retlist, command);
3.83 + gmyth_socket_write_stringlist (socket, retlist);
3.84 +
3.85 + // receive answer
3.86 + gmyth_socket_read_stringlist (socket, retlist);
3.87 + return gmyth_string_list_get_string(retlist, 0);
3.88 +}
3.89 +
3.90 +
3.91 +/** Function to analyze the response from the backend
3.92 + *
3.93 + * @param ret the msg returned by the backend
3.94 + * @param value the expected value
3.95 + * @return 0 if success and -1 if error
3.96 + *
3.97 + */
3.98 +gint test_result(gchar* ret, gchar* value)
3.99 +{
3.100 + if (g_ascii_strcasecmp(ret, value))
3.101 + return 0;
3.102 + else
3.103 + {
3.104 + g_debug("JobQueue Error: %s", ret);
3.105 + return -1;
3.106 + }
3.107 +
3.108 +}
3.109 +
3.110 +/** Function to add a job inside JOBQUEUE
3.111 + *
3.112 + * @param transcode object holding all the info about the transcoding
3.113 + * @param job the job you want to add the action
3.114 + * @return the value of the key
3.115 + *
3.116 + */
3.117 +gint gmyth_jobqueue_add_job (GMythTranscode* transcode, GString* job)
3.118 +{
3.119 + GMythSocket *socket = backend_connect(transcode->backend_info);
3.120 + if (socket != NULL)
3.121 + {
3.122 + GString* options = g_string_new ("");
3.123 +
3.124 + if (g_ascii_strcasecmp(job->str, "JOB_TRANSCODE"))
3.125 + {
3.126 + if (transcode->cutlist)
3.127 + g_string_append(options, " JOB_USE_CUTLIST");
3.128 +
3.129 + if (transcode->output)
3.130 + g_string_append_printf(options, " JOB_OUTPUT %s",\
3.131 + transcode->output_filename->str);
3.132 +
3.133 + if (transcode->profile != NULL)
3.134 + g_string_append_printf(options, " %s", transcode->profile->str);
3.135 + }
3.136 +
3.137 + GString* ret = send_command(socket, "ADD", job->str, transcode->chanid,
3.138 + transcode->starttime->str, options->str);
3.139 +
3.140 + return test_result(ret->str, "JOBQUEUE_OK");
3.141 + }
3.142 + else
3.143 + {
3.144 + g_debug("JobQueue Connection Failed");
3.145 + return -1;
3.146 + }
3.147 +}
3.148 +
3.149 +/** Function to change a job cmd inside JOBQUEUE
3.150 + *
3.151 + * @param transcode object holding all the info about the transcoding
3.152 + * @param action the action (ADD)
3.153 + * @param job the job you want to add the action
3.154 + * @return the value of the key
3.155 + *
3.156 + */
3.157 +gint gmyth_jobqueue_change_cmd (GMythTranscode* transcode, GString* action,
3.158 + GString* job)
3.159 +{
3.160 + GMythSocket *socket = backend_connect(transcode->backend_info);
3.161 + if (socket != NULL)
3.162 + {
3.163 + GString* ret = send_command(socket, action->str, job->str,
3.164 + transcode->chanid,
3.165 + transcode->starttime->str, "");
3.166 +
3.167 + return test_result(ret->str, "JOBQUEUE_CHANGED_CMD_OK");
3.168 + }
3.169 + else
3.170 + {
3.171 + g_debug("JobQueue Connection Failed");
3.172 + return -1;
3.173 + }
3.174 +}
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/gmyth/src/gmyth_jobqueue.h Wed Feb 28 14:22:25 2007 +0000
4.3 @@ -0,0 +1,53 @@
4.4 +/**
4.5 + * GMyth Library
4.6 + *
4.7 + * @file gmyth/gmyth_jobqueue.h
4.8 + *
4.9 + * @brief <p> Library to use JobQueue from mythbackend
4.10 + *
4.11 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
4.12 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
4.13 + *
4.14 + *
4.15 + * This program is free software; you can redistribute it and/or modify
4.16 + * it under the terms of the GNU Lesser General Public License as published by
4.17 + * the Free Software Foundation; either version 2 of the License, or
4.18 + * (at your option) any later version.
4.19 + *
4.20 + * This program is distributed in the hope that it will be useful,
4.21 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
4.22 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4.23 + * GNU General Public License for more details.
4.24 + *
4.25 + * You should have received a copy of the GNU Lesser General Public License
4.26 + * along with this program; if not, write to the Free Software
4.27 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
4.28 + */
4.29 +
4.30 +#ifndef __GMYTH_JOBQUEUE_H__
4.31 +#define __GMYTH_JOBQUEUE_H__
4.32 +
4.33 +#include <glib-object.h>
4.34 +
4.35 +#include <stdio.h>
4.36 +#include <stdlib.h>
4.37 +#include <string.h>
4.38 +#include <stdarg.h>
4.39 +#include <glib.h>
4.40 +#include <glib/gprintf.h>
4.41 +
4.42 +#include "gmyth_stringlist.h"
4.43 +#include "gmyth_backendinfo.h"
4.44 +#include "gmyth_transcode.h"
4.45 +#include "gmyth_socket.h"
4.46 +#include "gmyth_util.h"
4.47 +
4.48 +G_BEGIN_DECLS
4.49 +
4.50 +gint gmyth_jobqueue_add_job (GMythTranscode* transcode, GString* job);
4.51 +gint gmyth_jobqueue_change_cmd (GMythTranscode* transcode, GString* action,
4.52 + GString* job);
4.53 +
4.54 +G_END_DECLS
4.55 +
4.56 +#endif /* __GMYTH_JOBQUEUE_H__ */
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/gmyth/src/gmyth_transcode.c Wed Feb 28 14:22:25 2007 +0000
5.3 @@ -0,0 +1,236 @@
5.4 +/**
5.5 + * GMyth Library
5.6 + *
5.7 + * @file gmyth/gmyth_transcode.c
5.8 + *
5.9 + * @brief <p> This file contains the transcode class.
5.10 + *
5.11 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
5.12 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
5.13 + *
5.14 + */
5.15 +/*
5.16 + *
5.17 + * This program is free software; you can redistribute it and/or modify
5.18 + * it under the terms of the GNU Lesser General Public License as published by
5.19 + * the Free Software Foundation; either version 2 of the License, or
5.20 + * (at your option) any later version.
5.21 + *
5.22 + * This program is distributed in the hope that it will be useful,
5.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
5.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5.25 + * GNU General Public License for more details.
5.26 + *
5.27 + * You should have received a copy of the GNU Lesser General Public License
5.28 + * along with this program; if not, write to the Free Software
5.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
5.30 + */
5.31 +
5.32 +
5.33 +#ifdef HAVE_CONFIG_H
5.34 +#include "config.h"
5.35 +#endif
5.36 +
5.37 +#include <stdlib.h>
5.38 +#include <string.h>
5.39 +#include <assert.h>
5.40 +
5.41 +#include "gmyth_transcode.h"
5.42 +#include "gmyth_util.h"
5.43 +#include "gmyth_debug.h"
5.44 +
5.45 +static void gmyth_transcode_class_init (GMythTranscodeClass *klass);
5.46 +static void gmyth_transcode_init (GMythTranscode *object);
5.47 +
5.48 +static void gmyth_transcode_dispose (GObject *object);
5.49 +static void gmyth_transcode_finalize (GObject *object);
5.50 +
5.51 +G_DEFINE_TYPE(GMythTranscode, gmyth_transcode, G_TYPE_OBJECT)
5.52 +
5.53 +static void
5.54 +gmyth_transcode_class_init (GMythTranscodeClass *klass)
5.55 +{
5.56 + GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
5.57 + gobject_class->dispose = gmyth_transcode_dispose;
5.58 + gobject_class->finalize = gmyth_transcode_finalize;
5.59 +}
5.60 +
5.61 +static void
5.62 +gmyth_transcode_init (GMythTranscode *gmyth_transcode)
5.63 +{
5.64 +
5.65 +}
5.66 +
5.67 +static void
5.68 +gmyth_transcode_dispose (GObject *object)
5.69 +{
5.70 + GMythTranscode *transcode = GMYTH_TRANSCODE(object);
5.71 +
5.72 + if (transcode->output_filename)
5.73 + g_free(transcode->output_filename);
5.74 +
5.75 + if (transcode->filename)
5.76 + g_free(transcode->filename);
5.77 +
5.78 + if (transcode->profile)
5.79 + g_free(transcode->profile);
5.80 +
5.81 + if (transcode->starttime)
5.82 + g_free(transcode->starttime);
5.83 +
5.84 + G_OBJECT_CLASS (gmyth_transcode_parent_class)->dispose (object);
5.85 +}
5.86 +
5.87 +static void
5.88 +gmyth_transcode_finalize (GObject *object)
5.89 +{
5.90 + g_signal_handlers_destroy (object);
5.91 + G_OBJECT_CLASS (gmyth_transcode_parent_class)->finalize (object);
5.92 +}
5.93 +
5.94 +/**
5.95 + * Creates a new instance of GMythTranscode.
5.96 + *
5.97 + * @return a new instance of GMythTranscode.
5.98 + **/
5.99 +GMythTranscode*
5.100 +gmyth_transcode_new (void)
5.101 +{
5.102 + GMythTranscode *transcode = GMYTH_TRANSCODE\
5.103 + (g_object_new(GMYTH_TRANSCODE_TYPE, NULL));
5.104 + return transcode;
5.105 +}
5.106 +
5.107 +/**
5.108 + *
5.109 + * gmyth_transcode_date_change_format
5.110 + * @brief converts a string like YYYY-MM-DDTHH:MM:SS into YYYYMMDDHHMMSS (vice versa)
5.111 + * @param date_s gchar*
5.112 + * @return gchar* with file or iso format
5.113 + *
5.114 + **/
5.115 +GString* gmyth_transcode_date_change_format (GString* date_s, int format)
5.116 +{
5.117 + if (date_s->str != NULL)
5.118 + {
5.119 + gint length = date_s->len;
5.120 +
5.121 + //create the right date format
5.122 + gchar* src = (gchar*)g_malloc0(sizeof(gchar) * length);
5.123 + strncpy(src, date_s->str, length);
5.124 +
5.125 + gchar* dst;
5.126 +
5.127 + if (format == DATE_FILE)
5.128 + {
5.129 + dst = (gchar*)g_malloc0(sizeof(gchar) * 16);
5.130 + g_snprintf(dst, 20, "%.4s%.2s%.2s%.2s%.2s%.2s\n", src, src+5,\
5.131 + src+7, src+9, src+11, src+13);
5.132 + dst[14] = '\0';
5.133 + }
5.134 + else
5.135 + if (format == DATE_ISO)
5.136 + {
5.137 + gchar* dst = (gchar*)g_malloc0(sizeof(gchar) * 20);
5.138 + g_snprintf(dst, 20, "%.4s-%.2s-%.2sT%.2s:%.2s:%.2s\n", src, src+4,\
5.139 + src+6, src+8, src+10, src+12);
5.140 + dst[19] = '\0';
5.141 + }
5.142 +
5.143 + GString* ret = g_string_new(dst);
5.144 +
5.145 + g_free(src);
5.146 + g_free(dst);
5.147 +
5.148 + return ret;
5.149 + }
5.150 + else return NULL;
5.151 +}
5.152 +
5.153 +/**
5.154 + *
5.155 + * gmyth_transcode_set_cutlist
5.156 + * @brief set transcode to use cutlist
5.157 + * @param value gboolean
5.158 + * @return void set's up the var to value
5.159 + *
5.160 + **/
5.161 +void gmyth_transcode_set_cutlist (GMythTranscode* transcode,
5.162 + gboolean value)
5.163 +{
5.164 + transcode->cutlist = value;
5.165 +}
5.166 +
5.167 +/**
5.168 + *
5.169 + * gmyth_transcode_set_output
5.170 + * @brief set transcode to use output
5.171 + * @param value gboolean
5.172 + * @param outfile filename of output
5.173 + * @return void set's up the var to value
5.174 + *
5.175 + **/
5.176 +void gmyth_transcode_set_output (GMythTranscode* transcode,
5.177 + gboolean value, GString* outputfile)
5.178 +{
5.179 + transcode->output = value;
5.180 + transcode->output_filename = outputfile;
5.181 +}
5.182 +
5.183 +/**
5.184 + *
5.185 + * gmyth_transcode_set_file
5.186 + * @brief set the file to transcode
5.187 + * @param file filename
5.188 + * @return void set's up the var to value
5.189 + *
5.190 + **/
5.191 +void gmyth_transcode_set_filename (GMythTranscode* transcode,
5.192 + GString* file)
5.193 +{
5.194 + transcode->filename = file;
5.195 +}
5.196 +
5.197 +
5.198 +/**
5.199 + *
5.200 + * gmyth_transcode_set_backendinfo
5.201 + * @brief set transcode's backendinfo
5.202 + * @param backendinfo GMythBackendInfo
5.203 + * @return void set's up the var to value
5.204 + *
5.205 + **/
5.206 +void gmyth_transcode_set_backend (GMythTranscode* transcode,
5.207 + GMythBackendInfo *backend)
5.208 +{
5.209 + transcode->backend_info = backend;
5.210 +}
5.211 +
5.212 +
5.213 +/**
5.214 + *
5.215 + * gmyth_transcode_get_profile_list
5.216 + * @brief get profile list from the backend
5.217 + * @param backend_info GMythBackendInfo*
5.218 + * @return GSList
5.219 + *
5.220 + **/
5.221 +GSList* gmyth_transcode_get_profile_list (GMythBackendInfo *backend_info)
5.222 +{
5.223 + //TODO: CODE THIS
5.224 + return NULL;
5.225 +}
5.226 +
5.227 +/**
5.228 + *
5.229 + * gmyth_transcode_create_profile
5.230 + * @brief get profile list from the backend
5.231 + * @param backend_info GMythBackendInfo*
5.232 + * @return gint representing the result
5.233 + *
5.234 + **/
5.235 +gint gmyth_transcode_create_profile (GMythBackendInfo *backend_info)
5.236 +{
5.237 + //TODO: CODE THIS
5.238 + return 0;
5.239 +}
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/gmyth/src/gmyth_transcode.h Wed Feb 28 14:22:25 2007 +0000
6.3 @@ -0,0 +1,89 @@
6.4 +/**
6.5 + * GMyth Library
6.6 + *
6.7 + * @file gmyth/gmyth_transcode.h
6.8 + *
6.9 + * @brief <p> This file contains the transcode class.
6.10 + *
6.11 + * Copyright (C) 2007 INdT - Instituto Nokia de Tecnologia.
6.12 + * @author Artur Duque de Souza <artur.souza@indt.org.br>
6.13 + *
6.14 + */
6.15 +/*
6.16 + *
6.17 + * This program is free software; you can redistribute it and/or modify
6.18 + * it under the terms of the GNU Lesser General Public License as published by
6.19 + * the Free Software Foundation; either version 2 of the License, or
6.20 + * (at your option) any later version.
6.21 + *
6.22 + * This program is distributed in the hope that it will be useful,
6.23 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
6.24 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
6.25 + * GNU General Public License for more details.
6.26 + *
6.27 + * You should have received a copy of the GNU Lesser General Public License
6.28 + * along with this program; if not, write to the Free Software
6.29 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
6.30 + */
6.31 +
6.32 +#ifndef _GMYTH_TRANSCODE_H
6.33 +#define _GMYTH_TRANSCODE_H
6.34 +
6.35 +#include <glib.h>
6.36 +#include <glib-object.h>
6.37 +
6.38 +#include "gmyth_stringlist.h"
6.39 +#include "gmyth_backendinfo.h"
6.40 +#include "gmyth_socket.h"
6.41 +
6.42 +G_BEGIN_DECLS
6.43 +
6.44 +#define GMYTH_TRANSCODE_TYPE (gmyth_transcode_get_type ())
6.45 +#define GMYTH_TRANSCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TRANSCODE_TYPE, GMythTranscode))
6.46 +#define GMYTH_TRANSCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TRANSCODE_TYPE, GMythTranscodeClass))
6.47 +#define IS_GMYTH_TRANSCODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GMYTH_TRANSCODE_TYPE))
6.48 +#define IS_GMYTH_TRANSCODE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GMYTH_TRANSCODE_TYPE))
6.49 +#define GMYTH_TRANSCODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GMYTH_TRANSCODE_TYPE, GMythTranscodeClass))
6.50 +
6.51 +#define DATE_ISO 0
6.52 +#define DATE_FILE 1
6.53 +
6.54 +typedef struct _GMythTranscode GMythTranscode;
6.55 +typedef struct _GMythTranscodeClass GMythTranscodeClass;
6.56 +
6.57 +struct _GMythTranscodeClass
6.58 +{
6.59 + GObjectClass parent_class;
6.60 +
6.61 + /* callbacks */
6.62 +};
6.63 +
6.64 +/**
6.65 + * The GMythTranscode structure is a class to implement functions
6.66 + * related to transcoding.
6.67 + */
6.68 +struct _GMythTranscode
6.69 +{
6.70 + /* all private members */
6.71 + GObject parent;
6.72 +
6.73 + gboolean cutlist;
6.74 + gboolean output;
6.75 +
6.76 + GString* output_filename;
6.77 + GString* filename;
6.78 + GString* profile;
6.79 + GString* starttime;
6.80 +
6.81 + gint chanid;
6.82 +
6.83 + GMythBackendInfo* backend_info;
6.84 +};
6.85 +
6.86 +GType gmyth_transcode_type (void);
6.87 +
6.88 +GMythTranscode* gmyth_transcode_new (void);
6.89 +
6.90 +G_END_DECLS
6.91 +
6.92 +#endif /*_GMYTH_TRANSCODE_H*/