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

Commit 0cc39e3a authored by Apurupa Pattapu's avatar Apurupa Pattapu Committed by Ricardo Cerqueira
Browse files

frameworks/base/nuplayer: Fixes to enable HTTP live streaming



- Enable QCOM specifc color formats in ACodec
- Do not skip lines without /n, in M3U Parser
- Stop scanning sources until reset is handled in NuPlayer.

Patchset 1: Add QCOM_HARDWARE ifdefs.

Conflicts:

	media/libstagefright/ACodec.cpp

Change-Id: Ie7e902c0cd56e7aec17d0ac67d2869a7819770cd
Signed-off-by: default avatarEvan McClain <aeroevan@gmail.com>
parent 334900fa
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -588,6 +588,9 @@ void NuPlayer::finishFlushIfPossible() {
void NuPlayer::finishReset() {
    CHECK(mAudioDecoder == NULL);
    CHECK(mVideoDecoder == NULL);
    // Make sure we don't continue to scan sources until we finish reset
    ++mScanSourcesGeneration;
    mScanSourcesPending = false;

    ++mScanSourcesGeneration;
    mScanSourcesPending = false;
+19 −0
Original line number Diff line number Diff line
@@ -13,6 +13,9 @@
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*--------------------------------------------------------------------------
Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
--------------------------------------------------------------------------*/

//#define LOG_NDEBUG 0
#define LOG_TAG "ACodec"
@@ -37,6 +40,7 @@
#include <OMX_Component.h>
#ifdef QCOM_HARDWARE
#include <OMX_QCOMExtns.h>
#include <gralloc_priv.h>
#endif

namespace android {
@@ -441,11 +445,21 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {
        return err;
    }

#ifdef QCOM_HARDWARE
    int format = (def.format.video.eColorFormat == (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka)?
                 HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED : def.format.video.eColorFormat;
#endif

    err = native_window_set_buffers_geometry(
            mNativeWindow.get(),
            def.format.video.nFrameWidth,
            def.format.video.nFrameHeight,
#ifdef QCOM_HARDWARE
            format);
#else
            def.format.video.eColorFormat);
#endif


    if (err != 0) {
        LOGE("native_window_set_buffers_geometry failed: %s (%d)",
@@ -997,7 +1011,12 @@ status_t ACodec::setSupportedOutputFormat() {
           || format.eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar
           || format.eColorFormat == OMX_COLOR_FormatCbYCrY
           || format.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
#ifdef QCOM_HARDWARE
           || format.eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_QCOM_COLOR_FormatYVU420SemiPlanar
           || format.eColorFormat ==  (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka);
#else
           || format.eColorFormat == OMX_QCOM_COLOR_FormatYVU420SemiPlanar);
#endif

    return mOMX->setParameter(
            mNode, OMX_IndexParamVideoPortFormat,
+0 −3
Original line number Diff line number Diff line
@@ -157,9 +157,6 @@ status_t M3UParser::parse(const void *_data, size_t size) {
        while (offsetLF < size && data[offsetLF] != '\n') {
            ++offsetLF;
        }
        if (offsetLF >= size) {
            break;
        }

        AString line;
        if (offsetLF > offset && data[offsetLF - 1] == '\r') {