[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-datatype-cvs
Subject:    [Datatype-cvs] omx/video/decoder rv20strm.cpp, 1.1.2.12,
From:       gahluwalia () helixcommunity ! org
Date:       2009-09-24 18:03:56
Message-ID: 200909241913.n8OJDxD0009477 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/datatype/omx/video/decoder
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv2586

Modified Files:
      Tag: hxclient_3_1_0_atlas
	rv20strm.cpp COmxVideoDec.cpp COmxVideoDec.h 
Log Message:
Fix for 16 pixel alignment bug

Index: COmxVideoDec.h
===================================================================
RCS file: /cvsroot/datatype/omx/video/decoder/COmxVideoDec.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -d -r1.1.2.3 -r1.1.2.4
--- COmxVideoDec.h	11 Aug 2009 23:32:52 -0000	1.1.2.3
+++ COmxVideoDec.h	24 Sep 2009 18:03:53 -0000	1.1.2.4
@@ -125,10 +125,15 @@
     HX_RESULT AVCDecoderConfigurationRecord(UCHAR *pData, int size, avc_configuration_data *avc);
     HX_RESULT SetupOutputColorFormat(void);
     HX_RESULT AddNALToBuffer(OMX_BUFFERHEADERTYPE* pBuffer, UINT8* pBytes, int size);
+    HXxRect* GetVideoRect()
+    {
+        return &m_uVideoRect;
+    }
     
 private:
     CODEC_TYPE m_etype;
     OMX_COLOR_FORMATTYPE m_eColorFormat;    
+    HXxRect  m_uVideoRect;
 };
 
 #endif //__COMXVIDEO_DEC_H__

Index: rv20strm.cpp
===================================================================
RCS file: /cvsroot/datatype/omx/video/decoder/rv20strm.cpp,v
retrieving revision 1.1.2.12
retrieving revision 1.1.2.13
diff -u -d -r1.1.2.12 -r1.1.2.13
--- rv20strm.cpp	23 Sep 2009 06:12:58 -0000	1.1.2.12
+++ rv20strm.cpp	24 Sep 2009 18:03:53 -0000	1.1.2.13
@@ -58,7 +58,8 @@
  * Contributor(s): 
  *
  * ***** END LICENSE BLOCK ***** */ 
-
+#define LOG_TAG "Rv20Strm"
+#include "utils/Log.h"
 #include "hxtypes.h"
 #include "hxassert.h"
 #include "hxresult.h"
@@ -464,8 +465,11 @@
 {        
     HX_ASSERT_VALID_PTR(puSize);
     HX_RESULT theErr = HXR_FAIL;
-    *puSize = m_mofYUV->cbLength;
-    theErr = HXR_OK;
+    if(m_mofYUV)
+    {
+    	*puSize = m_mofYUV->cbLength;
+    	theErr = HXR_OK;
+    }
     return(theErr);
 }
 
@@ -647,6 +651,7 @@
 OMXVStream::ProcessOutput(void)
 {
     HX_RESULT theErr = HXR_FAIL;
+    HXxRect* pRect = NULL;
     OMX_BUFFERHEADERTYPE* pBuffer = NULL;
     theErr = m_hDecoder->GetDecodedBuffer(pBuffer);
     if(theErr == HXR_OK)
@@ -663,7 +668,7 @@
                 {
                     // site knows how to do optimized display of NV21
                     // pass it the OMX buffer pointer directly
-                    allocRequest.uBufferSize = sizeof(UINT32) + sizeof(void*);
+                    allocRequest.uBufferSize = sizeof(UINT32) + sizeof(void*) + (sizeof(UINT32) * 2);
                     allocRequest.nNumBuffers = 1;
                     theErr = m_SendAllocator->SetProperties(&allocRequest, &allocActual);       
                     pDecodedFrameBuffer = m_SendAllocator->GetPacketBuffer(&pUnk);
@@ -672,8 +677,12 @@
                         // the format of the buffer
                         // DWORD : omx color format
                         // PTR   : pointer to buffer header
-                        *((UINT32*)pDecodedFrameBuffer) = m_hDecoder->GetOutputFormat();
-                        *((OMX_BUFFERHEADERTYPE**)(pDecodedFrameBuffer+sizeof(UINT32))) = pBuffer;
+                        pRect = m_hDecoder->GetVideoRect();
+                        UINT32* pPtr = (UINT32*)pDecodedFrameBuffer;
+                        *pPtr++ = m_hDecoder->GetOutputFormat();
+                        *pPtr++ = pRect->right;
+                        *pPtr++ = pRect->bottom;
+                        *((OMX_BUFFERHEADERTYPE**)(pPtr)) = pBuffer;
                     }
                 }
                 else
@@ -877,8 +886,8 @@
     // free the omx decoder buffer
     if (m_mofYUV->submoftag == HX_OMXV_ID)
     {
-        //the OMX buffer pointer is at offset SIZEOF(UINT32)
-        OMX_BUFFERHEADERTYPE* pBuffer = *(OMX_BUFFERHEADERTYPE**)(pncData->data + sizeof(UINT32));
+        //the OMX buffer pointer is at offset SIZEOF(UINT32) * 3
+        OMX_BUFFERHEADERTYPE* pBuffer = *(OMX_BUFFERHEADERTYPE**)(pncData->data + (sizeof(UINT32) * 3));
         m_hDecoder->ReUse(pBuffer);
         m_SendAllocator->ReleasePacketPtr(pncData->data);
     }

Index: COmxVideoDec.cpp
===================================================================
RCS file: /cvsroot/datatype/omx/video/decoder/COmxVideoDec.cpp,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -d -r1.1.2.5 -r1.1.2.6
--- COmxVideoDec.cpp	23 Sep 2009 06:12:58 -0000	1.1.2.5
+++ COmxVideoDec.cpp	24 Sep 2009 18:03:53 -0000	1.1.2.6
@@ -80,6 +80,7 @@
 COMXVideoDec::COMXVideoDec()
 {
     memset(&m_mofYUV, 0, sizeof(m_mofYUV));
+    memset(&m_uVideoRect, 0, sizeof(m_uVideoRect));
 }
 
 COMXVideoDec::~COMXVideoDec()
@@ -383,9 +384,19 @@
 COMXVideoDec::PortReconfig()
 {
     CBaseOMXDec::PortReconfig();
-    
+    UINT32 uNum = 1;
     m_mofYUV.uiWidth = m_PortOutputParam.format.video.nFrameWidth;
     m_mofYUV.uiHeight = m_PortOutputParam.format.video.nFrameHeight;
+    if(m_PortOutputParam.format.video.nSliceHeight <	m_PortOutputParam.format.video.nFrameHeight)
+    {
+        uNum = m_PortOutputParam.format.video.nFrameHeight/m_PortOutputParam.format.video.nSliceHeight;
+        if(m_PortOutputParam.format.video.nFrameHeight % m_PortOutputParam.format.video.nSliceHeight)
+        {
+            uNum++;
+        }
+    }
+    m_uVideoRect.bottom = m_PortOutputParam.format.video.nSliceHeight * uNum ;
+    m_uVideoRect.right = m_PortOutputParam.format.video.nStride ;
     return SetupOutputColorFormat();
 }
 


_______________________________________________
Datatype-cvs mailing list
Datatype-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/datatype-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic