Пример #1
0
  /**
   * 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
  /**
   * 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);
    }
  }