[Redbutton-devel] SF.net SVN: redbutton:[540] redbutton-browser/trunk/StreamClass.c
Brought to you by:
skilvington
From: <ski...@us...> - 2011-03-01 20:53:51
|
Revision: 540 http://redbutton.svn.sourceforge.net/redbutton/?rev=540&view=rev Author: skilvington Date: 2011-03-01 20:53:45 +0000 (Tue, 01 Mar 2011) Log Message: ----------- the easy part of StreamClass_SetData method Modified Paths: -------------- redbutton-browser/trunk/StreamClass.c Modified: redbutton-browser/trunk/StreamClass.c =================================================================== --- redbutton-browser/trunk/StreamClass.c 2011-02-28 17:04:27 UTC (rev 539) +++ redbutton-browser/trunk/StreamClass.c 2011-03-01 20:53:45 UTC (rev 540) @@ -7,6 +7,8 @@ #include "StreamComponent.h" #include "ExternalReference.h" #include "ContentBody.h" +#include "GenericOctetString.h" +#include "GenericContentReference.h" #include "si.h" #include "utils.h" @@ -344,11 +346,49 @@ void StreamClass_SetData(StreamClass *t, SetData *set, OctetString *caller_gid) { + NewContent *n = &set->new_content; + OctetString *service; + verbose("StreamClass: %s; SetData", ExternalReference_name(&t->rootClass.inst.ref)); + /* + * normally you'd do: + * NewContent_getContent(&set->new_content, caller_gid, &t->rootClass, &service) + * but FreeSat sends us a ContentReference, not IncludedContent + * so that would end up trying to load a file called "rec://svc/cur" and using its contents as the service + * so treat both types as if the value of the ContentRef or the IncludedContent is what we should set the service to + */ + switch(n->choice) + { + case NewContent_new_included_content: + service = GenericOctetString_getOctetString(&n->u.new_included_content, caller_gid); + break; + + case NewContent_new_referenced_content: + service = GenericContentReference_getContentReference(&n->u.new_referenced_content.generic_content_reference, caller_gid); + break; + + default: + error("Unknown StreamClass NewContent type: %d", n->choice); + service = NULL; + break; + } + + /* did we get a valid service */ + if(service != NULL && service->size > 0) + { /* TODO */ -printf("TODO: StreamClass_SetData not yet implemented\n"); -// MHEGEngine_setRecSvcCur(...) +printf("TODO: StreamClass_SetData '%.*s' not yet implemented\n", service->size, service->data); +// if playing, stop +// do same as StreamClass_Activation to call MHEGStreamPlayer_setServiceID(...) +// (should be able to factor out the code) +// if playing, update audio/video PIDs +// if playing, restart +// MHEGEngine_setRecSvcCur(service) - will need to copy 'service' contents +// make sure "rec://svc/cur" and "rec://svc/def" usage is still correct everywhere else + /* ContentPreparation behaviour specified in the ISO MHEG Corrigendum */ + MHEGEngine_generateAsyncEvent(&t->rootClass.inst.ref, EventType_content_available, NULL); + } return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |