Package org.red5.codec

Examples of org.red5.codec.IStreamCodecInfo


      // create a recording listener
      IRecordingListener listener = (IRecordingListener) ScopeUtils.getScopeService(scope, IRecordingListener.class, RecordingListener.class);
      // initialize the listener
      if (listener.init(scope, name, isAppend)) {
        // get decoder info if it exists for the stream
        IStreamCodecInfo codecInfo = getCodecInfo();
        log.debug("Codec info: {}", codecInfo);
        if (codecInfo instanceof StreamCodecInfo) {
          StreamCodecInfo info = (StreamCodecInfo) codecInfo;
          IVideoStreamCodec videoCodec = info.getVideoCodec();
          log.debug("Video codec: {}", videoCodec);
View Full Code Here


          }
        } else {
          log.debug("No metadata available");
        }

        IStreamCodecInfo codecInfo = stream.getCodecInfo();
        log.debug("Codec info: {}", codecInfo);
        if (codecInfo instanceof StreamCodecInfo) {
          StreamCodecInfo info = (StreamCodecInfo) codecInfo;
          IVideoStreamCodec videoCodec = info.getVideoCodec();
          log.debug("Video codec: {}", videoCodec);
View Full Code Here

          IoBuffer buf = null;
          if (rtmpEvent instanceof IStreamData && (buf = ((IStreamData<?>) rtmpEvent).getData()) != null) {
            bytesReceived += buf.limit();
          }
          // get stream codec
          IStreamCodecInfo codecInfo = getCodecInfo();
          StreamCodecInfo info = null;
          if (codecInfo instanceof StreamCodecInfo) {
            info = (StreamCodecInfo) codecInfo;
          }
          //log.trace("Stream codec info: {}", info);
          if (rtmpEvent instanceof AudioData) {
            IAudioStreamCodec audioStreamCodec = null;
            if (checkAudioCodec) {
              // dont try to read codec info from 0 length audio packets
              if (buf.limit() > 0) {
                  audioStreamCodec = AudioCodecFactory.getAudioCodec(buf);
                  if (info != null) {
                    info.setAudioCodec(audioStreamCodec);
                  }
                  checkAudioCodec = false;
              }
            } else if (codecInfo != null) {
              audioStreamCodec = codecInfo.getAudioCodec();
            }
            if (audioStreamCodec != null) {
              audioStreamCodec.addData(buf.asReadOnlyBuffer());
            }
            if (info != null) {
              info.setHasAudio(true);
            }
            eventTime = rtmpEvent.getTimestamp();
            log.trace("Audio: {}", eventTime);
          } else if (rtmpEvent instanceof VideoData) {
            IVideoStreamCodec videoStreamCodec = null;
            if (checkVideoCodec) {
              videoStreamCodec = VideoCodecFactory.getVideoCodec(buf);
              if (info != null) {
                info.setVideoCodec(videoStreamCodec);
              }
              checkVideoCodec = false;
            } else if (codecInfo != null) {
              videoStreamCodec = codecInfo.getVideoCodec();
            }
            if (videoStreamCodec != null) {
              videoStreamCodec.addData(buf.asReadOnlyBuffer());
            }
            if (info != null) {
View Full Code Here

      IRecordingListener listener = new RecordingListener();
      log.debug("Created: {}", listener);
      // initialize the listener
      if (listener.init(conn, name, isAppend)) {
        // get decoder info if it exists for the stream
        IStreamCodecInfo codecInfo = getCodecInfo();
        log.debug("Codec info: {}", codecInfo);
        if (codecInfo instanceof StreamCodecInfo) {
          StreamCodecInfo info = (StreamCodecInfo) codecInfo;
          IVideoStreamCodec videoCodec = info.getVideoCodec();
          log.debug("Video codec: {}", videoCodec);
View Full Code Here

    }

    IStreamableFileService service = factory.getService(file);

    IStreamableFile flv = service.getStreamableFile(file);

    writer = flv.getWriter();

  }
View Full Code Here

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
View Full Code Here

     */

    private void init() throws IOException {

   
    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils

        .getScopeService(scope, IStreamableFileFactory.class,

            StreamableFileFactory.class);

    File folder = file.getParentFile();

    if (!folder.exists()) {

      if (!folder.mkdirs()) {

        throw new IOException("Could not create parent folder");

      }

    }

    if (!file.isFile()) {

      // Maybe the (previously existing) file has been deleted

      file.createNewFile();

    } else if (!file.canWrite()) {

      throw new IOException("The file is read-only");

    }

    IStreamableFileService service = factory.getService(file);

    IStreamableFile flv = service.getStreamableFile(file);

    writer = flv.getWriter();

View Full Code Here

     *
     * @throws IOException          I/O exception
     */
    protected void init() throws IOException {

    IStreamableFileFactory factory = (IStreamableFileFactory) ScopeUtils
        .getScopeService(this.scope, IStreamableFileFactory.class,
            StreamableFileFactory.class);
   
    File folder = file.getParentFile();

    if (!folder.exists()) {
      if (!folder.mkdirs()) {
        throw new IOException("Could not create parent folder");
      }
    }

    if (!this.file.isFile()) {

      // Maybe the (previously existing) file has been deleted
      this.file.createNewFile();

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
View Full Code Here

      throw new IOException("The file is read-only");

    }

    IStreamableFileService service = factory.getService(file);

    IStreamableFile flv = service.getStreamableFile(file);

    writer = flv.getWriter();

  }
View Full Code Here

    } else if (!file.canWrite()) {
      throw new IOException("The file is read-only");
    }

    IStreamableFileService service = factory.getService(this.file);
    IStreamableFile flv = service.getStreamableFile(this.file);
    this.writer = flv.getWriter();

  }
View Full Code Here

TOP

Related Classes of org.red5.codec.IStreamCodecInfo

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.