From e0e7107ff14b3472e9e917efb2ce6340c5740a45 Mon Sep 17 00:00:00 2001
From: unknown <ruil2@RUIL2-WS01.cisco.com>
Date: Mon, 3 Mar 2014 17:05:06 +0800
Subject: [PATCH] add timestamp in encoder interface

---
 codec/api/svc/codec_app_def.h          | 2 ++
 codec/encoder/core/src/encoder_ext.cpp | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/codec/api/svc/codec_app_def.h b/codec/api/svc/codec_app_def.h
index a60347f1..330038c3 100644
--- a/codec/api/svc/codec_app_def.h
+++ b/codec/api/svc/codec_app_def.h
@@ -287,6 +287,7 @@ typedef struct {
   SLayerBSInfo	sLayerInfo[MAX_LAYER_NUM_OF_FRAME];
 
   int eOutputFrameType;
+  long long uiTimeStamp;
 } SFrameBSInfo, *PFrameBSInfo;
 
 typedef struct Source_Picture_s {
@@ -295,6 +296,7 @@ typedef struct Source_Picture_s {
   unsigned char*  pData[4];		// plane pData
   int  		iPicWidth;				// luma picture width in x coordinate
   int 		iPicHeight;				// luma picture height in y coordinate
+  long long uiTimeStamp;
 } SSourcePicture;
 
 
diff --git a/codec/encoder/core/src/encoder_ext.cpp b/codec/encoder/core/src/encoder_ext.cpp
index 766c3f7f..583ba740 100644
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2998,7 +2998,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou
 
   pCtx->iEncoderError						= ENC_RETURN_SUCCESS;
   pFbi->iLayerNum	= 0;	// for initialization
-
+  pFbi->uiTimeStamp = pSrcPic->uiTimeStamp;
   // perform csc/denoise/downsample/padding, generate spatial layers
   iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, &pSrcPic, 1);
   if (iSpatialNum < 1) {	// skip due to temporal layer settings (different frame rate)