summaryrefslogtreecommitdiffstats
path: root/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2015-04-30 18:18:34 -0700
committerLajos Molnar <lajos@google.com>2015-04-30 18:53:52 -0700
commit1de1e25cba872bd4c077c2e394f8ca9c70b65856 (patch)
tree7f01e01b5a3731a9c345684e38755d97e6a67f19 /media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
parent31de88566257d5546cf4eee9064d96926a4b0c24 (diff)
downloadframeworks_av-1de1e25cba872bd4c077c2e394f8ca9c70b65856.zip
frameworks_av-1de1e25cba872bd4c077c2e394f8ca9c70b65856.tar.gz
frameworks_av-1de1e25cba872bd4c077c2e394f8ca9c70b65856.tar.bz2
stagefright: remove NativeWindowWrapper
Now that Surface and SurfaceTextureClient are the same and Surface, it does not add value. Bug: 19489395 Change-Id: I016ecd1cf5cc51ce6244b6fa34ecd75f84e3db01
Diffstat (limited to 'media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp')
-rw-r--r--media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp25
1 files changed, 10 insertions, 15 deletions
diff --git a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
index 3c4d695..376c93a 100644
--- a/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
+++ b/media/libmediaplayerservice/nuplayer/NuPlayerDecoder.cpp
@@ -33,6 +33,8 @@
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaErrors.h>
+#include <gui/Surface.h>
+
#include "avc_utils.h"
#include "ATSParser.h"
@@ -42,10 +44,10 @@ NuPlayer::Decoder::Decoder(
const sp<AMessage> &notify,
const sp<Source> &source,
const sp<Renderer> &renderer,
- const sp<NativeWindowWrapper> &nativeWindow,
+ const sp<Surface> &surface,
const sp<CCDecoder> &ccDecoder)
: DecoderBase(notify),
- mNativeWindow(nativeWindow),
+ mSurface(surface),
mSource(source),
mRenderer(renderer),
mCCDecoder(ccDecoder),
@@ -178,14 +180,9 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) {
mIsAudio = !strncasecmp("audio/", mime.c_str(), 6);
mIsVideoAVC = !strcasecmp(MEDIA_MIMETYPE_VIDEO_AVC, mime.c_str());
- sp<Surface> surface = NULL;
- if (mNativeWindow != NULL) {
- surface = mNativeWindow->getSurfaceTextureClient();
- }
-
mComponentName = mime;
mComponentName.append(" decoder");
- ALOGV("[%s] onConfigure (surface=%p)", mComponentName.c_str(), surface.get());
+ ALOGV("[%s] onConfigure (surface=%p)", mComponentName.c_str(), mSurface.get());
mCodec = MediaCodec::CreateByType(mCodecLooper, mime.c_str(), false /* encoder */);
int32_t secure = 0;
@@ -210,17 +207,17 @@ void NuPlayer::Decoder::onConfigure(const sp<AMessage> &format) {
mCodec->getName(&mComponentName);
status_t err;
- if (mNativeWindow != NULL) {
+ if (mSurface != NULL) {
// disconnect from surface as MediaCodec will reconnect
err = native_window_api_disconnect(
- surface.get(), NATIVE_WINDOW_API_MEDIA);
+ mSurface.get(), NATIVE_WINDOW_API_MEDIA);
// We treat this as a warning, as this is a preparatory step.
// Codec will try to connect to the surface, which is where
// any error signaling will occur.
ALOGW_IF(err != OK, "failed to disconnect from surface: %d", err);
}
err = mCodec->configure(
- format, surface, NULL /* crypto */, 0 /* flags */);
+ format, mSurface, NULL /* crypto */, 0 /* flags */);
if (err != OK) {
ALOGE("Failed to configure %s decoder (err=%d)", mComponentName.c_str(), err);
mCodec->release();
@@ -337,12 +334,10 @@ void NuPlayer::Decoder::onShutdown(bool notifyComplete) {
mCodec = NULL;
++mBufferGeneration;
- if (mNativeWindow != NULL) {
+ if (mSurface != NULL) {
// reconnect to surface as MediaCodec disconnected from it
status_t error =
- native_window_api_connect(
- mNativeWindow->getNativeWindow().get(),
- NATIVE_WINDOW_API_MEDIA);
+ native_window_api_connect(mSurface.get(), NATIVE_WINDOW_API_MEDIA);
ALOGW_IF(error != NO_ERROR,
"[%s] failed to connect to native window, error=%d",
mComponentName.c_str(), error);