public void registerListener(ImageProcessorListener listener,@Nullable ImageProxy image){
synchronized (mRegisteredListeners) {
    logWrapper("There are " + mRegisteredListeners.size() + " listeners before addition");
    if (!mRegisteredListeners.contains(listener)) {
      mRegisteredListeners.add(listener);
      logWrapper("Listener will be overwritten.");
    }
    if (image == null) {
      mImageFilter.put(listener,null);
    }
 else {
      mImageFilter.put(listener,image.getTimestamp());
    }
    logWrapper("There are " + mRegisteredListeners.size() + " listeners after addition");
  }
  return;
}

public void registerListener ( ImageProcessorListener listener , @ Nullable ImageProxy image ) { synchronized ( mRegisteredListeners ) { logWrapper ( "There are " + mRegisteredListeners . size ( ) + " listeners before addition" ) ; if ( ! mRegisteredListeners . contains ( listener ) ) { mRegisteredListeners . add ( listener ) ; logWrapper ( "Listener will be overwritten." ) ; } if ( image == null ) { mImageFilter . put ( listener , null ) ; } else { mImageFilter . put ( listener , image . getTimestamp ( ) ) ; } logWrapper ( "There are " + mRegisteredListeners . size ( ) + " listeners after addition" ) ; } return ; }
register a listener filtered by a particular image object . if image is null , then events from all image processing will be sent to the registered listener .
