~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Open Mash Cross Reference
mash/tcl/indiva/services/irtp/irtp-application.tcl

Component: ~ [ mash ] ~ [ apps ] ~ [ gsm ] ~ [ lib ] ~ [ otcl ] ~ [ srm ] ~ [ tcl8.3 ] ~ [ tclcl ] ~ [ tk8.3 ] ~ [ tutorials ] ~

  1 import IndivaServiceApplication
  2 import IRtp
  3 import IRtpService
  4 
  5 Class IRtpApplication -superclass IndivaServiceApplication
  6 
  7 IRtpApplication instproc init { argv } {
  8     set o [$self options]
  9     $self init_args $o
 10     $self init_resources $o
 11     $self next $argv "irtp"
 12 
 13     $self instvar state_ client_
 14     set state_ [new IRtp]
 15 
 16     set hostaddress [$self get_option hostaddress]
 17     set mediatype [$self get_option mediatype]
 18     set servicemode [$self get_option servicemode]
 19     set devicenumber [$self get_option devicenumber]
 20     set multicastaddr [$self get_option multicastaddr]
 21     set multicastport [$self get_option multicastport]
 22     
 23     if {[$self get_option transmit]} {
 24         set service [$self new_service]
 25 
 26         $service start $hostaddress $mediatype $servicemode $devicenumber $multicastaddr $multicastport
 27 
 28     }
 29 
 30     $self on_exit "$state_ stop"
 31 }
 32 
 33 IRtpApplication instproc init_args { o } {
 34 #    $o add_default hostaddress "127.0.0.1"
 35     $o add_default hostaddress "video6"
 36     $o add_default mediatype "video"
 37     $o add_default servicemode "server"
 38     $o add_default devicenumber ""
 39     $o add_default multicastaddr "224.4.4.4"
 40     $o add_default multicastport "22222"
 41     $o add_default unicastaddr ""
 42     $o add_default unicastport ""
 43     $o add_default transmit ""
 44 }
 45 
 46 IRtpApplication instproc init_resources { o } {
 47     $o register_option -hostaddress hostaddress
 48     $o register_option -mediatype mediatype
 49     $o register_option -servicemode servicemode
 50     $o register_option -devicenumber devicenumber
 51     $o register_option -multicastaddr multicastaddr
 52     $o register_option -multicastport multicastport
 53     $o register_option -unicastaddr unicastaddr
 54     $o register_option -unicastport unicastport
 55     $o register_option -transmit transmit
 56 }
 57 
 58 IRtpApplication instproc new_service { } {
 59     $self instvar service_ state_
 60     set service_ [new IRtpService $state_]
 61     return $service_
 62 }
 63 
 64 IRtpApplication instproc get_service { service_id } {
 65     $self instvar service_
 66     if [info exists service_] {
 67         return $service_
 68     } else {
 69         return ""
 70     }
 71 }
 72 
 73 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.