00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "NvVideoDecoder.h"
00030 #include "NvVideoConverter.h"
00031 #include "EGL/egl.h"
00032 #include "EGL/eglext.h"
00033 #include <queue>
00034 #include <fstream>
00035 #include <pthread.h>
00036 #include "gie_inference.h"
00037 #include "nvosd.h"
00038
00039 using namespace std;
00040
00041 typedef struct
00042 {
00043 struct v4l2_buffer v4l2_buf;
00044 NvBuffer *buffer;
00045 NvBuffer *shared_buffer;
00046 void *arg;
00047 int bProcess;
00048 } Shared_Buffer;
00049
00050 typedef struct
00051 {
00052 NvVideoDecoder *dec;
00053 NvVideoConverter *conv;
00054 uint32_t decoder_pixfmt;
00055
00056 char *in_file_path;
00057 std::ifstream *in_file;
00058
00059 EGLDisplay egl_display;
00060
00061 queue<Shared_Buffer> *gie_buf_queue;
00062 pthread_mutex_t gie_lock;
00063 pthread_cond_t gie_cond;
00064 int gie_stop;
00065 pthread_t gie_thread_handle;
00066 GIE_Context *gie_ctx;
00067
00068 bool disable_dpb;
00069 uint32_t dec_width;
00070 uint32_t dec_height;
00071
00072 std::queue < NvBuffer * > *conv_output_plane_buf_queue;
00073 pthread_mutex_t queue_lock;
00074 pthread_cond_t queue_cond;
00075
00076 pthread_t dec_capture_loop;
00077 bool got_error;
00078 bool got_eos;
00079
00080 string deployfile;
00081 string modelfile;
00082 } context_t;
00083
00084 typedef struct
00085 {
00086 uint32_t window_height;
00087 uint32_t window_width;
00088 }display_resolution_t;
00089
00090 class GIE_Context;
00091
00092 int parseCsvArgs(context_t * ctx, GIE_Context *gie_ctx, int argc, char *argv[]);