diff mbox series

[FFmpeg-devel,4/6] dnn/queue: remove prefix FF for Queue and SafeQueue

Message ID 20210118125223.27426-1-yejun.guo@intel.com
State Accepted
Commit d4f40c1b608dbf619976f9fa3b48d16c6dcae946
Headers show
Series [FFmpeg-devel,1/6] dnn_backend_openvino.c: add version mismatch reminder
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Guo, Yejun Jan. 18, 2021, 12:52 p.m. UTC
we don't need FF prefix for internal data struct

Signed-off-by: Guo, Yejun <yejun.guo@intel.com>
---
 libavfilter/dnn/dnn_backend_openvino.c |  4 +-
 libavfilter/dnn/queue.c                | 58 +++++++++++++-------------
 libavfilter/dnn/queue.h                | 20 ++++-----
 libavfilter/dnn/safe_queue.c           | 18 ++++----
 libavfilter/dnn/safe_queue.h           | 14 +++----
 5 files changed, 57 insertions(+), 57 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 9c803c8188..573344e628 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -55,8 +55,8 @@  typedef struct OVModel{
     ie_infer_request_t *infer_request;
 
     /* for async execution */
-    FFSafeQueue *request_queue;   // holds RequestItem
-    FFQueue *task_queue;          // holds TaskItem
+    SafeQueue *request_queue;   // holds RequestItem
+    Queue *task_queue;          // holds TaskItem
 } OVModel;
 
 typedef struct TaskItem {
diff --git a/libavfilter/dnn/queue.c b/libavfilter/dnn/queue.c
index e64f567906..954437a8b4 100644
--- a/libavfilter/dnn/queue.c
+++ b/libavfilter/dnn/queue.c
@@ -23,31 +23,31 @@ 
 #include "libavutil/mem.h"
 #include "libavutil/avassert.h"
 
-typedef struct FFQueueEntry FFQueueEntry;
+typedef struct QueueEntry QueueEntry;
 
-struct FFQueueEntry {
+struct QueueEntry {
     void *value;
-    FFQueueEntry *prev;
-    FFQueueEntry *next;
+    QueueEntry *prev;
+    QueueEntry *next;
 };
 
-struct FFQueue {
-    FFQueueEntry *head;
-    FFQueueEntry *tail;
+struct Queue {
+    QueueEntry *head;
+    QueueEntry *tail;
     size_t length;
 };
 
-static inline FFQueueEntry *create_entry(void *val)
+static inline QueueEntry *create_entry(void *val)
 {
-    FFQueueEntry *entry = av_malloc(sizeof(*entry));
+    QueueEntry *entry = av_malloc(sizeof(*entry));
     if (entry)
         entry->value = val;
     return entry;
 }
 
-FFQueue* ff_queue_create(void)
+Queue* ff_queue_create(void)
 {
-    FFQueue *q = av_malloc(sizeof(*q));
+    Queue *q = av_malloc(sizeof(*q));
     if (!q)
         return NULL;
 
@@ -70,15 +70,15 @@  FFQueue* ff_queue_create(void)
     return q;
 }
 
-void ff_queue_destroy(FFQueue *q)
+void ff_queue_destroy(Queue *q)
 {
-    FFQueueEntry *entry;
+    QueueEntry *entry;
     if (!q)
         return;
 
     entry = q->head;
     while (entry != NULL) {
-        FFQueueEntry *temp = entry;
+        QueueEntry *temp = entry;
         entry = entry->next;
         av_freep(&temp);
     }
@@ -86,12 +86,12 @@  void ff_queue_destroy(FFQueue *q)
     av_freep(&q);
 }
 
-size_t ff_queue_size(FFQueue *q)
+size_t ff_queue_size(Queue *q)
 {
      return q ? q->length : 0;
 }
 
-void *ff_queue_peek_front(FFQueue *q)
+void *ff_queue_peek_front(Queue *q)
 {
     if (!q || q->length == 0)
         return NULL;
@@ -99,7 +99,7 @@  void *ff_queue_peek_front(FFQueue *q)
     return q->head->next->value;
 }
 
-void *ff_queue_peek_back(FFQueue *q)
+void *ff_queue_peek_back(Queue *q)
 {
     if (!q || q->length == 0)
         return NULL;
@@ -107,10 +107,10 @@  void *ff_queue_peek_back(FFQueue *q)
     return q->tail->prev->value;
 }
 
-int ff_queue_push_front(FFQueue *q, void *v)
+int ff_queue_push_front(Queue *q, void *v)
 {
-    FFQueueEntry *new_entry;
-    FFQueueEntry *original_next;
+    QueueEntry *new_entry;
+    QueueEntry *original_next;
     if (!q)
         return 0;
 
@@ -128,10 +128,10 @@  int ff_queue_push_front(FFQueue *q, void *v)
     return q->length;
 }
 
-int ff_queue_push_back(FFQueue *q, void *v)
+int ff_queue_push_back(Queue *q, void *v)
 {
-    FFQueueEntry *new_entry;
-    FFQueueEntry *original_prev;
+    QueueEntry *new_entry;
+    QueueEntry *original_prev;
     if (!q)
         return 0;
 
@@ -149,10 +149,10 @@  int ff_queue_push_back(FFQueue *q, void *v)
     return q->length;
 }
 
-void *ff_queue_pop_front(FFQueue *q)
+void *ff_queue_pop_front(Queue *q)
 {
-    FFQueueEntry *front;
-    FFQueueEntry *new_head_next;
+    QueueEntry *front;
+    QueueEntry *new_head_next;
     void *ret;
 
     if (!q || q->length == 0)
@@ -170,10 +170,10 @@  void *ff_queue_pop_front(FFQueue *q)
     return ret;
 }
 
-void *ff_queue_pop_back(FFQueue *q)
+void *ff_queue_pop_back(Queue *q)
 {
-    FFQueueEntry *back;
-    FFQueueEntry *new_tail_prev;
+    QueueEntry *back;
+    QueueEntry *new_tail_prev;
     void *ret;
 
     if (!q || q->length == 0)
diff --git a/libavfilter/dnn/queue.h b/libavfilter/dnn/queue.h
index df913d91ac..4d7121366a 100644
--- a/libavfilter/dnn/queue.h
+++ b/libavfilter/dnn/queue.h
@@ -22,20 +22,20 @@ 
 #ifndef AVFILTER_DNN_QUEUE_H
 #define AVFILTER_DNN_QUEUE_H
 
-typedef struct FFQueue FFQueue;
+typedef struct Queue Queue;
 
-FFQueue *ff_queue_create(void);
-void ff_queue_destroy(FFQueue *q);
+Queue *ff_queue_create(void);
+void ff_queue_destroy(Queue *q);
 
-size_t ff_queue_size(FFQueue *q);
+size_t ff_queue_size(Queue *q);
 
-void *ff_queue_peek_front(FFQueue *q);
-void *ff_queue_peek_back(FFQueue *q);
+void *ff_queue_peek_front(Queue *q);
+void *ff_queue_peek_back(Queue *q);
 
-int ff_queue_push_front(FFQueue *q, void *v);
-int ff_queue_push_back(FFQueue *q, void *v);
+int ff_queue_push_front(Queue *q, void *v);
+int ff_queue_push_back(Queue *q, void *v);
 
-void *ff_queue_pop_front(FFQueue *q);
-void *ff_queue_pop_back(FFQueue *q);
+void *ff_queue_pop_front(Queue *q);
+void *ff_queue_pop_back(Queue *q);
 
 #endif
diff --git a/libavfilter/dnn/safe_queue.c b/libavfilter/dnn/safe_queue.c
index 6b55b75246..e962d4cb7e 100644
--- a/libavfilter/dnn/safe_queue.c
+++ b/libavfilter/dnn/safe_queue.c
@@ -43,15 +43,15 @@  static inline int dnn_cond_wait(DNNCond *cond, AVMutex *mutex)
 }
 #endif
 
-struct FFSafeQueue {
-    FFQueue *q;
+struct SafeQueue {
+    Queue *q;
     AVMutex mutex;
     DNNCond cond;
 };
 
-FFSafeQueue *ff_safe_queue_create(void)
+SafeQueue *ff_safe_queue_create(void)
 {
-    FFSafeQueue *sq = av_malloc(sizeof(*sq));
+    SafeQueue *sq = av_malloc(sizeof(*sq));
     if (!sq)
         return NULL;
 
@@ -66,7 +66,7 @@  FFSafeQueue *ff_safe_queue_create(void)
     return sq;
 }
 
-void ff_safe_queue_destroy(FFSafeQueue *sq)
+void ff_safe_queue_destroy(SafeQueue *sq)
 {
     if (!sq)
         return;
@@ -77,12 +77,12 @@  void ff_safe_queue_destroy(FFSafeQueue *sq)
     av_freep(&sq);
 }
 
-size_t ff_safe_queue_size(FFSafeQueue *sq)
+size_t ff_safe_queue_size(SafeQueue *sq)
 {
     return sq ? ff_queue_size(sq->q) : 0;
 }
 
-int ff_safe_queue_push_front(FFSafeQueue *sq, void *v)
+int ff_safe_queue_push_front(SafeQueue *sq, void *v)
 {
     int ret;
     ff_mutex_lock(&sq->mutex);
@@ -92,7 +92,7 @@  int ff_safe_queue_push_front(FFSafeQueue *sq, void *v)
     return ret;
 }
 
-int ff_safe_queue_push_back(FFSafeQueue *sq, void *v)
+int ff_safe_queue_push_back(SafeQueue *sq, void *v)
 {
     int ret;
     ff_mutex_lock(&sq->mutex);
@@ -102,7 +102,7 @@  int ff_safe_queue_push_back(FFSafeQueue *sq, void *v)
     return ret;
 }
 
-void *ff_safe_queue_pop_front(FFSafeQueue *sq)
+void *ff_safe_queue_pop_front(SafeQueue *sq)
 {
     void *value;
     ff_mutex_lock(&sq->mutex);
diff --git a/libavfilter/dnn/safe_queue.h b/libavfilter/dnn/safe_queue.h
index 548a282f0c..36d6daabaf 100644
--- a/libavfilter/dnn/safe_queue.h
+++ b/libavfilter/dnn/safe_queue.h
@@ -21,16 +21,16 @@ 
 #ifndef AVFILTER_DNN_SAFE_QUEUE_H
 #define AVFILTER_DNN_SAFE_QUEUE_H
 
-typedef struct FFSafeQueue FFSafeQueue;
+typedef struct SafeQueue SafeQueue;
 
-FFSafeQueue *ff_safe_queue_create(void);
-void ff_safe_queue_destroy(FFSafeQueue *sq);
+SafeQueue *ff_safe_queue_create(void);
+void ff_safe_queue_destroy(SafeQueue *sq);
 
-size_t ff_safe_queue_size(FFSafeQueue *sq);
+size_t ff_safe_queue_size(SafeQueue *sq);
 
-int ff_safe_queue_push_front(FFSafeQueue *sq, void *v);
-int ff_safe_queue_push_back(FFSafeQueue *sq, void *v);
+int ff_safe_queue_push_front(SafeQueue *sq, void *v);
+int ff_safe_queue_push_back(SafeQueue *sq, void *v);
 
-void *ff_safe_queue_pop_front(FFSafeQueue *sq);
+void *ff_safe_queue_pop_front(SafeQueue *sq);
 
 #endif