private void notifyBroadcastStart ( ) { IStreamAwareScopeHandler handler = getStreamAwareHandler ( ) ; if ( handler != null ) { try { handler . streamBroadcastStart ( this ) ; } catch ( Throwable t ) { log . error ( "Error in notifyBroadcastStart" , t ) ; } } // send metadata for creation and start dates IoBuffer buf = IoBuffer . allocate ( 256 ) ; buf . setAutoExpand ( true ) ; Output out = new Output ( buf ) ; out . writeString ( "onMetaData" ) ; Map < Object , Object > params = new HashMap <> ( ) ; Calendar cal = GregorianCalendar . getInstance ( ) ; cal . setTimeInMillis ( creationTime ) ; params . put ( "creationdate" , ZonedDateTime . ofInstant ( cal . toInstant ( ) , ZoneId . of ( "UTC" ) ) . format ( DateTimeFormatter . ISO_INSTANT ) ) ; cal . setTimeInMillis ( startTime ) ; params . put ( "startdate" , ZonedDateTime . ofInstant ( cal . toInstant ( ) , ZoneId . of ( "UTC" ) ) . format ( DateTimeFormatter . ISO_INSTANT ) ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Params: {}" , params ) ; } out . writeMap ( params ) ; buf . flip ( ) ; Notify notify = new Notify ( buf ) ; notify . setAction ( "onMetaData" ) ; notify . setHeader ( new Header ( ) ) ; notify . getHeader ( ) . setDataType ( Notify . TYPE_STREAM_METADATA ) ; notify . getHeader ( ) . setStreamId ( 0 ) ; notify . setTimestamp ( 0 ) ; dispatchEvent ( notify ) ; }
Notifies handler on stream broadcast start