From 1a2952aee048ca7b1765e2bc09ebe9aeddaeafa3 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Thu, 14 Feb 2013 17:11:27 -0800 Subject: Refactoring: Rename SurfaceTextureClient to Surface Change-Id: I4e8a8b20914cb64edc37abe68233fbc9f2b5d830 --- cmds/stagefright/SimplePlayer.cpp | 8 ++++---- cmds/stagefright/codec.cpp | 3 ++- cmds/stagefright/stagefright.cpp | 4 ++-- cmds/stagefright/stream.cpp | 3 ++- include/media/mediarecorder.h | 2 +- include/media/stagefright/MediaCodec.h | 8 ++++---- include/media/stagefright/NativeWindowWrapper.h | 10 +++++----- include/media/stagefright/SurfaceMediaSource.h | 6 +++--- libvideoeditor/lvpp/NativeWindowRenderer.cpp | 6 +++--- libvideoeditor/lvpp/NativeWindowRenderer.h | 14 +++++++------- libvideoeditor/lvpp/PreviewPlayer.cpp | 4 ++-- media/libmedia/mediaplayer.cpp | 2 +- media/libmediaplayerservice/MediaPlayerService.cpp | 4 ++-- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 2 +- media/libstagefright/AwesomePlayer.cpp | 4 ++-- media/libstagefright/MediaCodec.cpp | 6 +++--- media/libstagefright/tests/SurfaceMediaSource_test.cpp | 18 +++++++++--------- .../wifi-display/sink/DirectRenderer.cpp | 3 ++- .../wifi-display/sink/TunnelRenderer.cpp | 2 +- media/libstagefright/wifi-display/source/Converter.cpp | 2 +- media/libstagefright/wifi-display/wfd.cpp | 2 +- services/camera/libcameraservice/Camera2Client.cpp | 5 ++--- services/camera/libcameraservice/CameraClient.cpp | 5 ++--- services/camera/libcameraservice/CameraClient.h | 2 +- services/camera/libcameraservice/CameraService.cpp | 1 - .../libcameraservice/camera2/CallbackProcessor.cpp | 4 ++-- .../camera/libcameraservice/camera2/JpegProcessor.cpp | 4 ++-- .../libcameraservice/camera2/StreamingProcessor.cpp | 4 ++-- .../camera/libcameraservice/camera2/ZslProcessor.cpp | 4 ++-- 29 files changed, 71 insertions(+), 71 deletions(-) diff --git a/cmds/stagefright/SimplePlayer.cpp b/cmds/stagefright/SimplePlayer.cpp index 93de112..5d2d721 100644 --- a/cmds/stagefright/SimplePlayer.cpp +++ b/cmds/stagefright/SimplePlayer.cpp @@ -20,7 +20,7 @@ #include "SimplePlayer.h" -#include +#include #include #include #include @@ -67,13 +67,13 @@ status_t SimplePlayer::setDataSource(const char *path) { status_t SimplePlayer::setSurface(const sp &bufferProducer) { sp msg = new AMessage(kWhatSetSurface, id()); - sp surfaceTextureClient; + sp 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 response; return PostAndAwaitResponse(msg, &response); diff --git a/cmds/stagefright/codec.cpp b/cmds/stagefright/codec.cpp index 723a6e5..fdfefdf 100644 --- a/cmds/stagefright/codec.cpp +++ b/cmds/stagefright/codec.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #include 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(); diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 2aae64d..5bdbfbb 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -53,7 +53,7 @@ #include -#include +#include #include using namespace android; @@ -941,7 +941,7 @@ int main(int argc, char **argv) { CHECK(useSurfaceTexAlloc); sp texture = new GLConsumer(0 /* tex */); - gSurface = new SurfaceTextureClient(texture->getBufferQueue()); + gSurface = new Surface(texture->getBufferQueue()); } CHECK_EQ((status_t)OK, diff --git a/cmds/stagefright/stream.cpp b/cmds/stagefright/stream.cpp index af6afe0..d49ab4a 100644 --- a/cmds/stagefright/stream.cpp +++ b/cmds/stagefright/stream.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -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(); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index 2882c41..da6b507 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -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); diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index 3f0d3b3..1002663 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -31,7 +31,7 @@ struct AMessage; struct AString; struct ICrypto; struct SoftwareRenderer; -struct SurfaceTextureClient; +struct Surface; struct MediaCodec : public AHandler { enum ConfigureFlags { @@ -52,7 +52,7 @@ struct MediaCodec : public AHandler { status_t configure( const sp &format, - const sp &nativeWindow, + const sp &nativeWindow, const sp &crypto, uint32_t flags); @@ -187,7 +187,7 @@ private: AString mComponentName; uint32_t mReplyID; uint32_t mFlags; - sp mNativeWindow; + sp mNativeWindow; SoftwareRenderer *mSoftRenderer; sp mOutputFormat; @@ -229,7 +229,7 @@ private: status_t queueCSDInputBuffer(size_t bufferIndex); status_t setNativeWindow( - const sp &surfaceTextureClient); + const sp &surface); void postActivityNotificationIfPossible(); diff --git a/include/media/stagefright/NativeWindowWrapper.h b/include/media/stagefright/NativeWindowWrapper.h index 97cc0ce..cfeec22 100644 --- a/include/media/stagefright/NativeWindowWrapper.h +++ b/include/media/stagefright/NativeWindowWrapper.h @@ -18,29 +18,29 @@ #define NATIVE_WINDOW_WRAPPER_H_ -#include +#include namespace android { -// SurfaceTextureClient derives from ANativeWindow which derives from multiple +// Surface derives from ANativeWindow which derives from multiple // base classes, in order to carry it in AMessages, we'll temporarily wrap it // into a NativeWindowWrapper. struct NativeWindowWrapper : RefBase { NativeWindowWrapper( - const sp &surfaceTextureClient) : + const sp &surfaceTextureClient) : mSurfaceTextureClient(surfaceTextureClient) { } sp getNativeWindow() const { return mSurfaceTextureClient; } - sp getSurfaceTextureClient() const { + sp getSurfaceTextureClient() const { return mSurfaceTextureClient; } private: - const sp mSurfaceTextureClient; + const sp mSurfaceTextureClient; DISALLOW_EVIL_CONSTRUCTORS(NativeWindowWrapper); }; diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index 609d84f..5f21da9 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -35,7 +35,7 @@ class GraphicBuffer; // ASSUMPTIONS // 1. SurfaceMediaSource is initialized with width*height which // can never change. However, deqeueue buffer does not currently -// enforce this as in BufferQueue, dequeue can be used by SurfaceTextureClient +// enforce this as in BufferQueue, dequeue can be used by Surface // which can modify the default width and heght. Also neither the width // nor height can be 0. // 2. setSynchronousMode is never used (basically no one should call @@ -122,7 +122,7 @@ public: protected: // Implementation of the BufferQueue::ConsumerListener interface. These - // calls are used to notify the SurfaceTextureClient of asynchronous events in the + // calls are used to notify the Surface of asynchronous events in the // BufferQueue. virtual void onFrameAvailable(); @@ -157,7 +157,7 @@ private: // mCurrentSlot is the buffer slot index of the buffer that is currently // being used by buffer consumer // (e.g. StageFrightRecorder in the case of SurfaceMediaSource or GLTexture - // in the case of SurfaceTextureClient). + // in the case of Surface). // It is initialized to INVALID_BUFFER_SLOT, // indicating that no buffer slot is currently bound to the texture. Note, // however, that a value of INVALID_BUFFER_SLOT does not necessarily mean diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.cpp b/libvideoeditor/lvpp/NativeWindowRenderer.cpp index 114f0f6..702900b 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.cpp +++ b/libvideoeditor/lvpp/NativeWindowRenderer.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include @@ -316,7 +316,7 @@ NativeWindowRenderer::~NativeWindowRenderer() { void NativeWindowRenderer::render(RenderInput* input) { sp ST = input->mST; - sp STC = input->mSTC; + sp STC = input->mSTC; if (input->mIsExternalBuffer) { queueExternalBuffer(STC.get(), input->mBuffer, @@ -569,7 +569,7 @@ RenderInput::RenderInput(NativeWindowRenderer* renderer, GLuint textureId) : mRenderer(renderer) , mTextureId(textureId) { mST = new GLConsumer(mTextureId); - mSTC = new SurfaceTextureClient(mST->getBufferQueue()); + mSTC = new Surface(mST->getBufferQueue()); native_window_connect(mSTC.get(), NATIVE_WINDOW_API_MEDIA); } diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.h b/libvideoeditor/lvpp/NativeWindowRenderer.h index b0623ba..26b4cba 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.h +++ b/libvideoeditor/lvpp/NativeWindowRenderer.h @@ -37,16 +37,16 @@ // we only expect that happens briefly when one clip is about to finish // and the next clip is about to start. // -// We allocate a SurfaceTextureClient for each RenderInput and the user can use +// We allocate a Surface for each RenderInput and the user can use // the getTargetWindow() function to get the corresponding ANativeWindow -// for that SurfaceTextureClient. The intention is that the user can pass that +// for that Surface. The intention is that the user can pass that // ANativeWindow to OMXCodec::Create() so the codec can decode directly // to buffers provided by the texture. namespace android { class GLConsumer; -class SurfaceTextureClient; +class Surface; class RenderInput; class NativeWindowRenderer { @@ -110,7 +110,7 @@ private: // destination aspect ratio. GLfloat mPositionCoordinates[8]; - // We use a different GL id for each SurfaceTextureClient. + // We use a different GL id for each Surface. GLuint mNextTextureId; // Number of existing RenderInputs, just for debugging. @@ -146,7 +146,7 @@ private: class RenderInput { public: - // Returns the ANativeWindow corresponds to the SurfaceTextureClient. + // Returns the ANativeWindow corresponds to the Surface. ANativeWindow* getTargetWindow(); // Updates video frame size from the MediaSource's metadata. Specifically @@ -156,7 +156,7 @@ public: // Renders the buffer with the given video effect and rending mode. // The video effets are defined in VideoEditorTools.h // Set isExternalBuffer to true only when the buffer given is not - // provided by the SurfaceTextureClient. + // provided by the Surface. void render(MediaBuffer *buffer, uint32_t videoEffect, M4xVSS_MediaRendering renderingMode, bool isExternalBuffer); private: @@ -165,7 +165,7 @@ private: NativeWindowRenderer* mRenderer; GLuint mTextureId; sp mST; - sp mSTC; + sp mSTC; int mWidth, mHeight; // These are only valid during render() calls diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp index 754c5a9..2bd9f84 100755 --- a/libvideoeditor/lvpp/PreviewPlayer.cpp +++ b/libvideoeditor/lvpp/PreviewPlayer.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include "VideoEditorPreviewController.h" #include "DummyAudioSource.h" @@ -1780,7 +1780,7 @@ void PreviewPlayer::setSurfaceTexture(const sp &bufferPr mSurface.clear(); if (bufferProducer != NULL) { - setNativeWindow_l(new SurfaceTextureClient(bufferProducer)); + setNativeWindow_l(new Surface(bufferProducer)); } } diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index 14602bf..3defec3 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index f932131..16f1317 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include // for status_t #include #include @@ -731,7 +731,7 @@ status_t MediaPlayerService::Client::setVideoSurfaceTexture( sp anw; if (bufferProducer != NULL) { - anw = new SurfaceTextureClient(bufferProducer); + anw = new Surface(bufferProducer); status_t err = native_window_api_connect(anw.get(), NATIVE_WINDOW_API_MEDIA); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 30eb4b9..2ba6c22 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -224,7 +224,7 @@ void NuPlayer::setVideoSurfaceTextureAsync( msg->setObject( "native-window", new NativeWindowWrapper( - new SurfaceTextureClient(bufferProducer))); + new Surface(bufferProducer))); } msg->post(); diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 0f4d866..bd28118 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -49,7 +49,7 @@ #include #include -#include +#include #include @@ -1183,7 +1183,7 @@ status_t AwesomePlayer::setSurfaceTexture(const sp &buff status_t err; if (bufferProducer != NULL) { - err = setNativeWindow_l(new SurfaceTextureClient(bufferProducer)); + err = setNativeWindow_l(new Surface(bufferProducer)); } else { err = setNativeWindow_l(NULL); } diff --git a/media/libstagefright/MediaCodec.cpp b/media/libstagefright/MediaCodec.cpp index 77aceb7..83be0fd 100644 --- a/media/libstagefright/MediaCodec.cpp +++ b/media/libstagefright/MediaCodec.cpp @@ -22,7 +22,7 @@ #include "include/SoftwareRenderer.h" -#include +#include #include #include #include @@ -132,7 +132,7 @@ status_t MediaCodec::init(const char *name, bool nameIsType, bool encoder) { status_t MediaCodec::configure( const sp &format, - const sp &nativeWindow, + const sp &nativeWindow, const sp &crypto, uint32_t flags) { sp msg = new AMessage(kWhatConfigure, id()); @@ -1526,7 +1526,7 @@ ssize_t MediaCodec::dequeuePortBuffer(int32_t portIndex) { } status_t MediaCodec::setNativeWindow( - const sp &surfaceTextureClient) { + const sp &surfaceTextureClient) { status_t err; if (mNativeWindow != NULL) { diff --git a/media/libstagefright/tests/SurfaceMediaSource_test.cpp b/media/libstagefright/tests/SurfaceMediaSource_test.cpp index 6a98509..a5459fe 100644 --- a/media/libstagefright/tests/SurfaceMediaSource_test.cpp +++ b/media/libstagefright/tests/SurfaceMediaSource_test.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include @@ -109,7 +109,7 @@ protected: ALOGV("No actual display. Choosing EGLSurface based on SurfaceMediaSource"); sp sms = (new SurfaceMediaSource( getSurfaceWidth(), getSurfaceHeight()))->getBufferQueue(); - sp stc = new SurfaceTextureClient(sms); + sp stc = new Surface(sms); sp window = stc; mEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig, @@ -361,7 +361,7 @@ protected: mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight); // Manual cast is required to avoid constructor ambiguity - mSTC = new SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); + mSTC = new Surface(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; } @@ -375,7 +375,7 @@ protected: const int mYuvTexHeight; sp mSMS; - sp mSTC; + sp mSTC; sp mANW; }; @@ -396,7 +396,7 @@ protected: ALOGV("SMS-GLTest::SetUp()"); android::ProcessState::self()->startThreadPool(); mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight); - mSTC = new SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); + mSTC = new Surface(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; // Doing the setup related to the GL Side @@ -416,7 +416,7 @@ protected: const int mYuvTexHeight; sp mSMS; - sp mSTC; + sp mSTC; sp mANW; }; @@ -483,7 +483,7 @@ sp SurfaceMediaSourceGLTest::setUpMediaRecorder(int fd, int video // query the mediarecorder for a surfacemeidasource and create an egl surface with that void SurfaceMediaSourceGLTest::setUpEGLSurfaceFromMediaRecorder(sp& mr) { sp iST = mr->querySurfaceMediaSourceFromMediaServer(); - mSTC = new SurfaceTextureClient(iST); + mSTC = new Surface(iST); mANW = mSTC; if (mEglSurface != EGL_NO_SURFACE) { @@ -750,7 +750,7 @@ TEST_F(SurfaceMediaSourceTest, DISABLED_EncodingFromCpuYV12BufferNpotWriteMediaS // get the reference to the surfacemediasource living in // mediaserver that is created by stagefrightrecorder sp iST = mr->querySurfaceMediaSourceFromMediaServer(); - mSTC = new SurfaceTextureClient(iST); + mSTC = new Surface(iST); mANW = mSTC; ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); ASSERT_EQ(NO_ERROR, native_window_set_buffers_format(mANW.get(), @@ -781,7 +781,7 @@ TEST_F(SurfaceMediaSourceGLTest, ChooseAndroidRecordableEGLConfigDummyWriter) { ALOGV("Verify creating a surface w/ right config + dummy writer*********"); mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight); - mSTC = new SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); + mSTC = new Surface(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; DummyRecorder writer(mSMS); diff --git a/media/libstagefright/wifi-display/sink/DirectRenderer.cpp b/media/libstagefright/wifi-display/sink/DirectRenderer.cpp index d7f169f..70369bb 100644 --- a/media/libstagefright/wifi-display/sink/DirectRenderer.cpp +++ b/media/libstagefright/wifi-display/sink/DirectRenderer.cpp @@ -24,6 +24,7 @@ #include "ATSParser.h" #include +#include #include #include #include @@ -279,7 +280,7 @@ void DirectRenderer::dequeueAccessUnits() { err = mVideoDecoder->configure( videoFormat, mSurfaceTex == NULL - ? NULL : new SurfaceTextureClient(mSurfaceTex), + ? NULL : new Surface(mSurfaceTex), NULL /* crypto */, 0 /* flags */); diff --git a/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp b/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp index 04dbd7b..75f9d73 100644 --- a/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp +++ b/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp @@ -376,7 +376,7 @@ void TunnelRenderer::initPlayer() { CHECK_EQ(mPlayer->setDataSource(mStreamSource), (status_t)OK); mPlayer->setVideoSurfaceTexture( - mSurfaceTex != NULL ? mSurfaceTex : mSurface->getSurfaceTexture()); + mSurfaceTex != NULL ? mSurfaceTex : mSurface->getIGraphicBufferProducer()); mPlayer->start(); } diff --git a/media/libstagefright/wifi-display/source/Converter.cpp b/media/libstagefright/wifi-display/source/Converter.cpp index 376b0df..2861aa9 100644 --- a/media/libstagefright/wifi-display/source/Converter.cpp +++ b/media/libstagefright/wifi-display/source/Converter.cpp @@ -23,7 +23,7 @@ #include "MediaPuller.h" #include -#include +#include #include #include #include diff --git a/media/libstagefright/wifi-display/wfd.cpp b/media/libstagefright/wifi-display/wfd.cpp index 21d661e..3f4216a 100644 --- a/media/libstagefright/wifi-display/wfd.cpp +++ b/media/libstagefright/wifi-display/wfd.cpp @@ -321,7 +321,7 @@ int main(int argc, char **argv) { sp looper = new ALooper; sp sink = new WifiDisplaySink( - session, surface->getSurfaceTexture()); + session, surface->getIGraphicBufferProducer()); looper->registerHandler(sink); if (connectToPort >= 0) { diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index 70bf0ac..b9feaf8 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -22,7 +22,6 @@ #include #include -#include #include #include "camera2/Parameters.h" #include "Camera2Client.h" @@ -489,7 +488,7 @@ status_t Camera2Client::setPreviewDisplay( sp binder; sp window; if (surface != 0) { - binder = surface->asBinder(); + binder = surface->getISurfaceTexture()->asBinder(); window = surface; } @@ -508,7 +507,7 @@ status_t Camera2Client::setPreviewTexture( sp window; if (bufferProducer != 0) { binder = bufferProducer->asBinder(); - window = new SurfaceTextureClient(bufferProducer); + window = new Surface(bufferProducer); } return setPreviewWindowL(binder, window); } diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp index f9cee0d..5f03a1c 100644 --- a/services/camera/libcameraservice/CameraClient.cpp +++ b/services/camera/libcameraservice/CameraClient.cpp @@ -18,7 +18,6 @@ //#define LOG_NDEBUG 0 #include -#include #include #include "CameraClient.h" @@ -302,7 +301,7 @@ status_t CameraClient::setPreviewWindow(const sp& binder, status_t CameraClient::setPreviewDisplay(const sp& surface) { LOG1("setPreviewDisplay(%p) (pid %d)", surface.get(), getCallingPid()); - sp binder(surface != 0 ? surface->asBinder() : 0); + sp binder(surface != 0 ? surface->getISurfaceTexture()->asBinder() : 0); sp window(surface); return setPreviewWindow(binder, window); } @@ -317,7 +316,7 @@ status_t CameraClient::setPreviewTexture( sp window; if (bufferProducer != 0) { binder = bufferProducer->asBinder(); - window = new SurfaceTextureClient(bufferProducer); + window = new Surface(bufferProducer); } return setPreviewWindow(binder, window); } diff --git a/services/camera/libcameraservice/CameraClient.h b/services/camera/libcameraservice/CameraClient.h index 7da3da7..74829ce 100644 --- a/services/camera/libcameraservice/CameraClient.h +++ b/services/camera/libcameraservice/CameraClient.h @@ -124,7 +124,7 @@ private: // Ensures atomicity among the public methods mutable Mutex mLock; - // This is a binder of Surface or SurfaceTextureClient. + // This is a binder of Surface or Surface. sp mSurface; sp mPreviewWindow; diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index 124d24d..717e159 100644 --- a/services/camera/libcameraservice/CameraService.cpp +++ b/services/camera/libcameraservice/CameraService.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp index 307cfab..c4055e0 100644 --- a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp +++ b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp @@ -22,7 +22,7 @@ #include #include "CallbackProcessor.h" -#include +#include #include "../Camera2Device.h" #include "../Camera2Client.h" @@ -65,7 +65,7 @@ status_t CallbackProcessor::updateStream(const Parameters ¶ms) { mCallbackConsumer = new CpuConsumer(kCallbackHeapCount); mCallbackConsumer->setFrameAvailableListener(this); mCallbackConsumer->setName(String8("Camera2Client::CallbackConsumer")); - mCallbackWindow = new SurfaceTextureClient( + mCallbackWindow = new Surface( mCallbackConsumer->getProducerInterface()); } diff --git a/services/camera/libcameraservice/camera2/JpegProcessor.cpp b/services/camera/libcameraservice/camera2/JpegProcessor.cpp index 6280f83..1ec5694 100644 --- a/services/camera/libcameraservice/camera2/JpegProcessor.cpp +++ b/services/camera/libcameraservice/camera2/JpegProcessor.cpp @@ -26,7 +26,7 @@ #include #include "JpegProcessor.h" -#include +#include #include "../Camera2Device.h" #include "../Camera2Client.h" @@ -82,7 +82,7 @@ status_t JpegProcessor::updateStream(const Parameters ¶ms) { mCaptureConsumer = new CpuConsumer(1); mCaptureConsumer->setFrameAvailableListener(this); mCaptureConsumer->setName(String8("Camera2Client::CaptureConsumer")); - mCaptureWindow = new SurfaceTextureClient( + mCaptureWindow = new Surface( mCaptureConsumer->getProducerInterface()); // Create memory for API consumption mCaptureHeap = new MemoryHeapBase(maxJpegSize.data.i32[0], 0, diff --git a/services/camera/libcameraservice/camera2/StreamingProcessor.cpp b/services/camera/libcameraservice/camera2/StreamingProcessor.cpp index 6ea27b2..a0d1093 100644 --- a/services/camera/libcameraservice/camera2/StreamingProcessor.cpp +++ b/services/camera/libcameraservice/camera2/StreamingProcessor.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include "StreamingProcessor.h" @@ -284,7 +284,7 @@ status_t StreamingProcessor::updateRecordingStream(const Parameters ¶ms) { true); mRecordingConsumer->setFrameAvailableListener(this); mRecordingConsumer->setName(String8("Camera2-RecordingConsumer")); - mRecordingWindow = new SurfaceTextureClient( + mRecordingWindow = new Surface( mRecordingConsumer->getProducerInterface()); // Allocate memory later, since we don't know buffer size until receipt } diff --git a/services/camera/libcameraservice/camera2/ZslProcessor.cpp b/services/camera/libcameraservice/camera2/ZslProcessor.cpp index 9584028..900c099 100644 --- a/services/camera/libcameraservice/camera2/ZslProcessor.cpp +++ b/services/camera/libcameraservice/camera2/ZslProcessor.cpp @@ -29,7 +29,7 @@ #include #include "ZslProcessor.h" -#include +#include #include "../Camera2Device.h" #include "../Camera2Client.h" @@ -124,7 +124,7 @@ status_t ZslProcessor::updateStream(const Parameters ¶ms) { true); mZslConsumer->setFrameAvailableListener(this); mZslConsumer->setName(String8("Camera2Client::ZslConsumer")); - mZslWindow = new SurfaceTextureClient( + mZslWindow = new Surface( mZslConsumer->getProducerInterface()); } -- cgit v1.1