Overriding publish and releaseStream

Hi!

We need to control publishing using some custom logic, for example

public void publish(IClient client, RequestFunction function, AMFDataList params)
{
if(this.someCustomLogic())
invokePrevious(client, function, params);
}

Seems like there are two methods - ModuleBase:: publish and ModuleBase::releaseStream to control streams publishing. There is no documentation for those methods. Can you please explain what is the purpose/difference between those two, and shell we override both, or one is enough?

Thanks, Alex.

Take a look at our limit publish by IP example for how to handle this event. releaseStream is called when there is already a stream being published with the same name.

Thank you, Matt!

There is another question. We see releaseStream being called even for non-existing streams.

We have the following setup to try:

One wowza, two origin applications - live and target.

live application is default Wowza origin application. It pulls some feed from rtmp URL provided in stream file, and started with mediacaster, and push it into target application, using PushPublish module and the following settings in PushPublishMap.txt:

test.stream={profile:“rtmp”, streamName:“test”, host:“127.0.0.1”, application:“target”}

Target application does not have any streams running. When live starts to pull a test.stream and therefore starts to push it into the target application, both releaseStream and publish functions are being called.

Only difference in target application is that it has custom StreamNameAliasProvider.

Such behaviour does not correspond to your reply: “releaseStream is called when there is already a stream being published with the same name.”

Can you please provide bit more details, why releaseStream is called on target application?

Many thanks, Alex

up