- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Good morning, I found a problem when you try to use an External
MemoryAllocator with a IPP decoder: for example MPEG4VideoDecoder.
I'm using latest IPP 6.1.5.054 library and IPP sample 6.1.5.060
The problem is that if you create the external Memory Allocator and pass it to the Init of the decoder, when you decoder make the line:
status = BaseCodec::Init(lpInit);
decoder check if you pass an allocator or have to create new one, but this condition:
if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || m_pMemoryAllocator != init->lpMemoryAllocator) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}
you get always UMC_ERR_INIT because the m_pMemoryAllocator is NULL. I have changed the line in this mode
if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || (m_pMemoryAllocator != init->lpMemoryAllocator)&&(m_pMemoryAllocator!=NULL)) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}
I get it works.
It's useful to take the MemoryAllocator extern from the decoder, so if you have to destroy and recreate the decoder you do not need to free all the memory allocated.
regards
I'm using latest IPP 6.1.5.054 library and IPP sample 6.1.5.060
The problem is that if you create the external Memory Allocator and pass it to the Init of the decoder, when you decoder make the line:
status = BaseCodec::Init(lpInit);
decoder check if you pass an allocator or have to create new one, but this condition:
if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || m_pMemoryAllocator != init->lpMemoryAllocator) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}
you get always UMC_ERR_INIT because the m_pMemoryAllocator is NULL. I have changed the line in this mode
if (init->lpMemoryAllocator) {
if (m_bOwnAllocator || (m_pMemoryAllocator != init->lpMemoryAllocator)&&(m_pMemoryAllocator!=NULL)) {
vm_debug_trace(VM_DEBUG_ERROR, VM_STRING("can't replace external allocator\\n"));
return UMC_ERR_INIT;
}
I get it works.
It's useful to take the MemoryAllocator extern from the decoder, so if you have to destroy and recreate the decoder you do not need to free all the memory allocated.
regards
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for providing that useful bit of information regarding the UMC sample code!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The engineer suggested that:
Thesamples has the wrong condition:
(m_bOwnAllocator || m_pMemoryAllocator != init->lpMemoryAllocator)
this shouldbe replaced with:
(m_bOwnAllocator && m_pMemoryAllocator != init->lpMemoryAllocator)
The fix will be included in the future version.
Thanks,
Chao
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page