1. Use boolean flag in write thread to avoid InterruptedException while
it is blocked and use interrupted flag in read thread.
2. Do NOT close input stream in read thread and output stream in write
thread when shutting down. socket.close() will handle it automatically.
Otherwise SocketException will be raised in the corresponding thread.
3. Do socket.shutdownInput() before ending read thread and capture
EOFException which may be the only correct way to return the blocking
input stream read method.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
Since isEmpty method of ConcurrentLinkedQueue may take some time, and
therefore it would not detect new elements offered, we have to wait a time
out to ensure ConcurrentLinkedQueue can detect new elements.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
ConcurrentLinkedQueue may have some bug since the queue is still empty
while elements have been added into it.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
When processing Cb and Cr component In yuv420planner frame, the length
of width and height should be half of that in Y component.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
The createStream response from the server may come after onFCPublish.
Therefore we have to wait until onStatus containing NetStream.Publish.Start
status code arrives.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>
The chunk size of RTMP packet means two things: When the SetChunkSize
command comes from the server, it changes rx chunk size of the peer
while the tx chunk size still stays unchanged.
Signed-off-by: Leo Ma <begeekmyfriend@gmail.com>