Skip to content
This repository has been archived by the owner on Jul 30, 2022. It is now read-only.

Commit

Permalink
DO NOT MERGE TO MR2
Browse files Browse the repository at this point in the history
There is a crash due to OMX_UseBuffer change.
In Reset(), media input node deletes the media input node port,
which deletes the allocator. When encoder node releases the
media data, it calls the allocator to release the memory.
That causes crash.

Cherry-picked from MR2 branch.

commit af748e6
Author: Jianhong Jiang <jianhong@google.com>
Date:   Fri Oct 23 14:41:57 2009 -0700

    RIO-7762: OMX_UseBuffer support buffers allocated in MIO.
    The change depends on
         https://android-git.corp.google.com/g/30984
  • Loading branch information
Jianhong Jiang authored and James Dong committed Nov 2, 2009
1 parent 52da244 commit 2481a65
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 2 additions & 0 deletions nodes/pvmediainputnode/src/pvmf_media_input_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,8 @@ class PvmfMediaInputNode : public OsclActiveObject,
} TimeStamp_KSV;
TimeStamp_KSV iErrorTimeStamp;
#endif

PVMFBufferPoolAllocator iPrivateDataFsiFragmentAlloc;
};

#endif // PVMF_MEDIA_INPUT_NODE_H_INCLUDED
Expand Down
4 changes: 2 additions & 2 deletions nodes/pvmediainputnode/src/pvmf_media_input_node_outport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ PvmfMediaInputNodeOutPort::PvmfMediaInputNodeOutPort(PvmfMediaInputNode* aNode,
iMediaDataAlloc = OSCL_NEW(PvmfMediaInputDataBufferAlloc, (iMediaDataAllocMemPool));
iDataPathLogger = PVLogger::GetLoggerObject("datapath.sourcenode");

iPrivateDataFsiFragmentAlloc.size(32, sizeof(OsclAny *)); //TODO REMOVE THE HARDCODED VALUE
iNode->iPrivateDataFsiFragmentAlloc.size(32, sizeof(OsclAny *)); //TODO REMOVE THE HARDCODED VALUE
#ifdef _TEST_AE_EROR_HANDLING
iTimeStampJunk = 0x000FFFFF;
#endif
Expand Down Expand Up @@ -412,7 +412,7 @@ PVMFCommandId PvmfMediaInputNodeOutPort::writeAsync(uint8 format_type, int32 for
OsclRefCounterMemFrag privatedataFsiMemFrag;
OsclLeaveCode fsiErrorCode = OsclErrNone;

OSCL_TRY(fsiErrorCode, privatedataFsiMemFrag = iPrivateDataFsiFragmentAlloc.get(););
OSCL_TRY(fsiErrorCode, privatedataFsiMemFrag = iNode->iPrivateDataFsiFragmentAlloc.get(););

OSCL_FIRST_CATCH_ANY(fsiErrorCode,
LOG_ERR((0, "Failed to allocate memory for FSI for private data"));
Expand Down
1 change: 0 additions & 1 deletion nodes/pvmediainputnode/src/pvmf_media_input_node_outport.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ class PvmfMediaInputNodeOutPort : public OsclTimerObject,
//logging
OSCL_HeapString<OsclMemAllocator> iMimeType;
PVLogger* iDataPathLogger;
PVMFBufferPoolAllocator iPrivateDataFsiFragmentAlloc;
};

#endif // PVMF_MEDIA_INPUT_NODE_INPORT_H_INCLUDED

0 comments on commit 2481a65

Please sign in to comment.