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

Commit b7e75437 authored by Lajos Molnar's avatar Lajos Molnar Committed by android-build-merger
Browse files

Merge changes I58b03acd,I7d7eb086 into nyc-dev

am: 0d0a8b48

* commit '0d0a8b48':
  stagefright: untangle metadata-mode handling
  stagefright: add a way to update native handle in OMX buffers

Change-Id: I857573724b0a4f7b38832777b12caa8666ac210b
parents 38616ced 0d0a8b48
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
	frameworks/av/media/libstagefright \
	$(TOP)/frameworks/native/include/media/openmax
	$(TOP)/frameworks/native/include/media/openmax \
	$(TOP)/frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
@@ -63,7 +64,8 @@ LOCAL_SHARED_LIBRARIES := \

LOCAL_C_INCLUDES:= \
	frameworks/av/media/libstagefright \
	$(TOP)/frameworks/native/include/media/openmax
	$(TOP)/frameworks/native/include/media/openmax \
	$(TOP)/frameworks/native/include/media/hardware

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
LOCAL_CLANG := true
+8 −3
Original line number Diff line number Diff line
@@ -118,6 +118,10 @@ public:
            node_id node, OMX_U32 port_index,
            const sp<GraphicBuffer> &graphicBuffer, buffer_id buffer) = 0;

    virtual status_t updateNativeHandleInMeta(
            node_id node, OMX_U32 port_index,
            const sp<NativeHandle> &nativeHandle, buffer_id buffer) = 0;

    // This will set *type to resulting metadata buffer type on OMX error (not on binder error) as
    // well as on success.
    virtual status_t createInputSurface(
@@ -272,17 +276,18 @@ struct CodecProfileLevel {
    OMX_U32 mLevel;
};

}  // namespace android

inline static const char *asString(android::MetadataBufferType i, const char *def = "??") {
inline static const char *asString(MetadataBufferType i, const char *def = "??") {
    using namespace android;
    switch (i) {
        case kMetadataBufferTypeCameraSource:   return "CameraSource";
        case kMetadataBufferTypeGrallocSource:  return "GrallocSource";
        case kMetadataBufferTypeANWBuffer:      return "ANWBuffer";
        case kMetadataBufferTypeNativeHandleSource: return "NativeHandleSource";
        case kMetadataBufferTypeInvalid:        return "Invalid";
        default:                                return def;
    }
}

}  // namespace android

#endif  // ANDROID_IOMX_H_
+4 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@
#include <utils/List.h>
#include <utils/RefBase.h>
#include <utils/String16.h>
#include <MetadataBufferType.h>

namespace android {

@@ -118,11 +119,11 @@ public:
     * Tell whether this camera source stores meta data or real YUV
     * frame data in video buffers.
     *
     * @return true if meta data is stored in the video
     *      buffers; false if real YUV data is stored in
     * @return a valid type if meta data is stored in the video
     *      buffers; kMetadataBufferTypeInvalid if real YUV data is stored in
     *      the video buffers.
     */
    bool isMetaDataStoredInVideoBuffers() const;
    MetadataBufferType metaDataStoredInVideoBuffers() const;

    virtual void signalBufferReturned(MediaBuffer* buffer);

+0 −1
Original line number Diff line number Diff line
@@ -37,7 +37,6 @@ struct MediaCodecSource : public MediaSource,
                          public MediaBufferObserver {
    enum FlagBits {
        FLAG_USE_SURFACE_INPUT      = 1,
        FLAG_USE_METADATA_INPUT     = 2,
        FLAG_PREFER_SOFTWARE_CODEC  = 4,  // used for testing only
    };

+8 −3
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@
#include <media/stagefright/MediaSource.h>
#include <media/stagefright/MediaBuffer.h>

#include <MetadataBufferType.h>

#include "foundation/ABase.h"

namespace android {
@@ -109,9 +111,9 @@ public:
    void dump(String8& result, const char* prefix, char* buffer,
                                                    size_t SIZE) const;

    // isMetaDataStoredInVideoBuffers tells the encoder whether we will
    // pass metadata through the buffers. Currently, it is force set to true
    bool isMetaDataStoredInVideoBuffers() const;
    // metaDataStoredInVideoBuffers tells the encoder what kind of metadata
    // is passed through the buffers. Currently, it is set to ANWBuffer
    MetadataBufferType metaDataStoredInVideoBuffers() const;

    sp<IGraphicBufferProducer> getProducer() const { return mProducer; }

@@ -234,6 +236,9 @@ private:

    Condition mMediaBuffersAvailableCondition;

    // Allocate and return a new MediaBuffer and pass the ANW buffer as metadata into it.
    void passMetadataBuffer_l(MediaBuffer **buffer, ANativeWindowBuffer *bufferHandle) const;

    // Avoid copying and equating and default constructor
    DISALLOW_EVIL_CONSTRUCTORS(SurfaceMediaSource);
};
Loading