• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/minidlna/ffmpeg-2.3.4/libavutil/

Lines Matching refs:mq

48 int av_thread_message_queue_alloc(AVThreadMessageQueue **mq,
76 *mq = rmq;
79 *mq = NULL;
84 void av_thread_message_queue_free(AVThreadMessageQueue **mq)
87 if (*mq) {
88 av_fifo_freep(&(*mq)->fifo);
89 pthread_cond_destroy(&(*mq)->cond);
90 pthread_mutex_destroy(&(*mq)->lock);
91 av_freep(mq);
98 static int av_thread_message_queue_send_locked(AVThreadMessageQueue *mq,
102 while (!mq->err_send && av_fifo_space(mq->fifo) < mq->elsize) {
105 pthread_cond_wait(&mq->cond, &mq->lock);
107 if (mq->err_send)
108 return mq->err_send;
109 av_fifo_generic_write(mq->fifo, msg, mq->elsize, NULL);
110 pthread_cond_signal(&mq->cond);
114 static int av_thread_message_queue_recv_locked(AVThreadMessageQueue *mq,
118 while (!mq->err_recv && av_fifo_size(mq->fifo) < mq->elsize) {
121 pthread_cond_wait(&mq->cond, &mq->lock);
123 if (av_fifo_size(mq->fifo) < mq->elsize)
124 return mq->err_recv;
125 av_fifo_generic_read(mq->fifo, msg, mq->elsize, NULL);
126 pthread_cond_signal(&mq->cond);
132 int av_thread_message_queue_send(AVThreadMessageQueue *mq,
139 pthread_mutex_lock(&mq->lock);
140 ret = av_thread_message_queue_send_locked(mq, msg, flags);
141 pthread_mutex_unlock(&mq->lock);
148 int av_thread_message_queue_recv(AVThreadMessageQueue *mq,
155 pthread_mutex_lock(&mq->lock);
156 ret = av_thread_message_queue_recv_locked(mq, msg, flags);
157 pthread_mutex_unlock(&mq->lock);
164 void av_thread_message_queue_set_err_send(AVThreadMessageQueue *mq,
168 pthread_mutex_lock(&mq->lock);
169 mq->err_send = err;
170 pthread_cond_broadcast(&mq->cond);
171 pthread_mutex_unlock(&mq->lock);
175 void av_thread_message_queue_set_err_recv(AVThreadMessageQueue *mq,
179 pthread_mutex_lock(&mq->lock);
180 mq->err_recv = err;
181 pthread_cond_broadcast(&mq->cond);
182 pthread_mutex_unlock(&mq->lock);