[Redbutton-devel] SF.net SVN: redbutton: [122] redbutton-download/trunk/command.c
Brought to you by:
skilvington
|
From: <ski...@us...> - 2006-06-22 09:07:02
|
Revision: 122 Author: skilvington Date: 2006-06-22 02:06:51 -0700 (Thu, 22 Jun 2006) ViewCVS: http://svn.sourceforge.net/redbutton/?rev=122&view=rev Log Message: ----------- add assoc command Modified Paths: -------------- redbutton-download/trunk/command.c Modified: redbutton-download/trunk/command.c =================================================================== --- redbutton-download/trunk/command.c 2006-06-21 11:01:49 UTC (rev 121) +++ redbutton-download/trunk/command.c 2006-06-22 09:06:51 UTC (rev 122) @@ -19,6 +19,7 @@ #define ARGV_MAX 10 /* the commands */ +bool cmd_assoc(struct listen_data *, FILE *, int, char **); bool cmd_astream(struct listen_data *, FILE *, int, char **); bool cmd_avstream(struct listen_data *, FILE *, int, char **); bool cmd_check(struct listen_data *, FILE *, int, char **); @@ -35,6 +36,7 @@ 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" }, @@ -127,6 +129,36 @@ } /* + * assoc + * show the association/component tag to PID mappings + * also shows the default audio and video PIDs + * (just for debugging) + */ + +bool +cmd_assoc(struct listen_data *listen_data, FILE *client, int argc, char *argv[]) +{ + struct carousel *car = listen_data->carousel; + unsigned int i; + + SEND_RESPONSE(200, "OK"); + + /* if this is ever used by rb-browser, you will need to send a length first */ + fprintf(client, "Tag\tPID\tType\n"); + fprintf(client, "===\t===\t====\n"); + + /* default audio and video PIDs */ + fprintf(client, "(audio)\t%u\t%u\n", car->audio_pid, car->audio_type); + fprintf(client, "(video)\t%u\t%u\n", car->video_pid, car->video_type); + + /* component tag mappings */ + for(i=0; i<car->assoc.nassocs; i++) + fprintf(client, "%u\t%u\t%u\n", car->assoc.sids[i], car->assoc.pids[i], car->assoc.types[i]); + + return false; +} + +/* * astream <tag> * send the given audio stream down the connection * the tag should be an association/component_tag number as found in the PMT This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |