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

Commit 1bb0ffd0 authored by Andreas Huber's avatar Andreas Huber
Browse files

Squashed commit of the following:

commit 0870f7bdd10a7cd36087d723d1957d8e1b967ca7
Author: Andreas Huber <andih@google.com>
Date:   Mon Nov 22 12:57:04 2010 -0800

    set_surface_crop doesn't seem to work right yet, stop using it in the SoftwareRenderer.

    Change-Id: If0a24f78b7810a6cecaa82eb4f23d0f90c22cc42

commit 4767b52bee3a54ae117a8708d6832276a44e6a6a
Author: Andreas Huber <andih@google.com>
Date:   Mon Nov 22 11:14:57 2010 -0800

    info->mMediaBuffer may still be NULL at this point...

    Change-Id: I25a71569015b1bb87f1ea7efff7588958774426f

commit 0cef79874e1f1ddb10b7402177a87d3cffc7de92
Author: Andreas Huber <andih@google.com>
Date:   Mon Nov 22 10:55:12 2010 -0800

    QCOM's YVU420 color format conversion has now been tested.

    Change-Id: I7fef4b642a928af15d42f006f7cdc107d5ff1d67

commit 84fe05a6c969ede0ce8a85a530e110afca07c7a7
Author: Andreas Huber <andih@google.com>
Date:   Mon Nov 22 09:59:50 2010 -0800

    Removed remaining traces of suspend/resume. Proper reporting of video dimensions based on cropping rectangle.

    Change-Id: Ib238b80cbc1f19e7d312f2422eb5e9ab6b06b1bc

commit 50970cdc837c5c498bcf0cb61b436196ca9e2ef7
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 16:11:06 2010 -0800

    Revamped Software Renderer respects the crop rectangle.

    Removed obsolete ADRENO support code.

    Change-Id: I984cbc8a99c4d97e09e7d1b1292099c88b9ae535

commit 8abbc6a5608bff650f968540f24a2eab75f254ed
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 16:10:41 2010 -0800

    The metadata retriever now respects the crop rectangle while capturing a video frame.

    Change-Id: Id3377176060086d16717f62c77ce26fabe899050

commit 2d42e4466609d304e88bd2cdd6eb7b297340cc21
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 16:09:50 2010 -0800

    Changed ColorConverter APIs to be more general.

    Clients can now refer to crop rectangles in both source and destination.

    Change-Id: Ief151d736818396d0389ec04e7df5650e3ad7c04

commit 273184303d54a54febd3e9c3dd4df30507ea78b5
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 15:04:06 2010 -0800

    The stagefright commandline tool now writes the extracted video frame to /sdcard/out.jpg

    Change-Id: Ieb2ab3fda7a7cd9294beccb8db0eed75096eeef4

commit 2d43390328cadf4ba94c1c3c02e4fb30baa29690
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 14:36:55 2010 -0800

    The AVC software decoder now properly advertises the cropping rectangle.

    Change-Id: Idb7a8a7e2fde5740f0fc34b7e8c92eca2577104b

commit 9a7ed23c2fac8ce19dce7a34a603acee945a89f6
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 13:40:39 2010 -0800

    OMXCodec now signals a format change if the cropping rectangle changes.

    ...and puts the cropping info into its output format.

    Change-Id: I3ffbd8e877ba286fe06a82c536ef20d92548d2e2

commit efe0323947029df1c502599ccc288c8d676dfd31
Author: Andreas Huber <andih@google.com>
Date:   Fri Nov 19 11:29:39 2010 -0800

    Stagefright's MetaData object now supports rectangle items.

    Change-Id: I5667bb5ee6622c76104b99fb57f60abb802a8504

Change-Id: I27cb78f2c5e0353f95fdfc5cb53991949ed75b70
parent 1ca56263
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -7,13 +7,16 @@ LOCAL_SRC_FILES:= \
	SineSource.cpp

LOCAL_SHARED_LIBRARIES := \
	libstagefright libmedia libutils libbinder libstagefright_foundation
	libstagefright libmedia libutils libbinder libstagefright_foundation \
        libskia

LOCAL_C_INCLUDES:= \
	$(JNI_H_INCLUDE) \
	frameworks/base/media/libstagefright \
	frameworks/base/media/libstagefright/include \
	$(TOP)/frameworks/base/include/media/stagefright/openmax
	$(TOP)/frameworks/base/include/media/stagefright/openmax \
        external/skia/include/core \
        external/skia/include/images \

LOCAL_CFLAGS += -Wno-multichar

+17 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@
#include <media/stagefright/MPEG2TSWriter.h>
#include <media/stagefright/MPEG4Writer.h>

#include <private/media/VideoFrame.h>
#include <SkBitmap.h>
#include <SkImageEncoder.h>

#include <fcntl.h>

using namespace android;
@@ -681,6 +685,19 @@ int main(int argc, char **argv) {

            if (mem != NULL) {
                printf("captureFrame(%s) => OK\n", filename);

                VideoFrame *frame = (VideoFrame *)mem->pointer();

                SkBitmap bitmap;
                bitmap.setConfig(
                        SkBitmap::kRGB_565_Config, frame->mWidth, frame->mHeight);

                bitmap.setPixels((uint8_t *)frame + sizeof(VideoFrame));

                CHECK(SkImageEncoder::EncodeFile(
                            "/sdcard/out.jpg", bitmap,
                            SkImageEncoder::kJPEG_Type,
                            SkImageEncoder::kDefaultQuality));
            } else {
                mem = retriever->extractAlbumArt();

+27 −15
Original line number Diff line number Diff line
@@ -33,35 +33,47 @@ struct ColorConverter {
    bool isValid() const;

    void convert(
            size_t width, size_t height,
            const void *srcBits, size_t srcSkip,
            void *dstBits, size_t dstSkip);
            const void *srcBits,
            size_t srcWidth, size_t srcHeight,
            size_t srcCropLeft, size_t srcCropTop,
            size_t srcCropRight, size_t srcCropBottom,
            void *dstBits,
            size_t dstWidth, size_t dstHeight,
            size_t dstCropLeft, size_t dstCropTop,
            size_t dstCropRight, size_t dstCropBottom);

private:
    struct BitmapParams {
        BitmapParams(
                void *bits,
                size_t width, size_t height,
                size_t cropLeft, size_t cropTop,
                size_t cropRight, size_t cropBottom);

        size_t cropWidth() const;
        size_t cropHeight() const;

        void *mBits;
        size_t mWidth, mHeight;
        size_t mCropLeft, mCropTop, mCropRight, mCropBottom;
    };

    OMX_COLOR_FORMATTYPE mSrcFormat, mDstFormat;
    uint8_t *mClip;

    uint8_t *initClip();

    void convertCbYCrY(
            size_t width, size_t height,
            const void *srcBits, size_t srcSkip,
            void *dstBits, size_t dstSkip);
            const BitmapParams &src, const BitmapParams &dst);

    void convertYUV420Planar(
            size_t width, size_t height,
            const void *srcBits, size_t srcSkip,
            void *dstBits, size_t dstSkip);
            const BitmapParams &src, const BitmapParams &dst);

    void convertQCOMYUV420SemiPlanar(
            size_t width, size_t height,
            const void *srcBits, size_t srcSkip,
            void *dstBits, size_t dstSkip);
            const BitmapParams &src, const BitmapParams &dst);

    void convertYUV420SemiPlanar(
            size_t width, size_t height,
            const void *srcBits, size_t srcSkip,
            void *dstBits, size_t dstSkip);
            const BitmapParams &src, const BitmapParams &dst);

    ColorConverter(const ColorConverter &);
    ColorConverter &operator=(const ColorConverter &);
+19 −0
Original line number Diff line number Diff line
@@ -32,6 +32,10 @@ enum {
    kKeyMIMEType          = 'mime',  // cstring
    kKeyWidth             = 'widt',  // int32_t
    kKeyHeight            = 'heig',  // int32_t

    // a rectangle, if absent assumed to be (0, 0, width - 1, height - 1)
    kKeyCropRect          = 'crop',

    kKeyRotation          = 'rotA',  // int32_t (angle in degrees)
    kKeyIFramesInterval   = 'ifiv',  // int32_t
    kKeyStride            = 'strd',  // int32_t
@@ -125,6 +129,7 @@ public:
        TYPE_INT64    = 'in64',
        TYPE_FLOAT    = 'floa',
        TYPE_POINTER  = 'ptr ',
        TYPE_RECT     = 'rect',
    };

    void clear();
@@ -136,12 +141,22 @@ public:
    bool setFloat(uint32_t key, float value);
    bool setPointer(uint32_t key, void *value);

    bool setRect(
            uint32_t key,
            int32_t left, int32_t top,
            int32_t right, int32_t bottom);

    bool findCString(uint32_t key, const char **value);
    bool findInt32(uint32_t key, int32_t *value);
    bool findInt64(uint32_t key, int64_t *value);
    bool findFloat(uint32_t key, float *value);
    bool findPointer(uint32_t key, void **value);

    bool findRect(
            uint32_t key,
            int32_t *left, int32_t *top,
            int32_t *right, int32_t *bottom);

    bool setData(uint32_t key, uint32_t type, const void *data, size_t size);

    bool findData(uint32_t key, uint32_t *type,
@@ -187,6 +202,10 @@ private:
        }
    };

    struct Rect {
        int32_t mLeft, mTop, mRight, mBottom;
    };

    KeyedVector<uint32_t, typed_data> mItems;

    // MetaData &operator=(const MetaData &);
+0 −1
Original line number Diff line number Diff line
@@ -31,7 +31,6 @@ LOCAL_SHARED_LIBRARIES := \
	libandroid_runtime    			\
	libstagefright        			\
	libstagefright_omx    			\
	libstagefright_color_conversion         \
	libstagefright_foundation               \
	libsurfaceflinger_client

Loading