Skip to content

Commit

Permalink
Clean code for MFX_BUFFER_QUEUE
Browse files Browse the repository at this point in the history
Signed-off-by: Nana Zhang <[email protected]>
Tracked-On: OAM-124733
  • Loading branch information
nanazhan committed Sep 14, 2024
1 parent a071ad9 commit c24c53f
Show file tree
Hide file tree
Showing 10 changed files with 2 additions and 1,069 deletions.
1 change: 0 additions & 1 deletion c2_components/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ cc_library_shared {
include_dirs: [
"vendor/intel/mediasdk_c2/c2_utils/include",
"vendor/intel/mediasdk_c2/c2_buffers/include",
"vendor/intel/mediasdk_c2/plugin_store/include",
"frameworks/native/libs/ui/include",
"frameworks/av/media/codec2/sfplugin/utils",
],
Expand Down
4 changes: 1 addition & 3 deletions c2_components/include/mfx_c2_decoder_component.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ class MfxC2DecoderComponent : public MfxC2Component
std::shared_ptr<C2ComponentDomainSetting> m_domain;
std::shared_ptr<C2StreamPictureSizeInfo::output> m_size;
std::shared_ptr<C2PortSurfaceAllocatorTuning::output> m_surfaceAllocator;
std::shared_ptr<C2PortAllocatorsTuning::input> m_inputAllocators;
std::shared_ptr<C2PortAllocatorsTuning::output> m_outputAllocators;
std::shared_ptr<C2StreamMaxPictureSizeTuning::output> m_maxSize;
std::shared_ptr<C2StreamMaxBufferSizeInfo::input> m_maxInputSize;
Expand All @@ -271,13 +270,12 @@ class MfxC2DecoderComponent : public MfxC2Component
std::shared_ptr<C2StreamUsageTuning::output> m_outputUsage;
std::shared_ptr<C2StreamProfileLevelInfo::input> m_profileLevel;
std::shared_ptr<C2PortActualDelayTuning::output> m_actualOutputDelay;
std::shared_ptr<C2PortRequestedDelayTuning::input> m_requestedInputDelay;
std::shared_ptr<C2PortActualDelayTuning::input> m_actualInputDelay;
std::shared_ptr<C2PortDelayTuning::input> m_inputDelay;
std::shared_ptr<C2StreamColorAspectsTuning::output> m_defaultColorAspects;
std::shared_ptr<C2StreamColorAspectsInfo::input> m_inColorAspects;
std::shared_ptr<C2StreamColorAspectsInfo::output> m_outColorAspects;
std::shared_ptr<C2StreamPixelFormatInfo::output> m_pixelFormat;

/* ----------------------------------------Setters------------------------------------------- */
static C2R OutputSurfaceAllocatorSetter(bool mayBlock, C2P<C2PortSurfaceAllocatorTuning::output> &me);
static C2R SizeSetter(bool mayBlock, const C2P<C2StreamPictureSizeInfo::output> &oldMe,
Expand Down
11 changes: 1 addition & 10 deletions c2_components/src/mfx_c2_decoder_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
#include "mfx_c2_components_registry.h"
#include "mfx_c2_utils.h"
#include "mfx_defaults.h"
#include "mfx_c2_allocator_id.h"
#include "mfx_c2_buffer_queue.h"
#include "C2PlatformSupport.h"
#include "mfx_c2_color_aspects_utils.h"

Expand Down Expand Up @@ -1365,14 +1363,7 @@ c2_status_t MfxC2DecoderComponent::UpdateC2Param(const mfxVideoParam* src, C2Par
}
case kParamIndexAllocators: {
if (C2PortAllocatorsTuning::output::PARAM_TYPE == index) {
if (m_mfxVideoParams.IOPattern == MFX_IOPATTERN_OUT_VIDEO_MEMORY)
#ifdef MFX_BUFFER_QUEUE
m_outputAllocators->m.values[0] = MFX_BUFFERQUEUE;
#else
m_outputAllocators->m.values[0] = C2PlatformAllocatorStore::GRALLOC;
#endif
else
m_outputAllocators->m.values[0] = C2PlatformAllocatorStore::GRALLOC;
m_outputAllocators->m.values[0] = C2PlatformAllocatorStore::GRALLOC;
MFX_DEBUG_TRACE_PRINTF("Set output port alloctor to: %d", m_outputAllocators->m.values[0]);
}
break;
Expand Down
5 changes: 0 additions & 5 deletions c2_utils/Android.bp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,11 @@ cc_library_static {
"src/*.cpp",
],

cflags: [
//"-DMFX_BUFFER_QUEUE"
],

local_include_dirs: [
"include",
],

include_dirs: [
"vendor/intel/mediasdk_c2/plugin_store/include",
"hardware/intel/external/minigbm-intel",
"frameworks/native/include",
"frameworks/native/libs/ui/include",
Expand Down
9 changes: 0 additions & 9 deletions c2_utils/src/mfx_va_frame_pool_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@
#if defined(LIBVA_SUPPORT)

#include "mfx_va_frame_pool_allocator.h"
#include "mfx_c2_buffer_queue.h"

#include "mfx_c2_utils.h"
#include "mfx_debug.h"
#include "mfx_msdk_debug.h"
Expand Down Expand Up @@ -89,13 +87,6 @@ mfxStatus MfxVaFramePoolAllocator::AllocFrames(mfxFrameAllocRequest *request,
break;
}

#ifdef MFX_BUFFER_QUEUE
res = std::static_pointer_cast<MfxC2BufferQueueBlockPool>(m_c2Allocator)->requestNewBufferSet(max_buffers);
if(res != C2_OK) {
mfx_res = MFX_ERR_MEMORY_ALLOC;
break;
}
#endif
response->NumFrameActual = 0;
#define RETRY_TIMES 5
for (int i = 0; i < opt_buffers; ++i) {
Expand Down
49 changes: 0 additions & 49 deletions plugin_store/Android.bp

This file was deleted.

27 changes: 0 additions & 27 deletions plugin_store/include/mfx_c2_allocator_id.h

This file was deleted.

86 changes: 0 additions & 86 deletions plugin_store/include/mfx_c2_buffer_queue.h

This file was deleted.

Loading

0 comments on commit c24c53f

Please sign in to comment.