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

Commit a84a31b8 authored by Steve Kondik's avatar Steve Kondik Committed by Gerrit Code Review
Browse files

Merge "libstagefright: changes to enable nvidia encoder" into froyo

parents 852c328c c4546204
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -143,6 +143,7 @@ static const CodecInfo kEncoderInfo[] = {
    { MEDIA_MIMETYPE_VIDEO_H263, "OMX.PV.h263enc" },
    { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.TI.Video.encoder" },
    { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.PV.avcenc" },
    { MEDIA_MIMETYPE_VIDEO_AVC, "OMX.Nvidia.h264.encoder" },
};

#undef OPTIONAL
@@ -687,6 +688,8 @@ static size_t getFrameSize(
        case OMX_COLOR_FormatYUV420SemiPlanar:
            return (width * height * 3) / 2;

        case OMX_COLOR_FormatYUV420Planar:
            return (width * height * 3) / 2;
        default:
            CHECK(!"Should not be here. Unsupported color format.");
            break;
@@ -713,6 +716,9 @@ void OMXCodec::setVideoInputFormat(
    if (!strcasecmp("OMX.TI.Video.encoder", mComponentName)) {
        colorFormat = OMX_COLOR_FormatYCbYCr;
    }
    if (!strcasecmp("OMX.Nvidia.h264.encoder", mComponentName)) {
        colorFormat = OMX_COLOR_FormatYUV420Planar;
    }

    CHECK_EQ(setVideoPortFormatType(
            kPortIndexInput, OMX_VIDEO_CodingUnused,
@@ -902,6 +908,10 @@ status_t OMXCodec::setupAVCEncoderParameters() {
    h264type.nCabacInitIdc = 0;
    h264type.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable;

    if (!strcasecmp("OMX.Nvidia.h264.encoder", mComponentName))
    {
        h264type.eLevel = OMX_VIDEO_AVCLevelMax;
    }
    err = mOMX->setParameter(
            mNode, OMX_IndexParamVideoAvc, &h264type, sizeof(h264type));
    CHECK_EQ(err, OK);