Infeasible
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Thanks for the report. I will route this to the appropriate internal team and update this when I hear back from them.
ra...@google.com <ra...@google.com> #3
One more detail, Data Layer event calls from the watch to the phone (running Android 13) do work on if the listener is in an Activity or Fragment.
vi...@google.com <vi...@google.com> #4
Also, I'm seeing this message in the Logcat:
"2022-06-12 18:47:15.156 1841-4562/? W/PackageManager: Intent does not match component's intent filter: Intent { act=com.google.android.gms.wearable.BIND_LISTENER"
"2022-06-12 18:47:15.156 1841-4562/? W/PackageManager: Intent does not match component's intent filter: Intent { act=com.google.android.gms.wearable.BIND_LISTENER"
Description
The problem is caused by Google's commit:
2、Description:
Currently, the video uses the device's codec (MediaCodec) to complete the video encode capability.
The general principle is: after rendering a frame of image, the image will be rendered to the Surface configured by MediaCodec, and MediaCodec will obtain the image from the Surface for encoding operations, and this cycle will continue until all frames are encoded.
The current reason for the block is when calling the system API (glDrawArrays) for drawing during the use of MediaCodec.
The relevant code and its log are as follows:
1) Application Code of call MediaCodec :
private fun drainOutputBuffer(waitEOS: Boolean): Boolean {
var times = 0
var drainSuccess = true
try {
do {
bufferInfo.set(0, 0, 0, 0)
val index = encoder.dequeueOutputBuffer(bufferInfo, 5_000L)
when {
(index >= 0) -> {
isSawEOS = (bufferInfo.flags and BUFFER_FLAG_END_OF_STREAM) == BUFFER_FLAG_END_OF_STREAM
when {
(bufferInfo.size <= 0) -> {
// 忽略空数据
LogUtil.d(TAG, "ignore empty output, pts: " + bufferInfo.presentationTimeUs + "ns")
}
((bufferInfo.flags and BUFFER_FLAG_CODEC_CONFIG) == BUFFER_FLAG_CODEC_CONFIG) -> {
LogUtil.d(TAG, "ignore codec config" + bufferInfo.presentationTimeUs + "ns")
}
else -> {
if (DEBUG) LogUtil.d(TAG, "encode output, pts: " + bufferInfo.presentationTimeUs + "ns")
val buffer = encoder.getOutputBuffer(index)
if (buffer != null) {
onOutputEncodeData(buffer, bufferInfo)
}
}
}
encoder.releaseOutputBuffer(index, false)
}
(index == INFO_OUTPUT_FORMAT_CHANGED) -> {
val format = encoder.outputFormat
onOutputFormat(format)
}
/* INFO_OUTPUT_BUFFERS_CHANGED, INFO_TRY_AGAIN_LATER */
else -> {
/* ignore */
}
}
if (times > 1000) {
LogUtil.w(TAG, "not saw EOS after wait 1000 times")
drainSuccess = false
break
}
times++
} while (waitEOS && !isSawEOS)
} catch (ex: Exception) {
if (ex is CodecException) {
LogUtil.w(TAG, "codec exception: isTransient=${ex.isTransient}, isRecoverable=${ex.isRecoverable}", ex)
} else {
LogUtil.w(TAG, "exception: ${ex.javaClass.simpleName}", ex)
}
isCodecError = true
drainSuccess = false
}
return drainSuccess
}
2) When using Surface related code, the program is blocked after executing the glDrawArrays method and no longer executes further.
@Override
public void draw() {
print("Draw 0");
mShader.use();
print("Draw 1");
GLES20.glDrawArrays(GLES20.GL_TRIANGLE_STRIP, 0, 4);
print("Draw 2");
positionAttribute.disable();
print("Draw 3");
inputTextureCoordinateAttribute.disable();
print("Draw 4");
}