Wowza Community

Closed captions processSendDirectMessages() problem

I’m using this code from Wowza official page and ((MediaStream)stream).processSendDirectMessages(); gives me a warn in the log: MediaStream#processSendDirectMessages() is no longer available for api use.

Any idea about how to solve it or wich is the right method?

public void sendTextDataMessage(IMediaStream stream, OnTextData onTextData)	{
		try {
			AMFDataObj amfData = new AMFDataObj(); 
			amfData.put("text", new AMFDataItem(onTextData.text));
			amfData.put("language", new AMFDataItem(languageID));
			amfData.put("trackid", new AMFDataItem(trackNumber));
			stream.sendDirect("onTextData", amfData);
			((MediaStream)stream).processSendDirectMessages();	

		} catch(Exception e) {
			e.printStackTrace();
		}
	}

Hi @Javier_Espanol1,

I had the same question, Wowza support replied:

The processSendDirectMessages() method has been deprecated with the later Wowza Streaming Engine versions.

You should be able to remove that portion of your code with no consequences.

If this is the case, I don’t understand why the method isn’t annotated with @Deprecated.
Also, the example code is still using this method (https://www.wowza.com/downloads/forums/closedcaptionlive/PublishOnTextData.zip).

Hopefully someone can shed some light.

Best regards,
Rafael

Probably a question best answered by Wowza engineers. However, looking at some GitHub stuff I would assume that most of the examples & modules don’t look like they were updated recently.

Could be that

((MediaStream)stream).processSendDirectMessages();

is automatically implied now when you write

stream.sendDirect("onTextData", amfData);