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 "NvEglRenderer.h"
00032 #include "EGL/egl.h"
00033 #include "EGL/eglext.h"
00034 #include <queue>
00035 #include <fstream>
00036 #include <pthread.h>
00037 #include "nvosd.h"
00038
00039 #define MAX_RECT_NUM 100
00040
00041 typedef struct
00042 {
00043 NvVideoDecoder *dec;
00044 NvVideoConverter *conv;
00045 uint32_t decoder_pixfmt;
00046
00047 void *nvosd_context;
00048 NvEglRenderer *renderer;
00049
00050 char *in_file_path;
00051 std::ifstream *in_file;
00052
00053 char *out_file_path;
00054 std::ofstream *out_file;
00055
00056 EGLDisplay egl_display;
00057 EGLImageKHR egl_image;
00058
00059 bool disable_rendering;
00060 bool fullscreen;
00061 uint32_t dec_width;
00062 uint32_t dec_height;
00063 uint32_t window_height;
00064 uint32_t window_width;
00065 uint32_t window_x;
00066 uint32_t window_y;
00067 uint32_t out_pixfmt;
00068 float fps;
00069
00070 bool input_nalu;
00071
00072 bool enable_osd;
00073 char *osd_file_path;
00074 std::ifstream *osd_file;
00075 NvOSD_RectParams g_rect[MAX_RECT_NUM];
00076 int g_rect_num;
00077
00078 std::queue < NvBuffer * > *conv_output_plane_buf_queue;
00079 pthread_mutex_t queue_lock;
00080 pthread_cond_t queue_cond;
00081
00082 pthread_t dec_capture_loop;
00083 bool got_error;
00084 bool got_eos;
00085 } context_t;
00086
00087 int parse_csv_args(context_t * ctx, int argc, char *argv[]);