diff options
Diffstat (limited to 'libvideoeditor')
-rwxr-xr-x | libvideoeditor/lvpp/Android.mk | 1 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/NativeWindowRenderer.cpp | 12 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/NativeWindowRenderer.h | 18 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/PreviewPlayer.cpp | 10 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/PreviewPlayer.h | 2 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPlayer.cpp | 8 | ||||
-rwxr-xr-x | libvideoeditor/lvpp/VideoEditorPlayer.h | 2 |
7 files changed, 26 insertions, 27 deletions
diff --git a/libvideoeditor/lvpp/Android.mk b/libvideoeditor/lvpp/Android.mk index 0ed7e6c..778c5ac 100755 --- a/libvideoeditor/lvpp/Android.mk +++ b/libvideoeditor/lvpp/Android.mk @@ -54,7 +54,6 @@ LOCAL_SHARED_LIBRARIES := \ libGLESv2 \ libgui \ libmedia \ - libmedia_native \ libdrmframework \ libstagefright \ libstagefright_foundation \ diff --git a/libvideoeditor/lvpp/NativeWindowRenderer.cpp b/libvideoeditor/lvpp/NativeWindowRenderer.cpp index 2e15ff9..702900b 100755 --- a/libvideoeditor/lvpp/NativeWindowRenderer.cpp +++ b/libvideoeditor/lvpp/NativeWindowRenderer.cpp @@ -20,8 +20,8 @@ #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <cutils/log.h> -#include <gui/SurfaceTexture.h> -#include <gui/SurfaceTextureClient.h> +#include <gui/GLConsumer.h> +#include <gui/Surface.h> #include <media/stagefright/MediaBuffer.h> #include <media/stagefright/MetaData.h> #include <media/stagefright/foundation/ADebug.h> @@ -315,8 +315,8 @@ NativeWindowRenderer::~NativeWindowRenderer() { } void NativeWindowRenderer::render(RenderInput* input) { - sp<SurfaceTexture> ST = input->mST; - sp<SurfaceTextureClient> STC = input->mSTC; + sp<GLConsumer> ST = input->mST; + sp<Surface> STC = input->mSTC; if (input->mIsExternalBuffer) { queueExternalBuffer(STC.get(), input->mBuffer, @@ -568,8 +568,8 @@ void NativeWindowRenderer::destroyRenderInput(RenderInput* input) { RenderInput::RenderInput(NativeWindowRenderer* renderer, GLuint textureId) : mRenderer(renderer) , mTextureId(textureId) { - mST = new SurfaceTexture(mTextureId); - mSTC = new SurfaceTextureClient(mST); + mST = new GLConsumer(mTextureId); + 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 8fbb4f9..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 SurfaceTexture 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 SurfaceTexture. 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 SurfaceTexture; -class SurfaceTextureClient; +class GLConsumer; +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 SurfaceTexture. + // 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 SurfaceTexture. + // 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 SurfaceTexture. + // provided by the Surface. void render(MediaBuffer *buffer, uint32_t videoEffect, M4xVSS_MediaRendering renderingMode, bool isExternalBuffer); private: @@ -164,8 +164,8 @@ private: ~RenderInput(); NativeWindowRenderer* mRenderer; GLuint mTextureId; - sp<SurfaceTexture> mST; - sp<SurfaceTextureClient> mSTC; + sp<GLConsumer> mST; + sp<Surface> mSTC; int mWidth, mHeight; // These are only valid during render() calls diff --git a/libvideoeditor/lvpp/PreviewPlayer.cpp b/libvideoeditor/lvpp/PreviewPlayer.cpp index 34731d7..2bd9f84 100755 --- a/libvideoeditor/lvpp/PreviewPlayer.cpp +++ b/libvideoeditor/lvpp/PreviewPlayer.cpp @@ -31,8 +31,8 @@ #include <media/stagefright/OMXCodec.h> #include <media/stagefright/foundation/ADebug.h> #include <gui/Surface.h> -#include <gui/ISurfaceTexture.h> -#include <gui/SurfaceTextureClient.h> +#include <gui/IGraphicBufferProducer.h> +#include <gui/Surface.h> #include "VideoEditorPreviewController.h" #include "DummyAudioSource.h" @@ -1775,12 +1775,12 @@ void PreviewPlayer::setSurface(const sp<Surface> &surface) { setNativeWindow_l(surface); } -void PreviewPlayer::setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { +void PreviewPlayer::setSurfaceTexture(const sp<IGraphicBufferProducer> &bufferProducer) { Mutex::Autolock autoLock(mLock); mSurface.clear(); - if (surfaceTexture != NULL) { - setNativeWindow_l(new SurfaceTextureClient(surfaceTexture)); + if (bufferProducer != NULL) { + setNativeWindow_l(new Surface(bufferProducer)); } } diff --git a/libvideoeditor/lvpp/PreviewPlayer.h b/libvideoeditor/lvpp/PreviewPlayer.h index 177853f..5a13b58 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> &surface); - void setSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); + void setSurfaceTexture(const sp<IGraphicBufferProducer> &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 fc9fb49..91a4415 100755 --- a/libvideoeditor/lvpp/VideoEditorPlayer.cpp +++ b/libvideoeditor/lvpp/VideoEditorPlayer.cpp @@ -81,10 +81,10 @@ status_t VideoEditorPlayer::setVideoSurface(const sp<Surface> &surface) { return OK; } -status_t VideoEditorPlayer::setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture) { +status_t VideoEditorPlayer::setVideoSurfaceTexture(const sp<IGraphicBufferProducer> &bufferProducer) { ALOGV("setVideoSurfaceTexture"); - mPlayer->setSurfaceTexture(surfaceTexture); + mPlayer->setSurfaceTexture(bufferProducer); return OK; } @@ -406,8 +406,8 @@ status_t VideoEditorPlayer::VeAudioOutput::open( } ALOGV("open(%u, %d, %d, %d)", sampleRate, channelCount, format, bufferCount); if (mTrack) close(); - int afSampleRate; - int afFrameCount; + uint32_t afSampleRate; + size_t afFrameCount; int frameCount; if (AudioSystem::getOutputFrameCount(&afFrameCount, mStreamType) != diff --git a/libvideoeditor/lvpp/VideoEditorPlayer.h b/libvideoeditor/lvpp/VideoEditorPlayer.h index 2ab4eef..77194ab 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> &surface); - virtual status_t setVideoSurfaceTexture(const sp<ISurfaceTexture> &surfaceTexture); + virtual status_t setVideoSurfaceTexture(const sp<IGraphicBufferProducer> &bufferProducer); virtual status_t prepare(); virtual status_t prepareAsync(); virtual status_t start(); |