diff options
Diffstat (limited to 'media/libstagefright/QCOMXCodec.cpp')
-rw-r--r-- | media/libstagefright/QCOMXCodec.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/media/libstagefright/QCOMXCodec.cpp b/media/libstagefright/QCOMXCodec.cpp index 0d5768a..fcc57f2 100644 --- a/media/libstagefright/QCOMXCodec.cpp +++ b/media/libstagefright/QCOMXCodec.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2013, 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 @@ -45,6 +45,7 @@ #include <OMX_Component.h> #include <QOMX_AudioExtensions.h> +#include "include/avc_utils.h" namespace android { @@ -589,4 +590,21 @@ void QCOMXCodec::setQCSpecificVideoFormat(const sp<MetaData> &meta, sp<IOMX> OMX } } +void QCOMXCodec::checkIfInterlaced(const uint8_t *ptr, const sp<MetaData> &meta) +{ + uint16_t spsSize = (((uint16_t)ptr[6]) << 8) + (uint16_t)(ptr[7]); + int32_t width = 0, height = 0, isInterlaced = 0; + const uint8_t *spsStart = &ptr[8]; + + sp<ABuffer> seqParamSet = new ABuffer(spsSize); + memcpy(seqParamSet->data(), spsStart, spsSize); + FindAVCDimensions(seqParamSet, &width, &height, &isInterlaced); + + ALOGV("height is %d, width is %d, isInterlaced is %d\n", height, width, isInterlaced); + if (isInterlaced) { + meta->setInt32(kKeyUseArbitraryMode, 1); + } + return; +} + } |