<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body text="#000000" bgcolor="#ffffff">
<small>Hi,<br>
I want my application concat 4 strings. The strings I converted into
byte arrays. <br>
<br>
ArrayList<byte[]> lStreamingBA = new ArrayList<byte[]>();<br>
...<br>
<br>
((AppSrc)appsrc).connect(new AppSrc.NEED_DATA() {<br>
int cnt = 0;<br>
@Override<br>
public void needData(Element arg0, int arg1, Pointer arg2) {<br>
byte[] nextAudioData = lStreamingBA.get(cnt);<br>
Buffer buf = new Buffer(nextAudioData.length);<br>
ByteBuffer bb = buf.getByteBuffer();<br>
bb.clear();<br>
bb.put(nextAudioData);<br>
<br>
((AppSrc)appsrc).pushBuffer(buf);<br>
cnt++;<br>
}<br>
});<br>
<br>
I have set appsrc properties:<br>
((AppSrc)appsrc).setMaxBytes(the Length Of The 4 byte Arrays In the
list);<br>
<br>
I also tried to set the block property to true. All this I done hoping
the ENOUGH_DATA is called, but nothing happens. What has to be set for
emitting the ENOUGH_DATA signal? <br>
<br>
If I extend the code of needData as follows:<br>
...<br>
((AppSrc)appsrc).pushBuffer(buf);<br>
if(cnt==(lStreamingBA.size()-1)){<br>
System.out.println("cnt to quit " + cnt);<br>
Gst.quit();<br>
System.out.println("quitted ...");<br>
}<br>
cnt++; <br>
<br>
the method is called 4 times as expected. But the result only
contains 3 strings the last string is missed. Can anybody explain why
this happens? <br>
</small><br>
<pre class="moz-signature" cols="72">--
Best regards
Andrea König
</pre>
</body>
</html>