summaryrefslogtreecommitdiffstats
path: root/media/libstagefright
diff options
context:
space:
mode:
authorDaniel Lam <dalam@google.com>2012-02-23 14:35:13 -0800
committerDaniel Lam <dalam@google.com>2012-03-13 14:39:28 -0700
commit2e76c992bfa955cb637417005941e3e93810a99d (patch)
treef3ef2b68546427a92df9462042150aee889911da /media/libstagefright
parentdc19246853332eec414c33fbc1ed0bb57196b765 (diff)
downloadframeworks_base-2e76c992bfa955cb637417005941e3e93810a99d.zip
frameworks_base-2e76c992bfa955cb637417005941e3e93810a99d.tar.gz
frameworks_base-2e76c992bfa955cb637417005941e3e93810a99d.tar.bz2
SurfaceTexture: Fully refactored from BufferQueue
Cleaning up camera and media interactions as part of SurfaceTexture refactoring Change-Id: Iea2b10ff80b5f01f83ed0902c725df1d3b4c541a
Diffstat (limited to 'media/libstagefright')
-rw-r--r--media/libstagefright/SurfaceMediaSource.cpp3
-rw-r--r--media/libstagefright/tests/SurfaceMediaSource_test.cpp9
2 files changed, 8 insertions, 4 deletions
diff --git a/media/libstagefright/SurfaceMediaSource.cpp b/media/libstagefright/SurfaceMediaSource.cpp
index 602469b..7481e2e 100644
--- a/media/libstagefright/SurfaceMediaSource.cpp
+++ b/media/libstagefright/SurfaceMediaSource.cpp
@@ -54,6 +54,9 @@ SurfaceMediaSource::SurfaceMediaSource(uint32_t bufW, uint32_t bufH) :
ALOGV("SurfaceMediaSource::SurfaceMediaSource");
sp<ISurfaceComposer> composer(ComposerService::getComposerService());
mGraphicBufferAlloc = composer->createGraphicBufferAlloc();
+ if (mGraphicBufferAlloc == 0) {
+ ALOGE("createGraphicBufferAlloc() failed in SurfaceMediaSource()");
+ }
}
SurfaceMediaSource::~SurfaceMediaSource() {
diff --git a/media/libstagefright/tests/SurfaceMediaSource_test.cpp b/media/libstagefright/tests/SurfaceMediaSource_test.cpp
index 3dcd9fc..fe77cf7 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<SurfaceMediaSource> sms = new SurfaceMediaSource(
+ sp<ISurfaceTexture> sms = new SurfaceMediaSource(
getSurfaceWidth(), getSurfaceHeight());
sp<SurfaceTextureClient> stc = new SurfaceTextureClient(sms);
sp<ANativeWindow> window = stc;
@@ -360,7 +360,8 @@ protected:
android::ProcessState::self()->startThreadPool();
mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight);
mSMS->setSynchronousMode(true);
- mSTC = new SurfaceTextureClient(mSMS);
+ // Manual cast is required to avoid constructor ambiguity
+ mSTC = new SurfaceTextureClient(static_cast<sp<ISurfaceTexture> >( mSMS));
mANW = mSTC;
}
@@ -395,7 +396,7 @@ protected:
ALOGV("SMS-GLTest::SetUp()");
android::ProcessState::self()->startThreadPool();
mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight);
- mSTC = new SurfaceTextureClient(mSMS);
+ mSTC = new SurfaceTextureClient(static_cast<sp<ISurfaceTexture> >( mSMS));
mANW = mSTC;
// Doing the setup related to the GL Side
@@ -773,7 +774,7 @@ TEST_F(SurfaceMediaSourceGLTest, ChooseAndroidRecordableEGLConfigDummyWriter) {
ALOGV("Verify creating a surface w/ right config + dummy writer*********");
mSMS = new SurfaceMediaSource(mYuvTexWidth, mYuvTexHeight);
- mSTC = new SurfaceTextureClient(mSMS);
+ mSTC = new SurfaceTextureClient(static_cast<sp<ISurfaceTexture> >( mSMS));
mANW = mSTC;
DummyRecorder writer(mSMS);