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

Commit bd42a7ac authored by vivek mehta's avatar vivek mehta Committed by Linux Build Service Account
Browse files

libstagefright: MPEG4Writer: Add support for HEVC muxing

Changes done to enable HEVC muxing
- writing HVCC atom
- configure HEVC encoder

Conflicts:
        media/libmediaplayerservice/StagefrightRecorder.cpp

Conflicts:
media/libmediaplayerservice/StagefrightRecorder.cpp
Change-Id: Icd382c1a3885d6f9d97466cab92289d7be0496b9
parent e9ec4b40
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ enum video_encoder {
    VIDEO_ENCODER_H264 = 2,
    VIDEO_ENCODER_MPEG_4_SP = 3,
    VIDEO_ENCODER_VP8 = 4,

    VIDEO_ENCODER_H265 = 5,
    VIDEO_ENCODER_LIST_END // must be the last - used to validate the video encoder type
};

+10 −0
Original line number Diff line number Diff line
@@ -88,6 +88,16 @@ struct ExtendedCodec {
    static status_t handleSupportedAudioFormats(
            int format, AString* mime);

    static status_t handleSupportedVideoFormats(
            int format, AString* mime);

    static bool checkIfCompressionHEVC(int format);

    static status_t setupHEVCEncoderParameters(
            const sp<MetaData> &meta, const sp<IOMX> &omx,
            IOMX::node_id node, const char* componentName,
            int portIndex, const sp<OMXCodec> &target);

    static const char* overrideComponentName(
            uint32_t quirks, const sp<MetaData> &meta,
            const char *mime, bool isEncoder);
+2 −0
Original line number Diff line number Diff line
@@ -204,6 +204,8 @@ private:

    MPEG4Writer(const MPEG4Writer &);
    MPEG4Writer &operator=(const MPEG4Writer &);

    bool mIsVideoHEVC;
};

}  // namespace android
+6 −6
Original line number Diff line number Diff line
@@ -121,6 +121,12 @@ struct OMXCodec : public MediaSource,

    static bool findCodecQuirks(const char *componentName, uint32_t *quirks);

    // If profile/level is set in the meta data, its value in the meta
    // data will be used; otherwise, the default value will be used.
    status_t getVideoProfileLevel(const sp<MetaData>& meta,
            const CodecProfileLevel& defaultProfileLevel,
            CodecProfileLevel& profileLevel);

protected:
    virtual ~OMXCodec();

@@ -278,12 +284,6 @@ private:
    status_t isColorFormatSupported(
            OMX_COLOR_FORMATTYPE colorFormat, int portIndex);

    // If profile/level is set in the meta data, its value in the meta
    // data will be used; otherwise, the default value will be used.
    status_t getVideoProfileLevel(const sp<MetaData>& meta,
            const CodecProfileLevel& defaultProfileLevel,
            CodecProfileLevel& profileLevel);

    status_t setVideoOutputFormat(
            const char *mime, const sp<MetaData>& meta);

+2 −1
Original line number Diff line number Diff line
@@ -38,7 +38,8 @@ MediaProfiles *MediaProfiles::sInstance = NULL;
const MediaProfiles::NameToTagMap MediaProfiles::sVideoEncoderNameMap[] = {
    {"h263", VIDEO_ENCODER_H263},
    {"h264", VIDEO_ENCODER_H264},
    {"m4v",  VIDEO_ENCODER_MPEG_4_SP}
    {"m4v",  VIDEO_ENCODER_MPEG_4_SP},
    {"h265", VIDEO_ENCODER_H265}
};

const MediaProfiles::NameToTagMap MediaProfiles::sAudioEncoderNameMap[] = {
Loading