Merge "Correctly handle a null surface"
This commit is contained in:
committed by
Android (Google) Code Review
commit
249fe0838f
@@ -60,6 +60,9 @@ using ::android::sp;
|
||||
|
||||
static jobject convertSurfaceToNativeHandle(JNIEnv* env, jobject /* clazz */,
|
||||
jobject previewSurface) {
|
||||
if (previewSurface == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
ANativeWindow* previewAnw = ANativeWindow_fromSurface(env, previewSurface);
|
||||
sp<Surface> surface = static_cast<Surface*>(previewAnw);
|
||||
sp<IGraphicBufferProducer> igbp = surface->getIGraphicBufferProducer();
|
||||
|
||||
Reference in New Issue
Block a user