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

Commit f48b75f9 authored by Praveen Chavan's avatar Praveen Chavan Committed by Linux Build Service Account
Browse files

Stagefright: Make classes customizable and add AV extensions

Change access modifiers and qualify methods with virtual, to
allow extensions. Add facility for loading customizations
(Extended classes) dynamically.

Conflicts:
	media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp

Change-Id: Icc8965754fb1c73175a13a9ad24c19665ad60988
parent 0eb0c1da
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ namespace android {
struct audio_track_cblk_t;
class AudioTrackClientProxy;
class StaticAudioTrackClientProxy;
struct ExtendedMediaUtils;

// ----------------------------------------------------------------------------

@@ -957,6 +958,7 @@ private:
    pid_t                   mClientPid;

    sp<AudioSystem::AudioDeviceCallback> mDeviceCallback;
    friend struct ExtendedMediaUtils;
};

class TimedAudioTrack : public AudioTrack
+7 −4
Original line number Diff line number Diff line
@@ -93,8 +93,11 @@ struct ACodec : public AHierarchicalStateMachine, public CodecBase {

protected:
    virtual ~ACodec();
    virtual status_t setupCustomCodec(
            status_t err, const char *mime, const sp<AMessage> &msg);
    virtual status_t GetVideoCodingTypeFromMime(
            const char *mime, OMX_VIDEO_CODINGTYPE *codingType);

private:
    struct BaseState;
    struct UninitializedState;
    struct LoadedState;
@@ -300,7 +303,7 @@ private:
            uint32_t portIndex, IOMX::buffer_id bufferID,
            ssize_t *index = NULL);

    status_t setComponentRole(bool isEncoder, const char *mime);
    virtual status_t setComponentRole(bool isEncoder, const char *mime);
    status_t configureCodec(const char *mime, const sp<AMessage> &msg);

    status_t configureTunneledVideoPlayback(int32_t audioHwSync,
@@ -314,7 +317,7 @@ private:

    status_t setSupportedOutputFormat(bool getLegacyFlexibleFormat);

    status_t setupVideoDecoder(
    virtual status_t setupVideoDecoder(
            const char *mime, const sp<AMessage> &msg, bool usingNativeBuffers);

    status_t setupVideoEncoder(
@@ -408,7 +411,7 @@ private:
            bool dropIncomplete = false, FrameRenderTracker::Info *until = NULL);

    void sendFormatChange(const sp<AMessage> &reply);
    status_t getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify);
    virtual status_t getPortFormat(OMX_U32 portIndex, sp<AMessage> &notify);

    void signalError(
            OMX_ERRORTYPE error = OMX_ErrorUndefined,
+66 −0
Original line number Diff line number Diff line
/*Copyright (c) 2015, 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
 * met:
 *     * Redistributions of source code must retain the above copyright
 *      notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 *       copyright notice, this list of conditions and the following
 *       disclaimer in the documentation and/or other materials provided
 *      with the distribution.
 *     * Neither the name of The Linux Foundation nor the names of its
 *      contributors may be used to endorse or promote products derived
 *       from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
 * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef _EXTENDED_MEDIA_DEFS_H_
#define _EXTENDED_MEDIA_DEFS_H_

namespace android {

extern const char *MEDIA_MIMETYPE_AUDIO_EVRC;
extern const char *MEDIA_MIMETYPE_VIDEO_WMV;
extern const char *MEDIA_MIMETYPE_AUDIO_WMA;
extern const char *MEDIA_MIMETYPE_CONTAINER_ASF;
extern const char *MEDIA_MIMETYPE_VIDEO_DIVX;
extern const char *MEDIA_MIMETYPE_CONTAINER_AAC;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCP;
extern const char *MEDIA_MIMETYPE_VIDEO_DIVX311;
extern const char *MEDIA_MIMETYPE_VIDEO_DIVX4;
extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2;
extern const char *MEDIA_MIMETYPE_CONTAINER_3G2;
extern const char *MEDIA_MIMETYPE_AUDIO_DTS;
extern const char *MEDIA_MIMETYPE_AUDIO_DTS_LBR;
extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB_PLUS;
extern const char *MEDIA_MIMETYPE_AUDIO_AIFF;
extern const char *MEDIA_MIMETYPE_AUDIO_ALAC;
extern const char *MEDIA_MIMETYPE_AUDIO_APE;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCAMR_NB;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCAMR_WB;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCWAV;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG2TS;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG2PS;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG4;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCMATROSKA;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCOGG;
extern const char *MEDIA_MIMETYPE_CONTAINER_QCFLV;
extern const char *MEDIA_MIMETYPE_VIDEO_VPX;
extern const char *MEDIA_MIMETYPE_CONTAINER_QTIFLAC;
extern const char *MEDIA_MIMETYPE_VIDEO_MPEG4_DP;

}  // namespace android

#endif // _EXTENDED_MEDIA_DEFS_H_
+2 −0
Original line number Diff line number Diff line
@@ -68,4 +68,6 @@ extern const char *MEDIA_MIMETYPE_DATA_TIMED_ID3;

}  // namespace android

#include <media/stagefright/ExtendedMediaDefs.h>

#endif  // MEDIA_DEFS_H_
+86 −0
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_SRC_FILES:=                          \
        stagefright/ExtendedMediaDefs.cpp  \
        stagefright/AVUtils.cpp            \
        stagefright/AVFactory.cpp          \

LOCAL_C_INCLUDES:= \
        $(TOP)/frameworks/av/include/media/ \
        $(TOP)/frameworks/av/media/libavextensions \
        $(TOP)/frameworks/native/include/media/hardware \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/external/flac/include \
        $(TOP)/hardware/qcom/media/mm-core/inc

LOCAL_CFLAGS += -Wno-multichar

ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS),true)
       LOCAL_CFLAGS += -DENABLE_AV_ENHANCEMENTS
endif

LOCAL_MODULE:= libavextensions

LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_LIBRARY)

########################################################

include $(CLEAR_VARS)

LOCAL_SRC_FILES:=                          \
        media/AVMediaUtils.cpp             \

LOCAL_C_INCLUDES:= \
        $(TOP)/frameworks/av/include/media/ \
        $(TOP)/frameworks/av/media/libavextensions \
        $(TOP)/frameworks/native/include/media/hardware \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/external/flac/include \
        $(TOP)/hardware/qcom/media/mm-core/inc

LOCAL_CFLAGS += -Wno-multichar

ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS),true)
       LOCAL_CFLAGS += -DENABLE_AV_ENHANCEMENTS
endif

LOCAL_MODULE:= libavmediaextentions

LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_LIBRARY)

########################################################

include $(CLEAR_VARS)

LOCAL_SRC_FILES:=                                      \
        mediaplayerservice/AVMediaServiceFactory.cpp   \
        mediaplayerservice/AVMediaServiceUtils.cpp     \
        mediaplayerservice/AVNuFactory.cpp             \
        mediaplayerservice/AVNuUtils.cpp               \

LOCAL_C_INCLUDES:= \
        $(TOP)/frameworks/av/include/media/ \
        $(TOP)/frameworks/av/media/libmediaplayerservice \
        $(TOP)/frameworks/av/media/libavextensions \
        $(TOP)/frameworks/native/include/media/hardware \
        $(TOP)/frameworks/native/include/media/openmax \
        $(TOP)/external/flac/include \
        $(TOP)/hardware/qcom/media/mm-core/inc

LOCAL_CFLAGS += -Wno-multichar

ifeq ($(TARGET_ENABLE_QC_AV_ENHANCEMENTS),true)
       LOCAL_CFLAGS += -DENABLE_AV_ENHANCEMENTS
endif

LOCAL_MODULE:= libavmediaserviceextensions

LOCAL_MODULE_TAGS := optional

include $(BUILD_STATIC_LIBRARY)
Loading