コード例 #1
0
 /**
  * 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");
   }
 }
コード例 #2
0
 /** Close the player */
 public void close() {
   if (fifo != null) {
     fifo.close();
     fifo = null;
   }
 }
コード例 #3
0
 /**
  * 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);
   }
 }