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

Commit b1e7cd15 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830
parent 62ad9071
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@

#include "SimplePlayer.h"

#include <gui/SurfaceTextureClient.h>
#include <gui/Surface.h>
#include <media/AudioTrack.h>
#include <media/ICrypto.h>
#include <media/stagefright/foundation/ABuffer.h>
@@ -67,13 +67,13 @@ status_t SimplePlayer::setDataSource(const char *path) {
status_t SimplePlayer::setSurface(const sp<IGraphicBufferProducer> &bufferProducer) {
    sp<AMessage> msg = new AMessage(kWhatSetSurface, id());

    sp<SurfaceTextureClient> surfaceTextureClient;
    sp<Surface> surface;
    if (bufferProducer != NULL) {
        surfaceTextureClient = new SurfaceTextureClient(bufferProducer);
        surface = new Surface(bufferProducer);
    }

    msg->setObject(
            "native-window", new NativeWindowWrapper(surfaceTextureClient));
            "native-window", new NativeWindowWrapper(surface));

    sp<AMessage> response;
    return PostAndAwaitResponse(msg, &response);
+2 −1
Original line number Diff line number Diff line
@@ -36,6 +36,7 @@
#include <media/stagefright/NuMediaExtractor.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/Surface.h>
#include <ui/DisplayInfo.h>

static void usage(const char *me) {
@@ -413,7 +414,7 @@ int main(int argc, char **argv) {
        looper->registerHandler(player);

        player->setDataSource(argv[0]);
        player->setSurface(surface->getSurfaceTexture());
        player->setSurface(surface->getIGraphicBufferProducer());
        player->start();
        sleep(60);
        player->stop();
+2 −2
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@

#include <fcntl.h>

#include <gui/SurfaceTextureClient.h>
#include <gui/Surface.h>
#include <gui/SurfaceComposerClient.h>

using namespace android;
@@ -941,7 +941,7 @@ int main(int argc, char **argv) {
            CHECK(useSurfaceTexAlloc);

            sp<GLConsumer> texture = new GLConsumer(0 /* tex */);
            gSurface = new SurfaceTextureClient(texture->getBufferQueue());
            gSurface = new Surface(texture->getBufferQueue());
        }

        CHECK_EQ((status_t)OK,
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include <media/IMediaPlayerService.h>
#include <gui/ISurfaceComposer.h>
#include <gui/SurfaceComposerClient.h>
#include <gui/Surface.h>

#include <fcntl.h>
#include <ui/DisplayInfo.h>
@@ -373,7 +374,7 @@ int main(int argc, char **argv) {
        service->create(client, 0);

    if (player != NULL && player->setDataSource(source) == NO_ERROR) {
        player->setVideoSurfaceTexture(surface->getSurfaceTexture());
        player->setVideoSurfaceTexture(surface->getISurfaceTexture());
        player->start();

        client->waitForEOS();
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ class IMediaRecorder;
class ICamera;
class ICameraRecordingProxy;
class IGraphicBufferProducer;
class SurfaceTextureClient;
class Surface;

typedef void (*media_completion_f)(status_t status, void *cookie);

Loading