コード例 #1
0
ファイル: VideoSharingImpl.java プロジェクト: herike/rcsjta
  /**
   * Returns the video descriptor
   *
   * @return Video descriptor
   * @throws RemoteException
   * @see VideoDescriptor
   */
  public VideoDescriptor getVideoDescriptor() throws RemoteException {
    try {
      final VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId);
      if (session == null) {
        return mPersistentStorage.getVideoDescriptor();
      }
      IVideoPlayer player = session.getPlayer();
      if (player != null) {
        VideoCodec codec = player.getCodec();
        return new VideoDescriptor(codec.getWidth(), codec.getHeight());
      }
      VideoContent content = (VideoContent) session.getContent();
      return new VideoDescriptor(content.getWidth(), content.getHeight());

    } 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);
    }
  }
コード例 #2
0
ファイル: VideoSharingImpl.java プロジェクト: herike/rcsjta
  /**
   * 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);
    }
  }
コード例 #3
0
ファイル: VideoSharingImpl.java プロジェクト: herike/rcsjta
  /**
   * Returns the state of the sharing
   *
   * @return State
   * @throws RemoteException
   * @see State
   */
  public int getState() throws RemoteException {
    try {
      VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId);
      if (session == null) {
        return mPersistentStorage.getState().toInt();
      }
      SipDialogPath dialogPath = session.getDialogPath();
      if (dialogPath != null && dialogPath.isSessionEstablished()) {
        return State.STARTED.toInt();

      } else if (session.isInitiatedByRemote()) {
        if (session.isSessionAccepted()) {
          return State.ACCEPTING.toInt();
        }
        return State.INVITED.toInt();
      }
      return State.INITIATING.toInt();

    } 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);
    }
  }
コード例 #4
0
ファイル: VideoSharingImpl.java プロジェクト: herike/rcsjta
  /**
   * Returns the local timestamp of when the video sharing was initiated for outgoing video sharing
   * or the local timestamp of when the video sharing invitation was received for incoming video
   * sharings.
   *
   * @return Timestamp in milliseconds
   * @throws RemoteException
   */
  public long getTimestamp() throws RemoteException {
    try {
      final VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId);
      if (session == null) {
        return mPersistentStorage.getTimestamp();
      }
      return session.getTimestamp();

    } 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);
    }
  }
コード例 #5
0
ファイル: VideoSharingImpl.java プロジェクト: herike/rcsjta
  /**
   * Returns the direction of the sharing (incoming or outgoing)
   *
   * @return Direction
   * @throws RemoteException
   * @see Direction
   */
  public int getDirection() throws RemoteException {
    try {
      VideoStreamingSession session = mRichcallService.getVideoSharingSession(mSharingId);
      if (session == null) {
        return mPersistentStorage.getDirection().toInt();
      }
      if (session.isInitiatedByRemote()) {
        return Direction.INCOMING.toInt();
      }
      return Direction.OUTGOING.toInt();

    } 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);
    }
  }