Skip to content

Commit

Permalink
ARCore Android SDK v1.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nvictornvictor committed Feb 6, 2020
1 parent 8a5f99a commit 7fb56db
Show file tree
Hide file tree
Showing 16 changed files with 90 additions and 666 deletions.
616 changes: 2 additions & 614 deletions LICENSE

Large diffs are not rendered by default.

41 changes: 26 additions & 15 deletions libraries/include/arcore_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,8 +582,7 @@ AR_DEFINE_ENUM(ArTrackableType){
///
/// All currently defined features are mutually compatible.
AR_DEFINE_ENUM(ArSessionFeature){
/// Indicates the end of a features list. This must be the last entry in
/// the
/// Indicates the end of a features list. This must be the last entry in the
/// array passed to ArSession_createWithFeatures().
AR_SESSION_FEATURE_END_OF_LIST = 0,

Expand Down Expand Up @@ -806,7 +805,7 @@ AR_DEFINE_ENUM(ArCloudAnchorState){
AR_CLOUD_ANCHOR_STATE_ERROR_HOSTING_DATASET_PROCESSING_FAILED = -5,

/// Resolving failed, because the ARCore Cloud Anchor service could not find
/// the provided cloud anchor ID.
/// the provided Cloud Anchor ID.
AR_CLOUD_ANCHOR_STATE_ERROR_CLOUD_ID_NOT_FOUND = -6,

AR_CLOUD_ANCHOR_STATE_ERROR_RESOLVING_LOCALIZATION_NO_MATCH AR_DEPRECATED(
Expand Down Expand Up @@ -1321,7 +1320,7 @@ void ArConfig_setUpdateMode(const ArSession *session,
ArConfig *config,
ArUpdateMode update_mode);

/// Gets the current cloud anchor mode from the ::ArConfig.
/// Gets the current Cloud Anchor mode from the ::ArConfig.
void ArConfig_getCloudAnchorMode(const ArSession *session,
const ArConfig *config,
ArCloudAnchorMode *out_cloud_anchor_mode);
Expand Down Expand Up @@ -1607,7 +1606,7 @@ ArStatus ArSession_checkSupported(const ArSession *session,
///
/// The following configurations are not supported:
///
/// - When using the back-facing camera (default):
/// - When using the (default) back-facing camera:
/// - #AR_AUGMENTED_FACE_MODE_MESH3D.
/// - When using the front-facing (selfie) camera
/// (#AR_SESSION_FEATURE_FRONT_CAMERA):
Expand Down Expand Up @@ -1663,9 +1662,8 @@ ArStatus ArSession_resume(ArSession *session);
ArStatus ArSession_pause(ArSession *session);

/// Sets the OpenGL texture name (id) that will allow GPU access to the camera
/// image. The provided ID should have been created with @c glGenTextures(). The
/// resulting texture must be bound to the @c GL_TEXTURE_EXTERNAL_OES target for
/// use. Shaders accessing this texture must use a @c samplerExternalOES
/// image. The texture must be bound to the @c GL_TEXTURE_EXTERNAL_OES target
/// for use. Shaders accessing this texture must use a @c samplerExternalOES
/// sampler. See sample code for an example.
void ArSession_setCameraTextureName(ArSession *session, uint32_t texture_id);

Expand Down Expand Up @@ -1763,7 +1761,7 @@ void ArSession_getAllTrackables(const ArSession *session,
ArTrackableType filter_type,
ArTrackableList *out_trackable_list);

/// This will create a new cloud anchor using pose and other metadata from
/// This will create a new Cloud Anchor using the pose and other metadata from
/// @c anchor.
///
/// If the function returns #AR_SUCCESS, the cloud state of @c out_cloud_anchor
Expand All @@ -1775,7 +1773,7 @@ void ArSession_getAllTrackables(const ArSession *session,
///
/// @param[in] session The ARCore session
/// @param[in] anchor The anchor to be hosted
/// @param[inout] out_cloud_anchor The new cloud anchor
/// @param[inout] out_cloud_anchor The new Cloud Anchor
/// @return #AR_SUCCESS or any of:
/// - #AR_ERROR_NOT_TRACKING
/// - #AR_ERROR_SESSION_PAUSED
Expand All @@ -1786,8 +1784,11 @@ ArStatus ArSession_hostAndAcquireNewCloudAnchor(ArSession *session,
const ArAnchor *anchor,
ArAnchor **out_cloud_anchor);

/// This will create a new cloud anchor, and schedule a resolving task to
/// resolve the anchor's pose using the given cloud anchor ID.
/// This will create a new Cloud Anchor, and schedule a task to resolve the
/// anchor's pose using the given Cloud Anchor ID. You don’t need to
/// wait for a call to resolve a Cloud Anchor to complete before initiating
/// another call. A session can be resolving up to 20 Cloud Anchors at a given
/// time.
///
/// If this function returns #AR_SUCCESS, the cloud state of @c out_cloud_anchor
/// will be #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, and its tracking state will
Expand All @@ -1799,7 +1800,7 @@ ArStatus ArSession_hostAndAcquireNewCloudAnchor(ArSession *session,
///
/// @param[in] session The ARCore session
/// @param[in] cloud_anchor_id The cloud ID of the anchor to be resolved
/// @param[inout] out_cloud_anchor The new cloud anchor
/// @param[inout] out_cloud_anchor The new Cloud Anchor
/// @return #AR_SUCCESS or any of:
/// - #AR_ERROR_NOT_TRACKING
/// - #AR_ERROR_SESSION_PAUSED
Expand Down Expand Up @@ -1845,6 +1846,8 @@ ArStatus ArSession_resolveAndAcquireNewCloudAnchor(ArSession *session,
/// @deprecated in release 1.11.0. Please use instead: @code
/// void ArSession_getSupportedCameraConfigsWithFilter(const ArSession* session,
/// const ArCameraConfigFilter* filter, ArCameraConfigList* list); @endcode
// TODO(b/146903940): Change ArSession_getSupportedCameraConfigs to return
// ArStatus.
void ArSession_getSupportedCameraConfigs(const ArSession *session,
ArCameraConfigList *list)
AR_DEPRECATED(
Expand Down Expand Up @@ -1893,6 +1896,12 @@ void ArSession_getCameraConfig(const ArSession *session,
/// capabilities. Overly restrictive filtering can result in the returned list
/// being empty on one or more devices.
///
/// Beginning with ARCore SDK 1.15.0, some devices support additional camera
/// configs with lower GPU texture resolutions than the device's default GPU
/// texture resolution. See the ARCore supported devices
/// (https://developers.google.com/ar/discover/supported-devices) page for
/// details.
///
/// Element 0 will contain the camera config that best matches the filter
/// settings, according to the following priority:
///
Expand All @@ -1907,6 +1916,8 @@ void ArSession_getCameraConfig(const ArSession *session,
/// Can be called at any time.
///
/// @return list of supported camera configs.
// TODO(b/146903940): Change ArSession_getSupportedCameraConfigsWithFilter to
// return ArStatus.
void ArSession_getSupportedCameraConfigsWithFilter(
const ArSession *session,
const ArCameraConfigFilter *filter,
Expand Down Expand Up @@ -2850,7 +2861,7 @@ void ArAnchor_detach(ArSession *session, ArAnchor *anchor);
/// This method may safely be called with @c NULL - it will do nothing.
void ArAnchor_release(ArAnchor *anchor);

/// Acquires the cloud anchor ID of the anchor. The ID acquired is an ASCII
/// Acquires the Cloud Anchor ID of the anchor. The ID acquired is an ASCII
/// null-terminated string. The acquired ID must be released after use by the
/// @c ArString_release function. For anchors with cloud state
/// #AR_CLOUD_ANCHOR_STATE_NONE or #AR_CLOUD_ANCHOR_STATE_TASK_IN_PROGRESS, this
Expand All @@ -2863,7 +2874,7 @@ void ArAnchor_acquireCloudAnchorId(ArSession *session,
ArAnchor *anchor,
char **out_cloud_anchor_id);

/// Gets the current cloud anchor state of the anchor. This state is guaranteed
/// Gets the current Cloud Anchor state of the anchor. This state is guaranteed
/// not to change until update() is called.
///
/// @param[in] session The ARCore session.
Expand Down
12 changes: 6 additions & 6 deletions samples/augmented_image_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def setVersionName = { ->
}

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.google.ar.core.examples.c.augmentedimage"

// 24 is the minimum since ARCore only works with 24 and higher.
minSdkVersion 24
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName setVersionName()

Expand Down Expand Up @@ -62,11 +62,11 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
natives 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'
natives 'com.google.ar:core:1.15.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'

// Glide - An image loading and caching library for Android
// https://github.com/bumptech/glide
Expand Down
2 changes: 1 addition & 1 deletion samples/augmented_image_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class BackgroundRenderer {
private int quadPositionParam;
private int quadTexCoordParam;
private int textureId = -1;
private boolean suppressTimestampZeroRendering = true;

public int getTextureId() {
return textureId;
Expand Down Expand Up @@ -108,6 +109,10 @@ public void createOnGlThread(Context context) throws IOException {
ShaderUtil.checkGLError(TAG, "Program parameters");
}

public void suppressTimestampZeroRendering(boolean suppressTimestampZeroRendering) {
this.suppressTimestampZeroRendering = suppressTimestampZeroRendering;
}

/**
* Draws the AR background image. The image will be drawn such that virtual content rendered with
* the matrices provided by {@link com.google.ar.core.Camera#getViewMatrix(float[], int)} and
Expand All @@ -128,7 +133,7 @@ public void draw(@NonNull Frame frame) {
quadTexCoords);
}

if (frame.getTimestamp() == 0) {
if (frame.getTimestamp() == 0 && suppressTimestampZeroRendering) {
// Suppress rendering if the camera did not produce the first frame yet. This is to avoid
// drawing possible leftover data from previous sessions if the texture is reused.
return;
Expand Down
2 changes: 1 addition & 1 deletion samples/cloud_anchor_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class BackgroundRenderer {
private int quadPositionParam;
private int quadTexCoordParam;
private int textureId = -1;
private boolean suppressTimestampZeroRendering = true;

public int getTextureId() {
return textureId;
Expand Down Expand Up @@ -108,6 +109,10 @@ public void createOnGlThread(Context context) throws IOException {
ShaderUtil.checkGLError(TAG, "Program parameters");
}

public void suppressTimestampZeroRendering(boolean suppressTimestampZeroRendering) {
this.suppressTimestampZeroRendering = suppressTimestampZeroRendering;
}

/**
* Draws the AR background image. The image will be drawn such that virtual content rendered with
* the matrices provided by {@link com.google.ar.core.Camera#getViewMatrix(float[], int)} and
Expand All @@ -128,7 +133,7 @@ public void draw(@NonNull Frame frame) {
quadTexCoords);
}

if (frame.getTimestamp() == 0) {
if (frame.getTimestamp() == 0 && suppressTimestampZeroRendering) {
// Suppress rendering if the camera did not produce the first frame yet. This is to avoid
// drawing possible leftover data from previous sessions if the texture is reused.
return;
Expand Down
12 changes: 6 additions & 6 deletions samples/computervision_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def setVersionName = { ->
}

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.google.ar.core.examples.c.computervision"

// 24 is the minimum since ARCore only works with 24 and higher.
minSdkVersion 24
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName setVersionName()

Expand Down Expand Up @@ -62,11 +62,11 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
natives 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'
natives 'com.google.ar:core:1.15.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
}

// Extracts the shared libraries from aars in the natives configuration.
Expand Down
2 changes: 1 addition & 1 deletion samples/computervision_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class BackgroundRenderer {
private int quadPositionParam;
private int quadTexCoordParam;
private int textureId = -1;
private boolean suppressTimestampZeroRendering = true;

public int getTextureId() {
return textureId;
Expand Down Expand Up @@ -108,6 +109,10 @@ public void createOnGlThread(Context context) throws IOException {
ShaderUtil.checkGLError(TAG, "Program parameters");
}

public void suppressTimestampZeroRendering(boolean suppressTimestampZeroRendering) {
this.suppressTimestampZeroRendering = suppressTimestampZeroRendering;
}

/**
* Draws the AR background image. The image will be drawn such that virtual content rendered with
* the matrices provided by {@link com.google.ar.core.Camera#getViewMatrix(float[], int)} and
Expand All @@ -128,7 +133,7 @@ public void draw(@NonNull Frame frame) {
quadTexCoords);
}

if (frame.getTimestamp() == 0) {
if (frame.getTimestamp() == 0 && suppressTimestampZeroRendering) {
// Suppress rendering if the camera did not produce the first frame yet. This is to avoid
// drawing possible leftover data from previous sessions if the texture is reused.
return;
Expand Down
12 changes: 6 additions & 6 deletions samples/hello_ar_c/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ def setVersionName = { ->
}

android {
compileSdkVersion 27
compileSdkVersion 28
defaultConfig {
applicationId "com.google.ar.core.examples.c.helloar"

// 24 is the minimum since ARCore only works with 24 and higher.
minSdkVersion 24
targetSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName setVersionName()

Expand Down Expand Up @@ -62,11 +62,11 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
natives 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'
natives 'com.google.ar:core:1.15.0'

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
}

// Extracts the shared libraries from aars in the natives configuration.
Expand Down
2 changes: 1 addition & 1 deletion samples/hello_ar_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
dependencies {
// ARCore library
// Dependency version is rewritten at build time.
implementation 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class BackgroundRenderer {
private int quadPositionParam;
private int quadTexCoordParam;
private int textureId = -1;
private boolean suppressTimestampZeroRendering = true;

public int getTextureId() {
return textureId;
Expand Down Expand Up @@ -108,6 +109,10 @@ public void createOnGlThread(Context context) throws IOException {
ShaderUtil.checkGLError(TAG, "Program parameters");
}

public void suppressTimestampZeroRendering(boolean suppressTimestampZeroRendering) {
this.suppressTimestampZeroRendering = suppressTimestampZeroRendering;
}

/**
* Draws the AR background image. The image will be drawn such that virtual content rendered with
* the matrices provided by {@link com.google.ar.core.Camera#getViewMatrix(float[], int)} and
Expand All @@ -128,7 +133,7 @@ public void draw(@NonNull Frame frame) {
quadTexCoords);
}

if (frame.getTimestamp() == 0) {
if (frame.getTimestamp() == 0 && suppressTimestampZeroRendering) {
// Suppress rendering if the camera did not produce the first frame yet. This is to avoid
// drawing possible leftover data from previous sessions if the texture is reused.
return;
Expand Down
2 changes: 1 addition & 1 deletion samples/shared_camera_java/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {

dependencies {
// ARCore library
implementation 'com.google.ar:core:1.14.0'
implementation 'com.google.ar:core:1.15.0'

// Obj - a simple Wavefront OBJ file loader
// https://github.com/javagl/Obj
Expand Down
Loading

0 comments on commit 7fb56db

Please sign in to comment.