[Redbutton-devel] SF.net SVN: redbutton: [279] redbutton-browser/trunk
Brought to you by:
skilvington
|
From: <ski...@us...> - 2007-04-08 11:50:34
|
Revision: 279
http://svn.sourceforge.net/redbutton/?rev=279&view=rev
Author: skilvington
Date: 2007-04-08 04:50:31 -0700 (Sun, 08 Apr 2007)
Log Message:
-----------
I know how to do this, but my wife's just had a baby, so it may not get done for a while!
Modified Paths:
--------------
redbutton-browser/trunk/MHEGEngine.c
redbutton-browser/trunk/MHEGEngine.h
redbutton-browser/trunk/si.c
Modified: redbutton-browser/trunk/MHEGEngine.c
===================================================================
--- redbutton-browser/trunk/MHEGEngine.c 2007-04-03 15:13:34 UTC (rev 278)
+++ redbutton-browser/trunk/MHEGEngine.c 2007-04-08 11:50:31 UTC (rev 279)
@@ -1448,6 +1448,22 @@
return (*(engine.backend.fns->retune))(&engine.backend, service);
}
+const OctetString *
+MHEGEngine_getRecSvcDef(void)
+{
+static OctetString _TODO = {4,"TODO"};
+printf("TODO: MHEGEngine_getRecSvcDef\n");
+return (const OctetString *) &_TODO;
+}
+
+const OctetString *
+MHEGEngine_getRecSvcCur(void)
+{
+static OctetString _TODO = {4,"TODO"};
+printf("TODO: MHEGEngine_getRecSvcCur\n");
+return (const OctetString *) &_TODO;
+}
+
/*
* returns the absolute group ID, ie it always starts with "~//"
* returns a ptr to static string that will be overwritten by the next call to this routine
Modified: redbutton-browser/trunk/MHEGEngine.h
===================================================================
--- redbutton-browser/trunk/MHEGEngine.h 2007-04-03 15:13:34 UTC (rev 278)
+++ redbutton-browser/trunk/MHEGEngine.h 2007-04-08 11:50:31 UTC (rev 279)
@@ -246,6 +246,9 @@
void MHEGEngine_closeStream(MHEGStream *);
void MHEGEngine_retune(OctetString *);
+const OctetString *MHEGEngine_getRecSvcDef(void);
+const OctetString *MHEGEngine_getRecSvcCur(void);
+
char *MHEGEngine_absoluteFilename(OctetString *);
/* convert PNG to internal format */
Modified: redbutton-browser/trunk/si.c
===================================================================
--- redbutton-browser/trunk/si.c 2007-04-03 15:13:34 UTC (rev 278)
+++ redbutton-browser/trunk/si.c 2007-04-08 11:50:31 UTC (rev 279)
@@ -12,22 +12,48 @@
static int si_max_index = -1;
static OctetString *si_channel = NULL;
+/*
+ * service can be:
+ * "dvb://<original_network_id>.[<transport_stream_id>].<service_id>"
+ * "rec://svc/def" - use the service we are downloading the carousel from
+ * "rec://svc/cur" - use the current service
+ * this will be the same as "def" unless SetData has been called on the StreamClass
+ * "rec://svc/lcn/X" - use logical channel number X (eg 1 for BBC1, 3 for ITV1, etc)
+ *
+ * we resolve whatever we are given to a dvb:// format URL and store that
+ */
+
int
si_get_index(OctetString *ref)
{
int i;
+ /* resolve it to dvb:// format */
+ if(OctetString_strcmp(ref, "rec://svc/def") == 0)
+ {
+ /* promise we wont change it */
+ ref = (OctetString *) MHEGEngine_getRecSvcDef();
+ }
+ else if(OctetString_strcmp(ref, "rec://svc/cur") == 0)
+ {
+ /* promise we wont change it */
+ ref = (OctetString *) MHEGEngine_getRecSvcCur();
+ }
+ else if(OctetString_strncmp(ref, "rec://svc/lcn/", 14) == 0)
+ {
+/* TODO */
+printf("TODO: si_get_index: service='%.*s'\n", ref->size, ref->data);
+ }
+ else if(OctetString_strncmp(ref, "dvb:", 4) != 0)
+ {
+ error("si_get_index: unexpected service '%.*s'", ref->size, ref->data);
+ }
+
/* have we assigned it already */
for(i=0; i<=si_max_index; i++)
if(OctetString_cmp(ref, &si_channel[i]) == 0)
return i;
-/* TODO */
-/* convert rec://svc/{def,cur,lcn/X} to dvb://network.transport.service */
-/* even if we don't have a backend! */
-if(ref->size < 6 || strncmp(ref->data, "dvb://", 6) != 0)
-printf("TODO: si_get_index '%.*s' is not in 'dvb://' format\n", ref->size, ref->data);
-
/* add it to the list */
si_max_index ++;
si_channel = safe_realloc(si_channel, (si_max_index + 1) * sizeof(OctetString));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|