You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(28) |
Sep
(20) |
Oct
(20) |
Nov
(6) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(17) |
Feb
(28) |
Mar
(13) |
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <me...@us...> - 2007-09-14 20:18:45
|
Revision: 849
http://gmyth.svn.sourceforge.net/gmyth/?rev=849&view=rev
Author: melunko
Date: 2007-09-14 13:18:38 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
Now nuvdemux package replaces gstreamer0.10-plugins-bad (see debian/control file)
Modified Paths:
--------------
trunk/gst-gmyth/debian/control
Modified: trunk/gst-gmyth/debian/control
===================================================================
--- trunk/gst-gmyth/debian/control 2007-09-14 12:46:26 UTC (rev 848)
+++ trunk/gst-gmyth/debian/control 2007-09-14 20:18:38 UTC (rev 849)
@@ -8,6 +8,7 @@
Architecture: any
Section: user/library
Depends: ${misc:Depends}, ${shlibs:Depends}
+Replaces: gstreamer0.10-plugins-bad
Description: INdT nuv demux GStreamer plugin
This GStreamer plugin permits demux of Nuv streams.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-09-14 12:46:38
|
Revision: 848
http://gmyth.svn.sourceforge.net/gmyth/?rev=848&view=rev
Author: melunko
Date: 2007-09-14 05:46:26 -0700 (Fri, 14 Sep 2007)
Log Message:
-----------
Fixed mythsrc/Makefile.am to checkout gstmythtvsrc.h
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/Makefile.am
Modified: trunk/gst-gmyth/mythsrc/Makefile.am
===================================================================
--- trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-12 15:47:02 UTC (rev 847)
+++ trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-14 12:46:26 UTC (rev 848)
@@ -19,7 +19,7 @@
$(GST_BASE_LIBS) \
$(GMYTH_LIBS)
-gstmythtvsrc.c:
+gstmythtvsrc.c: gstmythtvsrc.h
cvs -d:pserver:an...@an...:/cvs/gstreamer/ co gst-plugins-bad/ext/mythtv/gstmythtvsrc.c
mv gst-plugins-bad/ext/mythtv/gstmythtvsrc.c .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-09-12 15:47:00
|
Revision: 847
http://gmyth.svn.sourceforge.net/gmyth/?rev=847&view=rev
Author: morphbr
Date: 2007-09-12 08:47:02 -0700 (Wed, 12 Sep 2007)
Log Message:
-----------
- Fixed several bugs
- Included some help functions
Modified Paths:
--------------
trunk/gmyth/src/gmyth_programinfo.h
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
trunk/gmyth/src/gmyth_stringlist.c
trunk/gmyth/src/gmyth_stringlist.h
Modified: trunk/gmyth/src/gmyth_programinfo.h
===================================================================
--- trunk/gmyth/src/gmyth_programinfo.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_programinfo.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -63,7 +63,6 @@
/** The channel unique ID. */
GString *chanid;
-
/** The program start time. */
GTimeVal *startts;
/** The program end time. */
@@ -136,7 +135,11 @@
GString *recgroup;
GString *playgroup;
+ gint rectype;
+ gint recstatus;
gint recpriority;
+ gint dupin;
+ gint dupmethod;
/** The file size of the recorded program.*/
gint64 filesize;
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-09-12 15:47:02 UTC (rev 847)
@@ -510,7 +510,7 @@
_set_value(scheduler->msqlquery, "search", "0", rec_id);
if (type == GMYTH_SCHEDULE_ALL_OCCURRENCES) {
- _set_int_value(scheduler->msqlquery, "type", 4, rec_id);
+ _set_int_value(scheduler->msqlquery, "type", 3, rec_id);
} else if (type == GMYTH_SCHEDULE_ONE_OCCURRENCE) {
_set_int_value(scheduler->msqlquery, "type", 1, rec_id);
} else if (type == GMYTH_SCHEDULE_EXCEPTION) {
@@ -665,6 +665,206 @@
return update_backend(scheduler, record_id);
}
+
+gboolean gmyth_scheduler_was_recorded_before(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time)
+{
+ MYSQL_RES *msql_res;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+ g_string_printf(query_str, "SELECT callsign FROM channel "
+ "WHERE chanid = \"%d\"", channel_id);
+
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+ if (msql_row) {
+ GString* callsign = g_string_new(msql_row[0]);
+ GString* startts = gmyth_util_time_to_string(start_time);
+ g_string_printf(query_str, "SELECT * FROM oldrecorded "
+ "WHERE station = \"%s\" AND starttime = \"%s\"",
+ callsign->str, startts->str);
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ g_string_free(callsign, TRUE);
+ g_string_free(startts, TRUE);
+ g_string_free(query_str, TRUE);
+ if (mysql_fetch_row(msql_res)) return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+gboolean gmyth_scheduler_reactivate_schedule(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time)
+
+{
+ MYSQL_RES *msql_res;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+ g_string_printf(query_str, "SELECT callsign FROM channel "
+ "WHERE chanid = \"%d\"", channel_id);
+
+ msql_res = gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+ if (msql_row) {
+ GString* callsign = g_string_new(msql_row[0]);
+ GString* startts = gmyth_util_time_to_string(start_time);
+ g_string_printf(query_str, "UPDATE oldrecorded SET reactivate = 1 "
+ "WHERE station = \"%s\" AND starttime = \"%s\"",
+ callsign->str, startts->str);
+ gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+ g_string_free(callsign, TRUE);
+ g_string_free(startts, TRUE);
+ g_string_free(query_str, TRUE);
+ return TRUE;
+ }
+
+ }
+
+ return FALSE;
+}
+
+
+/*
+ * This should only be used in special situations. We do not know the time that
+ * the recording was set. We just know that it is an "ongoing" record and then
+ * we have to use this to get it's info. It's always the oldest one -> first on list
+ *
+ */
+GMythProgramInfo*
+gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
+ GString* channel)
+{
+ MYSQL_RES *msql_res;
+ GMythProgramInfo *proginfo = NULL;
+ GString *query_str = g_string_new("");
+
+ assert(scheduler);
+
+ g_string_printf(query_str,
+ "SELECT recorded.chanid,starttime,endtime,title,"
+ "subtitle,description,channel.channum,"
+ "channel.callsign,channel.name,channel.commfree,"
+ "channel.outputfilters,seriesid,programid,filesize,"
+ "lastmodified,stars,previouslyshown,originalairdate,"
+ "hostname,recordid,transcoder,playgroup,"
+ "recorded.recpriority,progstart,progend,basename,recgroup,"
+ "category,findid,duplicate "
+ "FROM recorded " "LEFT JOIN channel "
+ "ON recorded.chanid = channel.chanid "
+ "WHERE recorded.chanid = \"%s\" "
+ "ORDER BY starttime DESC", channel->str);
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery, query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo = gmyth_program_info_new();
+
+ proginfo->chanid = g_string_new(msql_row[0]);
+ proginfo->recstartts = gmyth_util_string_to_time_val(msql_row[1]);
+ proginfo->recendts = gmyth_util_string_to_time_val(msql_row[2]);
+
+ proginfo->title = g_string_new(msql_row[3]);
+ proginfo->subtitle = g_string_new(msql_row[4]);
+ proginfo->description = g_string_new(msql_row[5]);
+
+ proginfo->chanstr = g_string_new(msql_row[6]);
+ proginfo->chansign = g_string_new(msql_row[7]);
+ proginfo->channame = g_string_new(msql_row[8]);
+ proginfo->chancommfree = (gint) g_ascii_strtoull(msql_row[9], NULL, 10);
+ proginfo->chanOutputFilters = g_string_new(msql_row[10]);
+ proginfo->seriesid = g_string_new(msql_row[11]);
+ proginfo->programid = g_string_new(msql_row[12]);
+ proginfo->filesize = g_ascii_strtoull(msql_row[13], NULL, 10);
+
+ proginfo->lastmodified = gmyth_util_string_to_time_val(msql_row[14]);
+ proginfo->stars = g_ascii_strtod(msql_row[15], NULL);
+ proginfo->repeat = (gint)g_ascii_strtoull(msql_row[16], NULL, 10);
+
+ if (msql_row[17] == NULL) {
+ proginfo->originalAirDate = 0;
+ proginfo->hasAirDate = FALSE;
+ } else {
+ proginfo->originalAirDate = gmyth_util_string_to_time_val(msql_row[17]);
+ proginfo->hasAirDate = TRUE;
+ }
+
+ proginfo->hostname = g_string_new(msql_row[18]);
+ proginfo->recordid = (gint) g_ascii_strtoull(msql_row[19], NULL, 10);
+ proginfo->transcoder = (gint) g_ascii_strtoull(msql_row[20], NULL, 10);
+
+ proginfo->playgroup = g_string_new(msql_row[21]);
+ proginfo->recpriority = (gint) g_ascii_strtoull(msql_row[22], NULL, 10);
+
+ proginfo->startts = gmyth_util_string_to_time_val(msql_row[23]);
+ proginfo->endts = gmyth_util_string_to_time_val(msql_row[24]);
+ proginfo->pathname = g_string_new(g_strdup(msql_row[25]));
+ proginfo->recgroup = g_string_new(msql_row[26]);
+ proginfo->category = g_string_new(msql_row[27]);
+ proginfo->findid = (gint) g_ascii_strtoull(msql_row[28], NULL, 10);
+
+ proginfo->recpriority2 = 0;
+
+ g_string_printf(query_str,
+ "SELECT dupmethod,dupin,parentid,type "
+ "FROM record WHERE recordid = \"%d\"", proginfo->recordid);
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery,
+ query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo->dupmethod = (gint) g_ascii_strtoull(msql_row[0], NULL, 10);
+ proginfo->dupin = (gint) g_ascii_strtoull(msql_row[1], NULL, 10);
+ proginfo->parentid = (gint) g_ascii_strtoull(msql_row[2], NULL, 10);
+ proginfo->rectype = 0;
+ }
+ }
+
+
+ g_string_printf(query_str,
+ "SELECT sourceid,cardid,cardinputid,shareable "
+ "FROM cardinput");
+
+ msql_res =
+ gmyth_query_process_statement(scheduler->msqlquery,
+ query_str->str);
+
+ if (msql_res) {
+ MYSQL_ROW msql_row = mysql_fetch_row(msql_res);
+
+ if (msql_row) {
+ proginfo->sourceid = 0;
+ proginfo->cardid = 0;
+ proginfo->inputid = 0;
+ if (msql_row[3] != NULL && g_ascii_strcasecmp("Y", msql_row[3]) == 0)
+ proginfo->shareable = 1;
+ else
+ proginfo->shareable = 0;
+ }
+ }
+
+
+
+ }
+ }
+
+ g_string_free(query_str, TRUE);
+ return proginfo;
+}
+
/** Retrieves an existing recorded item information from database. The information
* is used to fill the returned GMythProgramInfo.
*
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -151,6 +151,15 @@
GList ** rec_list);
RecordedInfo* gmyth_scheduler_get_recorded_info (GMythScheduler *scheduler,
const char *basename);
+
+gboolean gmyth_scheduler_was_recorded_before(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time);
+
+gboolean gmyth_scheduler_reactivate_schedule(GMythScheduler* scheduler, gint channel_id,
+ time_t start_time);
+GMythProgramInfo*
+gmyth_scheduler_get_recorded_on_time(GMythScheduler* scheduler,
+ GString* channel);
GMythProgramInfo *gmyth_scheduler_get_recorded (GMythScheduler * scheduler,
GString * channel,
GTimeVal * starttime);
Modified: trunk/gmyth/src/gmyth_stringlist.c
===================================================================
--- trunk/gmyth/src/gmyth_stringlist.c 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_stringlist.c 2007-09-12 15:47:02 UTC (rev 847)
@@ -109,6 +109,24 @@
return value_str;
}
+
+/** Appends a gdouble to the string list.
+ *
+ * @param strlist The GMythStringList instance.
+ * @param value The gdouble to be appended.
+ *
+ * @return The appended gdouble converted to a GString object.
+ */
+GString *
+gmyth_string_list_append_float(GMythStringList * strlist, const gdouble value)
+{
+ GString *value_str = g_string_new("");
+ g_string_printf(value_str, "%f", value);
+ strlist->glist = g_list_append(strlist->glist, value_str);
+ return value_str;
+}
+
+
/** Appends a guint64 to the string list.
*
* @param strlist The GMythStringList instance.
Modified: trunk/gmyth/src/gmyth_stringlist.h
===================================================================
--- trunk/gmyth/src/gmyth_stringlist.h 2007-09-05 20:30:56 UTC (rev 846)
+++ trunk/gmyth/src/gmyth_stringlist.h 2007-09-12 15:47:02 UTC (rev 847)
@@ -75,6 +75,9 @@
void gmyth_string_list_clear_all(GMythStringList * strlist);
int gmyth_string_list_length(GMythStringList * strlist);
+GString *gmyth_string_list_append_float(GMythStringList * strlist,
+ const gdouble value);
+
GString *gmyth_string_list_append_int(GMythStringList * strlist,
const gint value);
GString *gmyth_string_list_append_uint64(GMythStringList * strlist,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-09-05 21:27:57
|
Revision: 846
http://gmyth.svn.sourceforge.net/gmyth/?rev=846&view=rev
Author: renatofilho
Date: 2007-09-05 13:30:56 -0700 (Wed, 05 Sep 2007)
Log Message:
-----------
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/Makefile.am
Modified: trunk/gst-gmyth/mythsrc/Makefile.am
===================================================================
--- trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-03 21:11:54 UTC (rev 845)
+++ trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-05 20:30:56 UTC (rev 846)
@@ -30,3 +30,5 @@
noinst_HEADERS = \
gstmythtvsrc.h
+CLEANFILES = \
+ $(libgstmythtvsrc_la_SOURCES)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-09-03 21:11:55
|
Revision: 845
http://gmyth.svn.sourceforge.net/gmyth/?rev=845&view=rev
Author: renatofilho
Date: 2007-09-03 14:11:54 -0700 (Mon, 03 Sep 2007)
Log Message:
-----------
moved mythsrc to gstreamer cvs
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/Makefile.am
Removed Paths:
-------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
trunk/gst-gmyth/mythsrc/gstmythtvsrc.h
Modified: trunk/gst-gmyth/mythsrc/Makefile.am
===================================================================
--- trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-03 20:14:14 UTC (rev 844)
+++ trunk/gst-gmyth/mythsrc/Makefile.am 2007-09-03 21:11:54 UTC (rev 845)
@@ -3,7 +3,8 @@
plugin_LTLIBRARIES = libgstmythtvsrc.la
libgstmythtvsrc_la_SOURCES = \
- gstmythtvsrc.c
+ gstmythtvsrc.c \
+ gstmythtvsrc.h
libgstmythtvsrc_la_CFLAGS = \
$(GST_CFLAGS) \
@@ -18,6 +19,14 @@
$(GST_BASE_LIBS) \
$(GMYTH_LIBS)
+gstmythtvsrc.c:
+ cvs -d:pserver:an...@an...:/cvs/gstreamer/ co gst-plugins-bad/ext/mythtv/gstmythtvsrc.c
+ mv gst-plugins-bad/ext/mythtv/gstmythtvsrc.c .
+
+gstmythtvsrc.h:
+ cvs -d:pserver:an...@an...:/cvs/gstreamer/ co gst-plugins-bad/ext/mythtv/gstmythtvsrc.h
+ mv gst-plugins-bad/ext/mythtv/gstmythtvsrc.h .
+
noinst_HEADERS = \
gstmythtvsrc.h
Deleted: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-09-03 20:14:14 UTC (rev 844)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-09-03 21:11:54 UTC (rev 845)
@@ -1,1085 +0,0 @@
-/*
- * GStreamer MythTV Plug-in Copyright (C) <2006> Rosfran Borges
- * <ros...@in...> This library is free software; you can
- * redistribute it and/or modify it under the terms of the GNU Library
- * General Public License as published by the Free Software Foundation;
- * either version 2 of the License, or (at your option) any later version.
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
- * General Public License for more details. You should have received a copy
- * of the GNU Library General Public License along with this library; if
- * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite
- * 330, Boston, MA 02111-1307, USA.
- */
-/**
- * SECTION:element-mythtvsrc
- *
- * <refsect2>
- * <para>
- * MythTVSrc allows to access a remote MythTV backend streaming Video/Audio server,
- * and to render audio and video content through a TCP/IP connection to a specific
- * port on this server, and based on a known MythTV protocol that is based on
- * some message passing, such as REQUEST_BLOCK on a specified number of bytes, to get
- * some chunk of remote file data.
- * You should pass the information aboute the remote MythTV backend server
- * through the <link linkend="GstMythTVSrc--location">location</link> property.
- * </para>
- * <title>Examples</title>
- * <para>
- * If you want to get the LiveTV content (set channel, TV tuner, RemoteEncoder,
- * Recorder),
- * put the following URI:
- *
- * <programlisting>
- * myth://xxx.xxx.xxx.xxx:6543/livetv?channel=BBC
- * </programlisting>
- *
- * This URI will say to the gmyth library to configure the Recorder instance (used to
- * change the channel, start the TV multimedia content transmition, etc.), using
- * the IP address (xxx.xxx.xxx.xxx) and port number (6543) of the MythTV backend
- * server, and setting the channel name to "BBC".
- *
- * To get a already recorded the MythTV NUV file, put the following URI:
- *
- * <programlisting>
- * myth://xxx.xxx.xxx.xxx:6543/filename.nuv
- * </programlisting>
- *
- * This URI will say to the gmyth library to configure the Recorder instance (used to
- * change the channel, start the TV multimedia content transmition, etc.), using
- * the IP address (xxx.xxx.xxx.xxx) and port number (6543) of the MythTV backend
- * server, and setting the channel name to "BBC".
- *
- * Another possible way to use the LiveTV content, and just in the case you want to
- * use the mysql database, put the location URI in the following format:
- *
- * <programlisting>
- * myth://mythtv:my...@xx...:6543/?mythconverg&channel=9
- * </programlisting>
- *
- * Where the first field is the protocol (myth), the second and third are user
- * name (mythtv) and password (mythtv), then backend host name and port number,
- * and the last field is the database name (mythconverg).
- * </para>
- * </refsect2>
- */
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include "gstmythtvsrc.h"
-#include <gmyth/gmyth_file.h>
-#include <gmyth/gmyth_file_transfer.h>
-#include <gmyth/gmyth_file_local.h>
-#include <gmyth/gmyth_livetv.h>
-
-#include <gmyth/gmyth_socket.h>
-#include <gmyth/gmyth_tvchain.h>
-
-#include <string.h>
-#include <unistd.h>
-
-GST_DEBUG_CATEGORY_STATIC(mythtvsrc_debug);
-#define GST_GMYTHTV_ID_NUM 1
-#define GST_GMYTHTV_CHANNEL_DEFAULT_NUM (-1)
-#define GMYTHTV_VERSION_DEFAULT 30
-#define GMYTHTV_TRANSFER_MAX_WAITS 100
-#define GMYTHTV_TRANSFER_MAX_RESENDS 2
-#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
-#define READ_SIZE (14*1024)
-#define READ_SIZE_LIVETV (80*1024)
-#define GST_FLOW_ERROR_NO_DATA (-101)
-
-static const GstElementDetails gst_mythtv_src_details =
-GST_ELEMENT_DETAILS("MythTV client source",
- "Source/Network",
- "Control and receive data as a client over the network "
- "via raw socket connections using the MythTV protocol",
- "Rosfran Borges <ros...@in...>");
-
-static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE("src",
- GST_PAD_SRC,
- GST_PAD_ALWAYS,
- GST_STATIC_CAPS_ANY);
- /*
- * GST_STATIC_CAPS ("video/x-nuv"));
- */
-
-enum {
- PROP_0,
- PROP_LOCATION,
- PROP_GMYTHTV_VERSION,
- PROP_GMYTHTV_LIVE,
- PROP_GMYTHTV_LIVEID,
- PROP_GMYTHTV_LIVE_CHAINID,
- PROP_GMYTHTV_ENABLE_TIMING_POSITION,
- PROP_GMYTHTV_CHANNEL_NUM
-};
-
-static void gst_mythtv_src_clear(GstMythtvSrc * mythtv_src);
-
-static void gst_mythtv_src_finalize(GObject * gobject);
-
-static GstFlowReturn gst_mythtv_src_create(GstPushSrc * psrc,
- GstBuffer ** outbuf);
-
-static gboolean gst_mythtv_src_start(GstBaseSrc * bsrc);
-static gboolean gst_mythtv_src_stop(GstBaseSrc * bsrc);
-static gboolean gst_mythtv_src_get_size(GstBaseSrc * bsrc, guint64 * size);
-static gboolean gst_mythtv_src_is_seekable(GstBaseSrc * push_src);
-
-static gboolean gst_mythtv_src_do_seek(GstBaseSrc * base,
- GstSegment * segment);
-
-static GstStateChangeReturn
-gst_mythtv_src_change_state(GstElement * element,
- GstStateChange transition);
-
-static void gst_mythtv_src_set_property(GObject * object,
- guint prop_id,
- const GValue * value,
- GParamSpec * pspec);
-static void gst_mythtv_src_get_property(GObject * object,
- guint prop_id, GValue * value,
- GParamSpec * pspec);
-
-static void gst_mythtv_src_uri_handler_init(gpointer g_iface,
- gpointer iface_data);
-
-static gboolean gst_mythtv_src_handle_query(GstPad * pad,
- GstQuery * query);
-
-static gboolean gst_mythtv_src_handle_event(GstPad * pad,
- GstEvent * event);
-
-static GMythFileReadResult do_read_request_response(GstMythtvSrc * src,
- guint size,
- GByteArray * data_ptr);
-
-static void
-_urihandler_init(GType type)
-{
- static const GInterfaceInfo urihandler_info = {
- gst_mythtv_src_uri_handler_init,
- NULL,
- NULL
- };
-
- g_type_add_interface_static(type, GST_TYPE_URI_HANDLER,
- &urihandler_info);
-
- GST_DEBUG_CATEGORY_INIT(mythtvsrc_debug, "mythtvsrc", 0, "MythTV src");
-}
-
-GST_BOILERPLATE_FULL(GstMythtvSrc, gst_mythtv_src, GstPushSrc,
- GST_TYPE_PUSH_SRC, _urihandler_init)
- static void gst_mythtv_src_base_init(gpointer g_class)
-{
- GstElementClass *element_class = GST_ELEMENT_CLASS(g_class);
-
- gst_element_class_add_pad_template(element_class,
- gst_static_pad_template_get
- (&srctemplate));
-
- gst_element_class_set_details(element_class, &gst_mythtv_src_details);
-
- element_class->change_state = gst_mythtv_src_change_state;
-
-}
-
-static void
-gst_mythtv_src_class_init(GstMythtvSrcClass * klass)
-{
- GObjectClass *gobject_class;
- GstPushSrcClass *gstpushsrc_class;
- GstBaseSrcClass *gstbasesrc_class;
-
- gobject_class = (GObjectClass *) klass;
- gstbasesrc_class = (GstBaseSrcClass *) klass;
- gstpushsrc_class = (GstPushSrcClass *) klass;
-
- gobject_class->set_property = gst_mythtv_src_set_property;
- gobject_class->get_property = gst_mythtv_src_get_property;
- gobject_class->finalize = gst_mythtv_src_finalize;
-
- g_object_class_install_property
- (gobject_class, PROP_LOCATION,
- g_param_spec_string("location", "Location",
- "The location. In the form:"
- "\n\t\t\tmyth://a.com/file.nuv"
- "\n\t\t\tmyth://a.com:23223/file.nuv "
- "\n\t\t\ta.com/file.nuv - default scheme 'myth'",
- "", G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_VERSION,
- g_param_spec_int("mythtv-version", "mythtv-version",
- "Change MythTV version", 26, 30, 26,
- G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_LIVEID,
- g_param_spec_int("mythtv-live-id", "mythtv-live-id",
- "Change MythTV version",
- 0, 200, GST_GMYTHTV_ID_NUM, G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_LIVE_CHAINID,
- g_param_spec_string("mythtv-live-chainid", "mythtv-live-chainid",
- "Sets the MythTV chain ID (from TV Chain)",
- "", G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_LIVE,
- g_param_spec_boolean("mythtv-live", "mythtv-live",
- "Enable MythTV Live TV content streaming",
- FALSE, G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_ENABLE_TIMING_POSITION,
- g_param_spec_boolean("mythtv-enable-timing-position",
- "mythtv-enable-timing-position",
- "Enable MythTV Live TV content size continuous updating",
- FALSE, G_PARAM_READWRITE));
-
- g_object_class_install_property
- (gobject_class, PROP_GMYTHTV_CHANNEL_NUM,
- g_param_spec_string("mythtv-channel", "mythtv-channel",
- "Change MythTV channel number",
- "", G_PARAM_READWRITE));
-
- gstbasesrc_class->start = gst_mythtv_src_start;
- gstbasesrc_class->stop = gst_mythtv_src_stop;
- gstbasesrc_class->get_size = gst_mythtv_src_get_size;
- gstbasesrc_class->is_seekable = gst_mythtv_src_is_seekable;
- gstbasesrc_class->do_seek = gst_mythtv_src_do_seek;
- gstpushsrc_class->create = gst_mythtv_src_create;
-
- GST_DEBUG_CATEGORY_INIT(mythtvsrc_debug, "mythtvsrc", 0,
- "MythTV Client Source");
-}
-
-static void
-gst_mythtv_src_init(GstMythtvSrc * this, GstMythtvSrcClass * g_class)
-{
- this->file = NULL;
- this->unique_setup = FALSE;
- this->mythtv_version = GMYTHTV_VERSION_DEFAULT;
- this->state = GST_MYTHTV_SRC_FILE_TRANSFER;
- this->bytes_read = 0;
- this->prev_content_size = 0;
- this->content_size = 0;
- this->read_offset = 0;
- this->content_size_last = 0;
- this->live_tv = FALSE;
- this->enable_timing_position = FALSE;
- this->update_prog_chain = FALSE;
- this->user_agent = g_strdup("mythtvsrc");
- this->update_prog_chain = FALSE;
- this->channel_name = NULL;
- this->eos = FALSE;
- this->wait_to_transfer = 0;
- gst_base_src_set_format(GST_BASE_SRC(this), GST_FORMAT_BYTES);
- gst_pad_set_event_function(GST_BASE_SRC_PAD(GST_BASE_SRC(this)),
- gst_mythtv_src_handle_event);
- gst_pad_set_query_function(GST_BASE_SRC_PAD(GST_BASE_SRC(this)),
- gst_mythtv_src_handle_query);
-
-}
-
-static void
-gst_mythtv_src_clear(GstMythtvSrc * mythtv_src)
-{
- mythtv_src->unique_setup = FALSE;
-
- if (mythtv_src->spawn_livetv) {
- g_object_unref(mythtv_src->spawn_livetv);
- mythtv_src->spawn_livetv = NULL;
- }
-
- if (mythtv_src->file) {
- g_object_unref(mythtv_src->file);
- mythtv_src->file = NULL;
- }
-
- if (mythtv_src->backend_info) {
- g_object_unref(mythtv_src->backend_info);
- mythtv_src->backend_info = NULL;
- }
-}
-
-static void
-gst_mythtv_src_finalize(GObject * gobject)
-{
- GstMythtvSrc *this = GST_MYTHTV_SRC(gobject);
-
- gst_mythtv_src_clear(this);
-
- if (this->uri_name) {
- g_free(this->uri_name);
- this->uri_name = NULL;
- }
-
- if (this->user_agent) {
- g_free(this->user_agent);
- this->user_agent = NULL;
- }
-
- G_OBJECT_CLASS(parent_class)->finalize(gobject);
-}
-
-static GMythFileReadResult
-do_read_request_response(GstMythtvSrc * src, guint size,
- GByteArray * data_ptr)
-{
- gint read = 0;
- guint sizetoread = size;
- gint max_iters = GMYTHTV_TRANSFER_MAX_RESENDS;
- GMythFileReadResult result;
-
- GST_LOG_OBJECT(src, "Starting: Reading %d bytes...", sizetoread);
-
- /*
- * Loop sending the Myth File Transfer request: Retry whilst
- * authentication fails and we supply it.
- */
-
- while (sizetoread == size && --max_iters > 0) {
- /*
- * if ( gmyth_backend_info_is_local_file(src->backend_info) )
- */
- if (IS_GMYTH_FILE_LOCAL(src->file))
- result = gmyth_file_local_read(GMYTH_FILE_LOCAL(src->file),
- data_ptr, sizetoread,
- src->live_tv);
- else if (IS_GMYTH_FILE_TRANSFER(src->file))
- result =
- gmyth_file_transfer_read(GMYTH_FILE_TRANSFER(src->file),
- data_ptr, sizetoread,
- src->live_tv);
-
- if (data_ptr->len > 0) {
- read += data_ptr->len;
- sizetoread -= data_ptr->len;
- } else if (data_ptr->len <= 0) {
- if (src->live_tv == FALSE) {
- result = GMYTH_FILE_READ_EOF;
- goto eos;
- } else {
- if (result == GMYTH_FILE_READ_ERROR) { /* -314 */
- GST_INFO_OBJECT(src,
- "[LiveTV] FileTransfer READ_ERROR!");
- }
- goto done;
- }
- }
- /*
- * else if (data_ptr->len == 0) goto done;
- */
- if (read == sizetoread)
- goto done;
- }
-
- if ((read < 0 && !src->live_tv) || max_iters == 0) {
- result = GMYTH_FILE_READ_EOF;
- goto eos;
- }
-
- goto done;
-
- eos:
- src->eos = TRUE;
-
- done:
- return result;
-}
-
-static GstFlowReturn
-gst_mythtv_src_create(GstPushSrc * psrc, GstBuffer ** outbuf)
-{
- GstMythtvSrc *src;
- GstFlowReturn ret = GST_FLOW_OK;
- GByteArray *buffer;
- gint buffer_remain = 0;
- GMythFileReadResult result = GMYTH_FILE_READ_OK;
- gboolean buffering = FALSE;
-
- src = GST_MYTHTV_SRC(psrc);
-
- buffer = g_byte_array_new ();
- if (src->live_tv)
- result = do_read_request_response(src, READ_SIZE_LIVETV, buffer);
- else
- result = do_read_request_response(src, READ_SIZE, buffer);
-
- if (result == GMYTH_FILE_READ_ERROR)
- goto read_error;
-
-
- *outbuf = gst_buffer_new();
- GST_BUFFER_SIZE(*outbuf) = buffer->len;
- GST_BUFFER_MALLOCDATA(*outbuf) = g_malloc0(GST_BUFFER_SIZE(*outbuf));
- GST_BUFFER_DATA(*outbuf) = GST_BUFFER_MALLOCDATA(*outbuf);
- g_memmove(GST_BUFFER_DATA((*outbuf)), buffer->data,
- GST_BUFFER_SIZE(*outbuf));
- GST_BUFFER_OFFSET(*outbuf) = src->read_offset;
- GST_BUFFER_OFFSET_END(*outbuf) =
- src->read_offset + GST_BUFFER_SIZE(*outbuf);
-
- src->read_offset += GST_BUFFER_SIZE(*outbuf);
- src->bytes_read += GST_BUFFER_SIZE(*outbuf);
-
- g_byte_array_free (buffer, TRUE);
-
- if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
- GstPad *peer;
-
- peer = gst_pad_get_peer (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)));
- gst_pad_send_event (peer,
- gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
-
- gst_object_unref (peer);
- }
-
- if (src->eos ||
- (!src->live_tv && (src->bytes_read >= src->content_size)))
- ret = GST_FLOW_UNEXPECTED;
-
- return ret;
-
-read_error:
- GST_ELEMENT_ERROR(src, RESOURCE, READ,
- (NULL), ("Could not read any bytes (%i, %s)",
- read, src->uri_name));
- return GST_FLOW_ERROR;
-}
-
-gint64
-gst_mythtv_src_get_position(GstMythtvSrc * src)
-{
-
- gint64 size_tmp = 0;
- guint max_tries = 2;
-
- if (src->live_tv == TRUE && (abs(src->content_size - src->bytes_read) <
- GMYTHTV_TRANSFER_MAX_BUFFER)) {
-
- get_file_pos:
- g_usleep(10);
- size_tmp =
- gmyth_recorder_get_file_position(src->spawn_livetv->recorder);
- if (size_tmp > (src->content_size + GMYTHTV_TRANSFER_MAX_BUFFER))
- src->content_size = size_tmp;
- else if (size_tmp > 0 && --max_tries > 0)
- goto get_file_pos;
- GST_LOG_OBJECT(src, "GET_POSITION: file_position = %lld",
- size_tmp);
- /*
- * sets the last content size amount before it can be updated
- */
- src->prev_content_size = src->content_size;
- }
-
- return src->content_size;
-
-}
-
-static gboolean
-gst_mythtv_src_do_seek(GstBaseSrc * base, GstSegment * segment)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(base);
- gint64 new_offset = -1;
- gint64 actual_seek = segment->start;
- gboolean ret = TRUE;
-
- GST_LOG_OBJECT(src, "seek, segment: %" GST_SEGMENT_FORMAT, segment);
-
- if (segment->format == GST_FORMAT_TIME) {
- goto done;
- }
- GST_LOG_OBJECT(src,
- "Trying to seek at the value (actual_seek = %lld, read_offset = %lld)",
- actual_seek, src->read_offset);
- /*
- * verify if it needs to seek
- */
- if (src->read_offset != actual_seek) {
-
- /*
- * if ( gmyth_backend_info_is_local_file(src->backend_info) )
- */
- if (IS_GMYTH_FILE_LOCAL(src->file))
- new_offset =
- gmyth_file_local_seek(GMYTH_FILE_LOCAL(src->file),
- segment->start, G_SEEK_SET);
- else if (IS_GMYTH_FILE_TRANSFER(src->file))
- new_offset =
- gmyth_file_transfer_seek(GMYTH_FILE_TRANSFER(src->file),
- segment->start, SEEK_SET);
-
- GST_LOG_OBJECT(src,
- "Segment offset start = %lld, SRC Offset = %lld, NEW actual backend SEEK Offset = %lld.",
- segment->start, src->read_offset, new_offset);
- if (G_UNLIKELY(new_offset < 0)) {
- ret = FALSE;
- if (!src->live_tv)
- goto eos;
- }
-
- src->read_offset = new_offset;
-
- if (ret == FALSE) {
- GST_INFO_OBJECT(src, "Failed to set the SEEK on segment!");
- }
-
- }
-
- done:
- return ret;
-
- eos:
- {
- GST_DEBUG_OBJECT(src, "EOS found on seeking!!!");
- return FALSE;
- }
-
-}
-
-/*
- * create a socket for connecting to remote server
- */
-static gboolean
-gst_mythtv_src_start(GstBaseSrc * bsrc)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(bsrc);
-
- GString *chain_id_local = NULL;
- GMythURI *gmyth_uri = NULL;
- gboolean ret = TRUE;
- GstMessage *msg;
-
- if (src->unique_setup == FALSE) {
- src->unique_setup = TRUE;
- } else {
- goto done;
- }
-
- gmyth_uri = gmyth_uri_new_with_value(src->uri_name);
- src->backend_info = gmyth_backend_info_new_with_uri(src->uri_name);
- src->live_tv = gmyth_uri_is_livetv(gmyth_uri);
-
- if (src->live_tv) {
- src->spawn_livetv = gmyth_livetv_new(src->backend_info);
- gchar *ch = gmyth_uri_get_channel_name(gmyth_uri);
- if (ch != NULL)
- src->channel_name = ch;
-
- if (src->channel_name != NULL) {
- gboolean result;
- result =
- gmyth_livetv_channel_name_setup(src->spawn_livetv,
- src->channel_name);
- if (result == FALSE) {
- GST_INFO_OBJECT(src, "LiveTV setup felt down on error");
- ret = FALSE;
- goto init_failed;
- }
-
- } else {
- if (gmyth_livetv_setup(src->spawn_livetv) == FALSE) {
- GST_INFO_OBJECT(src, "LiveTV setup felt down on error");
- ret = FALSE;
- goto init_failed;
- }
- }
-
- /*
- * testing change channel...
- */
- /*
- * gmyth_recorder_change_channel( src->spawn_livetv->recorder,
- * CHANNEL_DIRECTION_UP );
- */
-
- src->file =
- GMYTH_FILE(gmyth_livetv_create_file_transfer
- (src->spawn_livetv));
-
-
- if (NULL == src->file) {
- GST_INFO_OBJECT(src, "[LiveTV] FileTransfer equals to NULL");
- ret = FALSE;
- goto init_failed;
- }
-
- /*
- * Check if the file is local to this specific client renderer
- */
- if (gmyth_uri_is_local_file(gmyth_uri))
- ret = gmyth_file_local_open(GMYTH_FILE_LOCAL(src->file));
- else
- ret =
- gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(src->file),
- src->spawn_livetv->uri !=
- NULL ? gmyth_uri_get_path(src->
- spawn_livetv->
- uri) :
- src->spawn_livetv->proginfo->
- pathname->str);
-
- /*
- * sets the mythtvsrc "location" property
- */
- g_object_set(src, "location", gmyth_file_get_uri(src->file), NULL);
-
- if (!ret) {
- GST_INFO_OBJECT(src,
- "Error: couldn't open the FileTransfer from LiveTV source!");
- g_object_unref(src->file);
- src->file = NULL;
- goto init_failed;
- }
- } else {
-
- /*
- * Check if the file is local to this specific client renderer,
- * and tries to open a local connection
- */
- if (gmyth_uri_is_local_file(gmyth_uri)) {
- src->file =
- GMYTH_FILE(gmyth_file_local_new(src->backend_info));
- ret = gmyth_file_local_open(GMYTH_FILE_LOCAL(src->file));
- } else {
- src->file =
- GMYTH_FILE(gmyth_file_transfer_new(src->backend_info));
- ret =
- gmyth_file_transfer_open(GMYTH_FILE_TRANSFER(src->file),
- src->uri_name);
- }
-
- } /* if (else) - recorded FileTransfer */
-
- if (NULL == src->file) {
- GST_INFO_OBJECT(src, "FileTransfer is NULL");
- goto init_failed;
- }
- /*
- * GST_INFO_OBJECT( src, "uri = %s", src->spawn_livetv->file);
- */
-
- if (ret == FALSE) {
- GST_INFO_OBJECT(src,
- "MythTV FileTransfer request failed when setting up socket connection!");
- goto begin_req_failed;
- }
-
- GST_INFO_OBJECT(src,
- "MythTV FileTransfer filesize = %lld, content_size = %lld!",
- gmyth_file_get_filesize(src->file), src->content_size);
-
- src->content_size = gmyth_file_get_filesize(src->file);
-
- msg =
- gst_message_new_duration(GST_OBJECT(src), GST_FORMAT_BYTES,
- src->content_size);
- gst_element_post_message(GST_ELEMENT(src), msg);
-
-
- src->do_start = FALSE;
-
- gst_pad_push_event(GST_BASE_SRC_PAD(GST_BASE_SRC(src)),
- gst_event_new_new_segment(TRUE, 1.0,
- GST_FORMAT_TIME, 0,
- src->content_size, 0));
-
- done:
- if (gmyth_uri != NULL) {
- g_object_unref(gmyth_uri);
- gmyth_uri = NULL;
- }
-
- if (chain_id_local != NULL) {
- g_string_free(chain_id_local, TRUE);
- chain_id_local = NULL;
- }
-
- return TRUE;
-
- /*
- * ERRORS
- */
- init_failed:
- if (gmyth_uri != NULL) {
- g_object_unref(gmyth_uri);
- gmyth_uri = NULL;
- }
-
- if (src->spawn_livetv != NULL) {
- g_object_unref(src->spawn_livetv);
- src->spawn_livetv = NULL;
- }
-
- GST_ELEMENT_ERROR(src, LIBRARY, INIT,
- (NULL),
- ("Could not initialize MythTV library (%i, %s)", ret,
- src->uri_name));
-
-
- gst_mythtv_src_clear(src);
-
- return FALSE;
- begin_req_failed:
- if (gmyth_uri != NULL) {
- g_object_unref(gmyth_uri);
- gmyth_uri = NULL;
- }
-
- GST_ELEMENT_ERROR(src, LIBRARY, INIT,
- (NULL),
- ("Could not begin request sent to MythTV server (%i, %s)",
- ret, src->uri_name));
- return FALSE;
-
-}
-
-static gboolean
-gst_mythtv_src_get_size(GstBaseSrc * bsrc, guint64 * size)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(bsrc);
- gboolean ret = TRUE;
-
- GST_LOG_OBJECT(src,
- "Differs from previous content size: %d (max.: %d)",
- abs(src->content_size - src->prev_content_size),
- GMYTHTV_TRANSFER_MAX_BUFFER);
-
- if (src->live_tv) {
- ret = FALSE;
- } else if (src->live_tv && src->enable_timing_position
- && (abs(src->content_size - src->bytes_read) <
- GMYTHTV_TRANSFER_MAX_BUFFER)) {
-
- gint64 new_offset =
- gmyth_recorder_get_file_position(src->spawn_livetv->recorder);
- if (new_offset > 0 && new_offset > src->content_size) {
- src->content_size = new_offset;
- } else if (new_offset < src->content_size) {
- src->update_prog_chain = TRUE;
- }
-
- }
-
- *size = src->content_size;
- GST_LOG_OBJECT(src, "Content size = %lld", src->content_size);
-
- return ret;
-
-}
-
-/*
- * close the socket and associated resources used both to recover from
- * errors and go to NULL state
- */
-static gboolean
-gst_mythtv_src_stop(GstBaseSrc * bsrc)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(bsrc);
-
- gst_mythtv_src_clear(src);
- return TRUE;
-}
-
-static gboolean
-gst_mythtv_src_handle_event(GstPad * pad, GstEvent * event)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(GST_PAD_PARENT(pad));
- gint64 cont_size = 0;
- gboolean ret = TRUE;
-
- switch (GST_EVENT_TYPE(event)) {
- case GST_EVENT_EOS:
- if (src->live_tv) {
- cont_size = gst_mythtv_src_get_position(src);
- if (cont_size > src->content_size) {
- src->content_size = cont_size;
- src->eos = FALSE;
- } else {
- src->eos = TRUE;
- gst_element_set_state(GST_ELEMENT(src), GST_STATE_NULL);
- gst_element_set_locked_state(GST_ELEMENT(src), FALSE);
- }
- }
- break;
- default:
- ret = gst_pad_event_default(pad, event);
- }
-
- GST_DEBUG_OBJECT (src, "HANDLE EVENT %d", ret);
- return ret;
-}
-
-static gboolean
-gst_mythtv_src_is_seekable(GstBaseSrc * push_src)
-{
- return TRUE;
-}
-
-static gboolean
-gst_mythtv_src_handle_query(GstPad * pad, GstQuery * query)
-{
- gboolean res = FALSE;
- GstMythtvSrc *myth = GST_MYTHTV_SRC(gst_pad_get_parent(pad));
- GstFormat formt;
-
-
- switch (GST_QUERY_TYPE(query)) {
- case GST_QUERY_POSITION:
- gst_query_parse_position(query, &formt, NULL);
- if (formt == GST_FORMAT_BYTES) {
- gst_query_set_position(query, formt, myth->read_offset);
- GST_DEBUG_OBJECT(myth, "POS %" G_GINT64_FORMAT,
- myth->read_offset);
- res = TRUE;
- } else if (formt == GST_FORMAT_TIME) {
- res = gst_pad_query_default(pad, query);
- }
- break;
- case GST_QUERY_DURATION:
- gst_query_parse_duration(query, &formt, NULL);
- if (formt == GST_FORMAT_BYTES) {
- gint64 size = myth->content_size;
-
- gst_query_set_duration(query, GST_FORMAT_BYTES, 10);
- GST_DEBUG_OBJECT(myth, "SIZE %" G_GINT64_FORMAT, size);
- res = TRUE;
- } else if (formt == GST_FORMAT_TIME) {
- res = gst_pad_query_default(pad, query);
- }
- break;
- default:
- res = gst_pad_query_default(pad, query);
- break;
- }
-
- gst_object_unref(myth);
-
- return res;
-}
-
-static GstStateChangeReturn
-gst_mythtv_src_change_state(GstElement * element,
- GstStateChange transition)
-{
- GstStateChangeReturn ret = GST_STATE_CHANGE_FAILURE;
- GstMythtvSrc *src = GST_MYTHTV_SRC(element);
-
- switch (transition) {
- case GST_STATE_CHANGE_NULL_TO_READY:
- break;
- case GST_STATE_CHANGE_READY_TO_PAUSED:
- if (!src->uri_name) {
- GST_WARNING_OBJECT (src, "Invalid location");
- return ret;
- }
- break;
- case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
- if (src->live_tv) {
- if (!gmyth_recorder_send_frontend_ready_command
- (src->spawn_livetv->recorder))
- GST_WARNING_OBJECT(src,
- "Couldn't send the FRONTEND_READY message to the backend!");
- else
- GST_DEBUG_OBJECT(src, "FRONTEND_READY was sent to the backend");
- }
- break;
- default:
- break;
- }
-
- ret = GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
- if (ret == GST_STATE_CHANGE_FAILURE) {
- return ret;
- }
-
-
- switch (transition) {
- case GST_STATE_CHANGE_READY_TO_NULL:
- gst_mythtv_src_clear(src);
- break;
- case GST_STATE_CHANGE_PLAYING_TO_PAUSED:
- case GST_STATE_CHANGE_PAUSED_TO_READY:
- break;
- default:
- break;
- }
-
- return ret;
-}
-
-static void
-gst_mythtv_src_set_property(GObject * object, guint prop_id,
- const GValue * value, GParamSpec * pspec)
-{
- GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC(object);
-
- GST_OBJECT_LOCK(mythtvsrc);
- switch (prop_id) {
- case PROP_LOCATION:
- if (!g_value_get_string(value)) {
- GST_WARNING("location property cannot be NULL");
- break;
- }
-
- if (mythtvsrc->uri_name != NULL) {
- g_free(mythtvsrc->uri_name);
- mythtvsrc->uri_name = NULL;
- }
- mythtvsrc->uri_name = g_value_dup_string(value);
- break;
- case PROP_GMYTHTV_VERSION:
- mythtvsrc->mythtv_version = g_value_get_int(value);
- break;
- case PROP_GMYTHTV_LIVEID:
- mythtvsrc->live_tv_id = g_value_get_int(value);
- break;
- case PROP_GMYTHTV_LIVE:
- mythtvsrc->live_tv = g_value_get_boolean(value);
- break;
- case PROP_GMYTHTV_ENABLE_TIMING_POSITION:
- mythtvsrc->enable_timing_position = g_value_get_boolean(value);
- break;
- case PROP_GMYTHTV_LIVE_CHAINID:
- if (!g_value_get_string(value)) {
- GST_WARNING_OBJECT(object, "MythTV Live chainid property cannot be NULL");
- break;
- }
-
- if (mythtvsrc->live_chain_id != NULL) {
- g_free(mythtvsrc->live_chain_id);
- mythtvsrc->live_chain_id = NULL;
- }
- mythtvsrc->live_chain_id = g_value_dup_string(value);
- break;
- case PROP_GMYTHTV_CHANNEL_NUM:
- mythtvsrc->channel_name = g_value_dup_string(value);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-
- GST_OBJECT_UNLOCK(mythtvsrc);
-}
-
-static void
-gst_mythtv_src_get_property(GObject * object, guint prop_id,
- GValue * value, GParamSpec * pspec)
-{
- GstMythtvSrc *mythtvsrc = GST_MYTHTV_SRC(object);
-
- GST_OBJECT_LOCK(mythtvsrc);
- switch (prop_id) {
- case PROP_LOCATION:
- g_value_set_string(value, mythtvsrc->uri_name);
- break;
- case PROP_GMYTHTV_VERSION:
- g_value_set_int(value, mythtvsrc->mythtv_version);
- break;
- case PROP_GMYTHTV_LIVEID:
- g_value_set_int(value, mythtvsrc->live_tv_id);
- break;
- case PROP_GMYTHTV_LIVE:
- g_value_set_boolean(value, mythtvsrc->live_tv);
- break;
- case PROP_GMYTHTV_ENABLE_TIMING_POSITION:
- g_value_set_boolean(value, mythtvsrc->enable_timing_position);
- break;
- case PROP_GMYTHTV_LIVE_CHAINID:
- g_value_set_string(value, mythtvsrc->live_chain_id);
- break;
- case PROP_GMYTHTV_CHANNEL_NUM:
- g_value_set_string(value, mythtvsrc->channel_name);
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
- GST_OBJECT_UNLOCK(mythtvsrc);
-}
-
-static gboolean
-plugin_init(GstPlugin * plugin)
-{
- return gst_element_register(plugin, "mythtvsrc", GST_RANK_NONE,
- GST_TYPE_MYTHTV_SRC);
-}
-
-GST_PLUGIN_DEFINE(GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- "mythtv",
- "lib MythTV src",
- plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME,
- GST_PACKAGE_ORIGIN);
-
-
-/*** GSTURIHANDLER INTERFACE *************************************************/
-static guint
-gst_mythtv_src_uri_get_type(void)
-{
- return GST_URI_SRC;
-}
-
-static gchar **
-gst_mythtv_src_uri_get_protocols(void)
-{
- static gchar *protocols[] = { "myth", "myths", NULL };
-
- return protocols;
-}
-
-static const gchar *
-gst_mythtv_src_uri_get_uri(GstURIHandler * handler)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(handler);
-
- return src->uri_name;
-}
-
-static gboolean
-gst_mythtv_src_uri_set_uri(GstURIHandler * handler, const gchar * uri)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(handler);
-
- gchar *protocol;
-
- protocol = gst_uri_get_protocol(uri);
- if ((strcmp(protocol, "myth") != 0)
- && (strcmp(protocol, "myths") != 0)) {
- g_free(protocol);
- return FALSE;
- }
- g_free(protocol);
- g_object_set(src, "location", uri, NULL);
-
- return TRUE;
-}
-
-static void
-gst_mythtv_src_uri_handler_init(gpointer g_iface, gpointer iface_data)
-{
- GstURIHandlerInterface *iface = (GstURIHandlerInterface *) g_iface;
-
- iface->get_type = gst_mythtv_src_uri_get_type;
- iface->get_protocols = gst_mythtv_src_uri_get_protocols;
- iface->get_uri = gst_mythtv_src_uri_get_uri;
- iface->set_uri = gst_mythtv_src_uri_set_uri;
-}
-
-void
-size_header_handler(void *userdata, const char *value)
-{
- GstMythtvSrc *src = GST_MYTHTV_SRC(userdata);
-
- GST_DEBUG_OBJECT(src, "content size = %lld bytes", src->content_size);
-}
Deleted: trunk/gst-gmyth/mythsrc/gstmythtvsrc.h
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.h 2007-09-03 20:14:14 UTC (rev 844)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.h 2007-09-03 21:11:54 UTC (rev 845)
@@ -1,118 +0,0 @@
-/*
- * GStreamer Copyright (C) <2006> Rosfran Borges
- * <ros...@in...> This library is free software; you can
- * redistribute it and/or modify it under the terms of the GNU Library
- * General Public License as published by the Free Software Foundation;
- * either version 2 of the License, or (at your option) any later version.
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
- * General Public License for more details. You should have received a copy
- * of the GNU Library General Public License along with this library; if
- * not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite
- * 330, Boston, MA 02111-1307, USA.
- */
-
-#ifndef __GST_MYTHTV_SRC_H__
-#define __GST_MYTHTV_SRC_H__
-
-#include <gst/gst.h>
-#include <gst/base/gstbasesrc.h>
-#include <gst/base/gstpushsrc.h>
-#include <stdio.h>
-
-#include <gmyth/gmyth_socket.h>
-#include <gmyth/gmyth_file.h>
-#include <gmyth/gmyth_file_transfer.h>
-#include <gmyth/gmyth_file_local.h>
-#include <gmyth/gmyth_livetv.h>
-#include <gmyth/gmyth_backendinfo.h>
-
-G_BEGIN_DECLS
-#define GST_TYPE_MYTHTV_SRC \
- (gst_mythtv_src_get_type())
-#define GST_MYTHTV_SRC(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_MYTHTV_SRC,GstMythtvSrc))
-#define GST_MYTHTV_SRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_MYTHTV_SRC,GstMythtvSrcClass))
-#define GST_IS_MYTHTV_SRC(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_MYTHTV_SRC))
-#define GST_IS_MYTHTV_SRC_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_MYTHTV_SRC))
-typedef struct _GstMythtvSrc GstMythtvSrc;
-typedef struct _GstMythtvSrcClass GstMythtvSrcClass;
-
-typedef enum {
- GST_MYTHTV_SRC_FILE_TRANSFER,
- GST_MYTHTV_SRC_NEXT_PROGRAM_CHAIN,
- GST_MYTHTV_SRC_INVALID_DATA
-} GstMythtvState;
-
-struct _GstMythtvSrc {
- GstPushSrc element;
-
- /*
- * MythFileTransfer
- */
- GMythFile *file;
-
- GMythLiveTV *spawn_livetv;
-
- GMythBackendInfo *backend_info;
-
- GstMythtvState state;
-
- gchar *uri_name;
- gchar *user_agent;
-
- gchar *live_chain_id;
-
- gint mythtv_version;
-
- gint64 content_size;
-
- gint64 prev_content_size;
-
- gint64 content_size_last;
-
- guint64 bytes_read;
-
- gint64 read_offset;
-
- gboolean eos;
-
- gboolean do_start;
-
- gboolean unique_setup;
-
- gboolean live_tv;
-
- gboolean enable_timing_position;
-
- gint live_tv_id;
-
- gchar *channel_name;
-
- guint mode;
-
- /*
- * MythTV capabilities
- */
- GstCaps *mythtv_caps;
-
- gboolean update_prog_chain;
-
- /*
- * stablish a maximum iteration value to the IS_RECORDING message
- */
- guint wait_to_transfer;
-};
-
-struct _GstMythtvSrcClass {
- GstPushSrcClass parent_class;
-};
-
-GType gst_mythtv_src_get_type(void);
-
-G_END_DECLS
-#endif /* __GST_MYTHTV_SRC_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-09-03 20:14:13
|
Revision: 844
http://gmyth.svn.sourceforge.net/gmyth/?rev=844&view=rev
Author: renatofilho
Date: 2007-09-03 13:14:14 -0700 (Mon, 03 Sep 2007)
Log Message:
-----------
fixed livetv destructor
Modified Paths:
--------------
trunk/gmyth/src/gmyth_livetv.c
Modified: trunk/gmyth/src/gmyth_livetv.c
===================================================================
--- trunk/gmyth/src/gmyth_livetv.c 2007-08-31 17:31:09 UTC (rev 843)
+++ trunk/gmyth/src/gmyth_livetv.c 2007-09-03 20:14:14 UTC (rev 844)
@@ -391,7 +391,7 @@
* @return <code>true</code> if the LiveTV's recorder instance configuration
* had been concluded succcesfully
*/
-static gboolean
+static gboolean
gmyth_livetv_setup_recorder_channel_name(GMythLiveTV * livetv,
gchar * channel)
{
@@ -399,6 +399,8 @@
g_return_val_if_fail(livetv != NULL, FALSE);
+ g_mutex_lock(livetv->mutex);
+
if (livetv->socket == NULL) {
livetv->socket = gmyth_socket_new();
/*
@@ -417,8 +419,6 @@
}
}
- g_mutex_lock(livetv->mutex);
-
livetv->is_livetv = TRUE;
livetv->local_hostname = gmyth_socket_get_local_hostname();
@@ -865,18 +865,18 @@
* @return the actual GMythFileTransfer instance, generated using the
* data got from the actual program info.
*/
-GMythFile *
+GMythFile*
gmyth_livetv_create_file_transfer(GMythLiveTV * livetv)
{
// GMythURI* uri = NULL;
if (NULL == livetv)
- goto done;
+ return NULL;
if (!livetv->setup_done) {
gmyth_debug
("Error: You must do the LiveTV setup, just before generating the FileTransfer from LiveTV source!");
- goto done;
+ return NULL;
}
if (livetv->proginfo != NULL)
@@ -936,19 +936,9 @@
g_object_ref(livetv->file);
+done:
g_mutex_unlock(livetv->mutex);
-
- /*
- * Do some locking procedure with the Monitor Handler messages...
- */
-
- done:
- /*
- * if ( uri != NULL ) { g_object_unref( uri ); uri = NULL; }
- */
-
return livetv->file;
-
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-31 23:27:52
|
Revision: 835
http://gmyth.svn.sourceforge.net/gmyth/?rev=835&view=rev
Author: morphbr
Date: 2007-08-28 07:41:35 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
- Increased buffer size on gstmythtvsrc.c
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-28 07:30:10 UTC (rev 834)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-28 14:41:35 UTC (rev 835)
@@ -87,7 +87,7 @@
#define GMYTHTV_TRANSFER_MAX_WAITS 100
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
-#define READ_SIZE (4*1024)
+#define READ_SIZE (100*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
static const GstElementDetails gst_mythtv_src_details =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-31 17:31:08
|
Revision: 843
http://gmyth.svn.sourceforge.net/gmyth/?rev=843&view=rev
Author: morphbr
Date: 2007-08-31 10:31:09 -0700 (Fri, 31 Aug 2007)
Log Message:
-----------
- Updated "chunked" bug on gmencoder
- Updated "poll" bug on gmencoder
- Updated wrong method name on transcoder
- Updated request_handler error message
- New version of gmyth_cat
Modified Paths:
--------------
trunk/gmyth/samples/gmyth_cat.c
trunk/gmyth-stream/server/lib/request_handler.py
trunk/gmyth-stream/server/lib/transcoder.py
trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
Modified: trunk/gmyth/samples/gmyth_cat.c
===================================================================
--- trunk/gmyth/samples/gmyth_cat.c 2007-08-30 12:46:59 UTC (rev 842)
+++ trunk/gmyth/samples/gmyth_cat.c 2007-08-31 17:31:09 UTC (rev 843)
@@ -1,4 +1,3 @@
-
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@@ -12,6 +11,12 @@
#include "gmyth_util.h"
#include "gmyth_common.h"
+
+static GMainLoop *main_loop = NULL;
+static GAsyncQueue *data_queue = NULL;
+static GThread *producer_thread = NULL;
+static gboolean program_end = FALSE;
+
typedef struct {
GMythBackendInfo *b_info;
char *filename;
@@ -99,13 +104,60 @@
return TRUE;
}
+static gpointer
+_async_data_producer_cb (gpointer data)
+{
+ gint file_transf_ret;
+ GMythFileTransfer *gmyth_file;
+ GArray *array = NULL;
+
+ gmyth_file = (GMythFileTransfer *) data;
+
+ array = g_array_new(FALSE, TRUE, sizeof(gchar));
+ file_transf_ret = gmyth_file_transfer_read (GMYTH_FILE_TRANSFER(gmyth_file),
+ (GByteArray *) array, 64000, TRUE);
+
+ while ((file_transf_ret == GMYTH_FILE_READ_OK) ||
+ (file_transf_ret == GMYTH_FILE_READ_NEXT_PROG_CHAIN) ||
+ program_end == FALSE) {
+
+ g_async_queue_push (data_queue, array);
+
+ array = g_array_new(FALSE, TRUE, sizeof(gchar));
+ file_transf_ret = gmyth_file_transfer_read (GMYTH_FILE_TRANSFER(gmyth_file),
+ (GByteArray *) array, 64000, TRUE);
+ }
+
+ gmyth_file_transfer_close(gmyth_file);
+ program_end = TRUE;
+
+ return NULL;
+}
+
+static gboolean
+_sync_data_consumer_cb (gpointer data)
+{
+ if (g_async_queue_length (data_queue) > 0) {
+ GArray *data = g_async_queue_try_pop (data_queue);
+
+ if (data != NULL) {
+ fwrite(data->data, sizeof (gchar) , data->len, stdout);
+ fflush(stdout);
+ g_array_free (data, TRUE);
+ }
+ }
+
+ if (program_end == TRUE && g_async_queue_length (data_queue) == 0) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
static gboolean
_cat_recorded_file(cat_options_t * options)
{
- GArray *array = NULL;
GMythFileTransfer *transfer;
- guint64 size = 0,
- total = 0;
g_return_val_if_fail(options != NULL, FALSE);
g_return_val_if_fail(options->b_info != NULL, FALSE);
@@ -123,49 +175,16 @@
return FALSE;
}
- size = gmyth_file_transfer_get_filesize(transfer);
- fprintf(stderr, "Size:%" G_GUINT64_FORMAT "\n", size);
-
- array = g_array_new(FALSE, TRUE, sizeof(gchar));
-
- while (total != size) {
- GMythFileReadResult res;
-
- res = gmyth_file_transfer_read(transfer, (GByteArray *) array,
- (size - total) >
- 64000 ? 64000 : (size - total),
- FALSE);
- if ((res != GMYTH_FILE_READ_OK) && (res != GMYTH_FILE_READ_EOF)) {
- g_array_free(array, TRUE);
- g_printerr("Error while reading the file: aborting!!\n");
- break;
- }
-
- fwrite(array->data, array->len, 1, stdout);
- fflush(stdout);
-
- total += array->len;
- fprintf(stderr, "%" G_GUINT64_FORMAT "\n", total);
- g_array_remove_range(array, 0, array->len);
- // usleep(300000);
- }
-
- gmyth_file_transfer_close(transfer);
- g_array_free(array, TRUE);
- g_object_unref(transfer);
-
- return TRUE;
+ producer_thread = g_thread_create (_async_data_producer_cb, transfer, TRUE, NULL);
+ return TRUE;
}
-static gboolean
+static gboolean
_cat_channel(cat_options_t * options)
{
GMythLiveTV *livetv = NULL;
GMythFile *gmyth_file = NULL;
- GArray *array = NULL;
- gint file_transf_ret;
-
g_return_val_if_fail(options != NULL, FALSE);
g_return_val_if_fail(options->b_info != NULL, FALSE);
g_return_val_if_fail(options->channel != NULL, FALSE);
@@ -193,25 +212,30 @@
return FALSE;
}
- array = g_array_new(FALSE, TRUE, sizeof(gchar));
+ producer_thread = g_thread_create (_async_data_producer_cb, gmyth_file, TRUE, NULL);
+ return TRUE;
+}
- while (((file_transf_ret = gmyth_file_transfer_read
- (GMYTH_FILE_TRANSFER(gmyth_file),
- (GByteArray *) array, 64000, TRUE)) == GMYTH_FILE_READ_OK) ||
- file_transf_ret == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
- fwrite(array->data, sizeof(gpointer), array->len, stdout);
- fflush(stdout);
- g_array_remove_range(array, 0, array->len);
+static gboolean
+_cat_loop (cat_options_t *options)
+{
+ gboolean res = FALSE;
- g_main_context_iteration(g_main_context_default(), FALSE);
+ data_queue = g_async_queue_new();
+
+ if (options->filename)
+ res = _cat_recorded_file(options);
+ else if (options->channel)
+ res = _cat_channel(options);
+ else {
+ g_printerr
+ ("Argument invalid. You must specify --filename or --channel.\n"
+ "Type --help for more information.\n");
}
- g_array_free(array, TRUE);
- g_object_unref(gmyth_file);
- g_object_unref(livetv);
-
- return TRUE;
+ g_idle_add (_sync_data_consumer_cb, NULL);
+ return res;
}
int
@@ -224,6 +248,8 @@
if (!g_thread_supported())
g_thread_init(NULL);
+ main_loop = g_main_loop_new (NULL, FALSE);
+
options = _cat_options_new();
res = _parse_args(argc, argv, options);
if (!res) {
@@ -231,16 +257,11 @@
return 1;
}
- if (options->filename)
- res = _cat_recorded_file(options);
- else if (options->channel)
- res = _cat_channel(options);
- else
- g_printerr
- ("Argument invalid. You must specify --filename or --channel.\n"
- "Type --help for more information.\n");
+ if (!_cat_loop (options))
+ return 1;
+ g_main_loop_run (main_loop);
+
_cat_options_free(options);
-
return 0;
}
Modified: trunk/gmyth-stream/server/lib/request_handler.py
===================================================================
--- trunk/gmyth-stream/server/lib/request_handler.py 2007-08-30 12:46:59 UTC (rev 842)
+++ trunk/gmyth-stream/server/lib/request_handler.py 2007-08-31 17:31:09 UTC (rev 843)
@@ -425,10 +425,6 @@
self.send_response(200)
self.send_header("Content-Type", obj.get_mimetype())
self.send_header("Cache-Control","no-cache")
-
- if (obj.name == "gmencoder"):
- self.send_header("Transfer-Encoding", "chunked")
-
self.end_headers()
if body:
@@ -443,9 +439,9 @@
self.server.add_transcoders(self, obj)
if obj.start(self.wfile):
- self.transcoders_log.info (test_tid, "OK")
+ self.transcoders_log.info(test_tid, "OK")
else:
- self.transcoders_log.info (test_tid, "Fail")
+ self.transcoders_log.info(test_tid, "Fail")
self.server.del_transcoders(self, obj)
files.TranscodedFile("", self.query)
Modified: trunk/gmyth-stream/server/lib/transcoder.py
===================================================================
--- trunk/gmyth-stream/server/lib/transcoder.py 2007-08-30 12:46:59 UTC (rev 842)
+++ trunk/gmyth-stream/server/lib/transcoder.py 2007-08-31 17:31:09 UTC (rev 843)
@@ -42,7 +42,7 @@
pass
# stop()
- def get_legth (self):
+ def get_length (self):
pass
# get_leght ()
Modified: trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py
===================================================================
--- trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py 2007-08-30 12:46:59 UTC (rev 842)
+++ trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py 2007-08-31 17:31:09 UTC (rev 843)
@@ -64,7 +64,6 @@
self._insert_param("-o", "file://%s" % path)
else:
self._insert_param ("-o", "fd://%d" % outfd.fileno())
- self.opts.append ("-c")
cmd = " ".join(self.opts)
self.log.info(self.tid, "GMencoder: %s" % cmd)
@@ -84,8 +83,9 @@
try:
if not outfile:
p = select.poll()
- p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN )
-
+ p.register (outfd, select.POLLNVAL | select.POLLERR |
+ select.POLLHUP)
+ tries = 0
while (self.proc and self.proc.poll() == None):
r, w, x = select.select([self.proc.stdout], [], [], 1)
if self.proc.stdout in r:
@@ -93,12 +93,17 @@
if (progress.find ("PROGRESS") >= 0):
self.status = progress.split (":")[1]
elif (progress.find ("Erro") >= 0):
- return False
+ self.log.error(self.tid, "Detected problem @ gmencoder:"
+ " %s" % progress)
+ if tries < 50:
+ tries += 1
+ else:
+ return False
if not outfile:
ret = p.poll(0)
if ret:
- self.log.info(self.tid, "Lost connection")
+ self.log.info(self.tid, "* Lost connection *")
self.stop ()
return False
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-30 12:46:59 UTC (rev 842)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-31 17:31:09 UTC (rev 843)
@@ -88,7 +88,7 @@
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
#define READ_SIZE (14*1024)
-#define READ_SIZE_LIVETV (30*1024)
+#define READ_SIZE_LIVETV (80*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
static const GstElementDetails gst_mythtv_src_details =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-30 12:46:57
|
Revision: 842
http://gmyth.svn.sourceforge.net/gmyth/?rev=842&view=rev
Author: melunko
Date: 2007-08-30 05:46:59 -0700 (Thu, 30 Aug 2007)
Log Message:
-----------
Added some more fields at ScheduleInfo structure
Modified Paths:
--------------
trunk/gmyth/src/gmyth_scheduler.c
trunk/gmyth/src/gmyth_scheduler.h
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-08-30 11:51:31 UTC (rev 841)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-08-30 12:46:59 UTC (rev 842)
@@ -219,7 +219,7 @@
g_string_printf(query_str,
"SELECT recordid,programid,chanid,starttime,startdate,"
- "endtime,enddate,title,subtitle,description,category FROM record;");
+ "endtime,enddate,title,subtitle,description,category,type,parentid FROM record;");
if (scheduler->msqlquery == NULL) {
g_warning("[%s] Scheduler db connection not initialized",
@@ -240,6 +240,7 @@
while ((row = mysql_fetch_row(msql_res)) != NULL) {
schedule = g_new0(ScheduleInfo, 1);
+ gint type = 0;
schedule->schedule_id =
(guint) g_ascii_strtoull(row[0], NULL, 10);
@@ -267,6 +268,15 @@
schedule->subtitle = g_string_new(row[8]);
schedule->description = g_string_new(row[9]);
schedule->category = g_string_new(row[10]);
+ type = g_ascii_strtoull (row[11], NULL, 10);
+ if (type == 4) {
+ schedule->type = GMYTH_SCHEDULE_ALL_OCCURRENCES;
+ } else if (type == 1) {
+ schedule->type = GMYTH_SCHEDULE_ONE_OCCURRENCE;
+ } else if (type == 8) {
+ schedule->type = GMYTH_SCHEDULE_EXCEPTION;
+ schedule->parentid = (gint) g_ascii_strtoull (row[12], NULL, 10);
+ }
(*schedule_list) = g_list_append(*(schedule_list), schedule);
}
@@ -505,7 +515,7 @@
_set_int_value(scheduler->msqlquery, "type", 1, rec_id);
} else if (type == GMYTH_SCHEDULE_EXCEPTION) {
_set_int_value(scheduler->msqlquery, "type", 8, rec_id);
- _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid,
+ _set_int_value(scheduler->msqlquery, "parentid", schedule_info->parentid,
rec_id);
}
@@ -535,9 +545,7 @@
schedule_info->schedule_id = rec_id;
- /*
- * Notify the backend of changes
- */
+ /* Notify the backend of changes */
return update_backend(scheduler, rec_id);
}
Modified: trunk/gmyth/src/gmyth_scheduler.h
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.h 2007-08-30 11:51:31 UTC (rev 841)
+++ trunk/gmyth/src/gmyth_scheduler.h 2007-08-30 12:46:59 UTC (rev 842)
@@ -110,6 +110,8 @@
GString *description;
GString *category;
+ GMythScheduleType type;
+
gint parentid;
} ScheduleInfo;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-30 11:51:30
|
Revision: 841
http://gmyth.svn.sourceforge.net/gmyth/?rev=841&view=rev
Author: morphbr
Date: 2007-08-30 04:51:31 -0700 (Thu, 30 Aug 2007)
Log Message:
-----------
- Fixed livetv buffer at 30kb during tests
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-30 07:11:50 UTC (rev 840)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-30 11:51:31 UTC (rev 841)
@@ -88,7 +88,7 @@
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
#define READ_SIZE (14*1024)
-#define READ_SIZE_LIVETV (80*1024)
+#define READ_SIZE_LIVETV (30*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
static const GstElementDetails gst_mythtv_src_details =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-30 07:11:47
|
Revision: 840
http://gmyth.svn.sourceforge.net/gmyth/?rev=840&view=rev
Author: morphbr
Date: 2007-08-30 00:11:50 -0700 (Thu, 30 Aug 2007)
Log Message:
-----------
- Another fix on gstmythtvsrc.c buffers size
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-29 14:33:31 UTC (rev 839)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-30 07:11:50 UTC (rev 840)
@@ -83,12 +83,12 @@
GST_DEBUG_CATEGORY_STATIC(mythtvsrc_debug);
#define GST_GMYTHTV_ID_NUM 1
#define GST_GMYTHTV_CHANNEL_DEFAULT_NUM (-1)
-#define GMYTHTV_VERSION_DEFAULT 30
+#define GMYTHTV_VERSION_DEFAULT 30
#define GMYTHTV_TRANSFER_MAX_WAITS 100
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
-#define READ_SIZE (8*1024)
-#define READ_SIZE_LIVETV (50*1024)
+#define READ_SIZE (14*1024)
+#define READ_SIZE_LIVETV (80*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
static const GstElementDetails gst_mythtv_src_details =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-29 14:33:28
|
Revision: 839
http://gmyth.svn.sourceforge.net/gmyth/?rev=839&view=rev
Author: morphbr
Date: 2007-08-29 07:33:31 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
- Update size of buffer for livetv inside gstmythtvsrc
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-29 13:42:10 UTC (rev 838)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-29 14:33:31 UTC (rev 839)
@@ -87,7 +87,8 @@
#define GMYTHTV_TRANSFER_MAX_WAITS 100
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
-#define READ_SIZE (100*1024)
+#define READ_SIZE (8*1024)
+#define READ_SIZE_LIVETV (50*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
static const GstElementDetails gst_mythtv_src_details =
@@ -407,7 +408,11 @@
src = GST_MYTHTV_SRC(psrc);
buffer = g_byte_array_new ();
- result = do_read_request_response(src, READ_SIZE, buffer);
+ if (src->live_tv)
+ result = do_read_request_response(src, READ_SIZE_LIVETV, buffer);
+ else
+ result = do_read_request_response(src, READ_SIZE, buffer);
+
if (result == GMYTH_FILE_READ_ERROR)
goto read_error;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-29 13:42:07
|
Revision: 838
http://gmyth.svn.sourceforge.net/gmyth/?rev=838&view=rev
Author: morphbr
Date: 2007-08-29 06:42:10 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
- Arranged code in a better way
Modified Paths:
--------------
trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py
Added Paths:
-----------
trunk/gmyth-stream/server/data/
trunk/gmyth-stream/server/debian/
trunk/gmyth-stream/server/gms.py
trunk/gmyth-stream/server/html/
trunk/gmyth-stream/server/lib/
trunk/gmyth-stream/server/plugins/
trunk/gmyth-stream/server/server.conf
trunk/gmyth-stream/server/setup.py
Removed Paths:
-------------
trunk/gmyth-stream/server/0.3/
Copied: trunk/gmyth-stream/server/data (from rev 836, trunk/gmyth-stream/server/0.3/data)
Copied: trunk/gmyth-stream/server/debian (from rev 836, trunk/gmyth-stream/server/0.3/debian)
Copied: trunk/gmyth-stream/server/gms.py (from rev 836, trunk/gmyth-stream/server/0.3/gms.py)
===================================================================
--- trunk/gmyth-stream/server/gms.py (rev 0)
+++ trunk/gmyth-stream/server/gms.py 2007-08-29 13:42:10 UTC (rev 838)
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+
+__author__ = "Artur Duque de Souza"
+__author_email__ = "art...@in..."
+__license__ = "GPL"
+__version__ = "0.3"
+__thanks__ = "Gustavo Sverzut Barbieri"
+__GMS_DATA_DIR__ = "/usr/share/gms/"
+
+import sys
+import os
+import mimetypes
+import logging as log
+
+if os.path.exists (__GMS_DATA_DIR__):
+ sys.path.append(__GMS_DATA_DIR__)
+
+from lib.server import serve_forever, load_plugins_transcoders
+from lib.utils import config
+
+mimetypes.init()
+log_level = log.INFO
+for p in sys.argv[1:]:
+ if p == "-v" or p == "--verbose":
+ log_level -= 10
+
+log.basicConfig(level=log_level,
+ format=("### %(asctime)s %(name)-18s \t%(levelname)-8s "
+ "\t%(message)s"),
+ datefmt="%Y-%m-%d %H:%M:%S")
+
+if config.get_transcoded_location () is None:
+ print "Gms not configured"
+ exit (0)
+
+if not os.path.exists(config.get_transcoded_location()):
+ os.mkdir(config.get_transcoded_location())
+
+
+if "-d" in sys.argv:
+ #run with deamon
+ try:
+ pid = os.fork()
+ if pid > 0:
+ sys.exit(0)
+ except OSError, e:
+ print >>sys.stderr, "Fail to start deamon: %d (%s)" % (e.errno, e.strerror)
+ sys.exit(1)
+
+ os.chdir("/")
+ os.setsid()
+ os.umask(0)
+
+ try:
+ pid = os.fork()
+ if pid > 0:
+ fp = open ("/var/run/gms.pid", "w")
+ fp.write ("%d" % pid)
+ fp.close ()
+ sys.exit(0)
+ except OSError, e:
+ print >>sys.stderr, "Fail to start deamon: %d (%s)" % (e.errno, e.strerror)
+ sys.exit(1)
+
+# main deamon
+pd = os.path.join(__GMS_DATA_DIR__, "plugins", "transcoders")
+if os.path.exists (pd):
+ load_plugins_transcoders(pd)
+
+pd = os.path.join("plugins", "transcoders");
+if os.path.exists (pd):
+ load_plugins_transcoders(pd)
+
+serve_forever()
Copied: trunk/gmyth-stream/server/html (from rev 836, trunk/gmyth-stream/server/0.3/html)
Copied: trunk/gmyth-stream/server/lib (from rev 836, trunk/gmyth-stream/server/0.3/lib)
Copied: trunk/gmyth-stream/server/plugins (from rev 836, trunk/gmyth-stream/server/0.3/plugins)
Modified: trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py
===================================================================
--- trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py 2007-08-29 09:00:25 UTC (rev 836)
+++ trunk/gmyth-stream/server/plugins/transcoders/gmencoder.py 2007-08-29 13:42:10 UTC (rev 838)
@@ -98,7 +98,7 @@
if not outfile:
ret = p.poll(0)
if ret:
- print "Lost Connection"
+ self.log.info(self.tid, "Lost connection")
self.stop ()
return False
Copied: trunk/gmyth-stream/server/server.conf (from rev 836, trunk/gmyth-stream/server/0.3/server.conf)
===================================================================
--- trunk/gmyth-stream/server/server.conf (rev 0)
+++ trunk/gmyth-stream/server/server.conf 2007-08-29 13:42:10 UTC (rev 838)
@@ -0,0 +1,2 @@
+[PATHS]
+transcoded=./.transcoded
Copied: trunk/gmyth-stream/server/setup.py (from rev 836, trunk/gmyth-stream/server/0.3/setup.py)
===================================================================
--- trunk/gmyth-stream/server/setup.py (rev 0)
+++ trunk/gmyth-stream/server/setup.py 2007-08-29 13:42:10 UTC (rev 838)
@@ -0,0 +1,17 @@
+from distutils.core import setup
+from glob import glob
+
+setup(name='gms',
+ version='0.6',
+ description='carman rich view package',
+ long_description='carman rich view (SDL based) package',
+ url='http://www.indt.org.br',
+ scripts=['gms.py'],
+ package_dir={'lib': 'lib', 'plugins' : 'plugins','data' : 'data' },
+ packages=['lib','plugins','plugins.transcoders','plugins.transcoders.mencoder_lib'],
+ data_files = [
+ ('share/gms/html', glob("html/*")),
+ ('etc/init.d', ['data/gmsd']),
+ ('etc/gms', ['data/server.conf'])
+ ],
+ )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-29 13:29:32
|
Revision: 837
http://gmyth.svn.sourceforge.net/gmyth/?rev=837&view=rev
Author: morphbr
Date: 2007-08-29 06:29:24 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
- Deleted old code
- Bug fix on gmencoder by Renato Filho
- Restored Renato's version of monitor_handler to work with gmencoder
Modified Paths:
--------------
trunk/gmyth/src/gmyth_monitor_handler.c
trunk/gmyth/src/gmyth_monitor_handler.h
trunk/gmyth-stream/gmemcoder/src/gmencoder.c
Removed Paths:
-------------
trunk/gmyth-stream/libgnomevfs2/
Modified: trunk/gmyth/src/gmyth_monitor_handler.c
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-29 09:00:25 UTC (rev 836)
+++ trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-29 13:29:24 UTC (rev 837)
@@ -70,7 +70,9 @@
#define GMYTHTV_ENABLE_DEBUG 1
#endif
-gpointer gmyth_monitor_handler_listener(gpointer data);
+static gboolean gmyth_monitor_handler_listener (GIOChannel *io_channel,
+ GIOCondition condition,
+ gpointer data);
static void gmyth_monitor_handler_default_listener(GMythMonitorHandler
* monitor,
@@ -92,51 +94,10 @@
void gmyth_monitor_handler_close(GMythMonitorHandler * monitor);
-G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT)
- static void
+G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
+static void
+gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
{
GObjectClass *gobject_class;
GMythMonitorHandlerClass *gmonitor_class;
@@ -169,23 +130,11 @@
monitor->hostname = NULL;
monitor->port = 0;
monitor->actual_index = 0;
-
monitor->allow_msgs_listener = FALSE;
-
/*
- * monitor->backend_msgs = g_hash_table_new( g_int_hash, g_int_equal
- * );
- */
-
- /*
* it is used for signalizing the event socket consumer thread
*/
monitor->mutex = g_mutex_new();
-
- monitor->th = NULL;
-
- monitor->gmyth_monitor_handler_listener =
- gmyth_monitor_handler_listener;
}
static void
@@ -197,14 +146,9 @@
monitor->allow_msgs_listener = FALSE;
- if (monitor->th != NULL) {
- gboolean *ret = (gboolean *) g_thread_join(monitor->th);
-
- if (*ret == FALSE)
- gmyth_debug("Error closing GThread listener socket!");
- else
- gmyth_debug("Closed GThread listener socket.");
- // g_object_unref( monitor->th );
+ if (monitor->io_source != 0) {
+ g_source_remove (monitor->io_source);
+ monitor->io_source = 0;
}
/*
@@ -226,6 +170,7 @@
monitor->hostname = NULL;
}
+
if (monitor->backend_msgs != NULL) {
g_hash_table_destroy(monitor->backend_msgs);
monitor->backend_msgs = NULL;
@@ -236,6 +181,7 @@
* io_watcher_cond = NULL; }
*/
+
G_OBJECT_CLASS(gmyth_monitor_handler_parent_class)->dispose(object);
}
@@ -353,30 +299,22 @@
gmyth_debug("Monitor event socket --- hostname: %s, port %d\n",
monitor->hostname, monitor->port);
- if (NULL != monitor->event_sock) {
+ if (monitor->event_sock != NULL) {
g_object_unref(monitor->event_sock);
monitor->event_sock = NULL;
}
/*
- * configure the event socket
+ * configure the event socket
*/
- if (NULL == monitor->event_sock) {
- if (!gmyth_connect_to_backend_monitor(monitor)) {
- gmyth_debug("Connection to backend failed (Event Socket)!");
- ret = FALSE;
- } else {
- gmyth_debug
- ("Remote monitor event socket had been succesfully created. (io_fd == %d)\n",
- g_io_channel_unix_get_fd(monitor->event_sock->sd_io_ch));
- }
+ if (!gmyth_connect_to_backend_monitor(monitor)) {
+ gmyth_debug("Connection to backend failed (Event Socket)!");
+ ret = FALSE;
} else {
- gmyth_debug
- ("ASSERT ERROR: Remote monitor event socket is not NULL at the setup...\n");
+ gmyth_debug ("Remote monitor event socket had been succesfully create");
}
return ret;
-
}
/**
@@ -493,122 +431,73 @@
* @return Pointer to a gboolean <code>true</code> value, if the data was
* successfully read.
*/
-gpointer
-gmyth_monitor_handler_listener(gpointer data)
+static gboolean
+gmyth_monitor_handler_listener (GIOChannel *io_channel,
+ GIOCondition io_cond,
+ gpointer data)
{
- GMythMonitorHandler *monitor = (GMythMonitorHandler *) data;
+ GMythMonitorHandler *monitor;
guint recv = 0;
- gboolean *ret = g_new0(gboolean, 1);
gsize len = 0;
- GIOChannel *io_channel = monitor->event_sock->sd_io_ch;
- GIOCondition io_cond =
- g_io_channel_get_buffer_condition(io_channel);
- static guint count = 0;
+ GMythStringList *strlist = NULL;
+ gint bytes_sent = 0;
- *ret = TRUE;
+ monitor = (GMythMonitorHandler *) data;
gmyth_debug("Entering MONITOR handler listener...");
myth_control_acquire_context(monitor, TRUE);
- if ((io_cond & G_IO_HUP) != 0) {
- *ret = FALSE;
+ if (((io_cond & G_IO_HUP) != 0) ||
+ ((io_cond & G_IO_ERR) != 0)) {
goto clean_up;
}
- GMythStringList *strlist = NULL;
- if (NULL == io_channel) {
- gmyth_debug("Monitor socket is NULL! (GIOChannel)");
- *ret = FALSE;
- goto clean_up;
- }
+ gmyth_debug("Listening on Monitor socket...!\n");
+ strlist = gmyth_string_list_new();
- while (monitor->allow_msgs_listener) {
- ++count;
+ len = gmyth_socket_read_stringlist(monitor->event_sock, strlist);
+ if ((len > 0) && strlist != NULL && gmyth_string_list_length(strlist) > 0) {
+ gchar *back_msg_action;
+ gint msg_type;
- gmyth_debug("%d - Listening on Monitor socket...!\n", count);
+ bytes_sent = gmyth_string_list_get_int(strlist, 0);
+ // on backend error
+ gmyth_debug ("received data buffer from IO event channel... %d strings gone!\n", len);
+ recv += len;
- do {
+ /*
+ * debug purpose: prints out all the string list
+ * elements
+ */
+ g_list_foreach(strlist->glist,
+ (GFunc) gmyth_monitor_handler_print,
+ NULL);
- gint bytes_sent = 0;
+ back_msg_action = g_new0(gchar, 1);
+ msg_type = gmyth_monitor_handler_is_backend_message(monitor,
+ strlist,
+ &back_msg_action);
- strlist = gmyth_string_list_new();
-
- if (monitor->event_sock != NULL) {
-
- len =
- gmyth_socket_read_stringlist(monitor->event_sock,
- strlist);
-
- if ((len > 0) && strlist != NULL
- && gmyth_string_list_length(strlist) > 0) {
- bytes_sent = gmyth_string_list_get_int(strlist, 0); // -1
- //
- //
- // on
- // backend
- // error
-
- gmyth_debug
- ("[%s] MONITOR: received data buffer from IO event channel... %d strings gone!\n",
- __FUNCTION__, len);
-
- recv += len;
-
- /*
- * debug purpose: prints out all the string list
- * elements
- */
- g_list_foreach(strlist->glist,
- (GFunc) gmyth_monitor_handler_print,
- NULL);
-
- gchar *back_msg_action = g_new0(gchar, 1);
- gint msg_type =
- gmyth_monitor_handler_is_backend_message(monitor,
- strlist,
- &back_msg_action);
-
- if (monitor != NULL
- && msg_type != GMYTH_BACKEND_NO_MESSAGE)
- g_signal_emit(monitor, GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id, 0, /* details
- */
- msg_type, back_msg_action);
-
- if (back_msg_action != NULL)
- g_free(back_msg_action);
-
- }
-
- }
-
- if (strlist != NULL) {
- g_object_unref(strlist);
- strlist = NULL;
- }
-
- io_cond = g_io_channel_get_buffer_condition(io_channel);
-
- g_usleep(500);
-
+ if (msg_type != GMYTH_BACKEND_NO_MESSAGE) {
+ g_signal_emit(monitor,
+ GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id,
+ 0, msg_type, back_msg_action);
}
- while (recv <= 0 && ((io_cond & G_IO_HUP) == 0));
- gmyth_debug("\tMONITOR EVENT: Read %d bytes\n", recv);
+ if (back_msg_action != NULL)
+ g_free(back_msg_action);
- } /* main GThread while */
+ g_object_unref(strlist);
+ }
- clean_up:
+clean_up:
myth_control_release_context(monitor);
-
- g_thread_exit(ret);
-
- return (gpointer) ret;
-
+ return TRUE;
}
-/**
+/**
* Opens connection events' socket the the Monitor socket on
* MythTV backend server.
*
@@ -616,7 +505,7 @@
*
* @return <code>true</code>, if the socket was successfully opened.
*/
-static gboolean
+static gboolean
gmyth_connect_to_backend_monitor(GMythMonitorHandler * monitor)
{
gboolean ret = TRUE;
@@ -625,7 +514,7 @@
/*
* Connects the socket, send Mythtv ANN Monitor and verify Mythtv
- * protocol version
+ * protocol version
*/
if (!gmyth_socket_connect_to_backend_events(monitor->event_sock,
monitor->hostname,
@@ -638,52 +527,38 @@
return ret;
}
-/**
+/**
* Opens connection the the Monitor socket on MythTV backend server,
* where all status messages are notified to the client.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
* @param channel The GIOChannel instance to the Monitor socket.
- *
+ *
* @return Pointer to the boolean value, and it is <code>true</code> only if the
- * GMythMonitorHandler could be configured.
+ * GMythMonitorHandler could be configured.
*/
-static gboolean
+static gboolean
gmyth_monitor_handler_setup(GMythMonitorHandler * monitor,
GIOChannel * channel)
{
- gboolean ret = TRUE;
+ gboolean ret = TRUE;
if (channel != NULL) {
monitor->allow_msgs_listener = TRUE;
-
- monitor->th =
- g_thread_create((GThreadFunc) gmyth_monitor_handler_listener,
- monitor, TRUE, NULL);
- gmyth_debug("MONITOR GThread created!");
+ monitor->io_source = g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP,
+ gmyth_monitor_handler_listener,
+ monitor);
} else {
ret = FALSE;
- goto cleanup;
}
-
- if (NULL == monitor->th) {
- gmyth_debug
- ("[%s] Error adding GThread listener function to the IO control channel!\n",
- __FUNCTION__);
- ret = FALSE;
- goto cleanup;
- }
-
- cleanup:
-
return ret;
}
-/**
+/**
* Starts the MonitorHandler thread to the GIOWatcher.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
- *
+ *
* @return <code>true</code>, if the MonitorHandler was started.
*/
gboolean
Modified: trunk/gmyth/src/gmyth_monitor_handler.h
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-29 09:00:25 UTC (rev 836)
+++ trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-29 13:29:24 UTC (rev 837)
@@ -63,12 +63,12 @@
GObjectClass parent_class;
/*
- * callbacks
+ * callbacks
*/
guint backend_events_handler_signal_id;
/*
- * signal default handlers
+ * signal default handlers
*/
void (*backend_events_handler) (GMythMonitorHandler *
monitor, gint msg_code,
@@ -88,14 +88,8 @@
*/
GMythSocket *event_sock;
+ //gpointer(*gmyth_monitor_handler_listener) (gpointer data);
-
-
-
-
-
- gpointer(*gmyth_monitor_handler_listener) (gpointer data);
-
gchar *hostname;
gint port;
@@ -109,9 +103,7 @@
GHashTable *backend_msgs;
GMutex *mutex;
-
- GThread *th;
-
+ guint io_source;
};
GType gmyth_monitor_handler_get_type(void);
Modified: trunk/gmyth-stream/gmemcoder/src/gmencoder.c
===================================================================
--- trunk/gmyth-stream/gmemcoder/src/gmencoder.c 2007-08-29 09:00:25 UTC (rev 836)
+++ trunk/gmyth-stream/gmemcoder/src/gmencoder.c 2007-08-29 13:29:24 UTC (rev 837)
@@ -866,7 +866,6 @@
GstElement *bsrc = NULL;
GstElement *src = NULL;
- GstElement *queue = NULL;
GstElement *aqueue = NULL;
GstElement *vqueue = NULL;
GstElement *decode = NULL;
@@ -888,11 +887,10 @@
if (src == NULL)
goto error;
- decode = gst_element_factory_make("decodebin", "decode");
+ decode = gst_element_factory_make("decodebin2", "decode");
if (decode == NULL)
goto error;
- queue = gst_element_factory_make("queue", "queue_src");
aqueue = gst_element_factory_make("queue", "aqueue");
if (aqueue == NULL)
goto error;
@@ -901,9 +899,9 @@
if (vqueue == NULL)
goto error;
- gst_bin_add_many(GST_BIN(bsrc), src, queue, decode, aqueue, vqueue,
+ gst_bin_add_many(GST_BIN(bsrc), src, decode, aqueue, vqueue,
NULL);
- gst_element_link_many(src, queue, decode, NULL);
+ gst_element_link (src, decode);
g_signal_connect(G_OBJECT(decode),
"new-decoded-pad",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-29 09:00:32
|
Revision: 836
http://gmyth.svn.sourceforge.net/gmyth/?rev=836&view=rev
Author: morphbr
Date: 2007-08-29 02:00:25 -0700 (Wed, 29 Aug 2007)
Log Message:
-----------
- Cleanup of svn (deleted old versions of gms as they are on repository)
Removed Paths:
-------------
trunk/gmyth-stream/server/0.1/
trunk/gmyth-stream/server/0.2/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-28 07:30:17
|
Revision: 834
http://gmyth.svn.sourceforge.net/gmyth/?rev=834&view=rev
Author: morphbr
Date: 2007-08-28 00:30:10 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
- Bug fix
Modified Paths:
--------------
trunk/gmyth-stream/server/0.3/lib/request_handler.py
trunk/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
Modified: trunk/gmyth-stream/server/0.3/lib/request_handler.py
===================================================================
--- trunk/gmyth-stream/server/0.3/lib/request_handler.py 2007-08-28 07:16:13 UTC (rev 833)
+++ trunk/gmyth-stream/server/0.3/lib/request_handler.py 2007-08-28 07:30:10 UTC (rev 834)
@@ -360,13 +360,14 @@
self.send_error(404, "File not found")
return
- filename = args[0];
+ filename = args[0];
if not filename:
self.send_error(404, "File not found")
return
#Only stream files on .transcode dir
- filename = os.path.join (utils.config.get_transcoded_location(), os.path.basename(filename))
+ filename = os.path.join (utils.config.get_transcoded_location(),
+ os.path.basename(filename))
self.log.error("Stream file: %s" % filename)
if not os.path.exists (filename):
self.send_error(404, "File not found")
@@ -377,7 +378,6 @@
self.send_header("Content-Type", mimetypes.guess_type(filename)[0])
self.send_header("Cache-Control","no-cache")
self.send_header("Content-Length", size)
- #self.send_header("Connection", "close")
self.end_headers()
media = open(filename)
@@ -429,7 +429,6 @@
if (obj.name == "gmencoder"):
self.send_header("Transfer-Encoding", "chunked")
- #self.send_header("Connection", "close")
self.end_headers()
if body:
Modified: trunk/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py
===================================================================
--- trunk/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py 2007-08-28 07:16:13 UTC (rev 833)
+++ trunk/gmyth-stream/server/0.3/plugins/transcoders/mencoder.py 2007-08-28 07:30:10 UTC (rev 834)
@@ -91,7 +91,7 @@
if self.args["mux"] == "mpeg":
video += " -mpegopts format=%s" % self.args["format"]
- video += " -vf kerndint,scale=%s:%s" % (self.args["width"], self.args["height"])
+ video += " -vf scale=%s:%s" % (self.args["width"], self.args["height"])
return video
# _setup_video()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <mo...@us...> - 2007-08-28 07:16:15
|
Revision: 833
http://gmyth.svn.sourceforge.net/gmyth/?rev=833&view=rev
Author: morphbr
Date: 2007-08-28 00:16:13 -0700 (Tue, 28 Aug 2007)
Log Message:
-----------
- Restored working version of gmyth_monitor_handler.c
- Patch on gmyth-cat by Renato Filho
Modified Paths:
--------------
trunk/gmyth/samples/gmyth_cat.c
trunk/gmyth/src/gmyth_monitor_handler.c
trunk/gmyth/src/gmyth_monitor_handler.h
Modified: trunk/gmyth/samples/gmyth_cat.c
===================================================================
--- trunk/gmyth/samples/gmyth_cat.c 2007-08-23 21:45:15 UTC (rev 832)
+++ trunk/gmyth/samples/gmyth_cat.c 2007-08-28 07:16:13 UTC (rev 833)
@@ -200,7 +200,7 @@
(GByteArray *) array, 64000, TRUE)) == GMYTH_FILE_READ_OK) ||
file_transf_ret == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
- fwrite(array->data, array->len, 1, stdout);
+ fwrite(array->data, sizeof(gpointer), array->len, stdout);
fflush(stdout);
g_array_remove_range(array, 0, array->len);
Modified: trunk/gmyth/src/gmyth_monitor_handler.c
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-23 21:45:15 UTC (rev 832)
+++ trunk/gmyth/src/gmyth_monitor_handler.c 2007-08-28 07:16:13 UTC (rev 833)
@@ -70,9 +70,7 @@
#define GMYTHTV_ENABLE_DEBUG 1
#endif
-gboolean gmyth_monitor_handler_listener (GIOChannel *io_channel,
- GIOCondition condition,
- gpointer data);
+gpointer gmyth_monitor_handler_listener(gpointer data);
static void gmyth_monitor_handler_default_listener(GMythMonitorHandler
* monitor,
@@ -94,10 +92,51 @@
void gmyth_monitor_handler_close(GMythMonitorHandler * monitor);
-G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT);
+G_DEFINE_TYPE(GMythMonitorHandler, gmyth_monitor_handler, G_TYPE_OBJECT)
+ static void
-static void
-gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ gmyth_monitor_handler_class_init(GMythMonitorHandlerClass * klass)
{
GObjectClass *gobject_class;
GMythMonitorHandlerClass *gmonitor_class;
@@ -130,11 +169,23 @@
monitor->hostname = NULL;
monitor->port = 0;
monitor->actual_index = 0;
+
monitor->allow_msgs_listener = FALSE;
+
/*
+ * monitor->backend_msgs = g_hash_table_new( g_int_hash, g_int_equal
+ * );
+ */
+
+ /*
* it is used for signalizing the event socket consumer thread
*/
monitor->mutex = g_mutex_new();
+
+ monitor->th = NULL;
+
+ monitor->gmyth_monitor_handler_listener =
+ gmyth_monitor_handler_listener;
}
static void
@@ -146,9 +197,14 @@
monitor->allow_msgs_listener = FALSE;
- if (monitor->io_source != 0) {
- g_source_remove (monitor->io_source);
- monitor->io_source = 0;
+ if (monitor->th != NULL) {
+ gboolean *ret = (gboolean *) g_thread_join(monitor->th);
+
+ if (*ret == FALSE)
+ gmyth_debug("Error closing GThread listener socket!");
+ else
+ gmyth_debug("Closed GThread listener socket.");
+ // g_object_unref( monitor->th );
}
/*
@@ -170,7 +226,6 @@
monitor->hostname = NULL;
}
-
if (monitor->backend_msgs != NULL) {
g_hash_table_destroy(monitor->backend_msgs);
monitor->backend_msgs = NULL;
@@ -181,7 +236,6 @@
* io_watcher_cond = NULL; }
*/
-
G_OBJECT_CLASS(gmyth_monitor_handler_parent_class)->dispose(object);
}
@@ -299,22 +353,30 @@
gmyth_debug("Monitor event socket --- hostname: %s, port %d\n",
monitor->hostname, monitor->port);
- if (monitor->event_sock != NULL) {
+ if (NULL != monitor->event_sock) {
g_object_unref(monitor->event_sock);
monitor->event_sock = NULL;
}
/*
- * configure the event socket
+ * configure the event socket
*/
- if (!gmyth_connect_to_backend_monitor(monitor)) {
- gmyth_debug("Connection to backend failed (Event Socket)!");
- ret = FALSE;
+ if (NULL == monitor->event_sock) {
+ if (!gmyth_connect_to_backend_monitor(monitor)) {
+ gmyth_debug("Connection to backend failed (Event Socket)!");
+ ret = FALSE;
+ } else {
+ gmyth_debug
+ ("Remote monitor event socket had been succesfully created. (io_fd == %d)\n",
+ g_io_channel_unix_get_fd(monitor->event_sock->sd_io_ch));
+ }
} else {
- gmyth_debug ("Remote monitor event socket had been succesfully create");
+ gmyth_debug
+ ("ASSERT ERROR: Remote monitor event socket is not NULL at the setup...\n");
}
return ret;
+
}
/**
@@ -431,73 +493,122 @@
* @return Pointer to a gboolean <code>true</code> value, if the data was
* successfully read.
*/
-gboolean
-gmyth_monitor_handler_listener (GIOChannel *io_channel,
- GIOCondition io_cond,
- gpointer data)
+gpointer
+gmyth_monitor_handler_listener(gpointer data)
{
- GMythMonitorHandler *monitor;
+ GMythMonitorHandler *monitor = (GMythMonitorHandler *) data;
guint recv = 0;
+ gboolean *ret = g_new0(gboolean, 1);
gsize len = 0;
- GMythStringList *strlist = NULL;
- gint bytes_sent = 0;
+ GIOChannel *io_channel = monitor->event_sock->sd_io_ch;
+ GIOCondition io_cond =
+ g_io_channel_get_buffer_condition(io_channel);
+ static guint count = 0;
- monitor = (GMythMonitorHandler *) data;
+ *ret = TRUE;
gmyth_debug("Entering MONITOR handler listener...");
myth_control_acquire_context(monitor, TRUE);
- if (((io_cond & G_IO_HUP) != 0) ||
- ((io_cond & G_IO_ERR) != 0)) {
+ if ((io_cond & G_IO_HUP) != 0) {
+ *ret = FALSE;
goto clean_up;
}
+ GMythStringList *strlist = NULL;
- gmyth_debug("%d - Listening on Monitor socket...!\n", count);
- strlist = gmyth_string_list_new();
+ if (NULL == io_channel) {
+ gmyth_debug("Monitor socket is NULL! (GIOChannel)");
+ *ret = FALSE;
+ goto clean_up;
+ }
- len = gmyth_socket_read_stringlist(monitor->event_sock, strlist);
- if ((len > 0) && strlist != NULL && gmyth_string_list_length(strlist) > 0) {
- gchar *back_msg_action;
- gint msg_type;
+ while (monitor->allow_msgs_listener) {
+ ++count;
- bytes_sent = gmyth_string_list_get_int(strlist, 0);
- // on backend error
- gmyth_debug ("received data buffer from IO event channel... %d strings gone!\n", len);
- recv += len;
+ gmyth_debug("%d - Listening on Monitor socket...!\n", count);
- /*
- * debug purpose: prints out all the string list
- * elements
- */
- g_list_foreach(strlist->glist,
- (GFunc) gmyth_monitor_handler_print,
- NULL);
+ do {
- back_msg_action = g_new0(gchar, 1);
- msg_type = gmyth_monitor_handler_is_backend_message(monitor,
- strlist,
- &back_msg_action);
+ gint bytes_sent = 0;
- if (msg_type != GMYTH_BACKEND_NO_MESSAGE) {
- g_signal_emit(monitor,
- GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id,
- 0, msg_type, back_msg_action);
+ strlist = gmyth_string_list_new();
+
+ if (monitor->event_sock != NULL) {
+
+ len =
+ gmyth_socket_read_stringlist(monitor->event_sock,
+ strlist);
+
+ if ((len > 0) && strlist != NULL
+ && gmyth_string_list_length(strlist) > 0) {
+ bytes_sent = gmyth_string_list_get_int(strlist, 0); // -1
+ //
+ //
+ // on
+ // backend
+ // error
+
+ gmyth_debug
+ ("[%s] MONITOR: received data buffer from IO event channel... %d strings gone!\n",
+ __FUNCTION__, len);
+
+ recv += len;
+
+ /*
+ * debug purpose: prints out all the string list
+ * elements
+ */
+ g_list_foreach(strlist->glist,
+ (GFunc) gmyth_monitor_handler_print,
+ NULL);
+
+ gchar *back_msg_action = g_new0(gchar, 1);
+ gint msg_type =
+ gmyth_monitor_handler_is_backend_message(monitor,
+ strlist,
+ &back_msg_action);
+
+ if (monitor != NULL
+ && msg_type != GMYTH_BACKEND_NO_MESSAGE)
+ g_signal_emit(monitor, GMYTH_MONITOR_HANDLER_GET_CLASS(monitor)->backend_events_handler_signal_id, 0, /* details
+ */
+ msg_type, back_msg_action);
+
+ if (back_msg_action != NULL)
+ g_free(back_msg_action);
+
+ }
+
+ }
+
+ if (strlist != NULL) {
+ g_object_unref(strlist);
+ strlist = NULL;
+ }
+
+ io_cond = g_io_channel_get_buffer_condition(io_channel);
+
+ g_usleep(500);
+
}
+ while (recv <= 0 && ((io_cond & G_IO_HUP) == 0));
- if (back_msg_action != NULL)
- g_free(back_msg_action);
+ gmyth_debug("\tMONITOR EVENT: Read %d bytes\n", recv);
- g_object_unref(strlist);
- }
+ } /* main GThread while */
-clean_up:
+ clean_up:
myth_control_release_context(monitor);
- return TRUE;
+
+ g_thread_exit(ret);
+
+ return (gpointer) ret;
+
}
-/**
+/**
* Opens connection events' socket the the Monitor socket on
* MythTV backend server.
*
@@ -505,7 +616,7 @@
*
* @return <code>true</code>, if the socket was successfully opened.
*/
-static gboolean
+static gboolean
gmyth_connect_to_backend_monitor(GMythMonitorHandler * monitor)
{
gboolean ret = TRUE;
@@ -514,7 +625,7 @@
/*
* Connects the socket, send Mythtv ANN Monitor and verify Mythtv
- * protocol version
+ * protocol version
*/
if (!gmyth_socket_connect_to_backend_events(monitor->event_sock,
monitor->hostname,
@@ -527,38 +638,52 @@
return ret;
}
-/**
+/**
* Opens connection the the Monitor socket on MythTV backend server,
* where all status messages are notified to the client.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
* @param channel The GIOChannel instance to the Monitor socket.
- *
+ *
* @return Pointer to the boolean value, and it is <code>true</code> only if the
- * GMythMonitorHandler could be configured.
+ * GMythMonitorHandler could be configured.
*/
-static gboolean
+static gboolean
gmyth_monitor_handler_setup(GMythMonitorHandler * monitor,
GIOChannel * channel)
{
- gboolean ret = TRUE;
+ gboolean ret = TRUE;
if (channel != NULL) {
monitor->allow_msgs_listener = TRUE;
- monitor->io_source = g_io_add_watch (channel, G_IO_IN | G_IO_ERR | G_IO_HUP,
- gmyth_monitor_handler_listener,
- monitor);
+
+ monitor->th =
+ g_thread_create((GThreadFunc) gmyth_monitor_handler_listener,
+ monitor, TRUE, NULL);
+ gmyth_debug("MONITOR GThread created!");
} else {
ret = FALSE;
+ goto cleanup;
}
+
+ if (NULL == monitor->th) {
+ gmyth_debug
+ ("[%s] Error adding GThread listener function to the IO control channel!\n",
+ __FUNCTION__);
+ ret = FALSE;
+ goto cleanup;
+ }
+
+ cleanup:
+
return ret;
}
-/**
+/**
* Starts the MonitorHandler thread to the GIOWatcher.
- *
+ *
* @param monitor The GMythMonitorHandler instance.
- *
+ *
* @return <code>true</code>, if the MonitorHandler was started.
*/
gboolean
Modified: trunk/gmyth/src/gmyth_monitor_handler.h
===================================================================
--- trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-23 21:45:15 UTC (rev 832)
+++ trunk/gmyth/src/gmyth_monitor_handler.h 2007-08-28 07:16:13 UTC (rev 833)
@@ -63,12 +63,12 @@
GObjectClass parent_class;
/*
- * callbacks
+ * callbacks
*/
guint backend_events_handler_signal_id;
/*
- * signal default handlers
+ * signal default handlers
*/
void (*backend_events_handler) (GMythMonitorHandler *
monitor, gint msg_code,
@@ -88,8 +88,14 @@
*/
GMythSocket *event_sock;
- //gpointer(*gmyth_monitor_handler_listener) (gpointer data);
+
+
+
+
+
+ gpointer(*gmyth_monitor_handler_listener) (gpointer data);
+
gchar *hostname;
gint port;
@@ -103,7 +109,9 @@
GHashTable *backend_msgs;
GMutex *mutex;
- guint io_source;
+
+ GThread *th;
+
};
GType gmyth_monitor_handler_get_type(void);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-23 21:45:18
|
Revision: 832
http://gmyth.svn.sourceforge.net/gmyth/?rev=832&view=rev
Author: melunko
Date: 2007-08-23 14:45:15 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
fixed output handle bug
Modified Paths:
--------------
trunk/gmyth-stream/gmemcoder/src/gmencoder.c
Modified: trunk/gmyth-stream/gmemcoder/src/gmencoder.c
===================================================================
--- trunk/gmyth-stream/gmemcoder/src/gmencoder.c 2007-08-23 21:30:57 UTC (rev 831)
+++ trunk/gmyth-stream/gmemcoder/src/gmencoder.c 2007-08-23 21:45:15 UTC (rev 832)
@@ -526,7 +526,7 @@
}
_close_output(self);
- if (_open_output(self, out_uri) == FALSE) {
+ if (_open_output(self, out_uri) == FALSE) {
return FALSE;
}
@@ -882,7 +882,6 @@
src = _create_v4l_source (self, uri);
}
else {
- g_debug ("SRC");
src = gst_element_make_from_uri(GST_URI_SRC, uri, "src");
}
@@ -957,7 +956,7 @@
result = gnome_vfs_open_fd (&priv->handle, atoi(i[1]));
} else {
if (g_file_test (i[1], G_FILE_TEST_EXISTS) == FALSE) {
- result = gnome_vfs_create (&priv->handle, uri, GNOME_VFS_OPEN_WRITE, TRUE,
+ result = gnome_vfs_create (&priv->handle, uri, GNOME_VFS_OPEN_WRITE, FALSE,
GNOME_VFS_PERM_USER_WRITE | GNOME_VFS_PERM_USER_READ | GNOME_VFS_PERM_GROUP_READ);
} else {
result = gnome_vfs_open (&priv->handle, uri,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-23 21:30:54
|
Revision: 831
http://gmyth.svn.sourceforge.net/gmyth/?rev=831&view=rev
Author: melunko
Date: 2007-08-23 14:30:57 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
fixed bug on transcode file
Modified Paths:
--------------
trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
Modified: trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py
===================================================================
--- trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py 2007-08-23 19:24:11 UTC (rev 830)
+++ trunk/gmyth-stream/server/0.3/plugins/transcoders/gmencoder.py 2007-08-23 21:30:57 UTC (rev 831)
@@ -72,15 +72,20 @@
try:
self.proc = subprocess.Popen(self.opts, stdin=subprocess.PIPE,
stdout=subprocess.PIPE)
+
+ if outfile:
+ outfd.write("OK ")
+
except Exception, e:
self.log.error(self.tid, "Error: executing GMencoder: %s" % e)
outfd.write("Error: GMencoder: %s" % e)
return False
try:
- p = select.poll()
- #print outfd.fileno()
- p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN )
+ if not outfile:
+ p = select.poll()
+ p.register (outfd, select.POLLNVAL | select.POLLERR | select.POLLHUP | select.POLLIN )
+
while (self.proc and self.proc.poll() == None):
r, w, x = select.select([self.proc.stdout], [], [], 1)
if self.proc.stdout in r:
@@ -90,11 +95,12 @@
elif (progress.find ("Erro") >= 0):
return False
- ret = p.poll(0)
- if ret:
- print "Lost Connection"
- self.stop ()
- return False
+ if not outfile:
+ ret = p.poll(0)
+ if ret:
+ print "Lost Connection"
+ self.stop ()
+ return False
except Exception, e:
self.log.error(self.tid, "Problems handling data: %s" % e)
@@ -102,8 +108,6 @@
self.status = 100;
- if outfile:
- outfd.write("OK ")
return True
# start()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-23 19:24:10
|
Revision: 830
http://gmyth.svn.sourceforge.net/gmyth/?rev=830&view=rev
Author: melunko
Date: 2007-08-23 12:24:11 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
fixed config file to expand dir
Modified Paths:
--------------
trunk/gmyth-stream/server/0.3/lib/gmsconfig.py
trunk/gmyth-stream/server/0.3/lib/request_handler.py
trunk/gmyth-stream/server/0.3/server.conf
Modified: trunk/gmyth-stream/server/0.3/lib/gmsconfig.py
===================================================================
--- trunk/gmyth-stream/server/0.3/lib/gmsconfig.py 2007-08-23 13:24:46 UTC (rev 829)
+++ trunk/gmyth-stream/server/0.3/lib/gmsconfig.py 2007-08-23 19:24:11 UTC (rev 830)
@@ -16,12 +16,11 @@
__CONFIG_FILE__ = "server.conf"
__CONFIG_DIRS__ = [os.path.join (os.path.expanduser("~"), ".gms"), \
os.path.join ("/", "etc", "gms"), \
- "."]
+ "."]
def __init__(self):
for path in self.__CONFIG_DIRS__:
file_name = os.path.join (path, self.__CONFIG_FILE__)
- print "test config file: %s" % file_name
if os.path.exists (file_name):
fp = open (file_name, "r")
self.config.readfp (fp)
@@ -30,7 +29,7 @@
def get_transcoded_location (self):
try:
- return self.config.get("PATHS", "transcoded")
+ return os.path.realpath (self.config.get("PATHS", "transcoded"))
except:
return None
# get_transcoded_location()
Modified: trunk/gmyth-stream/server/0.3/lib/request_handler.py
===================================================================
--- trunk/gmyth-stream/server/0.3/lib/request_handler.py 2007-08-23 13:24:46 UTC (rev 829)
+++ trunk/gmyth-stream/server/0.3/lib/request_handler.py 2007-08-23 19:24:11 UTC (rev 830)
@@ -355,8 +355,12 @@
# serve_file_info()
def serve_stream(self, body):
- filename = self.query.get("file", None)[0]
+ args = self.query.get("file", None)
+ if not args:
+ self.send_error(404, "File not found")
+ return
+ filename = args[0];
if not filename:
self.send_error(404, "File not found")
return
Modified: trunk/gmyth-stream/server/0.3/server.conf
===================================================================
--- trunk/gmyth-stream/server/0.3/server.conf 2007-08-23 13:24:46 UTC (rev 829)
+++ trunk/gmyth-stream/server/0.3/server.conf 2007-08-23 19:24:11 UTC (rev 830)
@@ -1,2 +1,2 @@
[PATHS]
-transcoded=.transcoded
+transcoded=./.transcoded
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-08-23 13:24:43
|
Revision: 829
http://gmyth.svn.sourceforge.net/gmyth/?rev=829&view=rev
Author: renatofilho
Date: 2007-08-23 06:24:46 -0700 (Thu, 23 Aug 2007)
Log Message:
-----------
created default config file to mantain compatibility
Modified Paths:
--------------
trunk/gmyth-stream/server/0.3/lib/gmsconfig.py
Added Paths:
-----------
trunk/gmyth-stream/server/0.3/server.conf
Modified: trunk/gmyth-stream/server/0.3/lib/gmsconfig.py
===================================================================
--- trunk/gmyth-stream/server/0.3/lib/gmsconfig.py 2007-08-22 16:57:16 UTC (rev 828)
+++ trunk/gmyth-stream/server/0.3/lib/gmsconfig.py 2007-08-23 13:24:46 UTC (rev 829)
@@ -14,21 +14,18 @@
class GmsConfig:
config = ConfigParser.ConfigParser()
__CONFIG_FILE__ = "server.conf"
+ __CONFIG_DIRS__ = [os.path.join (os.path.expanduser("~"), ".gms"), \
+ os.path.join ("/", "etc", "gms"), \
+ "."]
def __init__(self):
- file_name = os.path.join (os.path.expanduser("~"), ".gms", self.__CONFIG_FILE__)
- print "test config file: %s" % file_name
- if os.path.exists (file_name):
- fp = open (file_name, "r")
- self.config.readfp (fp)
- return
-
- file_name = os.path.join ("/", "etc", "gms", self.__CONFIG_FILE__)
- print "test config file: %s" % file_name
- if os.path.exists (file_name):
- fp = open (file_name, "r")
- self.config.readfp (fp)
- return
+ for path in self.__CONFIG_DIRS__:
+ file_name = os.path.join (path, self.__CONFIG_FILE__)
+ print "test config file: %s" % file_name
+ if os.path.exists (file_name):
+ fp = open (file_name, "r")
+ self.config.readfp (fp)
+ return
# __init__()
def get_transcoded_location (self):
Added: trunk/gmyth-stream/server/0.3/server.conf
===================================================================
--- trunk/gmyth-stream/server/0.3/server.conf (rev 0)
+++ trunk/gmyth-stream/server/0.3/server.conf 2007-08-23 13:24:46 UTC (rev 829)
@@ -0,0 +1,2 @@
+[PATHS]
+transcoded=.transcoded
Property changes on: trunk/gmyth-stream/server/0.3/server.conf
___________________________________________________________________
Name: svn:executable
+ *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ren...@us...> - 2007-08-22 16:57:15
|
Revision: 828
http://gmyth.svn.sourceforge.net/gmyth/?rev=828&view=rev
Author: renatofilho
Date: 2007-08-22 09:57:16 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
bug fixes
Modified Paths:
--------------
trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
trunk/gst-gmyth/mythsrc/gstmythtvsrc.h
trunk/gst-gmyth/nuvdemux/gstnuvdemux.c
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.c
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-22 13:57:53 UTC (rev 827)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.c 2007-08-22 16:57:16 UTC (rev 828)
@@ -87,10 +87,8 @@
#define GMYTHTV_TRANSFER_MAX_WAITS 100
#define GMYTHTV_TRANSFER_MAX_RESENDS 2
#define GMYTHTV_TRANSFER_MAX_BUFFER (128*1024)
-#define MAX_READ_SIZE (4*1024)
+#define READ_SIZE (4*1024)
#define GST_FLOW_ERROR_NO_DATA (-101)
-#define REQUEST_MAX_SIZE (64*1024)
-#define INTERNAL_BUFFER_SIZE (90*1024)
static const GstElementDetails gst_mythtv_src_details =
GST_ELEMENT_DETAILS("MythTV client source",
@@ -254,7 +252,6 @@
gstbasesrc_class->stop = gst_mythtv_src_stop;
gstbasesrc_class->get_size = gst_mythtv_src_get_size;
gstbasesrc_class->is_seekable = gst_mythtv_src_is_seekable;
-
gstbasesrc_class->do_seek = gst_mythtv_src_do_seek;
gstpushsrc_class->create = gst_mythtv_src_create;
@@ -281,7 +278,6 @@
this->update_prog_chain = FALSE;
this->channel_name = NULL;
this->eos = FALSE;
- this->bytes_queue = NULL;
this->wait_to_transfer = 0;
gst_base_src_set_format(GST_BASE_SRC(this), GST_FORMAT_BYTES);
gst_pad_set_event_function(GST_BASE_SRC_PAD(GST_BASE_SRC(this)),
@@ -310,11 +306,6 @@
g_object_unref(mythtv_src->backend_info);
mythtv_src->backend_info = NULL;
}
-
- if (mythtv_src->bytes_queue) {
- g_byte_array_free(mythtv_src->bytes_queue, TRUE);
- mythtv_src->bytes_queue = NULL;
- }
}
static void
@@ -378,17 +369,9 @@
if (result == GMYTH_FILE_READ_ERROR) { /* -314 */
GST_INFO_OBJECT(src,
"[LiveTV] FileTransfer READ_ERROR!");
- goto done;
- } else if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) { /* -315
- */
- GST_INFO_OBJECT(src,
- "[LiveTV] FileTransfer - Go to athe next program chain!");
- src->update_prog_chain = TRUE;
- continue;
}
goto done;
}
-
}
/*
* else if (data_ptr->len == 0) goto done;
@@ -414,214 +397,57 @@
static GstFlowReturn
gst_mythtv_src_create(GstPushSrc * psrc, GstBuffer ** outbuf)
{
- GstMythtvSrc *src;
+ GstMythtvSrc *src;
GstFlowReturn ret = GST_FLOW_OK;
- guint buffer_size_inter = 0;
+ GByteArray *buffer;
+ gint buffer_remain = 0;
+ GMythFileReadResult result = GMYTH_FILE_READ_OK;
+ gboolean buffering = FALSE;
src = GST_MYTHTV_SRC(psrc);
- /*
- * The caller should know the number of bytes and not read beyond EOS.
- */
- if (G_UNLIKELY(src->eos))
- goto eos;
- GST_DEBUG_OBJECT(src, "offset = %" G_GUINT64_FORMAT ", size = %d...",
- src->read_offset, MAX_READ_SIZE);
+ buffer = g_byte_array_new ();
+ result = do_read_request_response(src, READ_SIZE, buffer);
+ if (result == GMYTH_FILE_READ_ERROR)
+ goto read_error;
- GST_DEBUG_OBJECT(src, "Create: buffer_remain: %d, buffer_size = %d.",
- (gint) src->buffer_remain, src->bytes_queue->len);
- program_chain_changed:
- /*
- * just get from the byte array, no network effort...
- */
- if ((src->buffer_remain = src->bytes_queue->len) < MAX_READ_SIZE) {
- GByteArray *buffer;
- GMythFileReadResult result = GMYTH_FILE_READ_OK;
-
- buffer = NULL;
- buffer_size_inter = (INTERNAL_BUFFER_SIZE - src->buffer_remain);
-
- if (buffer_size_inter > REQUEST_MAX_SIZE)
- buffer_size_inter = REQUEST_MAX_SIZE;
-
- buffer = g_byte_array_new();
-
- result = do_read_request_response(src, buffer_size_inter, buffer);
-
- /*
- * got the next program info?
- */
- if (G_UNLIKELY(src->update_prog_chain) ||
- (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN)) {
- GST_DEBUG_OBJECT(src,
- "Update PROGRAM CHAIN!!! buffer_size = %d.",
- src->bytes_queue->len);
- gst_pad_push_event(GST_BASE_SRC_PAD(GST_BASE_SRC(psrc)),
- gst_event_new_custom
- (GST_EVENT_CUSTOM_DOWNSTREAM, NULL));
- /*
- * gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)),
- * gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, 0,
- * -1, 0));
- */
- src->update_prog_chain = FALSE;
- src->eos = FALSE;
-
- if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
- /*
- * if (buffer != NULL) { g_byte_array_free (buffer, TRUE);
- * buffer = NULL; } goto program_chain_changed;
- */
- } else if (result == GMYTH_FILE_READ_OK) {
- /*
- * remove wasteful, NUV file header data
- */
- /*
- * buffer = g_byte_array_remove_range( buffer, 0, 512 );
- */
- /*
- * TODO: need to send a new segment event to NUVDemux?
- */
- // gst_pad_push_event (GST_BASE_SRC_PAD (GST_BASE_SRC
- // (psrc)),
- // gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES,
- // 0, -1, 0));
-
- /*
- * goto change_progchain;
- */
- }
-
- }
- /*
- */
- if (G_UNLIKELY(buffer->len < 0)) {
- if (buffer != NULL) {
- g_byte_array_free(buffer, TRUE);
- buffer = NULL;
- }
-
- if (src->live_tv ||
- (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN))
- goto change_progchain;
- else
- goto read_error;
- } else if (G_UNLIKELY(buffer->len == 0)) {
-
- if (buffer != NULL) {
- g_byte_array_free(buffer, TRUE);
- buffer = NULL;
- }
-
- if (!src->live_tv) {
- if (src->eos)
- goto eos;
- else
- goto done;
- }
- else
- goto program_chain_changed;
- }
-
- src->bytes_queue =
- g_byte_array_append(src->bytes_queue, buffer->data,
- buffer->len);
- if (buffer->len > buffer_size_inter)
- GST_WARNING_OBJECT(src,
- "INCREASED buffer size! Backend sent more than we ask him... (%d)",
- abs(buffer->len - buffer_size_inter));
-
- src->buffer_remain += buffer->len;
-
- if (buffer != NULL) {
- g_byte_array_free(buffer, TRUE);
- buffer = NULL;
- }
-
- /*
- * GST_DEBUG_OBJECT (src, "BYTES READ (actual) = %d, BYTES READ
- * (cumulative) = %llu, " "OFFSET = %llu, CONTENT SIZE = %llu.",
- * read, src->bytes_read, src->read_offset, src->content_size);
- */
- }
-
- guint buffer_size;
- buffer_size = (src->buffer_remain < MAX_READ_SIZE) ?
- src->buffer_remain :
- MAX_READ_SIZE;
-
*outbuf = gst_buffer_new();
-
- /*
- * GST_DEBUG_OBJECT (src, "read from network? %s!, buffer_remain =
- * %d", (buffer_size_inter == 0) ? "NO, got from buffer" : "YES, go
- * see the backend's log file", src->buffer_remain);
- */
-
- GST_BUFFER_SIZE(*outbuf) = buffer_size;
+ GST_BUFFER_SIZE(*outbuf) = buffer->len;
GST_BUFFER_MALLOCDATA(*outbuf) = g_malloc0(GST_BUFFER_SIZE(*outbuf));
GST_BUFFER_DATA(*outbuf) = GST_BUFFER_MALLOCDATA(*outbuf);
- g_memmove(GST_BUFFER_DATA((*outbuf)), src->bytes_queue->data,
+ g_memmove(GST_BUFFER_DATA((*outbuf)), buffer->data,
GST_BUFFER_SIZE(*outbuf));
GST_BUFFER_OFFSET(*outbuf) = src->read_offset;
GST_BUFFER_OFFSET_END(*outbuf) =
src->read_offset + GST_BUFFER_SIZE(*outbuf);
- src->buffer_remain -= GST_BUFFER_SIZE(*outbuf);
-
src->read_offset += GST_BUFFER_SIZE(*outbuf);
src->bytes_read += GST_BUFFER_SIZE(*outbuf);
- // GST_DEBUG_OBJECT (src, "Buffer output with size: %d",
- // GST_BUFFER_SIZE (*outbuf));
- /*
- * flushs the newly buffer got from byte array
- */
- src->bytes_queue =
- g_byte_array_remove_range(src->bytes_queue, 0, buffer_size);
+ g_byte_array_free (buffer, TRUE);
- if (src->eos ||
- (!src->live_tv && (src->bytes_read >= src->content_size))
- )
- goto eos;
+ if (result == GMYTH_FILE_READ_NEXT_PROG_CHAIN) {
+ GstPad *peer;
- done:
- {
- return ret;
+ peer = gst_pad_get_peer (GST_BASE_SRC_PAD (GST_BASE_SRC (psrc)));
+ gst_pad_send_event (peer,
+ gst_event_new_new_segment (FALSE, 1.0, GST_FORMAT_BYTES, 0, -1, 0));
+
+ gst_object_unref (peer);
}
- eos:
- {
- return GST_FLOW_UNEXPECTED;
- }
- /*
- * ERRORS
- */
- read_error:
- {
- GST_ELEMENT_ERROR(src, RESOURCE, READ,
- (NULL), ("Could not read any bytes (%i, %s)",
- read, src->uri_name));
- return GST_FLOW_ERROR;
- }
- change_progchain:
- {
- GST_ELEMENT_ERROR(src, RESOURCE, READ,
- (NULL),
- ("Seek failed, go to the next program info... (%i, %s)",
- read, src->uri_name));
- /*
- * TODO: need to send a new segment event to NUVDemux?
- */
- gst_pad_push_event(GST_BASE_SRC_PAD(GST_BASE_SRC(psrc)),
- gst_event_new_new_segment(TRUE, 1.0,
- GST_FORMAT_TIME, 0,
- -1, 0));
+ if (src->eos ||
+ (!src->live_tv && (src->bytes_read >= src->content_size)))
+ ret = GST_FLOW_UNEXPECTED;
- goto program_chain_changed;
- }
+ return ret;
+read_error:
+ GST_ELEMENT_ERROR(src, RESOURCE, READ,
+ (NULL), ("Could not read any bytes (%i, %s)",
+ read, src->uri_name));
+ return GST_FLOW_ERROR;
}
gint64
@@ -737,16 +563,10 @@
gmyth_uri = gmyth_uri_new_with_value(src->uri_name);
src->backend_info = gmyth_backend_info_new_with_uri(src->uri_name);
src->live_tv = gmyth_uri_is_livetv(gmyth_uri);
- /*
- * testing UPnP...
- */
- /*
- * gmyth_backend_info_set_hostname( src->backend_info, NULL );
- */
+
if (src->live_tv) {
src->spawn_livetv = gmyth_livetv_new(src->backend_info);
-
- gchar *ch = gmyth_uri_get_channel_name(gmyth_uri);
+ gchar *ch = gmyth_uri_get_channel_name(gmyth_uri);
if (ch != NULL)
src->channel_name = ch;
@@ -781,6 +601,7 @@
GMYTH_FILE(gmyth_livetv_create_file_transfer
(src->spawn_livetv));
+
if (NULL == src->file) {
GST_INFO_OBJECT(src, "[LiveTV] FileTransfer equals to NULL");
ret = FALSE;
@@ -862,12 +683,6 @@
src->do_start = FALSE;
- /*
- * this is used for the buffer cache
- */
- src->bytes_queue = g_byte_array_sized_new(INTERNAL_BUFFER_SIZE);
- src->buffer_remain = 0;
-
gst_pad_push_event(GST_BASE_SRC_PAD(GST_BASE_SRC(src)),
gst_event_new_new_segment(TRUE, 1.0,
GST_FORMAT_TIME, 0,
@@ -967,11 +782,6 @@
GstMythtvSrc *src = GST_MYTHTV_SRC(bsrc);
gst_mythtv_src_clear(src);
-
- /*
- * src->eos = FALSE;
- */
-
return TRUE;
}
Modified: trunk/gst-gmyth/mythsrc/gstmythtvsrc.h
===================================================================
--- trunk/gst-gmyth/mythsrc/gstmythtvsrc.h 2007-08-22 13:57:53 UTC (rev 827)
+++ trunk/gst-gmyth/mythsrc/gstmythtvsrc.h 2007-08-22 16:57:16 UTC (rev 828)
@@ -79,8 +79,6 @@
gint64 read_offset;
- gint buffer_remain;
-
gboolean eos;
gboolean do_start;
@@ -102,15 +100,6 @@
*/
GstCaps *mythtv_caps;
- GByteArray *bytes_queue;
-
-#ifndef GST_DISABLE_GST_DEBUG
- /*
- * enable Myth TV debug messages
- */
- gboolean mythtv_msgs_dbg;
-#endif
-
gboolean update_prog_chain;
/*
Modified: trunk/gst-gmyth/nuvdemux/gstnuvdemux.c
===================================================================
--- trunk/gst-gmyth/nuvdemux/gstnuvdemux.c 2007-08-22 13:57:53 UTC (rev 827)
+++ trunk/gst-gmyth/nuvdemux/gstnuvdemux.c 2007-08-22 16:57:16 UTC (rev 828)
@@ -739,9 +739,14 @@
static void
gst_nuv_demux_create_pads(GstNuvDemux * nuv)
{
- if (nuv->priv->h.i_video_blocks != 0) {
- GstCaps *video_caps = NULL;
+ if ((nuv->priv->src_video_pad != NULL) ||
+ (nuv->priv->src_audio_pad != NULL)) {
+ return;
+ }
+ if (nuv->priv->h.i_video_blocks != 0){
+ GstCaps *video_caps = NULL;
+
video_caps = gst_caps_new_simple("video/x-divx",
"divxversion", G_TYPE_INT, 4,
"width", G_TYPE_INT,
@@ -764,13 +769,15 @@
}
if (nuv->priv->h.i_audio_blocks != 0) {
- GstCaps *audio_caps = NULL;
+ GstCaps *audio_caps = NULL;
- audio_caps = gst_caps_new_simple("audio/mpeg", "rate", G_TYPE_INT, nuv->priv->eh.i_audio_sample_rate, "format", GST_TYPE_FOURCC, nuv->priv->eh.i_audio_fcc, "channels", G_TYPE_INT, nuv->priv->eh.i_audio_channels, "layer", G_TYPE_INT, 3, // fixme:
- // magic
- // number
- "mpegversion", G_TYPE_INT,
- nuv->priv->eh.i_version, NULL);
+ audio_caps = gst_caps_new_simple("audio/mpeg",
+ "rate", G_TYPE_INT, nuv->priv->eh.i_audio_sample_rate,
+ "format", GST_TYPE_FOURCC, nuv->priv->eh.i_audio_fcc,
+ "channels", G_TYPE_INT, nuv->priv->eh.i_audio_channels,
+ "layer", G_TYPE_INT, 3, // fixme: magic number
+ "mpegversion", G_TYPE_INT, nuv->priv->eh.i_version,
+ NULL);
nuv->priv->src_audio_pad =
gst_nuv_demux_create_pad(nuv, audio_caps, &audio_src_template,
@@ -854,7 +861,7 @@
return TRUE;
}
-static GstFlowReturn
+static GstFlowReturn
gst_nuv_demux_stream_data(GstNuvDemux * nuv)
{
GstFlowReturn ret = GST_FLOW_OK;
@@ -1643,57 +1650,17 @@
nuv = GST_NUV_DEMUX(gst_pad_get_parent(pad));
switch (GST_EVENT_TYPE(event)) {
- case GST_EVENT_NEWSEGMENT:
- {
- gboolean update;
- gdouble rate;
- GstFormat format;
- gint64 start;
- gint64 stop;
- gint64 position;
-
- gst_event_parse_new_segment(event, &update, &rate, &format,
- &start, &stop, &position);
- if ((format == GST_FORMAT_BYTES) && (start == 0)) {
- g_debug("NEW SEGMENT 0");
- if (nuv->priv->segment > 0) {
- nuv->priv->new_file = TRUE;
- nuv->priv->state = GST_NUV_DEMUX_START;
- nuv->priv->offset = 0;
- }
- nuv->priv->segment++;
-
- /*
- * newsegment_event = gst_event_new_new_segment (FALSE,
- * rate, GST_FORMAT_TIME, 0, GST_CLOCK_TIME_NONE,
- * GST_CLOCK_TIME_NONE);
- *
- * gst_pad_push_event (nuv->priv->src_audio_pad,
- * gst_event_ref (newsegment_event)); gst_pad_push_event
- * (nuv->priv->src_video_pad, gst_event_ref
- * (newsegment_event)); gst_event_unref
- * (newsegment_event);
- */
- res = gst_pad_event_default(pad, event);
- }
- break;
- }
- case GST_EVENT_CUSTOM_DOWNSTREAM:
- {
- /*
- * nuv->priv->new_file = TRUE; nuv->priv->state =
- * GST_NUV_DEMUX_START; nuv->priv->offset = 0;
- */
+ case GST_EVENT_NEWSEGMENT:
GST_PAD_STREAM_LOCK(pad);
gst_nuv_demux_reset(nuv);
GST_PAD_STREAM_UNLOCK(pad);
+ //res = gst_pad_event_default(pad, event);
+ res = TRUE;
+ break;
+ default:
res = gst_pad_event_default(pad, event);
break;
- }
- default:
- res = gst_pad_event_default(pad, event);
- break;
}
return res;
@@ -1783,7 +1750,6 @@
{
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
- g_debug("Nuvdemux state_change");
switch (transition) {
case GST_STATE_CHANGE_NULL_TO_READY:
gst_nuv_demux_reset(GST_NUV_DEMUX(element));
@@ -1793,8 +1759,6 @@
break;
}
- g_debug("Nuvdemux state_change: 1");
-
ret =
GST_ELEMENT_CLASS(parent_class)->change_state(element, transition);
if (ret == GST_STATE_CHANGE_FAILURE) {
@@ -1802,8 +1766,6 @@
}
- g_debug("Nuvdemux state_change: 2");
-
switch (transition) {
case GST_STATE_CHANGE_READY_TO_NULL:
gst_nuv_demux_reset(GST_NUV_DEMUX(element));
@@ -1812,10 +1774,6 @@
default:
break;
}
-
-
- g_debug("Nuvdemux state_change: DONE");
-
done:
return ret;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-22 13:57:49
|
Revision: 827
http://gmyth.svn.sourceforge.net/gmyth/?rev=827&view=rev
Author: melunko
Date: 2007-08-22 06:57:53 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
GMyth 0.4 release
Modified Paths:
--------------
trunk/gmyth/configure.ac
trunk/gmyth/debian/changelog
Modified: trunk/gmyth/configure.ac
===================================================================
--- trunk/gmyth/configure.ac 2007-08-22 13:55:41 UTC (rev 826)
+++ trunk/gmyth/configure.ac 2007-08-22 13:57:53 UTC (rev 827)
@@ -3,14 +3,14 @@
AC_PREREQ(2.50)
-AC_INIT([gmyth],[0.3])
+AC_INIT([gmyth],[0.4])
AC_CONFIG_SRCDIR([src/gmyth.h])
AC_CONFIG_HEADER(config.h)
dnl when going to/from release please set the nano (fourth number) right !
dnl releases only do Wall, SVN and prerelease does Werror too
-AS_VERSION(gmyth, GMYTH, 0, 3, 0, 0, GMYTH_SVN="no", GMYTH_SVN="yes")
+AS_VERSION(gmyth, GMYTH, 0, 4, 0, 0, GMYTH_SVN="no", GMYTH_SVN="yes")
GMYTH_MAJORMINOR=$GMYTH_MAJOR_VERSION.$GMYTH_MINOR_VERSION
AC_SUBST(GMYTH_MAJORMINOR)
Modified: trunk/gmyth/debian/changelog
===================================================================
--- trunk/gmyth/debian/changelog 2007-08-22 13:55:41 UTC (rev 826)
+++ trunk/gmyth/debian/changelog 2007-08-22 13:57:53 UTC (rev 827)
@@ -1,3 +1,11 @@
+gmyth (0.4) unstable; urgency=low
+
+ * Bug fixes
+ * Improvements in the schedule management (add all schedule, add exception, ...)
+ * GMythBackendInfo now has db_port
+
+ -- Hallyson Melo <hal...@in...> Thu, 22 Aug 2007 14:46:08 -0300
+
gmyth (0.3) unstable; urgency=low
* Update file_reader an serveral bug fixes;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-22 13:55:40
|
Revision: 826
http://gmyth.svn.sourceforge.net/gmyth/?rev=826&view=rev
Author: melunko
Date: 2007-08-22 06:55:41 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
gmyth-ls and gmyth_query now considers db_port. Thanks to Bastien Nocera for his patch.
Modified Paths:
--------------
trunk/gmyth/samples/gmyth_ls.c
trunk/gmyth/src/gmyth_query.c
Modified: trunk/gmyth/samples/gmyth_ls.c
===================================================================
--- trunk/gmyth/samples/gmyth_ls.c 2007-08-22 13:07:49 UTC (rev 825)
+++ trunk/gmyth/samples/gmyth_ls.c 2007-08-22 13:55:41 UTC (rev 826)
@@ -42,6 +42,7 @@
gchar *host_ip = NULL;
gint host_port = 0;
+ gint db_port = 0;
gboolean list_channels = FALSE;
gchar *username = NULL;
gchar *password = NULL;
@@ -59,13 +60,17 @@
"LIST_CHANNELS"},
{"username", 'u', 0, G_OPTION_ARG_STRING, &username,
- "Mysql database username. Default: mythtv" "Mysql user",
+ "Mysql database username. Default: mythtv",
"MYSQL_USER"},
{"password", 'w', 0, G_OPTION_ARG_STRING, &password,
- "Mysql database password. Default: mythtv" "Mysql password",
+ "Mysql database password. Default: mythtv",
"MYSQL_PASSWD"},
+ {"db_port", 'P', 0, G_OPTION_ARG_STRING, &db_port,
+ "Mysql database port. Default: 0",
+ "MYSQL_PORT"},
+
{NULL}
};
Modified: trunk/gmyth/src/gmyth_query.c
===================================================================
--- trunk/gmyth/src/gmyth_query.c 2007-08-22 13:07:49 UTC (rev 825)
+++ trunk/gmyth/src/gmyth_query.c 2007-08-22 13:55:41 UTC (rev 826)
@@ -161,7 +161,9 @@
gmyth_query->backend_info->hostname,
gmyth_query->backend_info->username,
gmyth_query->backend_info->password,
- gmyth_query->backend_info->db_name, 0, NULL,
+ gmyth_query->backend_info->db_name,
+ gmyth_query->backend_info->db_port,
+ NULL,
0) == NULL) {
gmyth_query_print_error(gmyth_query->conn,
"mysql_real_connect() failed");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <me...@us...> - 2007-08-22 13:07:48
|
Revision: 825
http://gmyth.svn.sourceforge.net/gmyth/?rev=825&view=rev
Author: melunko
Date: 2007-08-22 06:07:49 -0700 (Wed, 22 Aug 2007)
Log Message:
-----------
A short warnning removed
Modified Paths:
--------------
trunk/gmyth/src/gmyth_scheduler.c
Modified: trunk/gmyth/src/gmyth_scheduler.c
===================================================================
--- trunk/gmyth/src/gmyth_scheduler.c 2007-08-22 13:06:43 UTC (rev 824)
+++ trunk/gmyth/src/gmyth_scheduler.c 2007-08-22 13:07:49 UTC (rev 825)
@@ -607,7 +607,6 @@
gmyth_scheduler_add_exception (GMythScheduler *scheduler, gint schedule_id,
ScheduleInfo *exception_info)
{
- GString *query_str;
gboolean res;
g_return_val_if_fail (scheduler != NULL, FALSE);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|