  #include <libyuv.h>
  #include <msm_media_info.h>
  
  #include "common/mutex.h"
  #include "common/swaglog.h"
  
  #include "omx_encoder.h"
  
  // Check the OMX error code and assert if an error occurred.
 
</s> remove #include <queue>
#include <mutex>
#include <condition_variable>
 </s> add  </s> remove   OMX_BUFFERHEADERTYPE* in_buf = (OMX_BUFFERHEADERTYPE *)queue_pop(&this->free_in);
 </s> add   OMX_BUFFERHEADERTYPE* in_buf = nullptr;
  while (!this->free_in.try_pop(in_buf, 20)) {
    if (do_exit) {
      pthread_mutex_unlock(&this->lock);
      return -1;
    }
  }
 </s> remove     queue_push(&this->free_in, (void*)buf);
 </s> add     this->free_in.push(buf);
#include "common/util.h"
  #include <libyuv.h>
  #include <msm_media_info.h>
  
  #include "common/mutex.h"
#include "common/util.h"
  #include "common/swaglog.h"
  
  #include "omx_encoder.h"
  
  // Check the OMX error code and assert if an error occurred.
keep keep keep add keep keep keep keep keep
 remove cqueue, use class SafeQueue (#19774)

* class SafeQueue

* cleanup includes

* space

* add timeout

use try_poll

* add function empty() & size()

* class SafeQueue

* add timeout

use try_poll

* add function empty() & size()

* rebase master

* rebase master

* for loop

* fix bug 
selfdrive/loggerd/omx_encoder.cc