diff --git a/amp_wrapper.c b/amp_wrapper.c index 43ba512..290547f 100644 --- a/amp_wrapper.c +++ b/amp_wrapper.c @@ -69,6 +69,21 @@ int amp_check_nugu_enabled(){ return 0; } +int amp_check_a2dp_playing(){ + char a2dp_play[PROP_VALUE_MAX]; + memset(a2dp_play, 0, PROP_VALUE_MAX); + + if( !property_get("vendor.audio.a2dp.playing", a2dp_play, "0") ) + ALOGD("++%s failed to read vendor.audio.a2dp.playing", __FUNCTION__); + + if( !strcmp(a2dp_play, "1") ){ + ALOGD("++%s a2dp_play (%s)!!!!", __FUNCTION__, a2dp_play); + return 1; + } + ALOGD("++%s a2dp_play (%s)!!!!", __FUNCTION__, a2dp_play); + return 0; +} + int amp_SetWindowSize(synaptics_player_info *socPlayerInfo) { ALOGD("++SetWindowSize"); if(socPlayerInfo == NULL) { @@ -394,9 +409,8 @@ HRESULT amp_dmx_event_handler(HANDLE hListener, AMP_EVENT *pEvent, VOID *pUserDa ALOGD("++amp_dmx_event_handler AMP_EVENT_DMX_INBUFF_OVERFLOW (handle=0x%x, fulness=0x%x, size=0x%x)", pBuffState->hHandle, pBuffState->uFullness, pBuffState->uSize ); - amp_stop_pipeline(player); - - amp_start_pipeline(player); +// amp_stop_pipeline(player); +// amp_start_pipeline(player); } break; case AMP_EVENT_DMX_INBUFF_UNDERFLOW: @@ -405,8 +419,8 @@ HRESULT amp_dmx_event_handler(HANDLE hListener, AMP_EVENT *pEvent, VOID *pUserDa ALOGD("++amp_dmx_event_handler AMP_EVENT_DMX_INBUFF_UNDERFLOW (handle=0x%x, fulness=0x%x, size=0x%x)", pBuffState->hHandle, pBuffState->uFullness, pBuffState->uSize ); if(socPlayerInfo->playerConfig.clock_recovery_enable == AVP_IPTV) { - amp_stop_pipeline(player); - amp_start_pipeline(player); +// amp_stop_pipeline(player); +// amp_start_pipeline(player); } } break; default: @@ -624,6 +638,8 @@ void setHdmiFormat(AMIXER_HANDLE amixer, AVP_AudioOutputMode mode) { if( amp_check_nugu_enabled() ){ ALOGD("++setHdmiFormat ignored nugu enabled!!!!"); + }else if( amp_check_a2dp_playing() ){ + ALOGD("++setHdmiFormat ignored a2dp playing!!!!"); }else{ ALOGD("++setHdmiFormat set dolby !!!!"); ret = AMP_SND_SetSpdifFormat(AMP_SND_SPDIF_FORMAT_RAW_MAIN); @@ -1145,8 +1161,10 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption (amp_config._u.pADEC.ucFrameIn == AMP_ADEC_STEAM) ? "StreamIn" : "FrameIn"); amp_log(socPlayerInfo->pip ? 1:0, "amp_create_pipeline_bottom_half 4 in, AVP_START"); +ALOGD("%s:%d", __FUNCTION__, __LINE__); AMP_RPC(ret, AMP_ADEC_Open, socPlayerInfo->amp_adec, &_config); assert(ret == SUCCESS); +ALOGD("%s:%d", __FUNCTION__, __LINE__); } if (socPlayerInfo->playerConfig.video_enable) { @@ -1154,7 +1172,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption ret = AMP_ConnectComp(socPlayerInfo->amp_vdec, 0, socPlayerInfo->amp_vout, 0); assert(ret == SUCCESS); } - +ALOGD("%s:%d", __FUNCTION__, __LINE__); if(socPlayerInfo->playerConfig.audio_enable) { //??? audio ???? if (PREPARE_PASSTHROUGH) { @@ -1174,6 +1192,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption ret = AMP_ConnectComp(socPlayerInfo->amp_adec, 0, socPlayerInfo->amp_aren, 1); assert(ret == SUCCESS); } +ALOGD("%s:%d", __FUNCTION__, __LINE__); if (PREPARE_PASSTHROUGH) { AMP_AREN_PARAST para_st; @@ -1209,6 +1228,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption assert(ret == SUCCESS); } } +ALOGD("%s:%d", __FUNCTION__, __LINE__); if (socPlayerInfo->playerConfig.video_enable) { AmpMemClear(&output_config, sizeof(AMP_DMX_CH_CFG)); @@ -1235,6 +1255,8 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption 0); assert(ret == SUCCESS); } +ALOGD("%s:%d", __FUNCTION__, __LINE__); + if(socPlayerInfo->playerConfig.audio_enable) { //audio ???? @@ -1244,7 +1266,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption output_config.Tag = 0; output_config.uPid = a_pid; output_config.uAlign = 2; - output_config.eESOutputMode = AMP_DMX_ES_OUTPUT_MODE_UNITSTART_ALIGN; +// output_config.eESOutputMode = AMP_DMX_ES_OUTPUT_MODE_UNITSTART_ALIGN; output_config.uBufSize = 1 * 1024 * 1024; output_config.uBufPaddingSize = 16 * 1024; socPlayerInfo->dmx_output_a.uiPortIdx = AMP_DMX_ANY_PORT_IDX; @@ -1260,6 +1282,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption AMP_RPC(ret, AMP_DMX_ChannelControl, socPlayerInfo->amp_dmx, &socPlayerInfo->dmx_output_a, AMP_DMX_CH_CTRL_ON, 0); assert(ret == SUCCESS); } +ALOGD("%s:%d", __FUNCTION__, __LINE__); AmpMemClear(&output_config, sizeof(AMP_DMX_CH_CFG)); AmpMemClear(&socPlayerInfo->dmx_output_p, sizeof(AMP_DMX_CHNL_ST)); @@ -1290,6 +1313,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption VIDEO_USER_DATA_TYPE_CC, AMP_VDEC_IOPARAM_USER_DATA_ENABLE); assert(ret == SUCCESS); } +ALOGD("%s:%d", __FUNCTION__, __LINE__); if(socPlayerInfo->playerConfig.video_enable) { // && socPlayerInfo->pip) { if (socPlayerInfo->playerConfig.clock_recovery_enable) { //???????? EOS???? ??? @@ -1308,6 +1332,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption AMP_EVENT_API_VOUT_CALLBACK_FIRST_FRAME); assert(ret == SUCCESS); } +ALOGD("%s:%d", __FUNCTION__, __LINE__); if(!socPlayerInfo->playerConfig.video_enable) { // jung2604 : ????a?θ?..????.. kec ???? ????? ???.. if(socPlayerInfo->playerConfig.audio_enable) { @@ -1317,6 +1342,7 @@ void amp_create_pipeline_bottom_half(AVP_HANDLE *player, BOOL enableCloseCaption assert(ret == SUCCESS); } } +ALOGD("%s:%d", __FUNCTION__, __LINE__); } //pipeline ????.. @@ -2482,6 +2508,7 @@ HRESULT clk_pause_resume(AVP_HANDLE *player, BOOL enable) { } */ +#if 0 if (TRUE == enable) { // pause //AMP_RPC(ret, AMP_CLK_SetState, socPlayerInfo->amp_clk, AMP_PAUSED); @@ -2495,6 +2522,7 @@ HRESULT clk_pause_resume(AVP_HANDLE *player, BOOL enable) { //AMP_RPC(ret, AMP_CLK_SetState, socPlayerInfo->amp_clk, AMP_EXECUTING); ALOGD("clk_pause_resume Video Resumed\n"); } +#endif return ret; } @@ -2527,6 +2555,7 @@ unsigned short convertAvpCodecToSocCodec(int type, int avpCodec) { return AMP_MS11_DDC; } else if (avpCodec == AVP_CODEC_AUDIO_AAC) { return AMP_HE_AAC; + // return AMP_MS11_DDT; } else if (avpCodec == AVP_CODEC_AUDIO_AC3) { return AMP_MS11_DDC; }