.getStreamCoder();
if (newCoder.getCodecType() == ICodec.Type.CODEC_TYPE_VIDEO) {
videoStreamIndex = streamIndex;
coder = newCoder;
if ((errorNumber = coder.open()) < 0) {
videoSharingSession.reportError(new DecodingException(
IError.make(errorNumber).getDescription()));
return;
}
}
if (coder == null)
// coder not properly set up yet
continue;
}
if (packet.getStreamIndex() == videoStreamIndex) {
// one of the pictures in this packet
IVideoPicture picture = IVideoPicture.make(
coder.getPixelType(), coder.getWidth(), coder.getHeight());
// offset for already processed data in package
int offset = 0;
// fetch every frame from the packet
while (offset < packet.getSize()) {
int bytesDecoded = coder.decodeVideo(picture, packet,
offset);
if (bytesDecoded < 0) {
videoSharingSession.reportError(new DecodingException(
IError.make(bytesDecoded).getDescription()));
return;
}
offset += bytesDecoded;