Hi,
So to get this to happen you need to add all the listeners to the appinstance, so
[PHP] appInstance.addLiveStreamTranscoderListener(new MyTranscoderCreateNotifier();
class MyTranscoderCreateNotifier implements ILiveStreamTranscoderNotify
{
public MyTranscoderCreateNotifier ( )
{
}
public void onLiveStreamTranscoderCreate(ILiveStreamTranscoder liveStreamTranscoder, IMediaStream stream)
{
((LiveStreamTranscoder)liveStreamTranscoder).addActionListener(new MyTranscoderActionNotifier());
}
public void onLiveStreamTranscoderDestroy(ILiveStreamTranscoder liveStreamTranscoder, IMediaStream stream)
{
}
public void onLiveStreamTranscoderInit(ILiveStreamTranscoder liveStreamTranscoder, IMediaStream stream)
{
}
}
class MyTranscoderActionNotifier extends LiveStreamTranscoderActionNotifyBase
{
public MyTranscoderActionNotifier( )
{
}
public void onInitStop(LiveStreamTranscoder liveStreamTranscoder)
{
while(true)
{
TranscoderStream transcoderStream = liveStreamTranscoder.getTranscodingStream();
if (transcoderStream == null)
break;
TranscoderSession transcoderSession = liveStreamTranscoder.getTranscodingSession();
TranscoderSessionVideo transcoderVideoSession = transcoderSession.getSessionVideo();
transcoderVideoSession.addFrameListener(new MyTranscoderVideoDecoderNotifyBase());
break;
}
}
}
class MyTranscoderVideoDecoderNotifyBase extends TranscoderVideoDecoderNotifyBase
{
public MyTranscoderVideoDecoderNotifyBase ( )
{
}
public void onBeforeScaleFrame(TranscoderSessionVideo sessionVideo, TranscoderStreamSourceVideo sourceVideo, long frameCount)
{
}
public void onBeforeDecodeFrame(TranscoderSessionVideo sessionVideo, TranscoderStreamSourceVideo sourceVideo, long frameCount)
{
}
public void onAfterDecodeFrame(TranscoderSessionVideo sessionVideo, TranscoderStreamSourceVideo sourceVideo, long frameCount)
{
}
}
[/PHP]
Be warned though, if you process anything within this part it must keep up with decoding otherwise things will stall and the output from the transcoder waiting for your process.
Andrew.