Package org.red5.server.adapter

Examples of org.red5.server.adapter.MultiThreadedApplicationAdapter


    public void onStreamEvent( Notify notify ) {

        //logger.debug( "onStreamEvent " + notify );

        ObjectMap map = (ObjectMap) notify.getCall().getArguments()[ 0 ];
        String code = (String) map.get( "code" );

        if ( StatusCodes.NS_PUBLISH_START.equals( code ) ) {
            //logger.debug( "onStreamEvent Publish start" );
            startPublish = true;
        }
View Full Code Here


    ScreenShare.instance.vScreenIconDown.addMouseListener(heightMouseListener);
    ScreenShare.instance.vScreenIconDown.addMouseMotionListener(heightMouseListener);
    ScreenShare.instance.t.add(ScreenShare.instance.vScreenIconDown);


    ScreenShare.instance.virtualScreen = new BlankArea(new Color(255,255,255,100));
    ScreenShare.instance.virtualScreen.setOpaque(true);
    ScreenShare.instance.virtualScreen.setHorizontalAlignment(SwingConstants.LEFT);
    ScreenShare.instance.virtualScreen.setVerticalAlignment(SwingConstants.TOP);
    ScreenShare.instance.virtualScreen.setText(VirtualScreenBean.screenWidthMax+":"+VirtualScreenBean.screenHeightMax);
    ScreenShare.instance.virtualScreen.setBounds(30, 170, VirtualScreenBean.vScreenWidth, VirtualScreenBean.vScreenHeight);
View Full Code Here

    ScreenShareRTMPT.instance.vScreenIconDown.addMouseListener(heightMouseListener);
    ScreenShareRTMPT.instance.vScreenIconDown.addMouseMotionListener(heightMouseListener);
    ScreenShareRTMPT.instance.t.add(ScreenShareRTMPT.instance.vScreenIconDown);


    ScreenShareRTMPT.instance.virtualScreen = new BlankArea(new Color(255,255,255,100));
    ScreenShareRTMPT.instance.virtualScreen.setOpaque(true);
    ScreenShareRTMPT.instance.virtualScreen.setHorizontalAlignment(SwingConstants.LEFT);
    ScreenShareRTMPT.instance.virtualScreen.setVerticalAlignment(SwingConstants.TOP);
    ScreenShareRTMPT.instance.virtualScreen.setText(VirtualScreenBean.screenWidthMax+":"+VirtualScreenBean.screenHeightMax);
    ScreenShareRTMPT.instance.virtualScreen.setBounds(30, 170, VirtualScreenBean.vScreenWidth, VirtualScreenBean.vScreenHeight);
View Full Code Here

                        stopButton.setBounds(290, 34, 200, 32);
                        stopButton.setEnabled(false);
                        t.add(stopButton);

                        //add the small screen thumb to the JFrame
                        new VirtualScreen();
                       
                        //*****
                        //Text Recording
                        textAreaHeaderRecording = new JLabel();
                       
View Full Code Here

      stopButton.setBounds(290, 34, 200, 32);
      stopButton.setEnabled(false);
      t.add(stopButton);

      //add the small screen thumb to the JFrame
      new VirtualScreen();
     
      //*****
      //Text Recording
      textAreaHeaderRecording = new JLabel();
     
View Full Code Here

  public void testScopeMultiThreadHandling() throws Throwable {
    log.debug("-----------------------------------------------------------------testScopeMultiThreadHandling");
    setupScopes();
    boolean persistent = false;
    // create app
    MultiThreadedApplicationAdapter app = new MultiThreadedApplicationAdapter();
    // change the handler
    appScope.setHandler(app);
    // start
    app.start(appScope);
    // get our room
    IScope room = ScopeUtils.resolveScope(appScope, "/junit/mt");
    if (room == null) {
      assertTrue(app.createChildScope("mt"));
      room = ScopeUtils.resolveScope(appScope, "/junit/mt");
    }
    // create the SO
    assertTrue(app.createSharedObject(room, "mtSO", persistent));
    ISharedObject so = app.getSharedObject(room, "mtSO");
    // acquire only works with non-persistent so's
    if (!persistent) {
      so.acquire();
      assertTrue(so.isAcquired());
    }
    // test runnables represent clients
    trs = new TestRunnable[21];
    for (int t = 0; t < trs.length; t++) {
      trs[t] = new ScopeClientWorker(t, app, room);
    }
    MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(trs);
    // fires off threads
    long start = System.nanoTime();
    mttr.runTestRunnables();
    System.out.println("Runtime: " + (System.nanoTime() - start) + "ns");
    // go to sleep
    try {
      Thread.sleep(3000);
    } catch (Exception e) {
    }
    for (TestRunnable r : trs) {
      ScopeClientWorker cl = (ScopeClientWorker) r;
      log.debug("Worker: {} shared object: {}", cl.getId(), cl.getSharedObject().getAttributes());
    }
    if (!persistent) {
      assertTrue(so.isAcquired());
      so.release();
      assertFalse(so.isAcquired());
    }
    app.stop(appScope);

    //    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room1");
    //    IScope room4 = ScopeUtils.resolveScope(appScope, "/junit/room1/room4");
    //    log.debug("Room 4 scope: {}", room4);
    //    assertTrue(room4.getDepth() == 3);
View Full Code Here

   */
  @Test
  public void testScopeMissingHandler() throws Throwable {
    log.debug("-----------------------------------------------------------------testScopeMissingHandler");
    // create app
    MultiThreadedApplicationAdapter app = new MultiThreadedApplicationAdapter();
    // change the handler
    appScope.setHandler(app);
    // start
    app.start(appScope);
    // create our additional scopes
    assertTrue(appScope.hasHandler());
    IScope top = ScopeUtils.resolveScope(appScope, "/junit");
    assertTrue(top.hasHandler());
    IScope room = ScopeUtils.resolveScope(appScope, "/junit/room13");
    if (room == null) {
      assertTrue(top.createChildScope("room13"));
      room = ScopeUtils.resolveScope(appScope, "/junit/room13");
      assertNotNull(room);
    }
    assertTrue(room.hasHandler());
    // get rooms
    IScope room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
    if (room1 == null) {
      assertTrue(room.createChildScope("subroomA"));
      room1 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomA");
      assertNotNull(room1);
    }
    Thread.sleep(10);
    IScope room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
    if (room2 == null) {
      assertTrue(room.createChildScope("subroomB"));
      room2 = ScopeUtils.resolveScope(appScope, "/junit/room13/subroomB");
      assertNotNull(room2);
    }
    // let it settle for a moment
    Thread.sleep(50L);
    // create the SOs
    String soName = "messager";
    if (!app.hasSharedObject(room1, soName)) {
      app.createSharedObject(room1, soName, false);
    }
    assertNotNull(app.getSharedObject(room1, soName, false));
    if (!app.hasSharedObject(room2, soName)) {
      app.createSharedObject(room2, soName, false);
    }
    assertNotNull(app.getSharedObject(room2, soName, false));
    // test runnables represent clients
    trs = new TestRunnable[2];
    trs[0] = new ScopeClientWorkerA(0, app, room1);
    trs[1] = new ScopeClientWorkerB(1, app, room2);
    MultiThreadedTestRunner mttr = new MultiThreadedTestRunner(trs);
    // fires off threads
    long start = System.nanoTime();
    mttr.runTestRunnables();
    System.out.println("Runtime: " + (System.nanoTime() - start) + "ns");
    ScopeClientWorkerA soa = (ScopeClientWorkerA) trs[0];
    log.debug("Worker: {} shared object: {}", soa.getId(), soa.getSharedObject().getAttributes());
    ScopeClientWorkerB sob = (ScopeClientWorkerB) trs[1];
    log.debug("Worker: {} shared object: {}", sob.getId(), sob.getSharedObject().getAttributes());
    Thread.sleep(300L);
    // clean up / stop
    app.stop(appScope);
  }
View Full Code Here

  }

  public RoomClient checkForRecording(){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
     
      log.debug("getCurrentRoomClient -2- "+streamid);
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
View Full Code Here

  }
 
  public String recordMeetingStream(String roomRecordingName, String comment, Boolean isInterview){
    try {
     
      IConnection current = Red5.getConnectionLocal();
      RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
      Long room_id = currentClient.getRoom_id();

      Date now = new Date();
     
      //Receive flvRecordingId
      Long flvRecordingId = this.flvRecordingDaoImpl.addFlvRecording("", roomRecordingName, null, currentClient.getUser_id(),
                  room_id, now, null, currentClient.getUser_id(), comment, currentClient.getStreamid(),
                  currentClient.getVWidth(),currentClient.getVHeight(), isInterview);
     
      //Update Client and set Flag
      currentClient.setIsRecording(true);
      currentClient.setFlvRecordingId(flvRecordingId);
      this.clientListManager.updateClientByStreamId(current.getClient().getId(), currentClient);
     
      //get all stream and start recording them
      Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
      for (Set<IConnection> conset : conCollection) {
        for (IConnection conn : conset) {
          if (conn != null) {
            if (conn instanceof IServiceCapableConnection) {
              RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
View Full Code Here

    return new Long(-1);
  }
 
  public RoomClient checkLzRecording() {
    try {
      IConnection current = Red5.getConnectionLocal();
      String streamid = current.getClient().getId();
     
      log.debug("getCurrentRoomClient -2- "+streamid);
     
      RoomClient currentClient = this.clientListManager.getClientByStreamId(streamid);
     
View Full Code Here

TOP

Related Classes of org.red5.server.adapter.MultiThreadedApplicationAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.