• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *  Copyright (c) 2018 The WebM project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef VPX_VP9_DECODER_VP9_JOB_QUEUE_H_
12 #define VPX_VP9_DECODER_VP9_JOB_QUEUE_H_
13 
14 #include "vpx_util/vpx_thread.h"
15 
16 typedef struct {
17   // Pointer to buffer base which contains the jobs
18   uint8_t *buf_base;
19 
20   // Pointer to current address where new job can be added
21   uint8_t *volatile buf_wr;
22 
23   // Pointer to current address from where next job can be obtained
24   uint8_t *volatile buf_rd;
25 
26   // Pointer to end of job buffer
27   uint8_t *buf_end;
28 
29   int terminate;
30 
31 #if CONFIG_MULTITHREAD
32   pthread_mutex_t mutex;
33   pthread_cond_t cond;
34 #endif
35 } JobQueueRowMt;
36 
37 void vp9_jobq_init(JobQueueRowMt *jobq, uint8_t *buf, size_t buf_size);
38 void vp9_jobq_reset(JobQueueRowMt *jobq);
39 void vp9_jobq_deinit(JobQueueRowMt *jobq);
40 void vp9_jobq_terminate(JobQueueRowMt *jobq);
41 int vp9_jobq_queue(JobQueueRowMt *jobq, void *job, size_t job_size);
42 int vp9_jobq_dequeue(JobQueueRowMt *jobq, void *job, size_t job_size,
43                      int blocking);
44 
45 #endif  // VPX_VP9_DECODER_VP9_JOB_QUEUE_H_
46