This discussion is archived
4 Replies Latest reply: Jan 25, 2010 2:54 PM by 843851 RSS

Section Filters

843851 Newbie
Currently Being Moderated
Hello,

I've been tasked with writing an Xlet that will demonstrate Section Filters.
I've found code at http://www.interactivetvweb.org/tutorials/mhp/section_filtering

In the example code, I'm getting stuck on:
// Having set the parameters, we can attach the section
// filter group to a transport stream. This will
// automatically start the filters once the group is
// attached
filterGroup.attach(ourTransportStream);

filterGroup is a SectionFilterGroup, and the attach method takes the parameters of
a TransportStream, a ResourceClient, and an Object.

I can't find where ourTransportStream is defined, so I'm stuck.


I've also looked to see what methods would return a TransportStream or a ResourceClient, but haven't found anything yet.

Any help with this would be greatly appreciated.
  • 1. Re: Section Filters
    843851 Newbie
    Currently Being Moderated
    Hi,

    to get instances of a TransportStream's the receiver is tuned to, you can use:

    org.davic.net.tuning.NetworkInterfaceManager.getInstance().getNetworkInterfaces()

    then choose a NetworkInterface and get TS by NetworkInterface.getCurrentTransportStream();

    SectionFilterGroup.attach() won't work on a TS to which the receiver is not tuned to.

    Cheers
  • 2. Re: Section Filters
    843851 Newbie
    Currently Being Moderated
    That seems to be working, but I'm still not sure how to get a ResourceClient.
    public void attach(TransportStream stream, ResourceClient client, Object requestData).

    Thanks for your help.
  • 3. Re: Section Filters
    843851 Newbie
    Currently Being Moderated
    ResourceClient client = new ResourceClient() {

    public boolean requestRelease(ResourceProxy arg0, Object arg1) {
    throw new UnsupportedOperationException("Not supported yet.");
    }

    public void release(ResourceProxy arg0) {
    throw new UnsupportedOperationException("Not supported yet.");
    }

    public void notifyRelease(ResourceProxy arg0) {
    throw new UnsupportedOperationException("Not supported yet.");
    }
    };

    This worked, I'm not getting exceptions. I guess Resource Management is something I'll have to learn, until then, this works.
  • 4. Re: Section Filters
    843851 Newbie
    Currently Being Moderated
    Glad it helped. If you dont need / dont want a ResourceClient, I'd suggest you just leave its methods stubbed, rather than throwing an exception. Your platform's middleware seems to ignore them, but I think its an undefined behavior.