Exemplo n.º 1
0
  /**
   * Return the video encoding (eg. H.264)
   *
   * @return Encoding
   * @throws RemoteException
   */
  public String getVideoEncoding() throws RemoteException {
    try {
      final VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId);
      if (session == null) {
        return mPersistentStorage.getVideoEncoding();
      }
      IVideoPlayer player = session.getPlayer();
      if (player == null) {
        throw new ServerApiGenericException(
            "Cannot get video encoding for session with sharing ID:".concat(mSharingId));
      }
      VideoCodec codec = player.getCodec();
      if (codec == null) {
        throw new ServerApiGenericException(
            "Cannot get video codec for session with sharing ID:".concat(mSharingId));
      }
      return codec.getEncoding();

    } catch (ServerApiBaseException e) {
      if (!e.shouldNotBeLogged()) {
        sLogger.error(ExceptionUtil.getFullStackTrace(e));
      }
      throw e;

    } catch (Exception e) {
      sLogger.error(ExceptionUtil.getFullStackTrace(e));
      throw new ServerApiGenericException(e);
    }
  }