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

Commit be516851 authored by Carlos Martinez Romero's avatar Carlos Martinez Romero Committed by Android (Google) Code Review
Browse files

Merge "Replace IGBP references for Surface in MediaRecorder (part 2)." into main

parents 7f7e21ef efc81b99
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -419,7 +419,7 @@ status_t JMediaCodec::detachOutputSurface() {
    return err;
}

status_t JMediaCodec::createInputSurface(sp<IGraphicBufferProducer>* surface) {
status_t JMediaCodec::createInputSurface(sp<MediaSurfaceType>* surface) {
    return mCodec->createInputSurface(surface);
}

@@ -1937,7 +1937,8 @@ static jobject android_media_MediaCodec_createPersistentInputSurface(
        return NULL;
    }

    sp<Surface> surface = sp<Surface>::make(persistentSurface->getBufferProducer(), true);
    sp<Surface> surface = mediaflagtools::surfaceTypeToSurface(
        persistentSurface->getSurface(), true);
    if (surface == NULL) {
        return NULL;
    }
@@ -2039,7 +2040,7 @@ static jobject android_media_MediaCodec_createInputSurface(JNIEnv* env,
    }

    // Tell the MediaCodec that we want to use a Surface as input.
    sp<IGraphicBufferProducer> surface;
    sp<MediaSurfaceType> surface;
    status_t err = codec->createInputSurface(&surface);
    if (err != NO_ERROR) {
        throwExceptionAsNecessary(env, err, codec);
@@ -2047,7 +2048,8 @@ static jobject android_media_MediaCodec_createInputSurface(JNIEnv* env,
    }

    // Wrap the IGBP in a Java-language Surface.
    return android_view_Surface_createFromIGraphicBufferProducer(env, surface);
    return android_view_Surface_createFromIGraphicBufferProducer(env,
            mediaflagtools::surfaceTypeToIGBP(surface));
}

static void android_media_MediaCodec_start(JNIEnv *env, jobject thiz) {
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ struct JMediaCodec : public AHandler {

    status_t detachOutputSurface();

    status_t createInputSurface(sp<IGraphicBufferProducer>* surface);
    status_t createInputSurface(sp<MediaSurfaceType>* surface);
    status_t setInputSurface(const sp<PersistentSurface> &surface);

    status_t start();