Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use X-tile format for video buffer #91

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion c2_components/src/mfx_c2_decoder_component.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ MfxC2DecoderComponent::MfxC2DecoderComponent(const C2String name, const CreateCo
.build());

// Pixel format info. Set to NV12 by default
m_pixelFormat = std::make_unique<C2StreamPixelFormatInfo::output>(SINGLE_STREAM_ID, HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL);
m_pixelFormat = std::make_unique<C2StreamPixelFormatInfo::output>(SINGLE_STREAM_ID, HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL);

// HDR static with BT2020 by default
m_hdrStaticInfo = std::make_shared<C2StreamHdrStaticInfo::output>();
Expand Down
2 changes: 1 addition & 1 deletion c2_utils/src/mfx_c2_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ int MfxFourCCToGralloc(mfxU32 fourcc, bool using_video_memory)
switch (fourcc)
{
case MFX_FOURCC_NV12:
return using_video_memory ? HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL : HAL_PIXEL_FORMAT_NV12;
return using_video_memory ? HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL : HAL_PIXEL_FORMAT_NV12;
case MFX_FOURCC_P010:
return HAL_PIXEL_FORMAT_P010_INTEL;
default:
Expand Down
2 changes: 1 addition & 1 deletion c2_utils/src/mfx_gralloc_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ c2_status_t MfxGrallocAllocator::Alloc(const uint16_t width, const uint16_t heig
gr1_err = (*m_grSetDimensionsFunc)(m_gralloc1_dev, descriptor, width, height);
if (GRALLOC1_ERROR_NONE != gr1_err) break;

gr1_err = (*m_grSetFormatFunc)(m_gralloc1_dev, descriptor, HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL);
gr1_err = (*m_grSetFormatFunc)(m_gralloc1_dev, descriptor, HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL);
if (GRALLOC1_ERROR_NONE != gr1_err) break;

gr1_err = (*m_grAllocateFunc)(m_gralloc1_dev, 1, &descriptor, handle);
Expand Down
2 changes: 2 additions & 0 deletions c2_utils/src/mfx_va_allocator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ static unsigned int ConvertGrallocFourccToVAFormat(int fourcc)
{
case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL:
case HAL_PIXEL_FORMAT_NV12_LINEAR_CAMERA_INTEL:
case HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL:
return VA_FOURCC_NV12;
case HAL_PIXEL_FORMAT_P010_INTEL:
return VA_FOURCC_P010;
Expand Down Expand Up @@ -600,6 +601,7 @@ mfxStatus MfxVaFrameAllocator::MapGrallocBufferToSurface(buffer_handle_t gralloc

if (buffer_details.format == HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL ||
buffer_details.format == HAL_PIXEL_FORMAT_NV12_LINEAR_CAMERA_INTEL ||
buffer_details.format == HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL ||
buffer_details.format == HAL_PIXEL_FORMAT_P010_INTEL ||
buffer_details.format == HAL_PIXEL_FORMAT_RGBA_8888 ||
buffer_details.format == HAL_PIXEL_FORMAT_RGBX_8888 ||
Expand Down