コード例 #1
0
  public boolean turnVideoOn(String sParticipantId, VideoChannelPtr in) {
    if (!_users.containsKey(sParticipantId)) {
      LogSdk.e(TAG, "turnVideoOn: Participant " + sParticipantId + " not found");
      return false;
    }

    RenderViewData d = null;
    Integer view_id = _users.get(sParticipantId).getViewId();
    if (view_id == -1) {
      LogSdk.d(TAG, "Participant " + sParticipantId + " is not connected to any GLView");
      d = getFreeRender();
      if (d != null) _users.get(sParticipantId).setViewId(d._view_id);

    } else {
      d = _renders.get(view_id);
    }

    if (d != null) {
      d._render.connect(in, sParticipantId);
      d._video_on = true;
      d._user = sParticipantId;
      LogSdk.d(TAG, "video is ON for " + sParticipantId + " GLView " + d._view_id);
      return true;
    } else {
      LogSdk.w(TAG, "No available GVView found for Participant " + sParticipantId);
    }
    return false;
  }
コード例 #2
0
 public Boolean isVideoOn(String participant) {
   VideoParticipant vp = _users.get(participant);
   if (vp == null) {
     LogSdk.w(TAG, "Participant " + participant + " not found!");
     return false;
   }
   Integer view_id = vp.getViewId();
   if (view_id != null && view_id != -1) {
     return _renders.get(view_id).isVideoOn();
   }
   return false;
 }
コード例 #3
0
  public void turnVideoOff(String sParticipantId) {
    if (!_users.containsKey(sParticipantId)) {
      LogSdk.e(TAG, "Participant " + sParticipantId + " not found");
      return;
    }

    Integer view_id = _users.get(sParticipantId).getViewId();
    if (view_id == -1) {
      LogSdk.w(TAG, "No GLview found for participant " + sParticipantId);
      return;
    }

    RenderViewData d = _renders.get(view_id);
    if (d != null) {
      if (d._render != null) d._render.disconnect();
      if (!_on_pause && !_on_full_mode) {
        d._video_on = false;
        d._user = null;
      }
      LogSdk.d(TAG, "video is OFF for " + sParticipantId);
    } else LogSdk.w(TAG, "turnVideoOff: No GVView found for Participant " + sParticipantId);
  }
コード例 #4
0
 public void addParticipant(String sParticipantId, String sOpaqueString) {
   if (_users.containsKey(sParticipantId)) {
     LogSdk.w(TAG, "add Participant failed! Participant " + sParticipantId + " already exist");
   }
   _users.put(sParticipantId, new VideoParticipant(sParticipantId, sOpaqueString, -1));
 }