From 8ba01021b573889802e67e029225a96f0dfa471a Mon Sep 17 00:00:00 2001 From: Andy McFadden Date: Tue, 18 Dec 2012 09:46:54 -0800 Subject: [PATCH] Rename ISurfaceTexture and SurfaceTexture The C++ class names don't match what the classes do, so rename ISurfaceTexture to IGraphicBufferProducer, and SurfaceTexture to GLConsumer. Bug 7736700 Change-Id: I64520a55f8c09fe6215382ea361c539a9940cba5 --- camera/Camera.cpp | 12 ++++++------ camera/ICamera.cpp | 11 ++++++----- cmds/stagefright/SimplePlayer.cpp | 6 +++--- cmds/stagefright/SimplePlayer.h | 4 ++-- cmds/stagefright/stagefright.cpp | 2 +- include/camera/Camera.h | 6 +++--- include/camera/ICamera.h | 6 +++--- include/media/IMediaPlayer.h | 4 ++-- include/media/IMediaRecorder.h | 4 ++-- include/media/IRemoteDisplayClient.h | 4 ++-- include/media/MediaPlayerInterface.h | 6 +++--- include/media/MediaRecorderBase.h | 4 ++-- include/media/mediaplayer.h | 4 ++-- include/media/mediarecorder.h | 8 ++++---- include/media/stagefright/MediaCodec.h | 2 +- include/media/stagefright/SurfaceMediaSource.h | 8 ++++---- libvideoeditor/lvpp/NativeWindowRenderer.cpp | 6 +++--- libvideoeditor/lvpp/NativeWindowRenderer.h | 14 +++++++------- libvideoeditor/lvpp/PreviewPlayer.cpp | 8 ++++---- libvideoeditor/lvpp/PreviewPlayer.h | 2 +- libvideoeditor/lvpp/VideoEditorPlayer.cpp | 4 ++-- libvideoeditor/lvpp/VideoEditorPlayer.h | 2 +- media/libmedia/IMediaPlayer.cpp | 14 +++++++------- media/libmedia/IMediaRecorder.cpp | 8 ++++---- media/libmedia/IRemoteDisplayClient.cpp | 10 +++++----- media/libmedia/mediaplayer.cpp | 4 ++-- media/libmedia/mediarecorder.cpp | 8 ++++---- media/libmediaplayerservice/MediaPlayerService.cpp | 16 ++++++++-------- media/libmediaplayerservice/MediaPlayerService.h | 2 +- media/libmediaplayerservice/MediaRecorderClient.cpp | 4 ++-- media/libmediaplayerservice/MediaRecorderClient.h | 4 ++-- media/libmediaplayerservice/MidiFile.h | 2 +- media/libmediaplayerservice/StagefrightPlayer.cpp | 4 ++-- media/libmediaplayerservice/StagefrightPlayer.h | 2 +- media/libmediaplayerservice/StagefrightRecorder.cpp | 2 +- media/libmediaplayerservice/StagefrightRecorder.h | 6 +++--- media/libmediaplayerservice/TestPlayerStub.h | 2 +- media/libmediaplayerservice/nuplayer/NuPlayer.cpp | 8 ++++---- media/libmediaplayerservice/nuplayer/NuPlayer.h | 2 +- media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp | 4 ++-- media/libmediaplayerservice/nuplayer/NuPlayerDriver.h | 2 +- media/libstagefright/AwesomePlayer.cpp | 8 ++++---- .../libstagefright/colorconversion/SoftwareRenderer.cpp | 2 +- media/libstagefright/include/AwesomePlayer.h | 4 ++-- media/libstagefright/tests/SurfaceMediaSource_test.cpp | 12 ++++++------ media/libstagefright/wifi-display/sink/RTPSink.cpp | 4 ++-- media/libstagefright/wifi-display/sink/RTPSink.h | 4 ++-- .../libstagefright/wifi-display/sink/TunnelRenderer.cpp | 4 ++-- media/libstagefright/wifi-display/sink/TunnelRenderer.h | 4 ++-- .../libstagefright/wifi-display/sink/WifiDisplaySink.cpp | 4 ++-- media/libstagefright/wifi-display/sink/WifiDisplaySink.h | 4 ++-- .../wifi-display/source/PlaybackSession.cpp | 2 +- .../libstagefright/wifi-display/source/PlaybackSession.h | 4 ++-- .../wifi-display/source/WifiDisplaySource.cpp | 2 +- media/libstagefright/wifi-display/wfd.cpp | 8 ++++---- services/camera/libcameraservice/Camera2Client.cpp | 8 ++++---- services/camera/libcameraservice/Camera2Client.h | 2 +- services/camera/libcameraservice/CameraClient.cpp | 12 ++++++------ services/camera/libcameraservice/CameraClient.h | 4 ++-- services/camera/libcameraservice/CameraService.h | 2 +- 60 files changed, 163 insertions(+), 162 deletions(-) diff --git a/camera/Camera.cpp b/camera/Camera.cpp index d43cb0bb43..3aaacaf5cd 100644 --- a/camera/Camera.cpp +++ b/camera/Camera.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include namespace android { @@ -184,14 +184,14 @@ status_t Camera::setPreviewDisplay(const sp& surface) } } -// pass the buffered ISurfaceTexture to the camera service -status_t Camera::setPreviewTexture(const sp& surfaceTexture) +// pass the buffered IGraphicBufferProducer to the camera service +status_t Camera::setPreviewTexture(const sp& bufferProducer) { - ALOGV("setPreviewTexture(%p)", surfaceTexture.get()); + ALOGV("setPreviewTexture(%p)", bufferProducer.get()); sp c = mCamera; if (c == 0) return NO_INIT; - if (surfaceTexture != 0) { - return c->setPreviewTexture(surfaceTexture); + if (bufferProducer != 0) { + return c->setPreviewTexture(bufferProducer); } else { ALOGD("app passed NULL surface"); return c->setPreviewTexture(0); diff --git a/camera/ICamera.cpp b/camera/ICamera.cpp index 8d8408c815..5d210e7680 100644 --- a/camera/ICamera.cpp +++ b/camera/ICamera.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include namespace android { @@ -79,13 +79,13 @@ public: return reply.readInt32(); } - // pass the buffered SurfaceTexture to the camera service - status_t setPreviewTexture(const sp& surfaceTexture) + // pass the buffered IGraphicBufferProducer to the camera service + status_t setPreviewTexture(const sp& bufferProducer) { ALOGV("setPreviewTexture"); Parcel data, reply; data.writeInterfaceToken(ICamera::getInterfaceDescriptor()); - sp b(surfaceTexture->asBinder()); + sp b(bufferProducer->asBinder()); data.writeStrongBinder(b); remote()->transact(SET_PREVIEW_TEXTURE, data, &reply); return reply.readInt32(); @@ -292,7 +292,8 @@ status_t BnCamera::onTransact( case SET_PREVIEW_TEXTURE: { ALOGV("SET_PREVIEW_TEXTURE"); CHECK_INTERFACE(ICamera, data, reply); - sp st = interface_cast(data.readStrongBinder()); + sp st = + interface_cast(data.readStrongBinder()); reply->writeInt32(setPreviewTexture(st)); return NO_ERROR; } break; diff --git a/cmds/stagefright/SimplePlayer.cpp b/cmds/stagefright/SimplePlayer.cpp index eb3296e896..93de112eac 100644 --- a/cmds/stagefright/SimplePlayer.cpp +++ b/cmds/stagefright/SimplePlayer.cpp @@ -64,12 +64,12 @@ status_t SimplePlayer::setDataSource(const char *path) { return PostAndAwaitResponse(msg, &response); } -status_t SimplePlayer::setSurface(const sp &surfaceTexture) { +status_t SimplePlayer::setSurface(const sp &bufferProducer) { sp msg = new AMessage(kWhatSetSurface, id()); sp surfaceTextureClient; - if (surfaceTexture != NULL) { - surfaceTextureClient = new SurfaceTextureClient(surfaceTexture); + if (bufferProducer != NULL) { + surfaceTextureClient = new SurfaceTextureClient(bufferProducer); } msg->setObject( diff --git a/cmds/stagefright/SimplePlayer.h b/cmds/stagefright/SimplePlayer.h index 2548252304..0a06059f8a 100644 --- a/cmds/stagefright/SimplePlayer.h +++ b/cmds/stagefright/SimplePlayer.h @@ -23,7 +23,7 @@ namespace android { struct ABuffer; struct ALooper; struct AudioTrack; -struct ISurfaceTexture; +struct IGraphicBufferProducer; struct MediaCodec; struct NativeWindowWrapper; struct NuMediaExtractor; @@ -32,7 +32,7 @@ struct SimplePlayer : public AHandler { SimplePlayer(); status_t setDataSource(const char *path); - status_t setSurface(const sp &surfaceTexture); + status_t setSurface(const sp &bufferProducer); status_t prepare(); status_t start(); status_t stop(); diff --git a/cmds/stagefright/stagefright.cpp b/cmds/stagefright/stagefright.cpp index 148b66e5e9..1002ac4b7d 100644 --- a/cmds/stagefright/stagefright.cpp +++ b/cmds/stagefright/stagefright.cpp @@ -940,7 +940,7 @@ int main(int argc, char **argv) { } else { CHECK(useSurfaceTexAlloc); - sp texture = new SurfaceTexture(0 /* tex */); + sp texture = new GLConsumer(0 /* tex */); gSurface = new SurfaceTextureClient(texture->getBufferQueue()); } diff --git a/include/camera/Camera.h b/include/camera/Camera.h index 234e1657ee..43dae1c84b 100644 --- a/include/camera/Camera.h +++ b/include/camera/Camera.h @@ -18,7 +18,7 @@ #define ANDROID_HARDWARE_CAMERA_H #include -#include +#include #include #include #include @@ -86,8 +86,8 @@ public: // pass the buffered Surface to the camera service status_t setPreviewDisplay(const sp& surface); - // pass the buffered ISurfaceTexture to the camera service - status_t setPreviewTexture(const sp& surfaceTexture); + // pass the buffered IGraphicBufferProducer to the camera service + status_t setPreviewTexture(const sp& bufferProducer); // start preview mode, must call setPreviewDisplay first status_t startPreview(); diff --git a/include/camera/ICamera.h b/include/camera/ICamera.h index 3d188379fe..eccaa41d73 100644 --- a/include/camera/ICamera.h +++ b/include/camera/ICamera.h @@ -27,7 +27,7 @@ namespace android { class ICameraClient; -class ISurfaceTexture; +class IGraphicBufferProducer; class Surface; class ICamera: public IInterface @@ -49,9 +49,9 @@ public: // pass the buffered Surface to the camera service virtual status_t setPreviewDisplay(const sp& surface) = 0; - // pass the buffered ISurfaceTexture to the camera service + // pass the buffered IGraphicBufferProducer to the camera service virtual status_t setPreviewTexture( - const sp& surfaceTexture) = 0; + const sp& bufferProducer) = 0; // set the preview callback flag to affect how the received frames from // preview are handled. diff --git a/include/media/IMediaPlayer.h b/include/media/IMediaPlayer.h index 4ed186348b..0cbd2697f4 100644 --- a/include/media/IMediaPlayer.h +++ b/include/media/IMediaPlayer.h @@ -32,7 +32,7 @@ namespace android { class Parcel; class Surface; class IStreamSource; -class ISurfaceTexture; +class IGraphicBufferProducer; class IMediaPlayer: public IInterface { @@ -46,7 +46,7 @@ public: virtual status_t setDataSource(int fd, int64_t offset, int64_t length) = 0; virtual status_t setDataSource(const sp& source) = 0; virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; + const sp& bufferProducer) = 0; virtual status_t prepareAsync() = 0; virtual status_t start() = 0; virtual status_t stop() = 0; diff --git a/include/media/IMediaRecorder.h b/include/media/IMediaRecorder.h index ec84e2574a..54af0d37c5 100644 --- a/include/media/IMediaRecorder.h +++ b/include/media/IMediaRecorder.h @@ -26,7 +26,7 @@ class Surface; class ICamera; class ICameraRecordingProxy; class IMediaRecorderClient; -class ISurfaceTexture; +class IGraphicBufferProducer; class IMediaRecorder: public IInterface { @@ -55,7 +55,7 @@ public: virtual status_t init() = 0; virtual status_t close() = 0; virtual status_t release() = 0; - virtual sp querySurfaceMediaSource() = 0; + virtual sp querySurfaceMediaSource() = 0; }; // ---------------------------------------------------------------------------- diff --git a/include/media/IRemoteDisplayClient.h b/include/media/IRemoteDisplayClient.h index 252b401d64..7b0fa9ed60 100644 --- a/include/media/IRemoteDisplayClient.h +++ b/include/media/IRemoteDisplayClient.h @@ -26,7 +26,7 @@ namespace android { -class ISurfaceTexture; +class IGraphicBufferProducer; class IRemoteDisplayClient : public IInterface { @@ -48,7 +48,7 @@ public: // Indicates that the remote display has been connected successfully. // Provides a surface texture that the client should use to stream buffers to // the remote display. - virtual void onDisplayConnected(const sp& surfaceTexture, + virtual void onDisplayConnected(const sp& bufferProducer, uint32_t width, uint32_t height, uint32_t flags) = 0; // one-way // Indicates that the remote display has been disconnected normally. diff --git a/include/media/MediaPlayerInterface.h b/include/media/MediaPlayerInterface.h index b7bee3f87c..8fc72c3984 100644 --- a/include/media/MediaPlayerInterface.h +++ b/include/media/MediaPlayerInterface.h @@ -37,7 +37,7 @@ namespace android { class Parcel; class Surface; -class ISurfaceTexture; +class IGraphicBufferProducer; template class SortedVector; @@ -131,9 +131,9 @@ public: return INVALID_OPERATION; } - // pass the buffered ISurfaceTexture to the media player service + // pass the buffered IGraphicBufferProducer to the media player service virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) = 0; + const sp& bufferProducer) = 0; virtual status_t prepare() = 0; virtual status_t prepareAsync() = 0; diff --git a/include/media/MediaRecorderBase.h b/include/media/MediaRecorderBase.h index ef799f5cff..803bc6436d 100644 --- a/include/media/MediaRecorderBase.h +++ b/include/media/MediaRecorderBase.h @@ -26,7 +26,7 @@ namespace android { class ICameraRecordingProxy; class Surface; -class ISurfaceTexture; +class IGraphicBufferProducer; struct MediaRecorderBase { MediaRecorderBase() {} @@ -55,7 +55,7 @@ struct MediaRecorderBase { virtual status_t reset() = 0; virtual status_t getMaxAmplitude(int *max) = 0; virtual status_t dump(int fd, const Vector& args) const = 0; - virtual sp querySurfaceMediaSource() const = 0; + virtual sp querySurfaceMediaSource() const = 0; private: MediaRecorderBase(const MediaRecorderBase &); diff --git a/include/media/mediaplayer.h b/include/media/mediaplayer.h index d753ebaa17..e5aa03301b 100644 --- a/include/media/mediaplayer.h +++ b/include/media/mediaplayer.h @@ -33,7 +33,7 @@ class ANativeWindow; namespace android { class Surface; -class ISurfaceTexture; +class IGraphicBufferProducer; enum media_event_type { MEDIA_NOP = 0, // interface test message @@ -199,7 +199,7 @@ public: status_t setDataSource(int fd, int64_t offset, int64_t length); status_t setDataSource(const sp &source); status_t setVideoSurfaceTexture( - const sp& surfaceTexture); + const sp& bufferProducer); status_t setListener(const sp& listener); status_t prepare(); status_t prepareAsync(); diff --git a/include/media/mediarecorder.h b/include/media/mediarecorder.h index 6d304e046c..2882c41978 100644 --- a/include/media/mediarecorder.h +++ b/include/media/mediarecorder.h @@ -31,7 +31,7 @@ class Surface; class IMediaRecorder; class ICamera; class ICameraRecordingProxy; -class ISurfaceTexture; +class IGraphicBufferProducer; class SurfaceTextureClient; typedef void (*media_completion_f)(status_t status, void *cookie); @@ -228,7 +228,7 @@ public: status_t close(); status_t release(); void notify(int msg, int ext1, int ext2); - sp querySurfaceMediaSourceFromMediaServer(); + sp querySurfaceMediaSourceFromMediaServer(); private: void doCleanUp(); @@ -237,10 +237,10 @@ private: sp mMediaRecorder; sp mListener; - // Reference toISurfaceTexture + // Reference to IGraphicBufferProducer // for encoding GL Frames. That is useful only when the // video source is set to VIDEO_SOURCE_GRALLOC_BUFFER - sp mSurfaceMediaSource; + sp mSurfaceMediaSource; media_recorder_states mCurrentState; bool mIsAudioSourceSet; diff --git a/include/media/stagefright/MediaCodec.h b/include/media/stagefright/MediaCodec.h index b1e57cf593..88aabf60a1 100644 --- a/include/media/stagefright/MediaCodec.h +++ b/include/media/stagefright/MediaCodec.h @@ -18,7 +18,7 @@ #define MEDIA_CODEC_H_ -#include +#include #include #include #include diff --git a/include/media/stagefright/SurfaceMediaSource.h b/include/media/stagefright/SurfaceMediaSource.h index e56527d60c..609d84fc98 100644 --- a/include/media/stagefright/SurfaceMediaSource.h +++ b/include/media/stagefright/SurfaceMediaSource.h @@ -17,7 +17,7 @@ #ifndef ANDROID_GUI_SURFACEMEDIASOURCE_H #define ANDROID_GUI_SURFACEMEDIASOURCE_H -#include +#include #include #include @@ -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 SurfaceTexture +// enforce this as in BufferQueue, dequeue can be used by SurfaceTextureClient // 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 SurfaceTexture of asynchronous events in the + // calls are used to notify the SurfaceTextureClient 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 SurfaceTexture). + // in the case of SurfaceTextureClient). // 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 efb45e2458..114f0f6d90 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.cpp +++ b/libvideoeditor/lvpp/NativeWindowRenderer.cpp @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include @@ -315,7 +315,7 @@ NativeWindowRenderer::~NativeWindowRenderer() { } void NativeWindowRenderer::render(RenderInput* input) { - sp ST = input->mST; + sp ST = input->mST; sp STC = input->mSTC; if (input->mIsExternalBuffer) { @@ -568,7 +568,7 @@ void NativeWindowRenderer::destroyRenderInput(RenderInput* input) { RenderInput::RenderInput(NativeWindowRenderer* renderer, GLuint textureId) : mRenderer(renderer) , mTextureId(textureId) { - mST = new SurfaceTexture(mTextureId); + mST = new GLConsumer(mTextureId); mSTC = new SurfaceTextureClient(mST->getBufferQueue()); native_window_connect(mSTC.get(), NATIVE_WINDOW_API_MEDIA); } diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.h b/libvideoeditor/lvpp/NativeWindowRenderer.h index 8fbb4f9e57..b0623bad37 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.h +++ b/libvideoeditor/lvpp/NativeWindowRenderer.h @@ -37,15 +37,15 @@ // we only expect that happens briefly when one clip is about to finish // and the next clip is about to start. // -// We allocate a SurfaceTexture for each RenderInput and the user can use +// We allocate a SurfaceTextureClient for each RenderInput and the user can use // the getTargetWindow() function to get the corresponding ANativeWindow -// for that SurfaceTexture. The intention is that the user can pass that +// for that SurfaceTextureClient. 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 SurfaceTexture; +class GLConsumer; class SurfaceTextureClient; class RenderInput; @@ -110,7 +110,7 @@ private: // destination aspect ratio. GLfloat mPositionCoordinates[8]; - // We use a different GL id for each SurfaceTexture. + // We use a different GL id for each SurfaceTextureClient. GLuint mNextTextureId; // Number of existing RenderInputs, just for debugging. @@ -146,7 +146,7 @@ private: class RenderInput { public: - // Returns the ANativeWindow corresponds to the SurfaceTexture. + // Returns the ANativeWindow corresponds to the SurfaceTextureClient. 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 SurfaceTexture. + // provided by the SurfaceTextureClient. void render(MediaBuffer *buffer, uint32_t videoEffect, M4xVSS_MediaRendering renderingMode, bool isExternalBuffer); private: @@ -164,7 +164,7 @@ private: ~RenderInput(); NativeWindowRenderer* mRenderer; GLuint mTextureId; - sp mST; + sp mST; sp mSTC; int mWidth, mHeight; diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp index 34731d724c..754c5a9686 100755 --- a/libvideoeditor/lvpp/PreviewPlayer.cpp +++ b/libvideoeditor/lvpp/PreviewPlayer.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "VideoEditorPreviewController.h" @@ -1775,12 +1775,12 @@ void PreviewPlayer::setSurface(const sp &surface) { setNativeWindow_l(surface); } -void PreviewPlayer::setSurfaceTexture(const sp &surfaceTexture) { +void PreviewPlayer::setSurfaceTexture(const sp &bufferProducer) { Mutex::Autolock autoLock(mLock); mSurface.clear(); - if (surfaceTexture != NULL) { - setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); + if (bufferProducer != NULL) { + setNativeWindow_l(new SurfaceTextureClient(bufferProducer)); } } diff --git a/libvideoeditor/lvpp/PreviewPlayer.h b/libvideoeditor/lvpp/PreviewPlayer.h index 177853f2aa..5a13b58a0d 100755 --- a/libvideoeditor/lvpp/PreviewPlayer.h +++ b/libvideoeditor/lvpp/PreviewPlayer.h @@ -44,7 +44,7 @@ struct PreviewPlayer { bool isPlaying() const; void setSurface(const sp &surface); - void setSurfaceTexture(const sp &surfaceTexture); + void setSurfaceTexture(const sp &bufferProducer); status_t seekTo(int64_t timeUs); status_t getVideoDimensions(int32_t *width, int32_t *height) const; diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.cpp b/libvideoeditor/lvpp/VideoEditorPlayer.cpp index a47fc1510d..91a44150c4 100755 --- a/libvideoeditor/lvpp/VideoEditorPlayer.cpp +++ b/libvideoeditor/lvpp/VideoEditorPlayer.cpp @@ -81,10 +81,10 @@ status_t VideoEditorPlayer::setVideoSurface(const sp &surface) { return OK; } -status_t VideoEditorPlayer::setVideoSurfaceTexture(const sp &surfaceTexture) { +status_t VideoEditorPlayer::setVideoSurfaceTexture(const sp &bufferProducer) { ALOGV("setVideoSurfaceTexture"); - mPlayer->setSurfaceTexture(surfaceTexture); + mPlayer->setSurfaceTexture(bufferProducer); return OK; } diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.h b/libvideoeditor/lvpp/VideoEditorPlayer.h index 2ab4eef076..77194ab880 100755 --- a/libvideoeditor/lvpp/VideoEditorPlayer.h +++ b/libvideoeditor/lvpp/VideoEditorPlayer.h @@ -99,7 +99,7 @@ public: virtual status_t setDataSource(int fd, int64_t offset, int64_t length); virtual status_t setVideoSurface(const sp &surface); - virtual status_t setVideoSurfaceTexture(const sp &surfaceTexture); + virtual status_t setVideoSurfaceTexture(const sp &bufferProducer); virtual status_t prepare(); virtual status_t prepareAsync(); virtual status_t start(); diff --git a/media/libmedia/IMediaPlayer.cpp b/media/libmedia/IMediaPlayer.cpp index cb077661cf..e79bcd242d 100644 --- a/media/libmedia/IMediaPlayer.cpp +++ b/media/libmedia/IMediaPlayer.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include namespace android { @@ -113,12 +113,12 @@ public: return reply.readInt32(); } - // pass the buffered ISurfaceTexture to the media player service - status_t setVideoSurfaceTexture(const sp& surfaceTexture) + // pass the buffered IGraphicBufferProducer to the media player service + status_t setVideoSurfaceTexture(const sp& bufferProducer) { Parcel data, reply; data.writeInterfaceToken(IMediaPlayer::getInterfaceDescriptor()); - sp b(surfaceTexture->asBinder()); + sp b(bufferProducer->asBinder()); data.writeStrongBinder(b); remote()->transact(SET_VIDEO_SURFACETEXTURE, data, &reply); return reply.readInt32(); @@ -383,9 +383,9 @@ status_t BnMediaPlayer::onTransact( } case SET_VIDEO_SURFACETEXTURE: { CHECK_INTERFACE(IMediaPlayer, data, reply); - sp surfaceTexture = - interface_cast(data.readStrongBinder()); - reply->writeInt32(setVideoSurfaceTexture(surfaceTexture)); + sp bufferProducer = + interface_cast(data.readStrongBinder()); + reply->writeInt32(setVideoSurfaceTexture(bufferProducer)); return NO_ERROR; } break; case PREPARE_ASYNC: { diff --git a/media/libmedia/IMediaRecorder.cpp b/media/libmedia/IMediaRecorder.cpp index a710fd77ba..fdbc747ace 100644 --- a/media/libmedia/IMediaRecorder.cpp +++ b/media/libmedia/IMediaRecorder.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include @@ -73,7 +73,7 @@ public: return reply.readInt32(); } - sp querySurfaceMediaSource() + sp querySurfaceMediaSource() { ALOGV("Query SurfaceMediaSource"); Parcel data, reply; @@ -83,7 +83,7 @@ public: if (returnedNull) { return NULL; } - return interface_cast(reply.readStrongBinder()); + return interface_cast(reply.readStrongBinder()); } status_t setPreviewSurface(const sp& surface) @@ -444,7 +444,7 @@ status_t BnMediaRecorder::onTransact( CHECK_INTERFACE(IMediaRecorder, data, reply); // call the mediaserver side to create // a surfacemediasource - sp surfaceMediaSource = querySurfaceMediaSource(); + sp surfaceMediaSource = querySurfaceMediaSource(); // The mediaserver might have failed to create a source int returnedNull= (surfaceMediaSource == NULL) ? 1 : 0 ; reply->writeInt32(returnedNull); diff --git a/media/libmedia/IRemoteDisplayClient.cpp b/media/libmedia/IRemoteDisplayClient.cpp index 4a1b570f1c..5c494b306d 100644 --- a/media/libmedia/IRemoteDisplayClient.cpp +++ b/media/libmedia/IRemoteDisplayClient.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include namespace android { @@ -37,12 +37,12 @@ public: { } - void onDisplayConnected(const sp& surfaceTexture, + void onDisplayConnected(const sp& bufferProducer, uint32_t width, uint32_t height, uint32_t flags) { Parcel data, reply; data.writeInterfaceToken(IRemoteDisplayClient::getInterfaceDescriptor()); - data.writeStrongBinder(surfaceTexture->asBinder()); + data.writeStrongBinder(bufferProducer->asBinder()); data.writeInt32(width); data.writeInt32(height); data.writeInt32(flags); @@ -75,8 +75,8 @@ status_t BnRemoteDisplayClient::onTransact( switch (code) { case ON_DISPLAY_CONNECTED: { CHECK_INTERFACE(IRemoteDisplayClient, data, reply); - sp surfaceTexture( - interface_cast(data.readStrongBinder())); + sp surfaceTexture( + interface_cast(data.readStrongBinder())); uint32_t width = data.readInt32(); uint32_t height = data.readInt32(); uint32_t flags = data.readInt32(); diff --git a/media/libmedia/mediaplayer.cpp b/media/libmedia/mediaplayer.cpp index bbbf4b6196..ae527e85da 100644 --- a/media/libmedia/mediaplayer.cpp +++ b/media/libmedia/mediaplayer.cpp @@ -221,12 +221,12 @@ status_t MediaPlayer::getMetadata(bool update_only, bool apply_filter, Parcel *m } status_t MediaPlayer::setVideoSurfaceTexture( - const sp& surfaceTexture) + const sp& bufferProducer) { ALOGV("setVideoSurfaceTexture"); Mutex::Autolock _l(mLock); if (mPlayer == 0) return NO_INIT; - return mPlayer->setVideoSurfaceTexture(surfaceTexture); + return mPlayer->setVideoSurfaceTexture(bufferProducer); } // must call with lock held diff --git a/media/libmedia/mediarecorder.cpp b/media/libmedia/mediarecorder.cpp index 9541015699..95c7f3ef27 100644 --- a/media/libmedia/mediarecorder.cpp +++ b/media/libmedia/mediarecorder.cpp @@ -24,7 +24,7 @@ #include #include #include // for MEDIA_ERROR_SERVER_DIED -#include +#include namespace android { @@ -348,9 +348,9 @@ status_t MediaRecorder::setVideoSize(int width, int height) } // Query a SurfaceMediaSurface through the Mediaserver, over the -// binder interface. This is used by the Filter Framework (MeidaEncoder) -// to get an object to hook up to ANativeWindow. -sp MediaRecorder:: +// binder interface. This is used by the Filter Framework (MediaEncoder) +// to get an object to hook up to ANativeWindow. +sp MediaRecorder:: querySurfaceMediaSourceFromMediaServer() { Mutex::Autolock _l(mLock); diff --git a/media/libmediaplayerservice/MediaPlayerService.cpp b/media/libmediaplayerservice/MediaPlayerService.cpp index c3e5c40714..4ca0811680 100644 --- a/media/libmediaplayerservice/MediaPlayerService.cpp +++ b/media/libmediaplayerservice/MediaPlayerService.cpp @@ -714,21 +714,21 @@ void MediaPlayerService::Client::disconnectNativeWindow() { } status_t MediaPlayerService::Client::setVideoSurfaceTexture( - const sp& surfaceTexture) + const sp& bufferProducer) { - ALOGV("[%d] setVideoSurfaceTexture(%p)", mConnId, surfaceTexture.get()); + ALOGV("[%d] setVideoSurfaceTexture(%p)", mConnId, bufferProducer.get()); sp p = getPlayer(); if (p == 0) return UNKNOWN_ERROR; - sp binder(surfaceTexture == NULL ? NULL : - surfaceTexture->asBinder()); + sp binder(bufferProducer == NULL ? NULL : + bufferProducer->asBinder()); if (mConnectedWindowBinder == binder) { return OK; } sp anw; - if (surfaceTexture != NULL) { - anw = new SurfaceTextureClient(surfaceTexture); + if (bufferProducer != NULL) { + anw = new SurfaceTextureClient(bufferProducer); status_t err = native_window_api_connect(anw.get(), NATIVE_WINDOW_API_MEDIA); @@ -745,10 +745,10 @@ status_t MediaPlayerService::Client::setVideoSurfaceTexture( } } - // Note that we must set the player's new SurfaceTexture before + // Note that we must set the player's new GraphicBufferProducer before // disconnecting the old one. Otherwise queue/dequeue calls could be made // on the disconnected ANW, which may result in errors. - status_t err = p->setVideoSurfaceTexture(surfaceTexture); + status_t err = p->setVideoSurfaceTexture(bufferProducer); disconnectNativeWindow(); diff --git a/media/libmediaplayerservice/MediaPlayerService.h b/media/libmediaplayerservice/MediaPlayerService.h index fd648dfcc8..afb67805f6 100644 --- a/media/libmediaplayerservice/MediaPlayerService.h +++ b/media/libmediaplayerservice/MediaPlayerService.h @@ -307,7 +307,7 @@ private: // IMediaPlayer interface virtual void disconnect(); virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture); + const sp& bufferProducer); virtual status_t prepareAsync(); virtual status_t start(); virtual status_t stop(); diff --git a/media/libmediaplayerservice/MediaRecorderClient.cpp b/media/libmediaplayerservice/MediaRecorderClient.cpp index eadc8ee75c..c6d8b7668c 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.cpp +++ b/media/libmediaplayerservice/MediaRecorderClient.cpp @@ -38,7 +38,7 @@ #include "MediaPlayerService.h" #include "StagefrightRecorder.h" -#include +#include namespace android { @@ -56,7 +56,7 @@ static bool checkPermission(const char* permissionString) { } -sp MediaRecorderClient::querySurfaceMediaSource() +sp MediaRecorderClient::querySurfaceMediaSource() { ALOGV("Query SurfaceMediaSource"); Mutex::Autolock lock(mLock); diff --git a/media/libmediaplayerservice/MediaRecorderClient.h b/media/libmediaplayerservice/MediaRecorderClient.h index c9ccf22ed9..56239177c1 100644 --- a/media/libmediaplayerservice/MediaRecorderClient.h +++ b/media/libmediaplayerservice/MediaRecorderClient.h @@ -25,7 +25,7 @@ namespace android { class MediaRecorderBase; class MediaPlayerService; class ICameraRecordingProxy; -class ISurfaceTexture; +class IGraphicBufferProducer; class MediaRecorderClient : public BnMediaRecorder { @@ -55,7 +55,7 @@ public: virtual status_t close(); virtual status_t release(); virtual status_t dump(int fd, const Vector& args) const; - virtual sp querySurfaceMediaSource(); + virtual sp querySurfaceMediaSource(); private: friend class MediaPlayerService; // for accessing private constructor diff --git a/media/libmediaplayerservice/MidiFile.h b/media/libmediaplayerservice/MidiFile.h index f6f8f7b3ef..24d59b40be 100644 --- a/media/libmediaplayerservice/MidiFile.h +++ b/media/libmediaplayerservice/MidiFile.h @@ -36,7 +36,7 @@ public: virtual status_t setDataSource(int fd, int64_t offset, int64_t length); virtual status_t setVideoSurfaceTexture( - const sp& surfaceTexture) + const sp& bufferProducer) { return UNKNOWN_ERROR; } virtual status_t prepare(); virtual status_t prepareAsync(); diff --git a/media/libmediaplayerservice/StagefrightPlayer.cpp b/media/libmediaplayerservice/StagefrightPlayer.cpp index 619c149089..de61d9bbed 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.cpp +++ b/media/libmediaplayerservice/StagefrightPlayer.cpp @@ -70,10 +70,10 @@ status_t StagefrightPlayer::setDataSource(const sp &source) { } status_t StagefrightPlayer::setVideoSurfaceTexture( - const sp &surfaceTexture) { + const sp &bufferProducer) { ALOGV("setVideoSurfaceTexture"); - return mPlayer->setSurfaceTexture(surfaceTexture); + return mPlayer->setSurfaceTexture(bufferProducer); } status_t StagefrightPlayer::prepare() { diff --git a/media/libmediaplayerservice/StagefrightPlayer.h b/media/libmediaplayerservice/StagefrightPlayer.h index e89e18ab2b..600945e6a2 100644 --- a/media/libmediaplayerservice/StagefrightPlayer.h +++ b/media/libmediaplayerservice/StagefrightPlayer.h @@ -41,7 +41,7 @@ public: virtual status_t setDataSource(const sp &source); virtual status_t setVideoSurfaceTexture( - const sp &surfaceTexture); + const sp &bufferProducer); virtual status_t prepare(); virtual status_t prepareAsync(); virtual status_t start(); diff --git a/media/libmediaplayerservice/StagefrightRecorder.cpp b/media/libmediaplayerservice/StagefrightRecorder.cpp index 57b0ec232d..497dda65e9 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.cpp +++ b/media/libmediaplayerservice/StagefrightRecorder.cpp @@ -89,7 +89,7 @@ status_t StagefrightRecorder::init() { // The client side of mediaserver asks it to creat a SurfaceMediaSource // and return a interface reference. The client side will use that // while encoding GL Frames -sp StagefrightRecorder::querySurfaceMediaSource() const { +sp StagefrightRecorder::querySurfaceMediaSource() const { ALOGV("Get SurfaceMediaSource"); return mSurfaceMediaSource->getBufferQueue(); } diff --git a/media/libmediaplayerservice/StagefrightRecorder.h b/media/libmediaplayerservice/StagefrightRecorder.h index ec5ce7ee58..351efd4571 100644 --- a/media/libmediaplayerservice/StagefrightRecorder.h +++ b/media/libmediaplayerservice/StagefrightRecorder.h @@ -35,7 +35,7 @@ struct MediaWriter; class MetaData; struct AudioSource; class MediaProfiles; -class ISurfaceTexture; +class IGraphicBufferProducer; class SurfaceMediaSource; struct StagefrightRecorder : public MediaRecorderBase { @@ -65,7 +65,7 @@ struct StagefrightRecorder : public MediaRecorderBase { virtual status_t getMaxAmplitude(int *max); virtual status_t dump(int fd, const Vector& args) const; // Querying a SurfaceMediaSourcer - virtual sp querySurfaceMediaSource() const; + virtual sp querySurfaceMediaSource() const; private: sp mCamera; @@ -116,7 +116,7 @@ private: bool mStarted; // Needed when GLFrames are encoded. - // An pointer + // An pointer // will be sent to the client side using which the // frame buffers will be queued and dequeued sp mSurfaceMediaSource; diff --git a/media/libmediaplayerservice/TestPlayerStub.h b/media/libmediaplayerservice/TestPlayerStub.h index 91ffa7dc43..a3802ebb8a 100644 --- a/media/libmediaplayerservice/TestPlayerStub.h +++ b/media/libmediaplayerservice/TestPlayerStub.h @@ -76,7 +76,7 @@ class TestPlayerStub : public MediaPlayerInterface { // All the methods below wrap the mPlayer instance. virtual status_t setVideoSurfaceTexture( - const android::sp& st) { + const android::sp& st) { return mPlayer->setVideoSurfaceTexture(st); } virtual status_t prepare() {return mPlayer->prepare();} diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp index 0f30372b1c..517fb34ef6 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.cpp @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include "avc_utils.h" @@ -198,16 +198,16 @@ void NuPlayer::setDataSource(int fd, int64_t offset, int64_t length) { } void NuPlayer::setVideoSurfaceTextureAsync( - const sp &surfaceTexture) { + const sp &bufferProducer) { sp msg = new AMessage(kWhatSetVideoNativeWindow, id()); - if (surfaceTexture == NULL) { + if (bufferProducer == NULL) { msg->setObject("native-window", NULL); } else { msg->setObject( "native-window", new NativeWindowWrapper( - new SurfaceTextureClient(surfaceTexture))); + new SurfaceTextureClient(bufferProducer))); } msg->post(); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayer.h b/media/libmediaplayerservice/nuplayer/NuPlayer.h index ca87be956a..09fc0ba732 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayer.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayer.h @@ -43,7 +43,7 @@ struct NuPlayer : public AHandler { void setDataSource(int fd, int64_t offset, int64_t length); void setVideoSurfaceTextureAsync( - const sp &surfaceTexture); + const sp &bufferProducer); void setAudioSink(const sp &sink); void start(); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp index a485ddae48..7043404400 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.cpp @@ -97,7 +97,7 @@ status_t NuPlayerDriver::setDataSource(const sp &source) { } status_t NuPlayerDriver::setVideoSurfaceTexture( - const sp &surfaceTexture) { + const sp &bufferProducer) { Mutex::Autolock autoLock(mLock); if (mResetInProgress) { @@ -106,7 +106,7 @@ status_t NuPlayerDriver::setVideoSurfaceTexture( mSetSurfaceInProgress = true; - mPlayer->setVideoSurfaceTextureAsync(surfaceTexture); + mPlayer->setVideoSurfaceTextureAsync(bufferProducer); while (mSetSurfaceInProgress) { mCondition.wait(mLock); diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h index d551bf178a..553c406795 100644 --- a/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h +++ b/media/libmediaplayerservice/nuplayer/NuPlayerDriver.h @@ -38,7 +38,7 @@ struct NuPlayerDriver : public MediaPlayerInterface { virtual status_t setDataSource(const sp &source); virtual status_t setVideoSurfaceTexture( - const sp &surfaceTexture); + const sp &bufferProducer); virtual status_t prepare(); virtual status_t prepareAsync(); virtual status_t start(); diff --git a/media/libstagefright/AwesomePlayer.cpp b/media/libstagefright/AwesomePlayer.cpp index 1e2625a6dc..23ce08814b 100644 --- a/media/libstagefright/AwesomePlayer.cpp +++ b/media/libstagefright/AwesomePlayer.cpp @@ -48,7 +48,7 @@ #include #include -#include +#include #include #include @@ -1178,12 +1178,12 @@ bool AwesomePlayer::isPlaying() const { return (mFlags & PLAYING) || (mFlags & CACHE_UNDERRUN); } -status_t AwesomePlayer::setSurfaceTexture(const sp &surfaceTexture) { +status_t AwesomePlayer::setSurfaceTexture(const sp &bufferProducer) { Mutex::Autolock autoLock(mLock); status_t err; - if (surfaceTexture != NULL) { - err = setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); + if (bufferProducer != NULL) { + err = setNativeWindow_l(new SurfaceTextureClient(bufferProducer)); } else { err = setNativeWindow_l(NULL); } diff --git a/media/libstagefright/colorconversion/SoftwareRenderer.cpp b/media/libstagefright/colorconversion/SoftwareRenderer.cpp index 2704a37113..77f21b79f6 100644 --- a/media/libstagefright/colorconversion/SoftwareRenderer.cpp +++ b/media/libstagefright/colorconversion/SoftwareRenderer.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace android { diff --git a/media/libstagefright/include/AwesomePlayer.h b/media/libstagefright/include/AwesomePlayer.h index 1422687de4..2306f3126a 100644 --- a/media/libstagefright/include/AwesomePlayer.h +++ b/media/libstagefright/include/AwesomePlayer.h @@ -36,7 +36,7 @@ struct MediaBuffer; struct MediaExtractor; struct MediaSource; struct NuCachedSource2; -struct ISurfaceTexture; +struct IGraphicBufferProducer; class DrmManagerClinet; class DecryptHandle; @@ -81,7 +81,7 @@ struct AwesomePlayer { bool isPlaying() const; - status_t setSurfaceTexture(const sp &surfaceTexture); + status_t setSurfaceTexture(const sp &bufferProducer); void setAudioSink(const sp &audioSink); status_t setLooping(bool shouldLoop); diff --git a/media/libstagefright/tests/SurfaceMediaSource_test.cpp b/media/libstagefright/tests/SurfaceMediaSource_test.cpp index a61d6a20f0..6a985098e2 100644 --- a/media/libstagefright/tests/SurfaceMediaSource_test.cpp +++ b/media/libstagefright/tests/SurfaceMediaSource_test.cpp @@ -107,7 +107,7 @@ protected: window.get(), NULL); } else { ALOGV("No actual display. Choosing EGLSurface based on SurfaceMediaSource"); - sp sms = (new SurfaceMediaSource( + sp sms = (new SurfaceMediaSource( getSurfaceWidth(), getSurfaceHeight()))->getBufferQueue(); sp stc = new SurfaceTextureClient(sms); sp window = stc; @@ -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 SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; } @@ -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 SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; // Doing the setup related to the GL Side @@ -482,7 +482,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(); + sp iST = mr->querySurfaceMediaSourceFromMediaServer(); mSTC = new SurfaceTextureClient(iST); mANW = mSTC; @@ -749,7 +749,7 @@ TEST_F(SurfaceMediaSourceTest, DISABLED_EncodingFromCpuYV12BufferNpotWriteMediaS mYuvTexHeight, 30); // get the reference to the surfacemediasource living in // mediaserver that is created by stagefrightrecorder - sp iST = mr->querySurfaceMediaSourceFromMediaServer(); + sp iST = mr->querySurfaceMediaSourceFromMediaServer(); mSTC = new SurfaceTextureClient(iST); mANW = mSTC; ASSERT_EQ(NO_ERROR, native_window_api_connect(mANW.get(), NATIVE_WINDOW_API_CPU)); @@ -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 SurfaceTextureClient(static_cast >( mSMS->getBufferQueue())); mANW = mSTC; DummyRecorder writer(mSMS); diff --git a/media/libstagefright/wifi-display/sink/RTPSink.cpp b/media/libstagefright/wifi-display/sink/RTPSink.cpp index 0918034957..640e05554c 100644 --- a/media/libstagefright/wifi-display/sink/RTPSink.cpp +++ b/media/libstagefright/wifi-display/sink/RTPSink.cpp @@ -238,9 +238,9 @@ void RTPSink::Source::addReportBlock( RTPSink::RTPSink( const sp &netSession, - const sp &surfaceTex) + const sp &bufferProducer) : mNetSession(netSession), - mSurfaceTex(surfaceTex), + mSurfaceTex(bufferProducer), mRTPPort(0), mRTPSessionID(0), mRTCPSessionID(0), diff --git a/media/libstagefright/wifi-display/sink/RTPSink.h b/media/libstagefright/wifi-display/sink/RTPSink.h index a1d127dab4..2183fd6646 100644 --- a/media/libstagefright/wifi-display/sink/RTPSink.h +++ b/media/libstagefright/wifi-display/sink/RTPSink.h @@ -35,7 +35,7 @@ struct TunnelRenderer; // the RTCP channel. struct RTPSink : public AHandler { RTPSink(const sp &netSession, - const sp &surfaceTex); + const sp &bufferProducer); // If TCP interleaving is used, no UDP sockets are created, instead // incoming RTP/RTCP packets (arriving on the RTSP control connection) @@ -66,7 +66,7 @@ private: struct StreamSource; sp mNetSession; - sp mSurfaceTex; + sp mSurfaceTex; KeyedVector > mSources; int32_t mRTPPort; diff --git a/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp b/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp index b913124587..8ffb877dd8 100644 --- a/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp +++ b/media/libstagefright/wifi-display/sink/TunnelRenderer.cpp @@ -159,9 +159,9 @@ void TunnelRenderer::StreamSource::doSomeWork() { TunnelRenderer::TunnelRenderer( const sp ¬ifyLost, - const sp &surfaceTex) + const sp &bufferProducer) : mNotifyLost(notifyLost), - mSurfaceTex(surfaceTex), + mSurfaceTex(bufferProducer), mTotalBytesQueued(0ll), mLastDequeuedExtSeqNo(-1), mFirstFailedAttemptUs(-1ll), diff --git a/media/libstagefright/wifi-display/sink/TunnelRenderer.h b/media/libstagefright/wifi-display/sink/TunnelRenderer.h index c9597e0e35..52e6e66f12 100644 --- a/media/libstagefright/wifi-display/sink/TunnelRenderer.h +++ b/media/libstagefright/wifi-display/sink/TunnelRenderer.h @@ -36,7 +36,7 @@ struct IStreamListener; struct TunnelRenderer : public AHandler { TunnelRenderer( const sp ¬ifyLost, - const sp &surfaceTex); + const sp &bufferProducer); sp dequeueBuffer(); @@ -55,7 +55,7 @@ private: mutable Mutex mLock; sp mNotifyLost; - sp mSurfaceTex; + sp mSurfaceTex; List > mPackets; int64_t mTotalBytesQueued; diff --git a/media/libstagefright/wifi-display/sink/WifiDisplaySink.cpp b/media/libstagefright/wifi-display/sink/WifiDisplaySink.cpp index c3e047046e..0f0caf11d9 100644 --- a/media/libstagefright/wifi-display/sink/WifiDisplaySink.cpp +++ b/media/libstagefright/wifi-display/sink/WifiDisplaySink.cpp @@ -31,10 +31,10 @@ namespace android { WifiDisplaySink::WifiDisplaySink( const sp &netSession, - const sp &surfaceTex) + const sp &bufferProducer) : mState(UNDEFINED), mNetSession(netSession), - mSurfaceTex(surfaceTex), + mSurfaceTex(bufferProducer), mSessionID(0), mNextCSeq(1) { } diff --git a/media/libstagefright/wifi-display/sink/WifiDisplaySink.h b/media/libstagefright/wifi-display/sink/WifiDisplaySink.h index f886ee557d..a50883940a 100644 --- a/media/libstagefright/wifi-display/sink/WifiDisplaySink.h +++ b/media/libstagefright/wifi-display/sink/WifiDisplaySink.h @@ -34,7 +34,7 @@ struct RTPSink; struct WifiDisplaySink : public AHandler { WifiDisplaySink( const sp &netSession, - const sp &surfaceTex = NULL); + const sp &bufferProducer = NULL); void start(const char *sourceHost, int32_t sourcePort); void start(const char *uri); @@ -76,7 +76,7 @@ private: State mState; sp mNetSession; - sp mSurfaceTex; + sp mSurfaceTex; AString mSetupURI; AString mRTSPHost; int32_t mSessionID; diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp index 916f7978bc..d6b87a773a 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp +++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp @@ -786,7 +786,7 @@ status_t WifiDisplaySource::PlaybackSession::addAudioSource(bool usePCMAudio) { return OK; } -sp WifiDisplaySource::PlaybackSession::getSurfaceTexture() { +sp WifiDisplaySource::PlaybackSession::getSurfaceTexture() { return mBufferQueue; } diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.h b/media/libstagefright/wifi-display/source/PlaybackSession.h index b9d193bf1f..281548d138 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.h +++ b/media/libstagefright/wifi-display/source/PlaybackSession.h @@ -26,7 +26,7 @@ namespace android { struct ABuffer; struct BufferQueue; struct IHDCP; -struct ISurfaceTexture; +struct IGraphicBufferProducer; struct MediaPuller; struct MediaSource; struct TSPacketizer; @@ -56,7 +56,7 @@ struct WifiDisplaySource::PlaybackSession : public AHandler { status_t finishPlay(); status_t pause(); - sp getSurfaceTexture(); + sp getSurfaceTexture(); int32_t width() const; int32_t height() const; diff --git a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp index 08f67f9cdf..9ec1064cd2 100644 --- a/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp +++ b/media/libstagefright/wifi-display/source/WifiDisplaySource.cpp @@ -25,7 +25,7 @@ #include "Sender.h" #include -#include +#include #include #include #include diff --git a/media/libstagefright/wifi-display/wfd.cpp b/media/libstagefright/wifi-display/wfd.cpp index 03a1123d5f..2ec9b4f44e 100644 --- a/media/libstagefright/wifi-display/wfd.cpp +++ b/media/libstagefright/wifi-display/wfd.cpp @@ -47,7 +47,7 @@ struct RemoteDisplayClient : public BnRemoteDisplayClient { RemoteDisplayClient(); virtual void onDisplayConnected( - const sp &surfaceTexture, + const sp &bufferProducer, uint32_t width, uint32_t height, uint32_t flags); @@ -67,7 +67,7 @@ private: bool mDone; sp mComposerClient; - sp mSurfaceTexture; + sp mSurfaceTexture; sp mDisplayBinder; DISALLOW_EVIL_CONSTRUCTORS(RemoteDisplayClient); @@ -83,14 +83,14 @@ RemoteDisplayClient::~RemoteDisplayClient() { } void RemoteDisplayClient::onDisplayConnected( - const sp &surfaceTexture, + const sp &bufferProducer, uint32_t width, uint32_t height, uint32_t flags) { ALOGI("onDisplayConnected width=%u, height=%u, flags = 0x%08x", width, height, flags); - mSurfaceTexture = surfaceTexture; + mSurfaceTexture = bufferProducer; mDisplayBinder = mComposerClient->createDisplay( String8("foo"), false /* secure */); diff --git a/services/camera/libcameraservice/Camera2Client.cpp b/services/camera/libcameraservice/Camera2Client.cpp index e804f77689..70bf0acfd1 100644 --- a/services/camera/libcameraservice/Camera2Client.cpp +++ b/services/camera/libcameraservice/Camera2Client.cpp @@ -497,7 +497,7 @@ status_t Camera2Client::setPreviewDisplay( } status_t Camera2Client::setPreviewTexture( - const sp& surfaceTexture) { + const sp& bufferProducer) { ATRACE_CALL(); ALOGV("%s: E", __FUNCTION__); Mutex::Autolock icl(mICameraLock); @@ -506,9 +506,9 @@ status_t Camera2Client::setPreviewTexture( sp binder; sp window; - if (surfaceTexture != 0) { - binder = surfaceTexture->asBinder(); - window = new SurfaceTextureClient(surfaceTexture); + if (bufferProducer != 0) { + binder = bufferProducer->asBinder(); + window = new SurfaceTextureClient(bufferProducer); } return setPreviewWindowL(binder, window); } diff --git a/services/camera/libcameraservice/Camera2Client.h b/services/camera/libcameraservice/Camera2Client.h index 55ead024aa..46699585fc 100644 --- a/services/camera/libcameraservice/Camera2Client.h +++ b/services/camera/libcameraservice/Camera2Client.h @@ -49,7 +49,7 @@ public: virtual status_t unlock(); virtual status_t setPreviewDisplay(const sp& surface); virtual status_t setPreviewTexture( - const sp& surfaceTexture); + const sp& bufferProducer); virtual void setPreviewCallbackFlag(int flag); virtual status_t startPreview(); virtual void stopPreview(); diff --git a/services/camera/libcameraservice/CameraClient.cpp b/services/camera/libcameraservice/CameraClient.cpp index 006a9c9ad3..f9cee0d591 100644 --- a/services/camera/libcameraservice/CameraClient.cpp +++ b/services/camera/libcameraservice/CameraClient.cpp @@ -307,17 +307,17 @@ status_t CameraClient::setPreviewDisplay(const sp& surface) { return setPreviewWindow(binder, window); } -// set the SurfaceTexture that the preview will use +// set the SurfaceTextureClient that the preview will use status_t CameraClient::setPreviewTexture( - const sp& surfaceTexture) { - LOG1("setPreviewTexture(%p) (pid %d)", surfaceTexture.get(), + const sp& bufferProducer) { + LOG1("setPreviewTexture(%p) (pid %d)", bufferProducer.get(), getCallingPid()); sp binder; sp window; - if (surfaceTexture != 0) { - binder = surfaceTexture->asBinder(); - window = new SurfaceTextureClient(surfaceTexture); + if (bufferProducer != 0) { + binder = bufferProducer->asBinder(); + window = new SurfaceTextureClient(bufferProducer); } return setPreviewWindow(binder, window); } diff --git a/services/camera/libcameraservice/CameraClient.h b/services/camera/libcameraservice/CameraClient.h index 2f31c4e711..7da3da7f97 100644 --- a/services/camera/libcameraservice/CameraClient.h +++ b/services/camera/libcameraservice/CameraClient.h @@ -33,7 +33,7 @@ public: virtual status_t lock(); virtual status_t unlock(); virtual status_t setPreviewDisplay(const sp& surface); - virtual status_t setPreviewTexture(const sp& surfaceTexture); + virtual status_t setPreviewTexture(const sp& bufferProducer); virtual void setPreviewCallbackFlag(int flag); virtual status_t startPreview(); virtual void stopPreview(); @@ -124,7 +124,7 @@ private: // Ensures atomicity among the public methods mutable Mutex mLock; - // This is a binder of Surface or SurfaceTexture. + // This is a binder of Surface or SurfaceTextureClient. sp mSurface; sp mPreviewWindow; diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h index 4dab340dec..41365a0578 100644 --- a/services/camera/libcameraservice/CameraService.h +++ b/services/camera/libcameraservice/CameraService.h @@ -81,7 +81,7 @@ public: virtual status_t lock() = 0; virtual status_t unlock() = 0; virtual status_t setPreviewDisplay(const sp& surface) = 0; - virtual status_t setPreviewTexture(const sp& surfaceTexture) = 0; + virtual status_t setPreviewTexture(const sp& bufferProducer)=0; virtual void setPreviewCallbackFlag(int flag) = 0; virtual status_t startPreview() = 0; virtual void stopPreview() = 0; -- 2.11.0