Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1279348 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

stagefright: Fix issues with software decoders

 * Fix MKV thumbnails
 * Fix VC1 thumbnails
 * Fix FFMPEG thumbnails
 * Fix trial decoder
 * Fix edge cases with WMV3/VC1 playback
 * Fix a state issue which caused some codecs to get wrong configuration

Change-Id: I09599166aa24bcff53f91e43de096c4fad8ca7ad
Ticket: CYNGNOS-325
parent 4fbc83f6
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ enum {
    kKeyBitRate           = 'brte',  // int32_t (bps)
    kKeyCodecId           = 'cdid',  // int32_t
    kKeyBitsPerSample     = 'sbit',  // int32_t (DUPE of kKeySampleBits)
    kKeyCodedSampleBits   = 'cosb',  // int32_t
    kKeySampleFormat      = 'sfmt',  // int32_t
    kKeyESDS              = 'esds',  // raw data
    kKeyAACProfile        = 'aacp',  // int32_t
+0 −4
Original line number Diff line number Diff line
@@ -1265,12 +1265,8 @@ status_t ACodec::setComponentRole(
            "video_decoder.mpeg2", "video_encoder.mpeg2" },
        { MEDIA_MIMETYPE_AUDIO_AC3,
            "audio_decoder.ac3", "audio_encoder.ac3" },
#ifdef ENABLE_AV_ENHANCEMENTS			
#ifdef DTS_CODEC_M_
        { MEDIA_MIMETYPE_AUDIO_DTS,
            "audio_decoder.dts", "audio_encoder.dts" },
#endif
#endif
        { MEDIA_MIMETYPE_AUDIO_EAC3,
            "audio_decoder.eac3", "audio_encoder.eac3" },
#ifdef ENABLE_AV_ENHANCEMENTS
+2 −2
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ endif
endif

ifeq ($(TARGET_BOARD_PLATFORM),omap4)
LOCAL_CFLAGS := -DBOARD_CANT_REALLOCATE_OMX_BUFFERS
LOCAL_CFLAGS += -DBOARD_CANT_REALLOCATE_OMX_BUFFERS
endif

#QTI FLAC Decoder
@@ -149,7 +149,7 @@ LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_EXTN_FLAC_DECODER)),true)
LOCAL_SRC_FILES += FLACDecoder.cpp
LOCAL_C_INCLUDES += $(TARGET_OUT_HEADERS)/mm-audio/audio-flac
LOCAL_CFLAGS := -DQTI_FLAC_DECODER
LOCAL_CFLAGS += -DQTI_FLAC_DECODER
endif
endif

+1 −1
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static const MetaKeyEntry MetaKeyTable[] {
   {kKeyCodecId              , "codec-id"               , INT32},
   {kKeySampleFormat         , "sample-format"          , INT32},
   {kKeyBlockAlign           , "block-align"            , INT32},

   {kKeyCodedSampleBits      , "coded-sample-bits"      , INT32},
   {kKeyAACAOT               , "aac-profile"            , INT32},
   {kKeyRVVersion            , "rv-version"             , INT32},
   {kKeyWMAVersion           , "wma-version"            , INT32},  // int32_t
+19 −2
Original line number Diff line number Diff line
@@ -60,6 +60,11 @@ void FFMPEGSoftCodec::convertMessageToMetaData(
    if (msg->findInt32("bitrate", &bitrate)) {
        meta->setInt32(kKeyBitRate, bitrate);
    }

    int32_t codedSampleBits;
    if (msg->findInt32("coded-sample-bits", &codedSampleBits)) {
        meta->setInt32(kKeyCodedSampleBits, codedSampleBits);
    }
}

template<class T>
@@ -357,6 +362,8 @@ status_t FFMPEGSoftCodec::setSupportedRole(
          "video_decoder.divx", NULL },
        { MEDIA_MIMETYPE_VIDEO_WMV,
          "video_decoder.wmv",  NULL },
        { MEDIA_MIMETYPE_VIDEO_VC1,
          "video_decoder.vc1", NULL },
        { MEDIA_MIMETYPE_VIDEO_RV,
          "video_decoder.rv", NULL },
        { MEDIA_MIMETYPE_VIDEO_FLV1,
@@ -411,7 +418,7 @@ status_t FFMPEGSoftCodec::setSupportedRole(
status_t FFMPEGSoftCodec::setWMVFormat(
        const sp<AMessage> &msg, sp<IOMX> OMXhandle, IOMX::node_id nodeID)
{
    int32_t version = kTypeWMVVer_7;
    int32_t version = -1;
    OMX_VIDEO_PARAM_WMVTYPE paramWMV;

    if (!msg->findInt32(ExtendedCodec::getMsgKey(kKeyWMVVersion), &version)) {
@@ -587,6 +594,8 @@ status_t FFMPEGSoftCodec::setWMAFormat(
    int32_t sampleRate = 0;
    int32_t blockAlign = 0;
    int32_t formattag = 0;
    int32_t bitsPerSample = 0;

    OMX_AUDIO_PARAM_WMATYPE paramWMA;

    CHECK(msg->findInt32(ExtendedCodec::getMsgKey(kKeyChannelCount), &numChannels));
@@ -600,6 +609,11 @@ status_t FFMPEGSoftCodec::setWMAFormat(
        }
    }

    // mm-parser may want a different bit depth
    if (msg->findInt32(ExtendedCodec::getMsgKey(kKeyWMABitspersample), &bitsPerSample)) {
        msg->setInt32("bits-per-sample", bitsPerSample);
    }

    ALOGV("Channels: %d, SampleRate: %d, BitRate: %d, blockAlign: %d",
            numChannels, sampleRate, bitRate, blockAlign);

@@ -884,6 +898,7 @@ status_t FFMPEGSoftCodec::setFFmpegAudioFormat(
    int32_t sampleRate = 0;
    int32_t blockAlign = 0;
    int32_t sampleFormat = 0;
    int32_t codedSampleBits = 0;
    OMX_AUDIO_PARAM_FFMPEGTYPE param;

    ALOGD("setFFmpegAudioFormat");
@@ -895,6 +910,8 @@ status_t FFMPEGSoftCodec::setFFmpegAudioFormat(
    msg->findInt32(ExtendedCodec::getMsgKey(kKeyBitsPerSample), &bitsPerSample);
    msg->findInt32(ExtendedCodec::getMsgKey(kKeySampleRate), &sampleRate);
    msg->findInt32(ExtendedCodec::getMsgKey(kKeyBlockAlign), &blockAlign);
    msg->findInt32(ExtendedCodec::getMsgKey(kKeyBitsPerSample), &bitsPerSample);
    msg->findInt32(ExtendedCodec::getMsgKey(kKeyCodedSampleBits), &codedSampleBits);

    status_t err = setRawAudioFormat(msg, OMXhandle, nodeID);
    if (err != OK)
@@ -911,7 +928,7 @@ status_t FFMPEGSoftCodec::setFFmpegAudioFormat(
    param.eCodecId       = codec_id;
    param.nChannels      = numChannels;
    param.nBitRate       = bitRate;
    param.nBitsPerSample = bitsPerSample;
    param.nBitsPerSample = codedSampleBits;
    param.nSampleRate    = sampleRate;
    param.nBlockAlign    = blockAlign;
    param.eSampleFormat  = sampleFormat;
Loading