public RtmpReader getReader(final String rawName) {
   final String streamName = Utils.trimSlashes(rawName);
   final String path = RtmpConfig.SERVER_HOME_DIR + "/apps/" + name + "/";
   final String readerPlayName;
   try {
     if (streamName.startsWith("mp4:")) {
       readerPlayName = streamName.substring(4);
       return new F4vReader(path + readerPlayName);
     } else {
       if (streamName.lastIndexOf('.') < streamName.length() - 4) {
         readerPlayName = streamName + ".flv";
       } else {
         readerPlayName = streamName;
       }
       return new FlvReader(path + readerPlayName);
     }
   } catch (Exception e) {
     logger.info("reader creation failed: {}", e.getMessage());
     return null;
   }
 }
 public RtmpWriter getWriter(final String rawName) {
   final String streamName = Utils.trimSlashes(rawName);
   final String path = RtmpConfig.SERVER_HOME_DIR + "/apps/" + name + "/";
   return new FlvWriter(path + streamName + ".flv");
 }
Exemple #3
0
 @Override
 public void run() {
   Utils.sendStopSignal(port);
 }
 private static String cleanName(final String raw) {
   return Utils.trimSlashes(raw).toLowerCase();
 }
 public void setSwfvBytes(byte[] swfvBytes) {
   this.swfvBytes = swfvBytes;
   Log.i(this.getClass().getName(), "set swf verification bytes: " + Utils.toHex(swfvBytes));
 }