/** * Read a media sample (blocking method) * * @return Media sample * @throws MediaException */ public VideoSample readSample() throws MediaException { try { if (fifo != null) { return (VideoSample) fifo.getObject(); } else { throw new MediaException("Media input not opened"); } } catch (Exception e) { throw new MediaException("Can't read media sample"); } }
/** Close the player */ public void close() { if (fifo != null) { fifo.close(); fifo = null; } }
/** * Add a new video frame * * @param data Data * @param timestamp Timestamp * @param marker Marker bit */ public void addFrame(byte[] data, long timestamp, VideoOrientation videoOrientation) { if (fifo != null) { VideoSample sample = new VideoSample(data, timestamp, videoOrientation); fifo.addObject(sample); } }