redbutton-devel Mailing List for RedButton MHEG Engine (Page 19)
Brought to you by:
skilvington
You can subscribe to this list here.
| 2006 |
Jan
(1) |
Feb
(4) |
Mar
(27) |
Apr
(6) |
May
(46) |
Jun
(45) |
Jul
(7) |
Aug
(4) |
Sep
(7) |
Oct
(5) |
Nov
(10) |
Dec
(11) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(49) |
Feb
(29) |
Mar
(35) |
Apr
(43) |
May
(23) |
Jun
(4) |
Jul
(1) |
Aug
(58) |
Sep
(66) |
Oct
(27) |
Nov
(15) |
Dec
(1) |
| 2008 |
Jan
(11) |
Feb
|
Mar
(8) |
Apr
|
May
|
Jun
(30) |
Jul
(1) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(3) |
Dec
(6) |
| 2009 |
Jan
(6) |
Feb
(1) |
Mar
(2) |
Apr
(5) |
May
(2) |
Jun
(1) |
Jul
(7) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(6) |
| 2010 |
Jan
(6) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(4) |
Oct
|
Nov
(11) |
Dec
(4) |
| 2011 |
Jan
|
Feb
(11) |
Mar
(8) |
Apr
|
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
(2) |
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ski...@us...> - 2007-02-13 17:00:09
|
Revision: 215
http://svn.sourceforge.net/redbutton/?rev=215&view=rev
Author: skilvington
Date: 2007-02-13 08:59:54 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
retry ioctl if it is interrupted by a signal
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-02-13 14:13:03 UTC (rev 214)
+++ redbutton-download/trunk/channels.c 2007-02-13 16:59:54 UTC (rev 215)
@@ -234,6 +234,7 @@
tune_service_id(unsigned int adapter, unsigned int timeout, uint16_t service_id)
{
char fe_dev[PATH_MAX];
+ bool got_info;
struct dvb_frontend_info fe_info;
struct dvb_frontend_parameters current_params;
struct dvb_frontend_parameters *needed_params;
@@ -261,8 +262,14 @@
vverbose("Getting frontend info");
- if(ioctl(fe_fd, FE_GET_INFO, &fe_info) < 0)
- fatal("ioctl FE_GET_INFO: %s", strerror(errno));
+ do
+ {
+ /* maybe interrupted by a signal */
+ got_info = (ioctl(fe_fd, FE_GET_INFO, &fe_info) >= 0);
+ if(!got_info && errno != EINTR)
+ fatal("ioctl FE_GET_INFO: %s", strerror(errno));
+ }
+ while(!got_info);
if(fe_info.type != FE_OFDM)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-13 14:13:09
|
Revision: 214
http://svn.sourceforge.net/redbutton/?rev=214&view=rev
Author: skilvington
Date: 2007-02-13 06:13:03 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
white space
Modified Paths:
--------------
redbutton-browser/trunk/StreamComponent.c
Modified: redbutton-browser/trunk/StreamComponent.c
===================================================================
--- redbutton-browser/trunk/StreamComponent.c 2007-02-13 14:12:31 UTC (rev 213)
+++ redbutton-browser/trunk/StreamComponent.c 2007-02-13 14:13:03 UTC (rev 214)
@@ -12,7 +12,6 @@
void
StreamComponent_registerStreamClass(StreamComponent *s, StreamClass *owner)
{
-
switch(s->choice)
{
case StreamComponent_audio:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-13 14:12:45
|
Revision: 213
http://svn.sourceforge.net/redbutton/?rev=213&view=rev
Author: skilvington
Date: 2007-02-13 06:12:31 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
let StreamComponents know which StreamClass they belong to
Modified Paths:
--------------
redbutton-browser/trunk/StreamClass.c
redbutton-browser/trunk/StreamComponent.c
redbutton-browser/trunk/StreamComponent.h
redbutton-browser/trunk/add_instance_vars.conf
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2007-02-13 10:30:46 UTC (rev 212)
+++ redbutton-browser/trunk/StreamClass.c 2007-02-13 14:12:31 UTC (rev 213)
@@ -13,6 +13,8 @@
void
default_StreamClassInstanceVars(StreamClass *t, StreamClassInstanceVars *v)
{
+ LIST_TYPE(StreamComponent) *comp;
+
bzero(v, sizeof(StreamClassInstanceVars));
v->Speed.numerator = 1;
@@ -24,6 +26,14 @@
v->CounterTriggers = NULL;
+ /* let the StreamComponents know who they belong to */
+ comp = t->multiplex;
+ while(comp)
+ {
+ StreamComponent_registerStreamClass(&comp->item, t);
+ comp = comp->next;
+ }
+
MHEGStreamPlayer_init(&v->player);
return;
Modified: redbutton-browser/trunk/StreamComponent.c
===================================================================
--- redbutton-browser/trunk/StreamComponent.c 2007-02-13 10:30:46 UTC (rev 212)
+++ redbutton-browser/trunk/StreamComponent.c 2007-02-13 14:12:31 UTC (rev 213)
@@ -9,6 +9,32 @@
#include "RTGraphicsClass.h"
#include "utils.h"
+void
+StreamComponent_registerStreamClass(StreamComponent *s, StreamClass *owner)
+{
+
+ switch(s->choice)
+ {
+ case StreamComponent_audio:
+ s->u.audio.inst.owner = owner;
+ break;
+
+ case StreamComponent_video:
+ s->u.video.inst.owner = owner;
+ break;
+
+ case StreamComponent_rtgraphics:
+ s->u.rtgraphics.inst.owner = owner;
+ break;
+
+ default:
+ error("Unknown StreamComponent type: %d", s->choice);
+ break;
+ }
+
+ return;
+}
+
RootClass *
StreamComponent_rootClass(StreamComponent *s)
{
Modified: redbutton-browser/trunk/StreamComponent.h
===================================================================
--- redbutton-browser/trunk/StreamComponent.h 2007-02-13 10:30:46 UTC (rev 212)
+++ redbutton-browser/trunk/StreamComponent.h 2007-02-13 14:12:31 UTC (rev 213)
@@ -9,6 +9,8 @@
#include "ISO13522-MHEG-5.h"
+void StreamComponent_registerStreamClass(StreamComponent *, StreamClass *);
+
RootClass *StreamComponent_rootClass(StreamComponent *);
bool StreamComponent_isInitiallyActive(StreamComponent *);
Modified: redbutton-browser/trunk/add_instance_vars.conf
===================================================================
--- redbutton-browser/trunk/add_instance_vars.conf 2007-02-13 10:30:46 UTC (rev 212)
+++ redbutton-browser/trunk/add_instance_vars.conf 2007-02-13 14:12:31 UTC (rev 213)
@@ -177,6 +177,8 @@
/* VideoClass */
/* UK MHEG Profile adds this */
XYPosition VideoDecodeOffset;
+ /* we add a link to the StreamClass it is a part of */
+ struct StreamClass *owner;
/* we add a lock for the size/position */
pthread_mutex_t bbox_lock;
/* and the scaled size */
@@ -222,9 +224,20 @@
typedef struct
{
int Volume;
+ /* we add a link to the StreamClass it is a part of */
+ struct StreamClass *owner;
} AudioClassInstanceVars;
</AudioClass>
+<RTGraphicsClass>
+typedef struct
+{
+ /* not implemented */
+ /* we add a link to the StreamClass it is a part of */
+ struct StreamClass *owner;
+} RTGraphicsClassInstanceVars;
+</RTGraphicsClass>
+
<SliderClass>
typedef struct
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-13 10:30:50
|
Revision: 212
http://svn.sourceforge.net/redbutton/?rev=212&view=rev
Author: skilvington
Date: 2007-02-13 02:30:46 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
more TODO
Modified Paths:
--------------
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-02-12 19:25:57 UTC (rev 211)
+++ redbutton-browser/trunk/TODO 2007-02-13 10:30:46 UTC (rev 212)
@@ -4,6 +4,9 @@
if video size != VideoClass size, centre and draw a smaller transparent hole
+clear overlay on boot/retune/launch/etc
+
+
use ffmpeg to permenantly scale-up bitmaps in MHEGBitmap_fromRGBA
(rather than having to apply an XRender xform matrix and filter each time)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-12 19:26:04
|
Revision: 211
http://svn.sourceforge.net/redbutton/?rev=211&view=rev
Author: skilvington
Date: 2007-02-12 11:25:57 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
show service ID in verbose message
Modified Paths:
--------------
redbutton-browser/trunk/MHEGStreamPlayer.c
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2007-02-12 17:31:11 UTC (rev 210)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2007-02-12 19:25:57 UTC (rev 211)
@@ -179,7 +179,7 @@
void
MHEGStreamPlayer_play(MHEGStreamPlayer *p)
{
- verbose("MHEGStreamPlayer_play: audio_tag=%d video_tag=%d", p->audio_tag, p->video_tag);
+ verbose("MHEGStreamPlayer_play: service_id=%d audio_tag=%d video_tag=%d", p->service_id, p->audio_tag, p->video_tag);
/* make sure the VideoClass doesn't try to draw anything yet */
if(p->video != NULL)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-12 17:31:15
|
Revision: 210
http://svn.sourceforge.net/redbutton/?rev=210&view=rev
Author: skilvington
Date: 2007-02-12 09:31:11 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
allow streaming a/v from different service IDs
Modified Paths:
--------------
redbutton-download/trunk/findmheg.c
Modified: redbutton-download/trunk/findmheg.c
===================================================================
--- redbutton-download/trunk/findmheg.c 2007-02-12 10:07:32 UTC (rev 209)
+++ redbutton-download/trunk/findmheg.c 2007-02-12 17:31:11 UTC (rev 210)
@@ -23,6 +23,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
+#include <string.h>
#include <netinet/in.h>
#include "carousel.h"
@@ -78,6 +79,10 @@
#define DATA_BROADCAST_ID 0x0106
#define APPLICATION_TYPE_CODE 0x0101
+static struct avstreams *find_current_avstreams(struct carousel *, int, int);
+static struct avstreams *find_service_avstreams(struct carousel *, int, int, int);
+static unsigned char *read_pmt(char *, uint16_t, unsigned int);
+
bool
is_audio_stream(uint8_t stream_type)
{
@@ -102,12 +107,9 @@
struct carousel *
find_mheg(unsigned int adapter, unsigned int timeout, uint16_t service_id, int carousel_id)
{
- unsigned char *pat;
+ unsigned char *pmt;
uint16_t section_length;
uint16_t offset;
- uint16_t map_pid = 0;
- bool found;
- unsigned char *pmt;
uint8_t stream_type;
uint16_t elementary_pid;
uint16_t info_length;
@@ -141,36 +143,8 @@
_car.nmodules = 0;
_car.modules = NULL;
- /* get the PAT */
- if((pat = read_table(_car.demux_device, PID_PAT, TID_PAT, timeout)) == NULL)
- fatal("Unable to read PAT");
-
- section_length = 3 + (((pat[1] & 0x0f) << 8) + pat[2]);
-
- /* find the PMT for this service_id */
- found = false;
- offset = 8;
- /* -4 for the CRC at the end */
- while((offset < (section_length - 4)) && !found)
- {
- if((pat[offset] << 8) + pat[offset+1] == service_id)
- {
- map_pid = ((pat[offset+2] & 0x1f) << 8) + pat[offset+3];
- found = true;
- }
- else
- {
- offset += 4;
- }
- }
-
- if(!found)
- fatal("Unable to find PMT PID for service_id %u", service_id);
-
- vverbose("PMT PID: %u", map_pid);
-
/* get the PMT */
- if((pmt = read_table(_car.demux_device, map_pid, TID_PMT, timeout)) == NULL)
+ if((pmt = read_pmt(_car.demux_device, service_id, timeout)) == NULL)
fatal("Unable to read PMT");
section_length = 3 + (((pmt[1] & 0x0f) << 8) + pmt[2]);
@@ -288,8 +262,15 @@
struct avstreams *
find_avstreams(struct carousel *car, int service_id, int audio_tag, int video_tag)
{
-if(service_id != -1) printf("TODO: find_avstreams %d\n", service_id);
+ if(service_id == -1)
+ return find_current_avstreams(car, audio_tag, video_tag);
+ else
+ return find_service_avstreams(car, service_id, audio_tag, video_tag);
+}
+static struct avstreams *
+find_current_avstreams(struct carousel *car, int audio_tag, int video_tag)
+{
/* map the tags to PIDs and stream types, or use the defaults */
if(audio_tag == -1)
{
@@ -318,3 +299,152 @@
return &_streams;
}
+static struct avstreams *
+find_service_avstreams(struct carousel *car, int service_id, int audio_tag, int video_tag)
+{
+ unsigned char *pmt;
+ uint16_t section_length;
+ uint16_t offset;
+ uint8_t stream_type;
+ uint16_t elementary_pid;
+ uint16_t info_length;
+ uint8_t desc_tag;
+ uint8_t desc_length;
+ uint16_t component_tag;
+
+ verbose("find_service_avstreams: %d %d %d", service_id, audio_tag, video_tag);
+
+ /* in case we don't find them */
+ bzero(&_streams, sizeof(_streams));
+
+ /* get the PMT */
+ if((pmt = read_pmt(car->demux_device, service_id, car->timeout)) == NULL)
+ fatal("Unable to read PMT");
+
+ section_length = 3 + (((pmt[1] & 0x0f) << 8) + pmt[2]);
+
+ /* skip the program_info descriptors */
+ offset = 10;
+ info_length = ((pmt[offset] & 0x0f) << 8) + pmt[offset+1];
+ offset += 2 + info_length;
+
+ /* find the streams */
+ while(offset < (section_length - 4))
+ {
+ stream_type = pmt[offset];
+ offset += 1;
+ elementary_pid = ((pmt[offset] & 0x1f) << 8) + pmt[offset+1];
+ offset += 2;
+ /* do we want the default video stream for this service */
+ if(video_tag == -1 && stream_type == STREAM_TYPE_VIDEO_MPEG2)
+ {
+ _streams.video_pid = elementary_pid;
+ _streams.video_type = stream_type;
+ vverbose("PID=%u video stream_type=0x%x", elementary_pid, stream_type);
+ }
+ /* read the descriptors */
+ info_length = ((pmt[offset] & 0x0f) << 8) + pmt[offset+1];
+ offset += 2;
+ while(info_length != 0)
+ {
+ desc_tag = pmt[offset];
+ desc_length = pmt[offset+1];
+ offset += 2;
+ info_length -= 2;
+ if(desc_tag == TAG_STREAM_ID_DESCRIPTOR)
+ {
+ struct stream_id_descriptor *desc;
+ desc = (struct stream_id_descriptor *) &pmt[offset];
+ component_tag = desc->component_tag;
+ vverbose("PID=%u component_tag=%u", elementary_pid, component_tag);
+ /* is it one we want */
+ if(audio_tag == component_tag)
+ {
+ _streams.audio_pid = elementary_pid;
+ _streams.audio_type = stream_type;
+ vverbose("PID=%u audio stream_type=0x%x", elementary_pid, stream_type);
+ }
+ else if(video_tag == component_tag)
+ {
+ _streams.video_pid = elementary_pid;
+ _streams.video_type = stream_type;
+ vverbose("PID=%u video stream_type=0x%x", elementary_pid, stream_type);
+ }
+ }
+ /* do we want the default audio */
+ else if(audio_tag == -1 && desc_tag == TAG_LANGUAGE_DESCRIPTOR && is_audio_stream(stream_type))
+ {
+ struct language_descriptor *desc;
+ desc = (struct language_descriptor *) &pmt[offset];
+ /* only remember the normal audio stream (not visually impaired stream) */
+ if(desc->audio_type == 0)
+ {
+ _streams.audio_pid = elementary_pid;
+ _streams.audio_type = stream_type;
+ vverbose("PID=%u audio stream_type=0x%x", elementary_pid, stream_type);
+ }
+ }
+ else
+ {
+ vverbose("PID=%u descriptor=0x%x", elementary_pid, desc_tag);
+ vhexdump(&pmt[offset], desc_length);
+ }
+ offset += desc_length;
+ info_length -= desc_length;
+ }
+ }
+
+ verbose("Audio PID=%u type=0x%x", _streams.audio_pid, _streams.audio_type);
+ verbose("Video PID=%u type=0x%x", _streams.video_pid, _streams.video_type);
+
+ return &_streams;
+}
+
+static unsigned char *
+read_pmt(char *demux, uint16_t service_id, unsigned int timeout)
+{
+ unsigned char *pat;
+ uint16_t section_length;
+ uint16_t offset;
+ uint16_t map_pid = 0;
+ bool found;
+ unsigned char *pmt;
+
+ /* get the PAT */
+ if((pat = read_table(_car.demux_device, PID_PAT, TID_PAT, timeout)) == NULL)
+ {
+ error("Unable to read PAT");
+ return NULL;
+ }
+
+ section_length = 3 + (((pat[1] & 0x0f) << 8) + pat[2]);
+
+ /* find the PMT for this service_id */
+ found = false;
+ offset = 8;
+ /* -4 for the CRC at the end */
+ while((offset < (section_length - 4)) && !found)
+ {
+ if((pat[offset] << 8) + pat[offset+1] == service_id)
+ {
+ map_pid = ((pat[offset+2] & 0x1f) << 8) + pat[offset+3];
+ found = true;
+ }
+ else
+ {
+ offset += 4;
+ }
+ }
+
+ if(!found)
+ fatal("Unable to find PMT PID for service_id %u", service_id);
+
+ vverbose("PMT PID: %u", map_pid);
+
+ /* get the PMT */
+ if((pmt = read_table(_car.demux_device, map_pid, TID_PMT, timeout)) == NULL)
+ error("Unable to read PMT");
+
+ return pmt;
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-12 10:07:36
|
Revision: 209
http://svn.sourceforge.net/redbutton/?rev=209&view=rev
Author: skilvington
Date: 2007-02-12 02:07:32 -0800 (Mon, 12 Feb 2007)
Log Message:
-----------
more TODO
Modified Paths:
--------------
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-02-11 12:38:51 UTC (rev 208)
+++ redbutton-browser/trunk/TODO 2007-02-12 10:07:32 UTC (rev 209)
@@ -1,3 +1,9 @@
+don't keep malloc/free'ing memory for a/v frames
+
+
+if video size != VideoClass size, centre and draw a smaller transparent hole
+
+
use ffmpeg to permenantly scale-up bitmaps in MHEGBitmap_fromRGBA
(rather than having to apply an XRender xform matrix and filter each time)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-11 12:38:59
|
Revision: 208
http://svn.sourceforge.net/redbutton/?rev=208&view=rev
Author: skilvington
Date: 2007-02-11 04:38:51 -0800 (Sun, 11 Feb 2007)
Log Message:
-----------
nearly able to stream a/v from different service IDs
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.c
redbutton-download/trunk/command.c
redbutton-download/trunk/findmheg.c
redbutton-download/trunk/findmheg.h
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-02-08 14:07:04 UTC (rev 207)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-02-11 12:38:51 UTC (rev 208)
@@ -540,21 +540,18 @@
unsigned int video_pid = 0;
bool err;
-/* TODO */
-if(service_id != -1) printf("TODO: openStream: service_id=%d\n", service_id);
-
/* no PIDs required */
if(!have_audio && !have_video)
return NULL;
/* video and audio */
else if(have_audio && have_video)
- snprintf(cmd, sizeof(cmd), "avstream %d %d\n", *audio_tag, *video_tag);
+ snprintf(cmd, sizeof(cmd), "avstream %d %d %d\n", service_id, *audio_tag, *video_tag);
/* audio only */
else if(have_audio)
- snprintf(cmd, sizeof(cmd), "astream %d\n", *audio_tag);
+ snprintf(cmd, sizeof(cmd), "astream %d %d\n", service_id, *audio_tag);
/* video only */
else
- snprintf(cmd, sizeof(cmd), "vstream %d\n", *video_tag);
+ snprintf(cmd, sizeof(cmd), "vstream %d %d\n", service_id, *video_tag);
/* false => create a new connection to the backend */
if((sock = remote_command(t, false, cmd)) == NULL)
Modified: redbutton-download/trunk/command.c
===================================================================
--- redbutton-download/trunk/command.c 2007-02-08 14:07:04 UTC (rev 207)
+++ redbutton-download/trunk/command.c 2007-02-11 12:38:51 UTC (rev 208)
@@ -13,6 +13,7 @@
#include <sys/stat.h>
#include "command.h"
+#include "findmheg.h"
#include "assoc.h"
#include "fs.h"
#include "stream.h"
@@ -40,16 +41,16 @@
char *help;
} command[] =
{
- { "assoc", "", cmd_assoc, "List component tag to PID mappings" },
- { "astream", "<ComponentTag>", cmd_astream, "Stream the given audio component tag" },
- { "avstream", "<AudioTag> <VideoTag>", cmd_avstream, "Stream the given audio and video component tags" },
- { "check", "<ContentReference>", cmd_check, "Check if the given file exists on the carousel" },
- { "exit", "", cmd_quit, "Close the connection" },
- { "file", "<ContentReference>", cmd_file, "Retrieve the given file from the carousel" },
- { "help", "", cmd_help, "List available commands" },
- { "quit", "", cmd_quit, "Close the connection" },
- { "retune", "<ServiceID>", cmd_retune, "Start downloading the carousel from ServiceID" },
- { "vstream", "<ComponentTag>", cmd_vstream, "Stream the given video component tag" },
+ { "assoc", "", cmd_assoc, "List component tag to PID mappings" },
+ { "astream", "[<ServiceID>] <ComponentTag>", cmd_astream, "Stream the given audio component tag" },
+ { "avstream", "[<ServiceID>] <AudioTag> <VideoTag>", cmd_avstream, "Stream the given audio and video component tags" },
+ { "check", "<ContentReference>", cmd_check, "Check if the given file exists on the carousel" },
+ { "exit", "", cmd_quit, "Close the connection" },
+ { "file", "<ContentReference>", cmd_file, "Retrieve the given file from the carousel" },
+ { "help", "", cmd_help, "List available commands" },
+ { "quit", "", cmd_quit, "Close the connection" },
+ { "retune", "<ServiceID>", cmd_retune, "Start downloading the carousel from ServiceID" },
+ { "vstream", "[<ServiceID>] <ComponentTag>", cmd_vstream, "Stream the given video component tag" },
{ NULL, NULL, NULL, NULL }
};
@@ -133,6 +134,14 @@
return false; \
}
+/* variable number of arguments */
+#define CHECK_VUSAGE(MIN, MAX, SYNTAX) \
+if(argc < MIN || argc > MAX) \
+{ \
+ SEND_RESPONSE(500, "Syntax: " SYNTAX); \
+ return false; \
+}
+
/*
* assoc
* show the association/component tag to PID mappings
@@ -164,48 +173,46 @@
}
/*
- * astream <tag>
+ * astream [<service_id>] <tag>
* send the given audio stream down the connection
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
* the tag should be an association/component_tag number as found in the PMT
* the tag is converted to a PID and that PID is sent as a MPEG Transport Stream down the connection
- * if tag is -1, the default audio stream for the current service_id is sent
+ * if tag is -1, the default audio stream for the service_id is sent
*/
bool
cmd_astream(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
{
struct carousel *car = listen_data->carousel;
+ int service;
int tag;
- uint16_t pid;
- uint8_t type;
+ struct avstreams *streams;
int audio_fd;
int ts_fd;
char hdr[64];
- CHECK_USAGE(2, "astream <ComponentTag>");
+ CHECK_VUSAGE(2, 3, "astream [<ServiceID>] <ComponentTag>");
- tag = strtol(argv[1], NULL, 0);
-
- /* map the tag to a PID and stream type, or use the default */
- if(tag == -1)
+ if(argc == 2)
{
- /* check we have a default stream */
- if(car->audio_pid == 0)
- {
- SEND_RESPONSE(500, "Unable to find audio PID");
- return false;
- }
- pid = car->audio_pid;
- type = car->audio_type;
+ service = -1;
+ tag = strtol(argv[1], NULL, 0);
}
else
{
- pid = stream2pid(&car->assoc, tag);
- type = stream2type(&car->assoc, tag);
+ service = strtol(argv[1], NULL, 0);
+ tag = strtol(argv[2], NULL, 0);
}
+ streams = find_avstreams(car, service, tag, -1);
+
+ /* check we have a default stream */
+ if(streams->audio_pid == 0)
+ SEND_RESPONSE(500, "Unable to resolve audio PID");
+
/* add the PID to the demux device */
- if((audio_fd = add_demux_filter(car->demux_device, pid, DMX_PES_AUDIO)) < 0)
+ if((audio_fd = add_demux_filter(car->demux_device, streams->audio_pid, DMX_PES_AUDIO)) < 0)
{
SEND_RESPONSE(500, "Unable to open audio PID");
return false;
@@ -223,7 +230,7 @@
SEND_RESPONSE(200, "OK");
/* tell the client what PID and stream type the component tag resolved to */
- snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u\n", pid, type);
+ snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u\n", streams->audio_pid, streams->audio_type);
fputs(hdr, client);
/* shovel the transport stream to client until the client closes or we get an error */
@@ -238,48 +245,46 @@
}
/*
- * vstream <tag>
+ * vstream [<service_id>] <tag>
* send the given video stream down the connection
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
* the tag should be an association/component_tag number as found in the PMT
* the tag is converted to a PID and that PID is sent as a MPEG Transport Stream down the connection
- * if tag is -1, the default video stream for the current service_id is sent
+ * if tag is -1, the default video stream for the service_id is sent
*/
bool
cmd_vstream(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
{
struct carousel *car = listen_data->carousel;
+ int service;
int tag;
- uint16_t pid;
- uint8_t type;
+ struct avstreams *streams;
int video_fd;
int ts_fd;
char hdr[64];
- CHECK_USAGE(2, "vstream <ComponentTag>");
+ CHECK_VUSAGE(2, 3, "vstream [<ServiceID>] <ComponentTag>");
- tag = strtol(argv[1], NULL, 0);
-
- /* map the tag to a PID and stream type, or use the default */
- if(tag == -1)
+ if(argc == 2)
{
- /* check we have a default stream */
- if(car->video_pid == 0)
- {
- SEND_RESPONSE(500, "Unable to find video PID");
- return false;
- }
- pid = car->video_pid;
- type = car->video_type;
+ service = -1;
+ tag = strtol(argv[1], NULL, 0);
}
else
{
- pid = stream2pid(&car->assoc, tag);
- type = stream2type(&car->assoc, tag);
+ service = strtol(argv[1], NULL, 0);
+ tag = strtol(argv[2], NULL, 0);
}
+ streams = find_avstreams(car, service, -1, tag);
+
+ /* check we have a default stream */
+ if(streams->video_pid == 0)
+ SEND_RESPONSE(500, "Unable to resolve video PID");
+
/* add the PID to the demux device */
- if((video_fd = add_demux_filter(car->demux_device, pid, DMX_PES_VIDEO)) < 0)
+ if((video_fd = add_demux_filter(car->demux_device, streams->video_pid, DMX_PES_VIDEO)) < 0)
{
SEND_RESPONSE(500, "Unable to open video PID");
return false;
@@ -297,7 +302,7 @@
SEND_RESPONSE(200, "OK");
/* tell the client what PID and stream type the component tag resolved to */
- snprintf(hdr, sizeof(hdr), "VideoPID %u VideoType %u\n", pid, type);
+ snprintf(hdr, sizeof(hdr), "VideoPID %u VideoType %u\n", streams->video_pid, streams->video_type);
fputs(hdr, client);
/* shovel the transport stream down client_sock until the client closes it or we get an error */
@@ -314,73 +319,55 @@
/*
* avstream <audio_tag> <video_tag>
* send the given audio and video streams down the connection
+ * if service_id is not specified or is -1, use the service we are downloading the carousel from
* the tags should be association/component_tag numbers as found in the PMT
* the tags are converted to PIDs and those PIDs are sent as a MPEG Transport Stream down the connection
- * if a tag is -1, the default audio or video stream for the current service_id is sent
+ * if a tag is -1, the default audio or video stream for the service_id is sent
*/
bool
cmd_avstream(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
{
struct carousel *car = listen_data->carousel;
+ int service;
int audio_tag;
int video_tag;
- uint16_t audio_pid;
- uint16_t video_pid;
- uint8_t audio_type;
- uint8_t video_type;
+ struct avstreams *streams;
int audio_fd;
int video_fd;
int ts_fd;
char hdr[64];
- CHECK_USAGE(3, "avstream <AudioTag> <VideoTag>");
+ CHECK_VUSAGE(3, 4, "avstream [<ServiceID>] <AudioTag> <VideoTag>");
- audio_tag = strtol(argv[1], NULL, 0);
- video_tag = strtol(argv[2], NULL, 0);
-
- /* map the tags to PIDs and stream types, or use the defaults */
- if(audio_tag == -1)
+ if(argc == 3)
{
- /* check we have a default stream */
- if(car->audio_pid == 0)
- {
- SEND_RESPONSE(500, "Unable to find audio PID");
- return false;
- }
- audio_pid = car->audio_pid;
- audio_type = car->audio_type;
+ service = -1;
+ audio_tag = strtol(argv[1], NULL, 0);
+ video_tag = strtol(argv[2], NULL, 0);
}
else
{
- audio_pid = stream2pid(&car->assoc, audio_tag);
- audio_type = stream2type(&car->assoc, audio_tag);
+ service = strtol(argv[1], NULL, 0);
+ audio_tag = strtol(argv[2], NULL, 0);
+ video_tag = strtol(argv[3], NULL, 0);
}
- if(video_tag == -1)
- {
- /* check we have a default stream */
- if(car->video_pid == 0)
- {
- SEND_RESPONSE(500, "Unable to find video PID");
- return false;
- }
- video_pid = car->video_pid;
- video_type = car->video_type;
- }
- else
- {
- video_pid = stream2pid(&car->assoc, video_tag);
- video_type = stream2type(&car->assoc, video_tag);
- }
+ streams = find_avstreams(car, service, audio_tag, video_tag);
+ /* check we have a default stream */
+ if(streams->audio_pid == 0)
+ SEND_RESPONSE(500, "Unable to resolve audio PID");
+ if(streams->video_pid == 0)
+ SEND_RESPONSE(500, "Unable to resolve video PID");
+
/* add the PIDs to the demux device */
- if((audio_fd = add_demux_filter(car->demux_device, audio_pid, DMX_PES_AUDIO)) < 0)
+ if((audio_fd = add_demux_filter(car->demux_device, streams->audio_pid, DMX_PES_AUDIO)) < 0)
{
SEND_RESPONSE(500, "Unable to open audio PID");
return false;
}
- if((video_fd = add_demux_filter(car->demux_device, video_pid, DMX_PES_VIDEO)) < 0)
+ if((video_fd = add_demux_filter(car->demux_device, streams->video_pid, DMX_PES_VIDEO)) < 0)
{
SEND_RESPONSE(500, "Unable to open video PID");
close(audio_fd);
@@ -400,7 +387,8 @@
SEND_RESPONSE(200, "OK");
/* tell the client what PIDs and stream types the component tags resolved to */
- snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u VideoPID %u VideoType %u\n", audio_pid, audio_type, video_pid, video_type);
+ snprintf(hdr, sizeof(hdr), "AudioPID %u AudioType %u VideoPID %u VideoType %u\n",
+ streams->audio_pid, streams->audio_type, streams->video_pid, streams->video_type);
fputs(hdr, client);
/* shovel the transport stream down client_sock until the client closes it or we get an error */
Modified: redbutton-download/trunk/findmheg.c
===================================================================
--- redbutton-download/trunk/findmheg.c 2007-02-08 14:07:04 UTC (rev 207)
+++ redbutton-download/trunk/findmheg.c 2007-02-11 12:38:51 UTC (rev 208)
@@ -26,6 +26,7 @@
#include <netinet/in.h>
#include "carousel.h"
+#include "findmheg.h"
#include "table.h"
#include "assoc.h"
#include "utils.h"
@@ -282,3 +283,38 @@
return &_car;
}
+static struct avstreams _streams;
+
+struct avstreams *
+find_avstreams(struct carousel *car, int service_id, int audio_tag, int video_tag)
+{
+if(service_id != -1) printf("TODO: find_avstreams %d\n", service_id);
+
+ /* map the tags to PIDs and stream types, or use the defaults */
+ if(audio_tag == -1)
+ {
+ /* maybe 0 if we have no default stream */
+ _streams.audio_pid = car->audio_pid;
+ _streams.audio_type = car->audio_type;
+ }
+ else
+ {
+ _streams.audio_pid = stream2pid(&car->assoc, audio_tag);
+ _streams.audio_type = stream2type(&car->assoc, audio_tag);
+ }
+
+ if(video_tag == -1)
+ {
+ /* maybe 0 if we have no default stream */
+ _streams.video_pid = car->video_pid;
+ _streams.video_type = car->video_type;
+ }
+ else
+ {
+ _streams.video_pid = stream2pid(&car->assoc, video_tag);
+ _streams.video_type = stream2type(&car->assoc, video_tag);
+ }
+
+ return &_streams;
+}
+
Modified: redbutton-download/trunk/findmheg.h
===================================================================
--- redbutton-download/trunk/findmheg.h 2007-02-08 14:07:04 UTC (rev 207)
+++ redbutton-download/trunk/findmheg.h 2007-02-11 12:38:51 UTC (rev 208)
@@ -25,7 +25,17 @@
#include <stdint.h>
+struct avstreams
+{
+ uint16_t audio_pid;
+ uint8_t audio_type;
+ uint16_t video_pid;
+ uint8_t video_type;
+};
+
struct carousel *find_mheg(unsigned int, unsigned int, uint16_t, int);
+struct avstreams *find_avstreams(struct carousel *, int, int, int);
+
#endif /* __FINDMHEG_H__ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-08 14:07:34
|
Revision: 207
http://svn.sourceforge.net/redbutton/?rev=207&view=rev
Author: skilvington
Date: 2007-02-08 06:07:04 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
update default service comment
Modified Paths:
--------------
redbutton-browser/trunk/StreamClass.c
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2007-02-08 12:09:35 UTC (rev 206)
+++ redbutton-browser/trunk/StreamClass.c 2007-02-08 14:07:04 UTC (rev 207)
@@ -94,7 +94,7 @@
StreamClass_Preparation(t);
}
- /* assume default is "rec://svc/def", ie current channel */
+ /* assume default is "rec://svc/cur", ie current channel */
if(t->have_original_content
&& (service = ContentBody_getReference(&t->original_content)) != NULL)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-08 12:09:36
|
Revision: 206
http://svn.sourceforge.net/redbutton/?rev=206&view=rev
Author: skilvington
Date: 2007-02-08 04:09:35 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
rec://svc/def resets the service ID
Modified Paths:
--------------
redbutton-browser/trunk/StreamClass.c
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2007-02-08 11:55:44 UTC (rev 205)
+++ redbutton-browser/trunk/StreamClass.c 2007-02-08 12:09:35 UTC (rev 206)
@@ -110,13 +110,21 @@
{
MHEGStreamPlayer_setServiceID(&t->inst.player, si_get_service_id(service));
}
- /* leave player's service ID as it is for "cur" and "def" */
- else if(OctetString_strcmp(service, "rec://svc/cur") != 0
- && OctetString_strcmp(service, "rec://svc/def") != 0)
+ else if(OctetString_strncmp(service, "rec://svc/lcn/", 14) == 0)
{
/* TODO */
printf("TODO: StreamClass: service='%.*s'\n", service->size, service->data);
}
+ else if(OctetString_strcmp(service, "rec://svc/def") == 0)
+ {
+ /* use the service ID we are currently tuned to */
+ MHEGStreamPlayer_setServiceID(&t->inst.player, -1);
+ }
+ /* leave player's service ID as it is for "rec://svc/cur" */
+ else if(OctetString_strcmp(service, "rec://svc/cur") != 0)
+ {
+ error("StreamClass: unexpected service '%.*s'", service->size, service->data);
+ }
}
/* start playing all active StreamComponents */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-02-08 11:55:49
|
Revision: 205
http://svn.sourceforge.net/redbutton/?rev=205&view=rev
Author: skilvington
Date: 2007-02-08 03:55:44 -0800 (Thu, 08 Feb 2007)
Log Message:
-----------
prepare to allow streaming a/v from different service IDs
Modified Paths:
--------------
redbutton-browser/trunk/ElementaryAction.c
redbutton-browser/trunk/MHEGBackend.c
redbutton-browser/trunk/MHEGBackend.h
redbutton-browser/trunk/MHEGEngine.c
redbutton-browser/trunk/MHEGEngine.h
redbutton-browser/trunk/MHEGStreamPlayer.c
redbutton-browser/trunk/MHEGStreamPlayer.h
redbutton-browser/trunk/StreamClass.c
redbutton-browser/trunk/StreamClass.h
redbutton-browser/trunk/der_decode.c
redbutton-browser/trunk/der_decode.h
Modified: redbutton-browser/trunk/ElementaryAction.c
===================================================================
--- redbutton-browser/trunk/ElementaryAction.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/ElementaryAction.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -1205,6 +1205,8 @@
TokenGroupClass_SetData((TokenGroupClass *) obj, &e->u.set_data, caller_gid);
else if(obj->inst.rtti == RTTI_ListGroupClass)
ListGroupClass_SetData((ListGroupClass *) obj, &e->u.set_data, caller_gid);
+ else if(obj->inst.rtti == RTTI_StreamClass)
+ StreamClass_SetData((StreamClass *) obj, &e->u.set_data, caller_gid);
else
error("SetData: unexpected target: %s", ExternalReference_name(&obj->inst.ref));
}
Modified: redbutton-browser/trunk/MHEGBackend.c
===================================================================
--- redbutton-browser/trunk/MHEGBackend.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGBackend.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -18,7 +18,7 @@
bool local_checkContentRef(MHEGBackend *, ContentReference *);
bool local_loadFile(MHEGBackend *, OctetString *, OctetString *);
FILE *local_openFile(MHEGBackend *, OctetString *);
-FILE *local_openStream(MHEGBackend *, bool, int *, int *, bool, int *, int *);
+FILE *local_openStream(MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
void local_retune(MHEGBackend *, OctetString *);
static struct MHEGBackendFns local_backend_fns =
@@ -34,7 +34,7 @@
bool remote_checkContentRef(MHEGBackend *, ContentReference *);
bool remote_loadFile(MHEGBackend *, OctetString *, OctetString *);
FILE *remote_openFile(MHEGBackend *, OctetString *);
-FILE *remote_openStream(MHEGBackend *, bool, int *, int *, bool, int *, int *);
+FILE *remote_openStream(MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
void remote_retune(MHEGBackend *, OctetString *);
static struct MHEGBackendFns remote_backend_fns =
@@ -333,14 +333,15 @@
* return a read-only FILE handle for an MPEG Transport Stream
* the TS will contain an audio stream (if have_audio is true) and a video stream (if have_video is true)
* the *audio_tag and *video_tag numbers refer to Component/Association Tag values from the DVB PMT
- * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the current Service ID is used
+ * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the given Service ID is used
+ * if service_id is -1, it uses the Service ID we are downloading the carousel from
* updates *audio_tag and/or *video_tag to the actual PIDs in the Transport Stream
* updates *audio_type and/or *video_type to the stream type IDs
* returns NULL on error
*/
FILE *
-local_openStream(MHEGBackend *t, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
+local_openStream(MHEGBackend *t, int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
{
/*
* we need to convert the audio/video_tag into PIDs
@@ -350,7 +351,7 @@
* 3. just stream the TS from the backend
* we choose 3, to avoid duplicating code and having to pass "-d <device>" options etc
*/
- return remote_openStream(t, have_audio, audio_tag, audio_type, have_video, video_tag, video_type);
+ return remote_openStream(t, service_id, have_audio, audio_tag, audio_type, have_video, video_tag, video_type);
}
/*
@@ -522,14 +523,15 @@
* return a read-only FILE handle for an MPEG Transport Stream
* the TS will contain an audio stream (if have_audio is true) and a video stream (if have_video is true)
* the *audio_tag and *video_tag numbers refer to Component/Association Tag values from the DVB PMT
- * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the current Service ID is used
+ * if *audio_tag or *video_tag is -1, the default audio and/or video stream for the given Service ID is used
+ * if service_id is -1, it uses the Service ID we are downloading the carousel from
* updates *audio_tag and/or *video_tag to the actual PIDs in the Transport Stream
* updates *audio_type and/or *video_type to the stream type IDs
* returns NULL on error
*/
FILE *
-remote_openStream(MHEGBackend *t, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
+remote_openStream(MHEGBackend *t, int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
{
char cmd[PATH_MAX];
FILE *sock;
@@ -538,6 +540,9 @@
unsigned int video_pid = 0;
bool err;
+/* TODO */
+if(service_id != -1) printf("TODO: openStream: service_id=%d\n", service_id);
+
/* no PIDs required */
if(!have_audio && !have_video)
return NULL;
Modified: redbutton-browser/trunk/MHEGBackend.h
===================================================================
--- redbutton-browser/trunk/MHEGBackend.h 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGBackend.h 2007-02-08 11:55:44 UTC (rev 205)
@@ -29,7 +29,7 @@
/* open a carousel file */
FILE *(*openFile)(struct MHEGBackend *, OctetString *);
/* open an MPEG Transport Stream */
- FILE *(*openStream)(struct MHEGBackend *, bool, int *, int *, bool, int *, int *);
+ FILE *(*openStream)(struct MHEGBackend *, int, bool, int *, int *, bool, int *, int *);
/* tune to the given service */
void (*retune)(struct MHEGBackend *, OctetString *);
} *fns;
Modified: redbutton-browser/trunk/MHEGEngine.c
===================================================================
--- redbutton-browser/trunk/MHEGEngine.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGEngine.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -1416,9 +1416,10 @@
*/
FILE *
-MHEGEngine_openStream(bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
+MHEGEngine_openStream(int service_id, bool have_audio, int *audio_tag, int *audio_type, bool have_video, int *video_tag, int *video_type)
{
return (*(engine.backend.fns->openStream))(&engine.backend,
+ service_id,
have_audio, audio_tag, audio_type,
have_video, video_tag, video_type);
}
Modified: redbutton-browser/trunk/MHEGEngine.h
===================================================================
--- redbutton-browser/trunk/MHEGEngine.h 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGEngine.h 2007-02-08 11:55:44 UTC (rev 205)
@@ -239,7 +239,7 @@
bool MHEGEngine_checkContentRef(ContentReference *);
bool MHEGEngine_loadFile(OctetString *, OctetString *);
FILE *MHEGEngine_openFile(OctetString *);
-FILE *MHEGEngine_openStream(bool, int *, int *, bool, int *, int *);
+FILE *MHEGEngine_openStream(int, bool, int *, int *, bool, int *, int *);
void MHEGEngine_retune(OctetString *);
char *MHEGEngine_absoluteFilename(OctetString *);
Modified: redbutton-browser/trunk/MHEGStreamPlayer.c
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGStreamPlayer.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -91,6 +91,9 @@
p->video = NULL;
p->audio = NULL;
+ /* stream a/v components from the service we are currently tuned to */
+ p->service_id = -1;
+
p->audio_codec = NULL;
pthread_mutex_init(&p->base_lock, NULL);
@@ -119,7 +122,21 @@
return;
}
+/*
+ * service ID is used to resolve the stream component tags
+ * -1 => use the service we are currently tuned to,
+ * ie the service we are downloading the carousel from
+ */
+
void
+MHEGStreamPlayer_setServiceID(MHEGStreamPlayer *p, int id)
+{
+ p->service_id = id;
+
+ return;
+}
+
+void
MHEGStreamPlayer_setVideoStream(MHEGStreamPlayer *p, VideoClass *video)
{
if(p->have_video)
@@ -174,7 +191,8 @@
p->audio_pid = p->audio_tag;
p->video_pid = p->video_tag;
- if((p->ts = MHEGEngine_openStream(p->have_audio, &p->audio_pid, &p->audio_type,
+ if((p->ts = MHEGEngine_openStream(p->service_id,
+ p->have_audio, &p->audio_pid, &p->audio_type,
p->have_video, &p->video_pid, &p->video_type)) == NULL)
{
error("Unable to open MPEG stream");
Modified: redbutton-browser/trunk/MHEGStreamPlayer.h
===================================================================
--- redbutton-browser/trunk/MHEGStreamPlayer.h 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/MHEGStreamPlayer.h 2007-02-08 11:55:44 UTC (rev 205)
@@ -57,6 +57,7 @@
bool have_audio; /* false if we have no audio stream */
VideoClass *video; /* output size/position, maybe NULL if audio only */
AudioClass *audio; /* output volume, maybe NULL if video only */
+ int service_id; /* service containing the audio/video components (-1 => what we are currently tuned to) */
int video_tag; /* video stream component tag (-1 => default for current service ID) */
int video_pid; /* PID in MPEG Transport Stream (-1 => not yet known) */
int video_type; /* video stream type (-1 => not yet known) */
@@ -81,6 +82,7 @@
void MHEGStreamPlayer_init(MHEGStreamPlayer *);
void MHEGStreamPlayer_fini(MHEGStreamPlayer *);
+void MHEGStreamPlayer_setServiceID(MHEGStreamPlayer *, int);
void MHEGStreamPlayer_setVideoStream(MHEGStreamPlayer *, VideoClass *);
void MHEGStreamPlayer_setAudioStream(MHEGStreamPlayer *, AudioClass *);
Modified: redbutton-browser/trunk/StreamClass.c
===================================================================
--- redbutton-browser/trunk/StreamClass.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/StreamClass.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -7,6 +7,7 @@
#include "StreamComponent.h"
#include "ExternalReference.h"
#include "ContentBody.h"
+#include "si.h"
#include "utils.h"
void
@@ -93,12 +94,29 @@
StreamClass_Preparation(t);
}
- /* assume default is "rec://svc/cur", ie current channel */
+ /* assume default is "rec://svc/def", ie current channel */
if(t->have_original_content
- && (service = ContentBody_getReference(&t->original_content)) != NULL
- && OctetString_strcmp(service, "rec://svc/cur") != 0)
+ && (service = ContentBody_getReference(&t->original_content)) != 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)
+ */
+ if(OctetString_strncmp(service, "dvb:", 4) == 0)
+ {
+ MHEGStreamPlayer_setServiceID(&t->inst.player, si_get_service_id(service));
+ }
+ /* leave player's service ID as it is for "cur" and "def" */
+ else if(OctetString_strcmp(service, "rec://svc/cur") != 0
+ && OctetString_strcmp(service, "rec://svc/def") != 0)
+ {
+/* TODO */
printf("TODO: StreamClass: service='%.*s'\n", service->size, service->data);
+ }
}
/* start playing all active StreamComponents */
@@ -201,7 +219,22 @@
return;
}
+/*
+ * corrigendum says StreamClass can be the target of SetData
+ * this changes the multiplex (ie service ID)
+ */
+
void
+StreamClass_SetData(StreamClass *t, SetData *set, OctetString *caller_gid)
+{
+ verbose("StreamClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref));
+
+/* TODO */
+printf("TODO: StreamClass_SetData not yet implemented\n");
+ return;
+}
+
+void
StreamClass_SetCounterTrigger(StreamClass *t, SetCounterTrigger *params, OctetString *caller_gid)
{
verbose("StreamClass: %s; SetCounterTrigger", ExternalReference_name(&t->rootClass.inst.ref));
Modified: redbutton-browser/trunk/StreamClass.h
===================================================================
--- redbutton-browser/trunk/StreamClass.h 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/StreamClass.h 2007-02-08 11:55:44 UTC (rev 205)
@@ -12,6 +12,7 @@
void StreamClass_Deactivation(StreamClass *);
void StreamClass_Destruction(StreamClass *);
+void StreamClass_SetData(StreamClass *, SetData *, OctetString *);
void StreamClass_SetCounterTrigger(StreamClass *, SetCounterTrigger *, OctetString *);
void StreamClass_SetSpeed(StreamClass *, SetSpeed *, OctetString *);
void StreamClass_SetCounterPosition(StreamClass *, SetCounterPosition *, OctetString *);
Modified: redbutton-browser/trunk/der_decode.c
===================================================================
--- redbutton-browser/trunk/der_decode.c 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/der_decode.c 2007-02-08 11:55:44 UTC (rev 205)
@@ -234,6 +234,19 @@
}
/*
+ * compare the first n characters of the OctetString with the given C string
+ */
+
+int
+OctetString_strncmp(OctetString *oct, char *str, size_t n)
+{
+ if(oct->size < n)
+ return oct->size - n;
+ else
+ return memcmp(oct->data, str, n);
+}
+
+/*
* assumes its okay to call der_realloc(dst->data, x)
* if dst is not initialised, you should use OctetString_dup instead
* src can be NULL, but dst must be valid
Modified: redbutton-browser/trunk/der_decode.h
===================================================================
--- redbutton-browser/trunk/der_decode.h 2007-01-29 17:00:12 UTC (rev 204)
+++ redbutton-browser/trunk/der_decode.h 2007-02-08 11:55:44 UTC (rev 205)
@@ -51,6 +51,7 @@
int OctetString_cmp(OctetString *, OctetString *);
int OctetString_strcmp(OctetString *, char *);
+int OctetString_strncmp(OctetString *, char *, size_t);
bool OctetString_copy(OctetString *, OctetString *);
void OctetString_dup(OctetString *, OctetString *);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-29 17:00:30
|
Revision: 204
http://svn.sourceforge.net/redbutton/?rev=204&view=rev
Author: skilvington
Date: 2007-01-29 09:00:12 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
typo
Modified Paths:
--------------
redbutton-browser/trunk/rb-browser.c
Modified: redbutton-browser/trunk/rb-browser.c
===================================================================
--- redbutton-browser/trunk/rb-browser.c 2007-01-29 16:55:28 UTC (rev 203)
+++ redbutton-browser/trunk/rb-browser.c 2007-01-29 17:00:12 UTC (rev 204)
@@ -47,7 +47,7 @@
/* default options */
bzero(&opts, sizeof(MHEGEngineOptions));
- opts.remote = false; /* not the default, but needed so you do eg "-r services/4165" */
+ opts.remote = false; /* not the default, but needed so you can do eg "-r services/4165" */
opts.srg_loc = DEFAULT_BACKEND;
opts.verbose = 0;
opts.fullscreen = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-29 16:55:41
|
Revision: 203
http://svn.sourceforge.net/redbutton/?rev=203&view=rev
Author: skilvington
Date: 2007-01-29 08:55:28 -0800 (Mon, 29 Jan 2007)
Log Message:
-----------
default backend is "-r 127.0.0.1"
Modified Paths:
--------------
redbutton-browser/trunk/MHEGBackend.h
redbutton-browser/trunk/rb-browser.c
www/index.html
Modified: redbutton-browser/trunk/MHEGBackend.h
===================================================================
--- redbutton-browser/trunk/MHEGBackend.h 2007-01-28 09:52:02 UTC (rev 202)
+++ redbutton-browser/trunk/MHEGBackend.h 2007-01-29 16:55:28 UTC (rev 203)
@@ -12,6 +12,8 @@
/* default TCP port to contact backend on */
#define DEFAULT_REMOTE_PORT 10101
+#define DEFAULT_BACKEND "127.0.0.1"
+
typedef struct MHEGBackend
{
char *base_dir; /* local Service Gateway root directory */
Modified: redbutton-browser/trunk/rb-browser.c
===================================================================
--- redbutton-browser/trunk/rb-browser.c 2007-01-28 09:52:02 UTC (rev 202)
+++ redbutton-browser/trunk/rb-browser.c 2007-01-29 16:55:28 UTC (rev 203)
@@ -1,5 +1,5 @@
/*
- * rb-browser [-v] [-f] [-d] [-o <video_output_method>] [-k <keymap_file>] [-t <timeout>] [-r] <service_gateway>
+ * rb-browser [-v] [-f] [-d] [-o <video_output_method>] [-k <keymap_file>] [-t <timeout>] [-r] [<service_gateway>]
*
* -v is verbose/debug mode
* -f is full screen, otherwise it uses a window
@@ -12,6 +12,8 @@
* -r means use a remote backend (rb-download running on another host), <service_gateway> should be host[:port]
* if -r is not specified, rb-download is running on the same machine
* and <service_gateway> should be an entry in the services directory, eg. services/4165
+ * (this is really only for debugging or running MHEG apps you've written yourself)
+ * the default backend is "-r 127.0.0.1"
*/
#include <unistd.h>
@@ -45,8 +47,8 @@
/* default options */
bzero(&opts, sizeof(MHEGEngineOptions));
- opts.remote = false;
- opts.srg_loc = NULL; /* must be given on cmd line */
+ opts.remote = false; /* not the default, but needed so you do eg "-r services/4165" */
+ opts.srg_loc = DEFAULT_BACKEND;
opts.verbose = 0;
opts.fullscreen = false;
opts.vo_method = NULL;
@@ -92,11 +94,13 @@
}
}
- if(optind != argc - 1)
+ if(optind == argc)
+ opts.remote = true; /* default backend "-r 127.0.0.1" */
+ else if(optind == argc - 1)
+ opts.srg_loc = argv[optind];
+ else
usage(prog_name);
- opts.srg_loc = argv[optind];
-
/* chop off any trailing / chars for local directory name */
if(!opts.remote)
{
@@ -125,7 +129,7 @@
"[-k <keymap_file>] "
"[-t <timeout>] "
"[-r] "
- "<service_gateway>\n\n"
+ "[<service_gateway>]\n\n"
"%s",
prog_name, MHEGVideoOutputMethod_getUsage());
}
Modified: www/index.html
===================================================================
--- www/index.html 2007-01-28 09:52:02 UTC (rev 202)
+++ www/index.html 2007-01-29 16:55:28 UTC (rev 203)
@@ -50,6 +50,10 @@
<P>
rb-download needs a "channels.conf" file which gives tuning parameters for service_id's.
A channels.conf files can be generated by the "scan" utility in the dvb-apps package at <A HREF="http://www.linuxtv.org">www.linuxtv.org</A>.
+For example:
+<PRE>
+scan ./uk-Malvern > ~/.tzap/channels.conf
+</PRE>
If not specified with -f, rb-download will search for:
<UL>
<LI>~/.tzap/channels.conf</LI>
@@ -69,6 +73,10 @@
<P>
If no <service_id> is given, a list of possible channels (and their <service_id>) is printed.
These will be the channels available on the MUX your DVB card is currently tuned to. Use dvbtune or equivalent to tune your card.
+eg:
+<PRE>
+dvbtune -f 722166667 && rb-download
+</PRE>
<P>
The file structure stored under <base_dir> will be:
<PRE>
@@ -95,23 +103,25 @@
<H2>rb-browser</H2>
Usage:
<PRE>
-rb-browser [-v] [-f] [-d] [-o <video_output_method>] [-k <keymap_config_file>] [-t <timeout>] [-r] <service_gateway>
+rb-browser [-v] [-f] [-d] [-o <video_output_method>] [-k <keymap_config_file>] [-t <timeout>] [-r] [<service_gateway>]
</PRE>
Display the MHEG apps downloaded with rb-download.
<P>
The -r option means use a remote backend (rb-download running on another host).
If -r is specified, then <service_gateway> should be the host[:port] that rb-download is running on.
+<P>
+The default backend is "-r 127.0.0.1" ie rb-download running on the same machine as rb-browser.
+<P>
If -r is not specified, rb-download is running on the same machine
and <service_gateway> should be an entry in the services directory.
+This is really only useful for debugging, or running MHEG apps you have written
+yourself.
+<P>
Eg, on a single host, do this:
<PRE>
rb-download 4165 &
-rb-browser services/4165
+rb-browser
</PRE>
-or, you could run rb-browser like this:
-<PRE>
-rb-browser -r 127.0.0.1
-</PRE>
To run the frontend on a different host, do this on the backend:
<PRE>
rb-download 4165 &
@@ -122,6 +132,13 @@
</PRE>
where 10.0.0.1 is the IP or hostname of the backend.
<P>
+To run an MHEG app you have previously downloaded and saved, do this:
+<PRE>
+rb-browser path/to/saved/services/4165
+</PRE>
+Although this will not give you any video or audio as this is streamed from rb-download.
+Retuning will also probably not work unless you've also saved the services directory for the channel you want to retune to.
+<P>
It will display the app in a window, use -f for full screen mode.
<P>
The -d flag disables all audio and video output.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-28 09:52:06
|
Revision: 202
http://svn.sourceforge.net/redbutton/?rev=202&view=rev
Author: skilvington
Date: 2007-01-28 01:52:02 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
if frontend is not locked when we start, tune it
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-27 18:59:26 UTC (rev 201)
+++ redbutton-download/trunk/channels.c 2007-01-28 09:52:02 UTC (rev 202)
@@ -238,6 +238,7 @@
struct dvb_frontend_parameters current_params;
struct dvb_frontend_parameters *needed_params;
struct dvb_frontend_event event;
+ fe_status_t status;
bool lock;
/* need to keep the frontend device open to stop it untuning itself */
static int fe_fd = -1;
@@ -281,16 +282,20 @@
return false;
}
-/* TODO */
/* if no-one was using the frontend when we open it
* FE_GET_FRONTEND may say we are tuned to the frequency we want
* but when we try to read any data, it fails
- * => always tune the first time we open the frontend
+ * so check if we have a lock
*/
+ if(ioctl(fe_fd, FE_READ_STATUS, &status) < 0)
+ lock = false;
+ else
+ lock = status & FE_HAS_LOCK;
/* are we already tuned to the right frequency */
- vverbose("Current frequency %u; needed %u", current_params.frequency, needed_params->frequency);
- if(current_params.frequency != needed_params->frequency)
+ vverbose("Current frequency %u; needed %u; lock=%d", current_params.frequency, needed_params->frequency, lock);
+ if(!lock
+ || current_params.frequency != needed_params->frequency)
{
verbose("Retuning to frequency %u", needed_params->frequency);
/* empty event queue */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-27 18:59:29
|
Revision: 201
http://svn.sourceforge.net/redbutton/?rev=201&view=rev
Author: skilvington
Date: 2007-01-27 10:59:26 -0800 (Sat, 27 Jan 2007)
Log Message:
-----------
not a fatal error if you don't have a DVB-T device - it just means you can't retune (yet)
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-26 17:04:50 UTC (rev 200)
+++ redbutton-download/trunk/channels.c 2007-01-27 18:59:26 UTC (rev 201)
@@ -264,7 +264,11 @@
fatal("ioctl FE_GET_INFO: %s", strerror(errno));
if(fe_info.type != FE_OFDM)
- fatal("TODO: Only able to tune DVB-T devices at present");
+ {
+/* TODO */
+printf("TODO: Only able to tune DVB-T devices at present\n");
+return false;
+ }
/* see what we are currently tuned to */
if(ioctl(fe_fd, FE_GET_FRONTEND, ¤t_params) < 0)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-26 17:04:52
|
Revision: 200
http://svn.sourceforge.net/redbutton/?rev=200&view=rev
Author: skilvington
Date: 2007-01-26 09:04:50 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
only snprintf the frontend device name once
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-26 17:01:43 UTC (rev 199)
+++ redbutton-download/trunk/channels.c 2007-01-26 17:04:50 UTC (rev 200)
@@ -242,10 +242,9 @@
/* need to keep the frontend device open to stop it untuning itself */
static int fe_fd = -1;
- snprintf(fe_dev, sizeof(fe_dev), FE_DEVICE, adapter);
-
if(fe_fd < 0)
{
+ snprintf(fe_dev, sizeof(fe_dev), FE_DEVICE, adapter);
/*
* need O_RDWR if you want to tune, O_RDONLY is okay for getting info
* if someone else is using the frontend, we can only open O_RDONLY
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-26 17:01:45
|
Revision: 199
http://svn.sourceforge.net/redbutton/?rev=199&view=rev
Author: skilvington
Date: 2007-01-26 09:01:43 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
open frontend read-only if we can't open it read/write
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-26 16:37:38 UTC (rev 198)
+++ redbutton-download/trunk/channels.c 2007-01-26 17:01:43 UTC (rev 199)
@@ -240,29 +240,34 @@
struct dvb_frontend_event event;
bool lock;
/* need to keep the frontend device open to stop it untuning itself */
- /* TODO: fix this hack */
static int fe_fd = -1;
+ snprintf(fe_dev, sizeof(fe_dev), FE_DEVICE, adapter);
+
+ if(fe_fd < 0)
+ {
+ /*
+ * need O_RDWR if you want to tune, O_RDONLY is okay for getting info
+ * if someone else is using the frontend, we can only open O_RDONLY
+ * => we can still download data, but just not retune
+ */
+ if((fe_fd = open(fe_dev, O_RDWR | O_NONBLOCK)) < 0)
+ {
+ error("Unable to open '%s' read/write; you will not be able to retune", fe_dev);
+ if((fe_fd = open(fe_dev, O_RDONLY | O_NONBLOCK)) < 0)
+ fatal("open '%s': %s", fe_dev, strerror(errno));
+ }
+ }
+
vverbose("Getting frontend info");
- /* see what we are currently tuned to */
- snprintf(fe_dev, sizeof(fe_dev), FE_DEVICE, adapter);
- /*
- * need O_RDWR if you want to tune, O_RDONLY is okay for getting info
- * if someone else is using the frontend, we can only open O_RDONLY
- * => we can still download data, but just not retune
- */
- if(fe_fd != -1)
- close(fe_fd);
- if((fe_fd = open(fe_dev, O_RDONLY | O_NONBLOCK)) < 0)
- fatal("open '%s': %s", fe_dev, strerror(errno));
-
if(ioctl(fe_fd, FE_GET_INFO, &fe_info) < 0)
fatal("ioctl FE_GET_INFO: %s", strerror(errno));
if(fe_info.type != FE_OFDM)
fatal("TODO: Only able to tune DVB-T devices at present");
+ /* see what we are currently tuned to */
if(ioctl(fe_fd, FE_GET_FRONTEND, ¤t_params) < 0)
fatal("ioctl FE_GET_FRONTEND: %s", strerror(errno));
@@ -285,15 +290,12 @@
if(current_params.frequency != needed_params->frequency)
{
verbose("Retuning to frequency %u", needed_params->frequency);
- close(fe_fd);
- if((fe_fd = open(fe_dev, O_RDWR | O_NONBLOCK)) < 0)
- fatal("open '%s': %s", fe_dev, strerror(errno));
/* empty event queue */
while(ioctl(fe_fd, FE_GET_EVENT, &event) >= 0)
; /* do nothing */
/* tune in */
if(ioctl(fe_fd, FE_SET_FRONTEND, needed_params) < 0)
- fatal("ioctl FE_GET_FRONTEND: %s", strerror(errno));
+ fatal("Unable to retune: ioctl FE_SET_FRONTEND: %s", strerror(errno));
/* wait for lock */
vverbose("Waiting for tuner to lock on");
/* TODO: use timeout value here */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-26 16:37:44
|
Revision: 198
http://svn.sourceforge.net/redbutton/?rev=198&view=rev
Author: skilvington
Date: 2007-01-26 08:37:38 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
show audio and video stream types in -vv mode
Modified Paths:
--------------
redbutton-download/trunk/findmheg.c
Modified: redbutton-download/trunk/findmheg.c
===================================================================
--- redbutton-download/trunk/findmheg.c 2007-01-26 16:33:59 UTC (rev 197)
+++ redbutton-download/trunk/findmheg.c 2007-01-26 16:37:38 UTC (rev 198)
@@ -193,6 +193,7 @@
{
_car.video_pid = elementary_pid;
_car.video_type = stream_type;
+ vverbose("PID=%u video stream_type=0x%x", elementary_pid, stream_type);
}
/* it's not the boot PID yet */
desc_boot_pid = -1;
@@ -253,6 +254,7 @@
{
_car.audio_pid = elementary_pid;
_car.audio_type = stream_type;
+ vverbose("PID=%u audio stream_type=0x%x", elementary_pid, stream_type);
}
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-26 16:34:15
|
Revision: 197
http://svn.sourceforge.net/redbutton/?rev=197&view=rev
Author: skilvington
Date: 2007-01-26 08:33:59 -0800 (Fri, 26 Jan 2007)
Log Message:
-----------
not a fatal error if you have no channels.conf file - you just can't retune
Modified Paths:
--------------
redbutton-download/trunk/channels.c
redbutton-download/trunk/listen.c
redbutton-download/trunk/rb-download.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-24 20:16:21 UTC (rev 196)
+++ redbutton-download/trunk/channels.c 2007-01-26 16:33:59 UTC (rev 197)
@@ -189,6 +189,12 @@
unsigned int id;
int len;
+ if(_channels == NULL)
+ {
+ verbose("No channels.conf file available");
+ return NULL;
+ }
+
bzero(&_params, sizeof(_params));
verbose("Searching channels.conf for service_id %u", service_id);
@@ -262,7 +268,10 @@
/* find the tuning params for the service */
if((needed_params = get_tune_params(service_id)) == NULL)
- fatal("service_id %u not found in channels.conf file", service_id);
+ {
+ error("service_id %u not found in channels.conf file", service_id);
+ return false;
+ }
/* TODO */
/* if no-one was using the frontend when we open it
Modified: redbutton-download/trunk/listen.c
===================================================================
--- redbutton-download/trunk/listen.c 2007-01-24 20:16:21 UTC (rev 196)
+++ redbutton-download/trunk/listen.c 2007-01-26 16:33:59 UTC (rev 197)
@@ -279,7 +279,8 @@
pid_t child;
/* retune if needed */
- tune_service_id(adapter, timeout, service_id);
+ if(!tune_service_id(adapter, timeout, service_id))
+ error("Unable to retune; let's hope you're already tuned to the right frequency...");
/* find the MHEG PIDs */
car = find_mheg(adapter, timeout, service_id, carousel_id);
Modified: redbutton-download/trunk/rb-download.c
===================================================================
--- redbutton-download/trunk/rb-download.c 2007-01-24 20:16:21 UTC (rev 196)
+++ redbutton-download/trunk/rb-download.c 2007-01-26 16:33:59 UTC (rev 197)
@@ -148,7 +148,7 @@
/* initialise channels.conf */
if(!init_channels_conf(channels_file))
- fatal("Unable to parse channels.conf file");
+ error("Unable to open channels.conf file");
/* do we need to change the base directory */
if(base_dir != NULL
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-24 20:16:28
|
Revision: 196
http://svn.sourceforge.net/redbutton/?rev=196&view=rev
Author: skilvington
Date: 2007-01-24 12:16:21 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
if video is disabled, draw a black rectangle where it should be
Modified Paths:
--------------
redbutton-browser/trunk/VideoClass.c
Modified: redbutton-browser/trunk/VideoClass.c
===================================================================
--- redbutton-browser/trunk/VideoClass.c 2007-01-24 17:28:12 UTC (rev 195)
+++ redbutton-browser/trunk/VideoClass.c 2007-01-24 20:16:21 UTC (rev 196)
@@ -375,18 +375,26 @@
{
XYPosition ins_pos;
OriginalBoxSize ins_box;
+ MHEGColour black;
verbose("VideoClass: %s; render", ExternalReference_name(&t->rootClass.inst.ref));
- /* if the MHEGStreamPlayer failed to open the video stream, don't display anything */
- if(t->inst.no_video)
- return;
-
if(!intersects(pos, box, &t->inst.Position, &t->inst.BoxSize, &ins_pos, &ins_box))
return;
- /* make a transparent hole in the MHEG overlay so we can see the video below it */
- MHEGDisplay_fillTransparentRectangle(d, &ins_pos, &ins_box);
+ /*
+ * if we have no video stream, just draw a black rectangle
+ * if we do have a video stream, make a transparent hole in the MHEG overlay so we can see the video below it
+ */
+ if(t->inst.no_video)
+ {
+ MHEGColour_black(&black);
+ MHEGDisplay_fillRectangle(d, &ins_pos, &ins_box, &black);
+ }
+ else
+ {
+ MHEGDisplay_fillTransparentRectangle(d, &ins_pos, &ins_box);
+ }
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-24 17:28:18
|
Revision: 195
http://svn.sourceforge.net/redbutton/?rev=195&view=rev
Author: skilvington
Date: 2007-01-24 09:28:12 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
only send regular files from the carousel
Modified Paths:
--------------
redbutton-download/trunk/command.c
Modified: redbutton-download/trunk/command.c
===================================================================
--- redbutton-download/trunk/command.c 2007-01-24 16:51:56 UTC (rev 194)
+++ redbutton-download/trunk/command.c 2007-01-24 17:28:12 UTC (rev 195)
@@ -9,6 +9,8 @@
#include <stdint.h>
#include <fcntl.h>
#include <signal.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include "command.h"
#include "assoc.h"
@@ -456,6 +458,7 @@
cmd_file(struct listen_data *listen_data, FILE *client, int argc, char *argv[])
{
char *filename;
+ struct stat info;
FILE *file;
long size;
char hdr[64];
@@ -471,6 +474,14 @@
return false;
}
+ /* check it is a regular file */
+ if(stat(filename, &info) < 0
+ || !S_ISREG(info.st_mode))
+ {
+ SEND_RESPONSE(500, "Invalid file");
+ return false;
+ }
+
if((file = fopen(filename, "r")) == NULL)
{
SEND_RESPONSE(404, "Not found");
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-24 16:52:00
|
Revision: 194
http://svn.sourceforge.net/redbutton/?rev=194&view=rev
Author: skilvington
Date: 2007-01-24 08:51:56 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
something TODO
Modified Paths:
--------------
redbutton-download/trunk/channels.c
Modified: redbutton-download/trunk/channels.c
===================================================================
--- redbutton-download/trunk/channels.c 2007-01-23 16:11:01 UTC (rev 193)
+++ redbutton-download/trunk/channels.c 2007-01-24 16:51:56 UTC (rev 194)
@@ -264,6 +264,13 @@
if((needed_params = get_tune_params(service_id)) == NULL)
fatal("service_id %u not found in channels.conf file", service_id);
+/* TODO */
+ /* if no-one was using the frontend when we open it
+ * FE_GET_FRONTEND may say we are tuned to the frequency we want
+ * but when we try to read any data, it fails
+ * => always tune the first time we open the frontend
+ */
+
/* are we already tuned to the right frequency */
vverbose("Current frequency %u; needed %u", current_params.frequency, needed_params->frequency);
if(current_params.frequency != needed_params->frequency)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-23 16:11:12
|
Revision: 193
http://svn.sourceforge.net/redbutton/?rev=193&view=rev
Author: skilvington
Date: 2007-01-23 08:11:01 -0800 (Tue, 23 Jan 2007)
Log Message:
-----------
add missing newline
Modified Paths:
--------------
redbutton-browser/trunk/MHEGEngine.c
Modified: redbutton-browser/trunk/MHEGEngine.c
===================================================================
--- redbutton-browser/trunk/MHEGEngine.c 2007-01-23 15:59:30 UTC (rev 192)
+++ redbutton-browser/trunk/MHEGEngine.c 2007-01-23 16:11:01 UTC (rev 193)
@@ -1456,7 +1456,7 @@
/* need to cope with CI: at the start */
if(name->size > 2 && strncmp(name->data, "CI:", 3) == 0)
{
-printf("TODO: absoluteFilename '%.*s'", name->size, name->data);
+printf("TODO: absoluteFilename '%.*s'\n", name->size, name->data);
}
/* DSM: at the start is equivalent to ~ */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-23 15:59:33
|
Revision: 192
http://svn.sourceforge.net/redbutton/?rev=192&view=rev
Author: skilvington
Date: 2007-01-23 07:59:30 -0800 (Tue, 23 Jan 2007)
Log Message:
-----------
don't hang if a timer causes us to Quit, Launch, Spawn or Retune
Modified Paths:
--------------
redbutton-browser/trunk/MHEGTimer.c
Modified: redbutton-browser/trunk/MHEGTimer.c
===================================================================
--- redbutton-browser/trunk/MHEGTimer.c 2007-01-23 08:56:53 UTC (rev 191)
+++ redbutton-browser/trunk/MHEGTimer.c 2007-01-23 15:59:30 UTC (rev 192)
@@ -22,6 +22,8 @@
{
TimerCBData *data = (TimerCBData *) usr_data;
EventData event_data;
+ XEvent ev;
+ MHEGDisplay *d = MHEGEngine_getDisplay();
/* generate a TimerFired event */
event_data.choice = EventData_integer;
@@ -33,8 +35,22 @@
safe_free(data);
- /* process the async event we generated */
- MHEGEngine_processMHEGEvents();
+ /*
+ * a timer going off does not get us out of a block in XtAppNextEvent
+ * but we need to process the async event we just generated
+ * we could just call MHEGEngine_processMHEGEvents() here
+ * but if processing that means we want to Launch, Retune etc we will not be able to do it until XtAppNextEvent exits
+ * so generate a fake event here, just to end XtAppNextEvent and get back to the engine main loop
+ */
+ ev.xexpose.type = Expose;
+ ev.xexpose.display = d->dpy;
+ ev.xexpose.window = d->win;
+ ev.xexpose.x = 0;
+ ev.xexpose.y = 0;
+ ev.xexpose.width = 0;
+ ev.xexpose.height = 0;
+ ev.xexpose.count = 0;
+ XSendEvent(d->dpy, d->win, False, 0, &ev);
return;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ski...@us...> - 2007-01-23 08:56:54
|
Revision: 191
http://svn.sourceforge.net/redbutton/?rev=191&view=rev
Author: skilvington
Date: 2007-01-23 00:56:53 -0800 (Tue, 23 Jan 2007)
Log Message:
-----------
cope with DSM: filename prefixes
Modified Paths:
--------------
redbutton-browser/trunk/MHEGEngine.c
redbutton-browser/trunk/TODO
Modified: redbutton-browser/trunk/MHEGEngine.c
===================================================================
--- redbutton-browser/trunk/MHEGEngine.c 2007-01-23 08:37:58 UTC (rev 190)
+++ redbutton-browser/trunk/MHEGEngine.c 2007-01-23 08:56:53 UTC (rev 191)
@@ -1449,26 +1449,43 @@
char *
MHEGEngine_absoluteFilename(OctetString *name)
{
-/**********************************************************************************/
+ unsigned int size;
+ unsigned char *data;
+
/* TODO */
-/* also need to cope with DSM: and CI: at the start */
-/**********************************************************************************/
+/* need to cope with CI: at the start */
+ if(name->size > 2 && strncmp(name->data, "CI:", 3) == 0)
+ {
+printf("TODO: absoluteFilename '%.*s'", name->size, name->data);
+ }
+ /* DSM: at the start is equivalent to ~ */
+ if(name->size > 3 && strncmp(name->data, "DSM:", 4) == 0)
+ {
+ size = name->size - 4;
+ data = &name->data[4];
+ }
+ else
+ {
+ size = name->size;
+ data = name->data;
+ }
+
/* does it already start with a ~// */
- if(name->size > 2 && strncmp(name->data, "~//", 3) == 0)
- snprintf(_absolute, sizeof(_absolute), "%.*s", name->size, name->data);
+ if(size > 2 && strncmp(data, "~//", 3) == 0)
+ snprintf(_absolute, sizeof(_absolute), "%.*s", size, data);
/* starting with // is the same as starting with ~// */
- else if(name->size > 1 && strncmp(name->data, "//", 2) == 0)
- snprintf(_absolute, sizeof(_absolute), "~%.*s", name->size, name->data);
+ else if(size > 1 && strncmp(data, "//", 2) == 0)
+ snprintf(_absolute, sizeof(_absolute), "~%.*s", size, data);
/* starting with ~/ means prepend the path to the current active app */
- else if(name->size > 1 && strncmp(name->data, "~/", 2) == 0)
- snprintf(_absolute, sizeof(_absolute), "%s%.*s", active_app_path(), name->size - 1, &name->data[1]);
+ else if(size > 1 && strncmp(data, "~/", 2) == 0)
+ snprintf(_absolute, sizeof(_absolute), "%s%.*s", active_app_path(), size - 1, &data[1]);
/* starting with / is the same as starting with ~/ */
- else if(name->size > 0 && name->data[0] == '/')
- snprintf(_absolute, sizeof(_absolute), "%s%.*s", active_app_path(), name->size, name->data);
+ else if(size > 0 && data[0] == '/')
+ snprintf(_absolute, sizeof(_absolute), "%s%.*s", active_app_path(), size, data);
/* no / at the start, UK Profile doesn't say what to do, so prepend the path to the current active app */
- else if(name->size > 0)
- snprintf(_absolute, sizeof(_absolute), "%s/%.*s", active_app_path(), name->size, name->data);
+ else if(size > 0)
+ snprintf(_absolute, sizeof(_absolute), "%s/%.*s", active_app_path(), size, data);
/* no name at all */
else
snprintf(_absolute, sizeof(_absolute), "%s/", active_app_path());
Modified: redbutton-browser/trunk/TODO
===================================================================
--- redbutton-browser/trunk/TODO 2007-01-23 08:37:58 UTC (rev 190)
+++ redbutton-browser/trunk/TODO 2007-01-23 08:56:53 UTC (rev 191)
@@ -35,9 +35,7 @@
(eg TokenGroupClass_CallActionSlot)
-cope with DSM: and CI: filename prefixes
-cope with .. in filenames (may not be needed, remote backend does it for us,
-for local backend filesystem does it for us)
+cope with CI: filename prefixes
see 8.3.2 in UK MHEG Profile
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|