[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] admin/web/src/srvprxy config_broad_mpeg2ts_ingress.html.wasm, 1.5, 1.6
From:       packard () helixcommunity ! org
Date:       2012-06-29 2:57:48
[Download RAW message or body]

Update of /cvsroot/server/admin/web/src/srvprxy
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv27715/admin/web/src/srvprxy


Modified Files:
	config_broad_mpeg2ts_ingress.html.wasm 
Log Message:
Synopsis
========
MPEG2 TS ingress on V15, part2, multi-thread 
Branches: HEAD, SERVER_15_0_RN

reviewed by: Chytanya, Xiaocheng Li


Description
===========
I. Intro
===================================================
   This CR is about the multi-threaded mpeg2ts ingress module.
   
   1. implement IHXEnhancedMultiLoadPlugin, add several TLS varaiables.
   2. let the manager thread do the configuration file checking work, and assign new \
file to a best thread.  3. implement a global Mp2tsFileOwner object, to save the file \
to thread mapping  4. implement several callback class in mp2tsworkercb.cpp
   5. manager thread only do the configuration file checking and receive request from \
other module.  6. if new file is set in cfg file, manager will assign it to a worker, \
                worker will create CTSSourceHandler and startprocess this file.
      as g_mp2ts_live_map is used to save mapping between file and CTSSourceHandler, \
and it is accessed by different threads,   locks are used in this class.
      Modify GetStreamHeader/ GetFileHeader in sourcehandler, don’t need to pass the \
header to mp2tspln, just pass the header to m_pFFResponse.   7. user should set a \
port-range in the admin page, and could set the stream name like streamname%d, which \
                means the real file name will be
      streamname_portnumber. If port-range has only one port or stream name don't \
                have %d suffix, only one file name is used.
      manager thread will try to choose different thread to handle each stream name.  \
  
   

II. File Added
==============
   servercur/server_rn/broadcast/transport/mpeg2ts/recv/mp2tsfileowner.cpp
   servercur/server_rn/broadcast/transport/mpeg2ts/recv/mp2tsworkercb.cpp
   servercur/server_rn/broadcast/transport/mpeg2ts/recv/pub/mp2tsworkercb.h
   servercur/server_rn/broadcast/transport/mpeg2ts/recv/pub/mp2tsfileowner.h
   
   
III. Files Affected
==============
   server_rn/broadcast/transport/mpeg2ts/recv/mp2tsmap.cpp
   server_rn/broadcast/transport/mpeg2ts/recv/pub/mp2tsmap.h
   server_rn/broadcast/transport/mpeg2ts/recv/pub/mp2tspln.h
   server_rn/broadcast/transport/mpeg2ts/recv/mp2tspln.cpp
   server_rn/broadcast/transport/mpeg2ts/recv/pub/mp2ts_config.h
   server_rn/broadcast/transport/mpeg2ts/recv/pub/sourcehandler.h
   server_rn/broadcast/transport/mpeg2ts/recv/sourcehandler.cpp
   
   server/admin/web/src/srvprxy/config_broad_mpeg2ts_ingress.html.wasm
   server/admin/web/build/server/config_broad_mpeg2ts_ingress.html
   

III.Testing Performed
=================
   use ffmpeg to generate mpeg2ts live stream to server
   server could generate two liveconnections, one for mpeg2ts, one for rtsplive
   could use rtsp player/flashplayer to play the stream.
   live feed is distributed to different thread(log from debug output, seen from rss \
log, work load is distributed too)

Index: config_broad_mpeg2ts_ingress.html.wasm
===================================================================
RCS file: /cvsroot/server/admin/web/src/srvprxy/config_broad_mpeg2ts_ingress.html.wasm,v
 retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- config_broad_mpeg2ts_ingress.html.wasm	27 Jan 2012 22:39:55 -0000	1.5
+++ config_broad_mpeg2ts_ingress.html.wasm	29 Jun 2012 02:57:45 -0000	1.6
@@ -36,7 +36,7 @@
     new PropObj( 'Enable', "1", false, true, 0, 1, "int", "Enable Source" ),
     new PropObj( 'StreamName', "", false, true, null, null, "string", "Stream \
                Name"),
     new PropObj( 'Address', "", false, true, null, null, "ipzero", \
                "Unicast/Multicast Address" ),
-    new PropObj( 'Port', "", false, true, 1, 65535, "int", "Port" ),
+    new PropObj( 'PortRange', "", false, true, null, null, "port_range", "Port \
                Range" ),
     new PropObj( 'ProgramNumber', "", false, false, 0, 9999, "int", "Program Number" \
                ),
     new PropObj( 'VideoPID', "", false, false, 0, 9999, "int", "Video PID" ),
     new PropObj( 'AudioPID', "", false, false, 0, 9999, "int", "Audio PID" ), 
@@ -80,7 +80,29 @@
         return rejectInput( theForm["MountPoint"], this.errMsg );
     }
     
+    if ( ! checkPort( getCtrlValue( theForm.PortRange0 ), 
+					  getCtrlValue( theForm.PortRange1 ) ) )
+        return false ;
+	
+    setCtrlValue( theForm.PortRange, 
+		( ("" == getCtrlValue( theForm.PortRange0 )) ? "" :
+			getCtrlValue( theForm.PortRange0 ) + "-" + 
+			getCtrlValue( theForm.PortRange1 ) ) );	
+    return true;
+}
+
+MPEG2TSIngressPropView.prototype.postFillFormFromSubList = function ( fValidate )
+{
+
+	// fillForm isn't recursive - have to do it for sublists
+	
+    var aTemp = getCtrlValue( theForm.PortRange ).split( /\s*-\s*/ );	
+    setCtrlValue( theForm.PortRange0, (aTemp[0] ? aTemp[0] : ""), true );
+    setCtrlValue( theForm.PortRange1, (aTemp[1] ? aTemp[1] : ""), true );
+	
+	
     return true;
+
 }
 
 MPEG2TSIngressPropView.prototype.postValidateSubList = function ( subListName )
@@ -97,36 +119,7 @@
 		}
 	}
    
-    var subList = this.getSubList();
-
-	if ( subList.m_status || subList.prop( "Port" ).isDirty() )
-	{
-		var port = getCtrlValue( theForm.Port );
-		var conflict = findPortConflictName( port );
-		if ( conflict )
-		{
-			return rejectInput( theForm.Port, getConflictErrMsg( conflict, "MPEG2TS Ingress \
                Port" ) );
-		}
-
-		// check the port against other MPEG2TS sources
-		function _checkPortConflict( otherSubList, prop )
-		{
-			// don't compare this sublist with itself
-			if ( otherSubList == subList ) return;
-
-			if ( prop.getValue() == port )
-			{
-				conflict = otherSubList.toString();
-				return 1;
-			}
-		}
-		propList.propSearch( "Port", _checkPortConflict );
-		if ( conflict )
-		{
-			return rejectInput( theForm.Port, 
-				"The '" + subListName + "' Listen Port conflicts with the '" + conflict + "' \
                Listen Port." );
-		}
-	}
+    
     return true;
 }
 
@@ -161,6 +154,23 @@
 
 var theForm;
 
+function checkPort ( port1, port2 )
+{
+	if ( ! (port1 && port2) )
+		return rejectInput( theForm.PortRange0, "A Port Range is required." );
+
+	if ( ! propList.port_validate( port1 ) )
+		return rejectInput( theForm.PortRange0, propList.errMsg );
+
+	if ( ! propList.port_validate( port2 ) )
+		return rejectInput( theForm.PortRange1, propList.errMsg );
+
+	if ( parseInt( port1 ) > parseInt( port2 ) )
+		return rejectInput( theForm.PortRange0, "Invalid Port Range." );
+
+	return true ;
+}
+
 function onLoad ()
 {
     theForm = document.theForm;
@@ -196,7 +206,7 @@
 @>
 
 <@= formTag2 @>
-
+<input type="hidden" name="PortRange" value="">
 <@= tabHeader @>
 
 <@= formTableTag @>
@@ -229,8 +239,9 @@
         <@= formElemText( "Stream Name" , name => "StreamName", class => \
"longInput", maxlength=>255 ); @>  <BR>    
         <@= formElemText( "Unicast/Multicast Address" , name => "Address", class => \
                "longInput", maxlength=>255 ); @>
-        <BR>    
-        <@= formElemText( "Port" , name => "Port", class => "longInput", \
maxlength=>255 ); @> +        <BR>
+		<@= formElem( "Port Range", 
+		qq{<input type="text" class="input" name="PortRange0" size="5" \
>&nbsp;to&nbsp;<input type="text" class="input" name="PortRange1" size="5" >} ); @>  \
> <BR>
         <@= formElemText( "Program Number <FONT color='grey'>(optional)</FONT>" , \
name => "ProgramNumber", class => "input", size=>16, maxlength=>255 ); @>  <BR>    


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic