Browse Source

Add header buffer flag

Signed-off-by: sw.multimedia <sw.multimedia@starfivetech.com>
sw.multimedia 2 years ago
parent
commit
3c6aa981bf

+ 1 - 0
soft_3rdpart/wave521/code/sample_v2/component/component.h

@@ -175,6 +175,7 @@ typedef struct PortContainerES {
     BOOL            last;
     Uint32          type;
     /* ---- DO NOT TOUCH THE ABOVE FIELDS ---- */
+    int             bufferType;
     vpu_buffer_t    buf;
     Uint32          size;
     Uint32          streamBufFull;

+ 1 - 0
soft_3rdpart/wave521/code/sample_v2/component_encoder/component_enc_encoder.c

@@ -793,6 +793,7 @@ static BOOL Encode(ComponentImpl* com, PortContainerYuv* in, PortContainerES* ou
     ctx->fullInterrupt      = FALSE;
 	//VLOG(INFO,"%s,%d\n",__func__,__LINE__);
     if ( out ) {
+        out->bufferType = encOutputInfo.reconFrameIndex;
         if (ctx->encOpenParam.ringBufferEnable ==  TRUE) {
             out->buf.phys_addr = encOutputInfo.rdPtr;
             out->size  = encOutputInfo.bitstreamSize;

+ 10 - 2
soft_3rdpart/wave521/code/sample_v2/component_encoder/component_enc_reader.c

@@ -186,7 +186,11 @@ static BOOL ExecuteReader(ComponentImpl* com, PortContainer* in, PortContainer*
 #ifdef USE_FEEDING_METHOD_BUFFER
                         osal_memcpy(output->pBuffer, buf, readSize);
                         output->nFilledLen = readSize;
-                        if (srcData->last == TRUE)
+                        if (srcData->bufferType == RECON_IDX_FLAG_HEADER_ONLY)
+                        {
+                            output->nFlags = 0x80;
+                        }
+                        else if (srcData->last == TRUE)
                         {
                             output->nFlags = 0x01;
                         }
@@ -224,7 +228,11 @@ static BOOL ExecuteReader(ComponentImpl* com, PortContainer* in, PortContainer*
                 if (srcData->streamBufFull == TRUE) {
                     srcData->buf.phys_addr = 0;
                 }
-                if (srcData->last == TRUE)
+                if (srcData->bufferType == RECON_IDX_FLAG_HEADER_ONLY)
+                {
+                    output->nFlags = 0x80;
+                }
+                else if (srcData->last == TRUE)
                 {
                     output->nFlags = 0x01;
                 }