Skip to content

Commit

Permalink
Merge 90cb645 on remote branch
Browse files Browse the repository at this point in the history
Change-Id: Idf504be8d262b5b205020109e502aeec90d94c98
  • Loading branch information
Linux Build Service Account committed Apr 18, 2018
2 parents b1a8ba4 + 90cb645 commit 5e6c27c
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 40 deletions.
16 changes: 15 additions & 1 deletion mm-core/inc/QOMX_AudioExtensions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
Copyright (c) 2009, 2011, 2015, 2017 The Linux Foundation. All rights reserved.
Copyright (c) 2009, 2011, 2015, 2017-2018 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -98,6 +98,7 @@ typedef enum QOMX_AUDIO_CODINGTYPE {
QOMX_AUDIO_CodingEVRCB = 0x7F000001,
QOMX_AUDIO_CodingEVRCWB = 0x7F000002,
QOMX_AUDIO_CodingFLAC = 0x7F000003,
QOMX_AUDIO_CodingMPEGH = 0x7F000004,
QOMX_AUDIO_CodingMax = 0x7FFFFFFF
}QOMX_AUDIO_CODINGTYPE;

Expand Down Expand Up @@ -581,6 +582,19 @@ typedef struct QOMX_AUDIO_PARAM_DSD_TYPE {
OMX_U32 nBitsPerSample;
} QOMX_AUDIO_PARAM_DSD_TYPE;

typedef struct QOMX_AUDIO_PARAM_MPEGH_TYPE {
OMX_U32 nSize;
OMX_VERSIONTYPE nVersion;
OMX_U32 nPortIndex;
OMX_U32 nSampleRate; /** Sent In-Band as well and can be redundant For Decoder, **/
OMX_U32 nBitRate; /** Sent In-Band as well and can be redundant For Decoder, **/
OMX_U32 nSamplesPerFrame; /** Sent In-Band as well and can be redundant For Decoder, **/
OMX_U32 nDFrames; /** No of Dependent Frames; if 10;every 11 frame is seekable
- Specific to Encoder; Redundant for Decoder **/
OMX_U32 nHOAOrder; /** HOA Order - Specific to Encoder; May be redundant for
Decoder **/
} QOMX_AUDIO_PARAM_MPEGH_TYPE;

enum {
kKeyIndexAlacFrameLength = 0,
kKeyIndexAlacCompatibleVersion = 4,
Expand Down
3 changes: 2 additions & 1 deletion mm-core/inc/QOMX_AudioIndexExtensions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
Copyright (c) 2009, 2015 The Linux Foundation. All rights reserved.
Copyright (c) 2009, 2015, 2018 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down Expand Up @@ -75,6 +75,7 @@ typedef enum QOMX_AUDIO_EXTENSIONS_INDEXTYPE
QOMX_IndexParamAudioApe = 0x7F200009, /** "OMX.Qualcomm.index.audio.ape" */
QOMX_IndexParamAudioFlacDec = 0x7F20000A, /** "OMX.Qualcomm.index.audio.flacdec**/
QOMX_IndexParamAudioDsdDec = 0x7F20000B, /** "OMX.Qualcomm.index.audio.Dsddec**/
QOMX_IndexParamAudioMpegh = 0x7F20000C, /** "OMX.Qualcomm.index.audio.mpegh**/
QOMX_IndexParamAudioUnused = 0x7F2FFFFF
} QOMX_AUDIO_EXTENSIONS_INDEXTYPE;

Expand Down
18 changes: 17 additions & 1 deletion mm-core/src/msm8998/registry_table.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
Copyright (c) 2016 - 2018, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
Expand Down Expand Up @@ -480,6 +480,22 @@ omx_core_cb_type core[] =
"audio_encoder.qcelp13"
}
},
{
"OMX.qcom.audio.encoder.mpegh",
NULL, // Create instance function
// Unique instance handle
{
NULL,
NULL,
NULL,
NULL
},
NULL, // Shared object library handle
"libOmxMpeghEncSw.so",
{
"audio_encoder.mpegh"
}
},
{
"OMX.qcom.audio.encoder.evrc",
NULL, // Create instance function
Expand Down
16 changes: 16 additions & 0 deletions mm-core/src/sdm660/registry_table_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,22 @@ omx_core_cb_type core[] =
"audio_encoder.qcelp13"
}
},
{
"OMX.qcom.audio.encoder.mpegh",
NULL, // Create instance function
// Unique instance handle
{
NULL,
NULL,
NULL,
NULL
},
NULL, // Shared object library handle
"libOmxMpeghEncSw.so",
{
"audio_encoder.mpegh"
}
},
{
"OMX.qcom.audio.encoder.evrc",
NULL, // Create instance function
Expand Down
2 changes: 2 additions & 0 deletions mm-video-v4l2/vidc/vdec/inc/omx_vdec.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <cutils/atomic.h>
#include <qdMetaData.h>
#include <color_metadata.h>
#define STRINGIFY_ENUMS
#include <media/msm_media_info.h>

static ptrdiff_t x;
Expand Down Expand Up @@ -79,6 +80,7 @@ extern "C" {
#endif // _ANDROID_

#if defined (_ANDROID_HONEYCOMB_) || defined (_ANDROID_ICS_)
#define STRINGIFY_ENUMS
#include <media/hardware/HardwareAPI.h>
#endif

Expand Down
44 changes: 30 additions & 14 deletions mm-video-v4l2/vidc/vdec/src/omx_vdec_v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5500,20 +5500,34 @@ OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
VALIDATE_OMX_PARAM_DATA(configData, DescribeColorAspectsParams);
DescribeColorAspectsParams *params = (DescribeColorAspectsParams *)configData;

print_debug_color_aspects(&(m_client_color_space.sAspects), "GetConfig Client");
print_debug_color_aspects(&(m_internal_color_space.sAspects), "GetConfig Internal");

if (params->bRequestingDataSpace) {
DEBUG_PRINT_HIGH("Does not handle dataspace request");
return OMX_ErrorUnsupportedSetting;
}
if (m_internal_color_space.bDataSpaceChanged == OMX_TRUE) {
DEBUG_PRINT_LOW("Updating Client's color aspects with internal");
memcpy(&(m_client_color_space.sAspects),
&(m_internal_color_space.sAspects), sizeof(ColorAspects));
m_internal_color_space.bDataSpaceChanged = OMX_FALSE;
}
memcpy(&(params->sAspects), &(m_client_color_space.sAspects), sizeof(ColorAspects));

print_debug_color_aspects(&(m_client_color_space.sAspects), "GetConfig Client");
print_debug_color_aspects(&(m_internal_color_space.sAspects), "GetConfig Internal");

// For VPX, use client-color if specified.
// For the rest, try to use the stream-color if present
bool preferClientColor = (output_capability == V4L2_PIX_FMT_VP8 ||
output_capability == V4L2_PIX_FMT_VP9);

const ColorAspects &preferredColor = preferClientColor ?
m_client_color_space.sAspects : m_internal_color_space.sAspects;
const ColorAspects &defaultColor = preferClientColor ?
m_internal_color_space.sAspects : m_client_color_space.sAspects;

params->sAspects.mPrimaries = preferredColor.mPrimaries != ColorAspects::PrimariesUnspecified ?
preferredColor.mPrimaries : defaultColor.mPrimaries;
params->sAspects.mTransfer = preferredColor.mTransfer != ColorAspects::TransferUnspecified ?
preferredColor.mTransfer : defaultColor.mTransfer;
params->sAspects.mMatrixCoeffs = preferredColor.mMatrixCoeffs != ColorAspects::MatrixUnspecified ?
preferredColor.mMatrixCoeffs : defaultColor.mMatrixCoeffs;
params->sAspects.mRange = preferredColor.mRange != ColorAspects::RangeUnspecified ?
preferredColor.mRange : defaultColor.mRange;

print_debug_color_aspects(&(params->sAspects), "GetConfig");

break;
}
Expand Down Expand Up @@ -11160,9 +11174,10 @@ void omx_vdec::convert_color_space_info(OMX_U32 primaries, OMX_U32 range,
}
}

void omx_vdec::print_debug_color_aspects(ColorAspects *aspects, const char *prefix) {
DEBUG_PRINT_HIGH("%s : Color aspects : Primaries = %d Range = %d Transfer = %d MatrixCoeffs = %d",
prefix, aspects->mPrimaries, aspects->mRange, aspects->mTransfer, aspects->mMatrixCoeffs);
void omx_vdec::print_debug_color_aspects(ColorAspects *a, const char *prefix) {
DEBUG_PRINT_HIGH("%s : Color aspects : Primaries = %d(%s) Range = %d(%s) Tx = %d(%s) Matrix = %d(%s)",
prefix, a->mPrimaries, asString(a->mPrimaries), a->mRange, asString(a->mRange),
a->mTransfer, asString(a->mTransfer), a->mMatrixCoeffs, asString(a->mMatrixCoeffs));
}

void omx_vdec::prepare_color_aspects_metadata(OMX_U32 primaries, OMX_U32 range,
Expand Down Expand Up @@ -11274,6 +11289,8 @@ bool omx_vdec::handle_color_space_info(void *data,

if (vpx_color_space_payload->color_space == 0) {
*color_space = ITU_R_601;
aspects->mPrimaries = ColorAspects::PrimariesBT601_6_525;
aspects->mRange = ColorAspects::RangeLimited;
} else {
DEBUG_PRINT_ERROR("Unsupported Color space for VP8");
break;
Expand Down Expand Up @@ -11348,7 +11365,6 @@ bool omx_vdec::handle_color_space_info(void *data,
m_internal_color_space.sAspects.mMatrixCoeffs != aspects->mMatrixCoeffs ||
m_internal_color_space.sAspects.mRange != aspects->mRange) {
memcpy(&(m_internal_color_space.sAspects), aspects, sizeof(ColorAspects));
m_internal_color_space.bDataSpaceChanged = OMX_TRUE;

m_color_mdata.colorPrimaries = color_mdata->colorPrimaries;
m_color_mdata.range = color_mdata->range;
Expand Down
23 changes: 0 additions & 23 deletions mm-video-v4l2/vidc/venc/src/video_encoder_device_v4l2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2007,32 +2007,9 @@ bool venc_dev::venc_set_param(void *paramData, OMX_INDEXTYPE index)
}

m_sOutput_buff_property.datasize = fmt.fmt.pix_mp.plane_fmt[0].sizeimage;

m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual;
bufreq.memory = V4L2_MEMORY_USERPTR;
bufreq.count = portDefn->nBufferCountActual;
bufreq.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;

if (ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq)) {
DEBUG_PRINT_ERROR("VIDIOC_REQBUFS CAPTURE_MPLANE Failed");
return false;
}

if (bufreq.count == portDefn->nBufferCountActual)
m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count;

if (portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount)
m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual;

if (fmt.fmt.pix_mp.num_planes > 1)
output_extradata_info.count = m_sOutput_buff_property.actualcount;

}

DEBUG_PRINT_LOW("input: actual: %u, min: %u, count_req: %u",
(unsigned int)portDefn->nBufferCountActual, (unsigned int)m_sInput_buff_property.mincount, bufreq.count);
DEBUG_PRINT_LOW("Output: actual: %u, min: %u, count_req: %u",
(unsigned int)portDefn->nBufferCountActual, (unsigned int)m_sOutput_buff_property.mincount, bufreq.count);
} else if (portDefn->nPortIndex == PORT_INDEX_OUT) {
m_sVenc_cfg.dvs_height = portDefn->format.video.nFrameHeight;
m_sVenc_cfg.dvs_width = portDefn->format.video.nFrameWidth;
Expand Down

0 comments on commit 5e6c27c

Please sign in to comment.