Lines Matching refs:surface

97 static status_t connectSurface(const sp<Surface>& surface, int32_t maxBufferSlack) {
100 err = surface->connect(NATIVE_WINDOW_API_CAMERA, /*listener*/NULL);
102 ALOGE("%s: Unable to connect to surface, error %s (%d).", __FUNCTION__,
107 err = native_window_set_usage(surface.get(), GRALLOC_USAGE_SW_WRITE_OFTEN);
115 err = static_cast<ANativeWindow*>(surface.get())->query(surface.get(),
125 err = native_window_set_buffer_count(surface.get(), maxBufferSlack + 1 + minUndequeuedBuffers);
135 * Produce a frame in the given surface.
138 * anw - a surface to produce a frame in.
199 ALOGE("%s: Error while querying surface pixel format %s (%d).", __FUNCTION__,
353 static sp<ANativeWindow> getNativeWindow(JNIEnv* env, jobject surface) {
355 if (surface) {
356 anw = android_view_Surface_getNativeWindow(env, surface);
361 jniThrowNullPointerException(env, "surface");
390 static sp<Surface> getSurface(JNIEnv* env, jobject surface) {
392 if (surface) {
393 s = android_view_Surface_getSurface(env, surface);
398 jniThrowNullPointerException(env, "surface");
411 static jint LegacyCameraDevice_nativeDetectSurfaceType(JNIEnv* env, jobject thiz, jobject surface) {
414 if ((anw = getNativeWindow(env, surface)) == NULL) {
415 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
421 ALOGE("%s: Error while querying surface pixel format %s (%d).", __FUNCTION__, strerror(-err),
428 static jint LegacyCameraDevice_nativeDetectSurfaceDataspace(JNIEnv* env, jobject thiz, jobject surface) {
431 if ((anw = getNativeWindow(env, surface)) == NULL) {
432 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
438 ALOGE("%s: Error while querying surface dataspace %s (%d).", __FUNCTION__, strerror(-err),
446 jobject surface, jintArray dimens) {
460 if ((anw = getNativeWindow(env, surface)) == NULL) {
461 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
467 ALOGE("%s: Error while querying surface width %s (%d).", __FUNCTION__, strerror(-err),
473 ALOGE("%s: Error while querying surface height %s (%d).", __FUNCTION__, strerror(-err),
482 jobject surface) {
486 if ((anw = getNativeWindow(env, surface)) == NULL) {
488 "Could not retrieve native window from surface.");
495 "Error while querying surface usage bits");
502 jobject surface) {
504 if (surface == nullptr) return NO_ERROR;
507 if ((anw = getNativeWindow(env, surface)) == NULL) {
515 "Error while disconnecting surface");
552 static jint LegacyCameraDevice_nativeConnectSurface(JNIEnv* env, jobject thiz, jobject surface) {
555 if ((s = getSurface(env, surface)) == NULL) {
556 ALOGE("%s: Could not retrieve surface.", __FUNCTION__);
561 ALOGE("%s: Error while configuring surface %s (%d).", __FUNCTION__, strerror(-err), err);
567 static jint LegacyCameraDevice_nativeProduceFrame(JNIEnv* env, jobject thiz, jobject surface,
572 if ((anw = getNativeWindow(env, surface)) == NULL) {
573 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
601 static jint LegacyCameraDevice_nativeSetSurfaceFormat(JNIEnv* env, jobject thiz, jobject surface,
605 if ((anw = getNativeWindow(env, surface)) == NULL) {
606 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
611 ALOGE("%s: Error while setting surface format %s (%d).", __FUNCTION__, strerror(-err), err);
617 static jint LegacyCameraDevice_nativeSetSurfaceDimens(JNIEnv* env, jobject thiz, jobject surface,
621 if ((anw = getNativeWindow(env, surface)) == NULL) {
622 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
630 ALOGE("%s: Error while setting surface user dimens %s (%d).", __FUNCTION__, strerror(-err),
637 static jlong LegacyCameraDevice_nativeGetSurfaceId(JNIEnv* env, jobject thiz, jobject surface) {
640 if ((s = getSurface(env, surface)) == NULL) {
641 ALOGE("%s: Could not retrieve native Surface from surface.", __FUNCTION__);
646 ALOGE("%s: Could not retrieve IGraphicBufferProducer from surface.", __FUNCTION__);
651 ALOGE("%s: Could not retrieve IBinder from surface.", __FUNCTION__);
662 jobject surface, jint facing, jint orientation) {
665 if ((anw = getNativeWindow(env, surface)) == NULL) {
666 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
689 ALOGE("%s: Unable to configure surface transform, error %s (%d)", __FUNCTION__,
697 static jint LegacyCameraDevice_nativeSetNextTimestamp(JNIEnv* env, jobject thiz, jobject surface,
701 if ((anw = getNativeWindow(env, surface)) == NULL) {
702 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
710 ALOGE("%s: Unable to set surface timestamp, error %s (%d)", __FUNCTION__, strerror(-err),
717 static jint LegacyCameraDevice_nativeSetScalingMode(JNIEnv* env, jobject thiz, jobject surface,
721 if ((anw = getNativeWindow(env, surface)) == NULL) {
722 ALOGE("%s: Could not retrieve native window from surface.", __FUNCTION__);
727 ALOGE("%s: Unable to set surface scaling mode, error %s (%d)", __FUNCTION__,