Change GST_RANK_NONE to GST_RANK_PRIMARY + 1, and Modify "g_printf" to GST_LOG 29/156129/2
authorjohnny nam <johnny@dignsys.com>
Tue, 17 Oct 2017 07:43:09 +0000 (16:43 +0900)
committerjohnny nam <johnny@dignsys.com>
Thu, 19 Oct 2017 06:46:23 +0000 (06:46 +0000)
Change-Id: Ib568a10c4accb8dce81d4344d94863970e9c142b
Signed-off-by: johnny Nam <johnny@dignsys.com>
src/decoder.c
src/gstnxvideodec.c

index 8220df9e8e6f193f6629b44dd9b3d8b2f565fb59..8011eee2878200f09b2ac7081320187287550e3c 100644 (file)
@@ -7,6 +7,7 @@
 #include <linux/videodev2.h>
 
 #include "decoder.h"
+
 #include "gstnxvideodec.h"
 
 #define        MAX_OUTPUT_BUF  6
@@ -49,7 +50,7 @@ FindCodecInfo (GstVideoCodecState * pState, NX_VIDEO_DEC_STRUCT * pDecHandle)
     pDecHandle->fpsDen = 1;
   }
 
-  g_print ("mime type = %s\n", pMime);
+  GST_LOG ("mime type = %s\n", pMime);
 
   // H.264
   if (!strcmp (pMime, "video/x-h264")) {
@@ -132,7 +133,7 @@ GetExtraInfo (NX_VIDEO_DEC_STRUCT * pDecHandle, guint8 * pCodecData,
         return FALSE;
       } else {
         // Debugging
-        g_print ("NumSps = %d, NumPps = %d, type = %s\n",
+        GST_DEBUG ("NumSps = %d, NumPps = %d, type = %s\n",
             pDecHandle->pH264Info->numSps,
             pDecHandle->pH264Info->numPps,
             (pDecHandle->pH264Info->eStreamType ==
@@ -142,7 +143,7 @@ GetExtraInfo (NX_VIDEO_DEC_STRUCT * pDecHandle, guint8 * pCodecData,
       memcpy (pDecHandle->pExtraData, pCodecData, codecDataSize);
     }
   } else {
-    g_print ("Codec_data not exist.\n");
+    GST_LOG ("Codec_data not exist.\n");
   }
 
   return TRUE;
@@ -347,7 +348,7 @@ VideoDecodeFrame (NX_VIDEO_DEC_STRUCT * pDecHandle, GstBuffer * pGstBuf,
     }
 
     if (0 != ret) {
-      g_print ("NX_V4l2DecDecodeFrame!!!!, ret = %d\n", ret);
+      GST_ERROR ("NX_V4l2DecDecodeFrame!!!!, ret = %d\n", ret);
       ret = DEC_ERR;
     }
   }
@@ -597,7 +598,7 @@ Initialize (NX_VIDEO_DEC_STRUCT * pHDec, GstBuffer * pGstBuf,
     }
 
     if (0 != ret) {
-      g_print ("NX_V4l2DecDecodeFrame!!!!, ret = %d\n", ret);
+      GST_ERROR ("NX_V4l2DecDecodeFrame!!!!, ret = %d\n", ret);
       ret = DEC_ERR;
     }
   } else {
@@ -662,7 +663,7 @@ InitializeCodaVpu (NX_VIDEO_DEC_STRUCT * pHDec, guint8 * pSeqInfo,
 
     pHDec->minRequiredFrameBuffer = seqOut.minBuffers;
     pHDec->pSem = VDecSemCreate (MAX_OUTPUT_BUF);
-    g_print
+    GST_LOG
         ("<<<<<<<<<< InitializeCodaVpu(Min=%d, %dx%d) (ret = %d) >>>>>>>>>\n",
         pHDec->minRequiredFrameBuffer, seqOut.width, seqOut.height, ret);
 
@@ -912,7 +913,7 @@ PopVideoTimeStamp (NX_VIDEO_DEC_STRUCT * hDec, gint64 * pTimestamp,
     hDec->outTimeStamp[minIdx].flag = (gint) - 1;
     return 0;
   } else {
-//              g_print("Cannot Found Time Stamp!!!\n");
+//  GST_ERROR ("Cannot Found Time Stamp!!!\n");
     return -1;
   }
 }
index fdc4e5b8f09ca483efd898128e304fda35d4f803..56f6a53716e00058f18bbd8a0b58a0f2417cf722 100644 (file)
@@ -445,7 +445,7 @@ gst_nxvideodec_set_format (GstVideoDecoder * pDecoder,
     }
     gst_buffer_unmap (pCodecData, &mapInfo);
   } else {
-    g_print ("No Codec Data\n");
+    GST_LOG ("No Codec Data\n");
   }
 
   if (pDecHandle->codecType == V4L2_PIX_FMT_H264) {
@@ -893,7 +893,7 @@ nxvideodec_buffer_finalize (gpointer pData)
           DisplayDone (pMeta->pNxVideoDec->pNxVideoDecHandle,
           pMeta->v4l2BufferIdx);
       if (ret) {
-        g_print ("Fail: DisplayDone !");
+        GST_ERROR ("Fail: DisplayDone !");
       }
     }
     pthread_mutex_unlock (&pMeta->pNxVideoDec->mutex);
@@ -985,7 +985,7 @@ plugin_init (GstPlugin * plugin)
 
   /* FIXME Remember to set the rank if it's an element that is meant
      to be autoplugged by decodebin. */
-  ret = gst_element_register (plugin, "nxvideodec", GST_RANK_NONE,
+  ret = gst_element_register (plugin, "nxvideodec", GST_RANK_PRIMARY + 1,
       GST_TYPE_NXVIDEODEC);
   FUNC_OUT ();