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

Commit 0024245e authored by Andreas Huber's avatar Andreas Huber
Browse files

Squashed commit of the following:

commit 374ea382ee3a9e3ce17e4c6357fc40d02e362810
Author: Andreas Huber <andih@google.com>
Date:   Tue Jul 28 09:54:13 2009 -0700

    PV's OMX implementation now uses (spec-compliant) microseconds instead of milliseconds in buffer timestamps.

commit 8d02f8ab5d7b022ad4ad34db2a9bdeea6ce2acfe
Author: Andreas Huber <andih@google.com>
Date:   Mon Jul 27 14:24:26 2009 -0700

    Support for using an overlay for video playback on TI hardware.

    Appears to be currently constrained to CbYCrY 16-bit colorspace.

commit d17f321cb4b15c1fea378f33a7ef5998f23dd0fc
Author: Andreas Huber <andih@google.com>
Date:   Mon Jul 27 09:45:38 2009 -0700

    Added '--audio-only' commandline option to stagefright tool.

commit d8beef6be5c668c46451446d87e622933371cd75
Author: Andreas Huber <andih@google.com>
Date:   Fri Jul 24 13:35:00 2009 -0700

    Generalize the various workarounds for OMX nodes with their own unique interpretation of the spec.

commit c7dfd53eeadf8ed5a39bf2b19b014dcd62f3324d
Author: Andreas Huber <andih@google.com>
Date:   Thu Jul 23 16:06:36 2009 -0700

    Fixed erroneous TI AAC decoder behaviour wrt shutdown.

    The AAC decoder appears to not return out buffers on an Executing->Idle transition, implemented a workaround that does a flush on all ports followed by the Executing->Idle. Oh, and flush with OMX_ALL doesn't properly work either. Fun.

commit d6377282e75060881336578f166f9c7feacf3f8f
Author: Andreas Huber <andih@google.com>
Date:   Thu Jul 23 14:06:50 2009 -0700

    Apparently the "channels" parameter in AudioTrack's constructor no longer counts channels but is a bitmask of enabled destinations, update the code accordingly.

commit ff698c79e851a2e57d362e9c3a09828af4048087
Author: Andreas Huber <andih@google.com>
Date:   Wed Jul 22 16:54:44 2009 -0700

    Fix MPEG4 decoding using TI's hardware decoder that I broke earlier...

commit 2ef78bb87cd856eb7f0b3d7dd68782a8650c12bf
Author: Andreas Huber <andih@google.com>
Date:   Wed Jul 22 15:43:18 2009 -0700

    Now that the qcom decoder properly advertises its own custom colorspace, update dependent code to reflect this fact.

commit bbaec96910727080fd7c8a6907c04facb9f5220f
Author: Andreas Huber <andih@google.com>
Date:   Wed Jul 22 14:32:03 2009 -0700

    Finishing up previous, incomplete change.

commit 76f14a1ae816b6f434771f8d12bdad81196f351e
Author: Andreas Huber <andih@google.com>
Date:   Wed Jul 22 14:25:17 2009 -0700

    The TI video decoder now properly decoder AVC/H.264 content.

commit e106130d8c100d5c94603e43864a7a93cca10252
Author: Andreas Huber <andih@google.com>
Date:   Wed Jul 22 08:56:04 2009 -0700

    Experimental support for the TI H.264 decoder, various modifications to OMXDecoder, non-functional still.

commit 241c3062dec3447db1a1ee74558cb4b9098fc404
Author: Andreas Huber <andih@google.com>
Date:   Tue Jul 21 12:13:09 2009 -0700

    Enable TI hardware OMX decoders (except for AVC/H.264 which still has issues).

    This particular set of OMX nodes does not appear to properly return our buffers when sending the "disable" command on a port. Rather it reqires manually flushing that port and _then_ disabling it instead.

commit 1c34506a46e32ce25f2a86f3b4250dcfc037356a
Author: Andreas Huber <andih@google.com>
Date:   Tue Jul 21 08:51:35 2009 -0700

    Make it simpler to switch between the stagefright player and PVPlayer.

commit 249c6de05671d403f8dd51f095d49bf190430c9c
Author: Andreas Huber <andih@google.com>
Date:   Mon Jul 20 14:38:15 2009 -0700

    Prepare to use soon-to-be-available hardware decoders in the OMX decoder.
parent 9a92037b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -119,7 +119,8 @@ int main(int argc, char **argv) {
    enc_meta->setInt32(kKeyWidth, width);
    enc_meta->setInt32(kKeyHeight, height);

    OMXDecoder *encoder = OMXDecoder::CreateEncoder(&client, enc_meta);
    OMXDecoder *encoder =
        OMXDecoder::Create(&client, enc_meta, true /* createEncoder */);

    encoder->setSource(decoder);
    // encoder->setSource(meta, new DummySource(width, height));
+10 −1
Original line number Diff line number Diff line
@@ -102,6 +102,7 @@ static int64_t getNowUs() {
int main(int argc, char **argv) {
    android::ProcessState::self()->startThreadPool();

    bool audioOnly = false;
    if (argc > 1 && !strcmp(argv[1], "--list")) {
        sp<IServiceManager> sm = defaultServiceManager();
        sp<IBinder> binder = sm->getService(String16("media.player"));
@@ -121,6 +122,10 @@ int main(int argc, char **argv) {
        }

        return 0;
    } else if (argc > 1 && !strcmp(argv[1], "--audio")) {
        audioOnly = true;
        ++argv;
        --argc;
    }

#if 0
@@ -149,7 +154,11 @@ int main(int argc, char **argv) {
        const char *mime;
        meta->findCString(kKeyMIMEType, &mime);

        if (!strncasecmp(mime, "video/", 6)) {
        if (audioOnly && !strncasecmp(mime, "audio/", 6)) {
            break;
        }

        if (!audioOnly && !strncasecmp(mime, "video/", 6)) {
            break;
        }
    }
+32 −10
Original line number Diff line number Diff line
@@ -26,6 +26,8 @@
#include <utils/List.h>
#include <utils/threads.h>

#include <OMX_Video.h>

namespace android {

class OMXMediaBuffer;
@@ -35,10 +37,8 @@ class OMXDecoder : public MediaSource,
                   public MediaBufferObserver {
public:
    static OMXDecoder *Create(
            OMXClient *client, const sp<MetaData> &data);

    static OMXDecoder *CreateEncoder(
            OMXClient *client, const sp<MetaData> &data);
            OMXClient *client, const sp<MetaData> &data,
            bool createEncoder = false);

    virtual ~OMXDecoder();

@@ -71,7 +71,19 @@ private:
        kPortStatusActive             = 0,
        kPortStatusDisabled           = 1,
        kPortStatusShutdown           = 2,
        kPortStatusFlushing = 3
        kPortStatusFlushing           = 3,
        kPortStatusFlushingToDisabled = 4,
        kPortStatusFlushingToShutdown = 5,
    };

    enum Quirks {
        kWantsRawNALFrames                   = 1,
        kDoesntReturnBuffersOnDisable        = 2,
        kDoesntFlushOnExecutingToIdle        = 4,
        kDoesntProperlyFlushAllPortsAtOnce   = 8,
        kRequiresAllocateBufferOnInputPorts  = 16,
        kRequiresAllocateBufferOnOutputPorts = 32,
        kRequiresLoadedToIdleAfterAllocation = 64
    };

    OMXClient *mClient;
@@ -79,6 +91,8 @@ private:
    IOMX::node_id mNode;
    char *mComponentName;
    bool mIsMP3;
    bool mIsAVC;
    uint32_t mQuirks;

    MediaSource *mSource;
    sp<MetaData> mOutputFormat;
@@ -116,7 +130,8 @@ private:
    bool mReachedEndOfInput;

    OMXDecoder(OMXClient *client, IOMX::node_id node,
               const char *mime, const char *codec);
               const char *mime, const char *codec,
               uint32_t quirks);

    void setPortStatus(OMX_U32 port_index, PortStatus status);
    PortStatus getPortStatus(OMX_U32 port_index) const;
@@ -125,7 +140,13 @@ private:

    void setAMRFormat();
    void setAACFormat();
    void setVideoOutputFormat(OMX_U32 width, OMX_U32 height);

    status_t setVideoPortFormatType(
            OMX_U32 portIndex,
            OMX_VIDEO_CODINGTYPE compressionFormat,
            OMX_COLOR_FORMATTYPE colorFormat);

    void setVideoOutputFormat(const char *mime, OMX_U32 width, OMX_U32 height);
    void setup();
    void dumpPortDefinition(OMX_U32 port_index);

@@ -144,6 +165,7 @@ private:

    void freeInputBuffer(IOMX::buffer_id buffer);
    void freeOutputBuffer(IOMX::buffer_id buffer);
    void freePortBuffers(OMX_U32 port_index);

    void postStart();
    void postEmptyBufferDone(IOMX::buffer_id buffer);
+58 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef TI_HARDWARE_RENDERER_H_

#define TI_HARDWARE_RENDERER_H_

#include <media/stagefright/VideoRenderer.h>
#include <utils/RefBase.h>
#include <utils/Vector.h>

namespace android {

class ISurface;
class Overlay;

class TIHardwareRenderer : public VideoRenderer {
public:
    TIHardwareRenderer(
            const sp<ISurface> &surface,
            size_t displayWidth, size_t displayHeight,
            size_t decodedWidth, size_t decodedHeight);

    virtual ~TIHardwareRenderer();

    virtual void render(
            const void *data, size_t size, void *platformPrivate);

private:
    sp<ISurface> mISurface;
    size_t mDisplayWidth, mDisplayHeight;
    size_t mDecodedWidth, mDecodedHeight;
    size_t mFrameSize;
    sp<Overlay> mOverlay;
    Vector<void *> mOverlayAddresses;
    size_t mIndex;

    TIHardwareRenderer(const TIHardwareRenderer &);
    TIHardwareRenderer &operator=(const TIHardwareRenderer &);
};

}  // namespace android

#endif  // TI_HARDWARE_RENDERER_H_
+2 −0
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@
#include <media/PVPlayer.h>
#include "TestPlayerStub.h"

//#undef USE_STAGEFRIGHT

#if USE_STAGEFRIGHT
#include "StagefrightPlayer.h"
#endif
Loading