Package de.fu_berlin.inf.dpp.videosharing.exceptions

Examples of de.fu_berlin.inf.dpp.videosharing.exceptions.EncodingException


                // log.warn("Encoding too slow for framerate. " + trace
                // + " ms behind. " + (SLOW_ENCODING_ERROR - slowEncoding)
                // + " warnings in row remaining.");
                if (++slowEncoding > SLOW_ENCODING_ERROR) {
                    videoSharingSession
                        .reportError(new EncodingException(
                            "Can't encode that fast. Please choose lower frames per second."));
                    return;
                }
            }
        }
View Full Code Here


                // PIXELFORMAT, width, height, bgrImage.getWidth(), bgrImage
                // .getHeight());
                converter = ConverterFactory.createConverter("XUGGLER-BGR-24",
                    pixelformat, width, height, width, height);
            } catch (UnsupportedOperationException e) {
                videoSharingSession.reportError(new EncodingException(e));
                return;
            }
        }

        image = Decoder.resample(image, new Dimension(width, height));

        long timeStamp = (now - firstTimestamp) * 1000; // convert to
        // microseconds
        com.xuggle.xuggler.IVideoPicture outFrame = converter.toPicture(
            convertToType(image, BufferedImage.TYPE_3BYTE_BGR), timeStamp);

        if ((errorNumber = coder.encodeVideo(packet, outFrame, 0)) < 0) {
            videoSharingSession.reportError(new EncodingException(IError.make(
                errorNumber).getDescription()));
            return;
        }

        if (packet.isComplete()) {
            if ((errorNumber = container.writePacket(packet)) < 0) {
                videoSharingSession.reportError(new EncodingException(IError
                    .make(errorNumber).getDescription()));
                return;
            }
        }
    }
View Full Code Here

            } catch (IOException e) {
                log.error(e.getMessage(), e);
                stopEncodingInternal();
                if (!(e instanceof EOFException))
                    videoSharingSession.reportError(new EncodingException(e));
                return;
            } catch (Exception e) {
                log.error(e.getMessage(), e);
                videoSharingSession.reportError(new EncodingException(e));
                return;
            }

            long elapsedTime = System.currentTimeMillis() - startTime;
            long frameIntervall = (1000L / framerate);
View Full Code Here

        }
    }

    private void reportMaxDroppedFramesReached() {
        videoSharingSession
            .reportError(new EncodingException(
                "Your PC cannot handle the current frame rate. Maximum bandwidth used was "
                    + (maxBandwidthUsed / 1024)
                    + " KiB per frame and can result in "
                    + ((maxBandwidthUsed / 1024) * framerate)
                    + " KiB/s at the current frame rate("
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.videosharing.exceptions.EncodingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.