InitialObjectDescriptor {
 objectDescriptorID 1
 audioProfileLevelIndication 255
 visualProfileLevelIndication 254
 sceneProfileLevelIndication 1
 graphicsProfileLevelIndication 1
 ODProfileLevelIndication 1
 esDescr [
  ES_Descriptor {
   ES_ID 1
   decConfigDescr DecoderConfigDescriptor {
    streamType 3
    decSpecificInfo BIFSConfig {
     isCommandStream true
     pixelMetric true
     pixelWidth 400
     pixelHeight 400
    }
   }
  }
  ES_Descriptor {
   ES_ID 2
   decConfigDescr DecoderConfigDescriptor {
    streamType 1
   }
  }
 ]
}

OrderedGroup {
 children [
  Background2D {
   backColor 1 1 1
  }
  WorldInfo {
   info ["This shows media streams synchronized to an empty OCR stream" "and mediaControl controling the OCR playback" "" "GPAC Regression Tests" "$Date: 2007-07-27 09:46:10 $ - $Revision: 1.3 $" "(C) 2002-2004 GPAC Team"]
   title "Animation Stream"
  }
  Transform2D {
   translation 0 160
   children [
    Shape {
     appearance DEF TXTAPP Appearance {
      material Material2D {
       emissiveColor 0 0 0
       filled TRUE
      }
     }
     geometry Text {
      string ["Click on video to switch streams"]
      fontStyle DEF TXTFT FontStyle {
       justify ["MIDDLE" "MIDDLE"]
       size 16
      }
     }
    }
   ]
  }
  Transform2D {
   children [
    Shape {
     appearance Appearance {
      texture DEF MT MovieTexture {
       url [od:12]
      }
     }
     geometry Bitmap {}

    }
    DEF TS TouchSensor {}
   ]
  }
  Transform2D {
   translation -120 -160
   children [
    Shape {
     appearance Appearance {
      material Material2D {
       emissiveColor 1 0 0
       filled TRUE
      }
     }
     geometry Rectangle {
      size 40 20
     }
    }
    Shape {
     appearance USE TXTAPP
     geometry DEF TXT Text {
      string ["Stop"]
      fontStyle USE TXTFT
     }
    }
    DEF TS2 TouchSensor {}
   ]
  }
  Transform2D {
   translation 40 -160
   children [
    Transform2D {
     translation -30 0
     children [
      Shape {
       appearance USE TXTAPP
       geometry Text {
        string ["OCR Time:"]
        fontStyle USE TXTFT
       }
      }
     ]
    }
    Transform2D {
     translation 60 0
     children [
      Shape {
       appearance USE TXTAPP
       geometry DEF OCR_TIME Text {
        string ["Stop"]
        fontStyle USE TXTFT
       }
      }
     ]
    }
   ]
  }
  Transform2D {
   translation 40 -180
   children [
    Transform2D {
     translation -30 0
     children [
      Shape {
       appearance USE TXTAPP
       geometry Text {
        string ["OCR Duration:"]
        fontStyle USE TXTFT
       }
      }
     ]
    }
    Transform2D {
     translation 60 0
     children [
      Shape {
       appearance USE TXTAPP
       geometry DEF OCR_DUR Text {
        string ["Stop"]
        fontStyle USE TXTFT
       }
      }
     ]
    }
   ]
  }
  DEF C Conditional {
   buffer {
    REPLACE MT.url BY ["od:12"]
    REPLACE ROUTE R1 BY TS.isActive TO RC.activate
   }
  }
  DEF RC Conditional {
   buffer {
    REPLACE MT.url BY ["od:10"]
    REPLACE ROUTE R1 BY TS.isActive TO C.activate
   }
  }
  DEF MC MediaControl {
   url [od:8]
   loop TRUE
   preRoll FALSE
  }
  DEF MS MediaSensor {
   url [od:8]
  }
  DEF VMS Valuator {}
  DEF VMS2 Valuator {}
  DEF C2 Conditional {
   buffer {
    REPLACE MC.mediaSpeed BY 0
    REPLACE TXT.string BY ["Play"]
    REPLACE ROUTE R2 BY TS2.isActive TO RC2.activate
   }
  }
  DEF RC2 Conditional {
   buffer {
    REPLACE MC.mediaSpeed BY 1
    REPLACE TXT.string BY ["Stop"]
    REPLACE ROUTE R2 BY TS2.isActive TO C2.activate
   }
  }
 ]
}

DEF R1 ROUTE TS.isActive TO C.activate
DEF R2 ROUTE TS2.isActive TO C2.activate
ROUTE MS.mediaCurrentTime TO VMS.inSFTime
ROUTE VMS.outMFString TO OCR_TIME.string
ROUTE MS.mediaDuration TO VMS2.inSFTime
ROUTE VMS2.outMFString TO OCR_DUR.string

AT 0 {
  UPDATE OD [
   ObjectDescriptor {
    objectDescriptorID 8
    esDescr [
     ES_Descriptor {
      ES_ID 8
      OCR_ES_ID 8
      decConfigDescr DecoderConfigDescriptor {
       objectTypeIndication 1
       streamType 2
      }
      muxInfo MuxInfo {
       duration 10000
      }
     }
    ]
   }
   ObjectDescriptor {
    objectDescriptorID 10
    esDescr [
     ES_Descriptor {
      ES_ID 5
      OCR_ES_ID 8
      muxInfo MuxInfo {
       fileName "../auxiliary_files/enst_video.h264"
      }
     }
    ]
   }
   ObjectDescriptor {
    objectDescriptorID 12
    esDescr [
     ES_Descriptor {
      ES_ID 4
      OCR_ES_ID 8
      muxInfo MuxInfo {
       fileName "../auxiliary_files/count_video.cmp"
      }
     }
    ]
   }
  ]
}

