Wowza Community

wowza4.4.1: How to distinguish which stream's ts chunk onFillChunkStart

Hi,

I have been testing based on this article

And I have noticed that in the

class LiveStreamPacketizerDataHandler implements IHTTPStreamerCupertinoLivePacketizerDataHandler2
	{
		private LiveStreamPacketizerCupertino liveStreamPacketizer = null;
		private int textId = 1;
		
		public LiveStreamPacketizerDataHandler(LiveStreamPacketizerCupertino liveStreamPacketizer)
		{
			this.liveStreamPacketizer = liveStreamPacketizer;
		}
		public void onFillChunkStart(LiveStreamPacketizerCupertinoChunk chunk)
		{
			getLogger().info("ModuleCupertinoVODOnTextToID3.onFillChunkStart["+chunk.getRendition().toString()+":"+liveStreamPacketizer.getContextStr()+"]: chunkId:"+chunk.getChunkIndexForPlaylist());
			

if you set transcode template(s) for the stream,

then the LiveStreamPacketizerDataHandler 's onFillChunkStart will be called same number of time as the number of the transcode template that I set for the stream.

Now my question is that is there a way to distinguish which stream’s ts chunk has been processing the handler ?

I do not see there is any method that I could used from

LiveStreamPacketizerCupertinoChunk chunk

Thank you

Oli

Hey Oli

I’m not quite certain what you are looking for here. The stream name or a different specific event handler (if so, what are you looking for it to contain)?

Thanks,

Matt

Great, It looks like that solution should work.

I could just simply passed streamName in the listener to the handler when LiveStreamPacketizerDataHandler2 gets initialied.

Thanks for the information.

Andy_E

Thank you for your reply Matt,

My question was how to find out which stream’s data packet was being call in fillChunks event handler here.

Since all the transcoded streams (ABR streams) will be called and I couldn’t distinguish that which resolution’s data packet was.

I actually figure out how to distinguish which stream’s packet was being called LiveStreamPacketizerDataHandler2 too.

I could just simply passed streamName in the listener to the handler when LiveStreamPacketizerDataHandler2 gets initialied.

public class LiveStreamPacketizerListener extends LiveStreamPacketizerActionNotifyBase {
  private static final WMSLogger sLogger =
      WMSLoggerFactory.getLogger(LiveStreamPacketizerListener.class);
  private IApplicationInstance mApp;
  private Map<String, String> mStreamNameMap = new HashMap<String, String>();
  public LiveStreamPacketizerListener(IApplicationInstance app) {
    mApp = app;
  }
  @Override
  synchronized public void onLiveStreamPacketizerCreate(
      ILiveStreamPacketizer liveStreamPacketizer, String streamName) {
    if (liveStreamPacketizer instanceof LiveStreamPacketizerCupertino) {
        LiveStreamPacketizerCupertino lspc = (LiveStreamPacketizerCupertino) liveStreamPacketizer;
        lspc.setDataHandler(new LiveStreamPacketizerDataHandler(mApp, streamName));
  }
}