Unable to display text using nvosd_put_text()

A simple patch for you by using 02_video_dec_cuda

---
 .../samples/02_video_dec_cuda/videodec.h           |  1 +
 .../samples/02_video_dec_cuda/videodec_main.cpp    | 25 +++++++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec.h b/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec.h
index 00d86c4..2727ad3 100644
--- a/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec.h
+++ b/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec.h
@@ -73,6 +73,7 @@ typedef struct
     char *osd_file_path;
     std::ifstream *osd_file;
     NvOSD_RectParams g_rect[MAX_RECT_NUM];
+    NvOSD_TextParams textParams;
     int  g_rect_num;
 
     std::queue < NvBuffer * > *conv_output_plane_buf_queue;
diff --git a/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec_main.cpp b/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec_main.cpp
index 08b8c5d..21b2ab1 100644
--- a/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec_main.cpp
+++ b/multimedia_api/ll_samples/samples/02_video_dec_cuda/videodec_main.cpp
@@ -162,6 +162,20 @@ abort(context_t *ctx)
         pthread_cond_broadcast(&ctx->queue_cond);
     }
 }
+static void
+set_text(context_t* ctx)
+{
+
+    ctx->textParams.display_text = strdup("Hello world");
+    ctx->textParams.x_offset = 400;
+    ctx->textParams.y_offset = 30;
+    ctx->textParams.font_params.font_name = strdup("Arial");
+    ctx->textParams.font_params.font_size = 18;
+    ctx->textParams.font_params.font_color.red = 1.0;
+    ctx->textParams.font_params.font_color.green = 0.0;
+    ctx->textParams.font_params.font_color.blue = 1.0;
+    ctx->textParams.font_params.font_color.alpha = 1.0;
+}
 
 static void
 get_rect(context_t *ctx)
@@ -352,6 +366,12 @@ conv0_capture_dqbuf_thread_callback(struct v4l2_buffer *v4l2_buf,
                               ctx->g_rect_num,
                               ctx->g_rect);
      }
+        set_text(ctx);
+        nvosd_put_text(ctx->nvosd_context,
+                              MODE_CPU,
+                              buffer->planes[0].fd,
+                              1,
+                              &ctx->textParams);
 
     // Write raw video frame to file and return the buffer to converter
     // capture plane
@@ -530,7 +550,7 @@ query_and_set_capture(context_t * ctx)
                    error);
 
         ret = ctx->conv->setCapturePlaneFormat((ctx->out_pixfmt == 1 ?
-                                                    V4L2_PIX_FMT_NV12M :
+                                                    V4L2_PIX_FMT_ABGR32 :
                                                     V4L2_PIX_FMT_YUV420M),
                                                 crop.c.width,
                                                 crop.c.height,
@@ -810,6 +830,7 @@ main(int argc, char *argv[])
         return -1;
     }
 
+	ctx.nvosd_context = nvosd_create_context();
     if (ctx.enable_osd) {
         ctx.nvosd_context = nvosd_create_context();
         cout << "ctx.osd_file_path:" << ctx.osd_file_path << endl;
@@ -1050,6 +1071,8 @@ cleanup:
         nvosd_destroy_context(ctx.nvosd_context);
         ctx.nvosd_context = NULL;
     }
+        nvosd_destroy_context(ctx.nvosd_context);
+        ctx.nvosd_context = NULL;
 
     if (error)
     {
-- 
2.1.4