Move snapshot logs to verbose

pull/630/head
Mattia Iavarone 6 years ago
parent 03e71b8bb6
commit 267270e40f
  1. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/overlay/OverlayLayout.java
  2. 10
      cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/AudioMediaEncoder.java
  3. 4
      cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoder.java
  4. 2
      cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/MediaEncoderEngine.java
  5. 6
      cameraview/src/main/java/com/otaliastudios/cameraview/video/encoding/TextureMediaEncoder.java

@ -127,7 +127,7 @@ public class OverlayLayout extends FrameLayout implements Overlay {
// to apply some scale (typically > 1). // to apply some scale (typically > 1).
float widthScale = canvas.getWidth() / (float) getWidth(); float widthScale = canvas.getWidth() / (float) getWidth();
float heightScale = canvas.getHeight() / (float) getHeight(); float heightScale = canvas.getHeight() / (float) getHeight();
LOG.i("draw", LOG.v("draw",
"target:", target, "target:", target,
"canvas:", canvas.getWidth() + "x" + canvas.getHeight(), "canvas:", canvas.getWidth() + "x" + canvas.getHeight(),
"view:", getWidth() + "x" + getHeight(), "view:", getWidth() + "x" + getHeight(),

@ -231,11 +231,11 @@ public class AudioMediaEncoder extends MediaEncoder {
} else { } else {
mCurrentReadBytes = mAudioRecord.read(mCurrentBuffer, mConfig.frameSize()); mCurrentReadBytes = mAudioRecord.read(mCurrentBuffer, mConfig.frameSize());
} }
LOG.i("read thread - eos:", endOfStream, "- Read new audio frame. Bytes:", LOG.v("read thread - eos:", endOfStream, "- Read new audio frame. Bytes:",
mCurrentReadBytes); mCurrentReadBytes);
if (mCurrentReadBytes > 0) { // Good read: increase PTS. if (mCurrentReadBytes > 0) { // Good read: increase PTS.
increaseTime(mCurrentReadBytes, endOfStream); increaseTime(mCurrentReadBytes, endOfStream);
LOG.i("read thread - eos:", endOfStream, "- mLastTimeUs:", mLastTimeUs); LOG.v("read thread - eos:", endOfStream, "- mLastTimeUs:", mLastTimeUs);
mCurrentBuffer.limit(mCurrentReadBytes); mCurrentBuffer.limit(mCurrentReadBytes);
enqueue(mCurrentBuffer, mLastTimeUs, endOfStream); enqueue(mCurrentBuffer, mLastTimeUs, endOfStream);
} else if (mCurrentReadBytes == AudioRecord.ERROR_INVALID_OPERATION) { } else if (mCurrentReadBytes == AudioRecord.ERROR_INVALID_OPERATION) {
@ -358,7 +358,7 @@ public class AudioMediaEncoder extends MediaEncoder {
if (mInputBufferQueue.isEmpty()) { if (mInputBufferQueue.isEmpty()) {
skipFrames(2); skipFrames(2);
} else { } else {
LOG.i("encoding thread - performing", mInputBufferQueue.size(), LOG.v("encoding thread - performing", mInputBufferQueue.size(),
"pending operations."); "pending operations.");
InputBuffer inputBuffer; InputBuffer inputBuffer;
while ((inputBuffer = mInputBufferQueue.peek()) != null) { while ((inputBuffer = mInputBufferQueue.peek()) != null) {
@ -408,7 +408,7 @@ public class AudioMediaEncoder extends MediaEncoder {
private void encode(@NonNull InputBuffer buffer) { private void encode(@NonNull InputBuffer buffer) {
long executeStart = System.nanoTime() / 1000000; long executeStart = System.nanoTime() / 1000000;
LOG.i("encoding thread - performing pending operation for timestamp:", LOG.v("encoding thread - performing pending operation for timestamp:",
buffer.timestamp, "- encoding."); buffer.timestamp, "- encoding.");
// NOTE: this copy is prob. the worst part here for performance // NOTE: this copy is prob. the worst part here for performance
buffer.data.put(buffer.source); buffer.data.put(buffer.source);
@ -417,7 +417,7 @@ public class AudioMediaEncoder extends MediaEncoder {
encodeInputBuffer(buffer); encodeInputBuffer(buffer);
boolean eos = buffer.isEndOfStream; boolean eos = buffer.isEndOfStream;
mInputBufferPool.recycle(buffer); mInputBufferPool.recycle(buffer);
LOG.i("encoding thread - performing pending operation for timestamp:", LOG.v("encoding thread - performing pending operation for timestamp:",
buffer.timestamp, "- draining."); buffer.timestamp, "- draining.");
// NOTE: can consider calling this drainOutput on yet another thread, which would let us // NOTE: can consider calling this drainOutput on yet another thread, which would let us
// use an even smaller BUFFER_POOL_MAX_SIZE without losing audio frames. But this way // use an even smaller BUFFER_POOL_MAX_SIZE without losing audio frames. But this way

@ -397,7 +397,7 @@ public abstract class MediaEncoder {
@SuppressLint("LogNotTimber") @SuppressLint("LogNotTimber")
@SuppressWarnings("WeakerAccess") @SuppressWarnings("WeakerAccess")
protected final void drainOutput(boolean drainAll) { protected final void drainOutput(boolean drainAll) {
LOG.i(mName, "DRAINING - EOS:", drainAll); LOG.v(mName, "DRAINING - EOS:", drainAll);
if (mMediaCodec == null) { if (mMediaCodec == null) {
LOG.e("drain() was called before prepare() or after releasing."); LOG.e("drain() was called before prepare() or after releasing.");
return; return;
@ -459,7 +459,7 @@ public abstract class MediaEncoder {
+ mLastTimeUs - mFirstTimeUs; + mLastTimeUs - mFirstTimeUs;
// Write. // Write.
LOG.i(mName, "DRAINING - About to write(). Adjusted presentation:", LOG.v(mName, "DRAINING - About to write(). Adjusted presentation:",
mBufferInfo.presentationTimeUs); mBufferInfo.presentationTimeUs);
OutputBuffer buffer = mOutputBufferPool.get(); OutputBuffer buffer = mOutputBufferPool.get();
//noinspection ConstantConditions //noinspection ConstantConditions

@ -186,7 +186,7 @@ public class MediaEncoderEngine {
*/ */
@SuppressWarnings("SameParameterValue") @SuppressWarnings("SameParameterValue")
public final void notify(final String event, final Object data) { public final void notify(final String event, final Object data) {
LOG.i("Passing event to encoders:", event); LOG.v("Passing event to encoders:", event);
for (MediaEncoder encoder : mEncoders) { for (MediaEncoder encoder : mEncoders) {
encoder.notify(event, data); encoder.notify(event, data);
} }

@ -124,7 +124,7 @@ public class TextureMediaEncoder extends VideoMediaEncoder<TextureConfig> {
// Always render the first few frames, or muxer fails. // Always render the first few frames, or muxer fails.
return true; return true;
} else if (getPendingEvents(FRAME_EVENT) > 2) { } else if (getPendingEvents(FRAME_EVENT) > 2) {
LOG.w("shouldRenderFrame - Dropping, we already have too many pending events:", LOG.v("shouldRenderFrame - Dropping, we already have too many pending events:",
getPendingEvents(FRAME_EVENT)); getPendingEvents(FRAME_EVENT));
return false; return false;
} else { } else {
@ -177,14 +177,14 @@ public class TextureMediaEncoder extends VideoMediaEncoder<TextureConfig> {
} }
// First, drain any previous data. // First, drain any previous data.
LOG.i("onEvent -", LOG.v("onEvent -",
"frameNumber:", mFrameNumber, "frameNumber:", mFrameNumber,
"timestampUs:", frame.timestampUs(), "timestampUs:", frame.timestampUs(),
"- draining."); "- draining.");
drainOutput(false); drainOutput(false);
// Then draw on the surface. // Then draw on the surface.
LOG.i("onEvent -", LOG.v("onEvent -",
"frameNumber:", mFrameNumber, "frameNumber:", mFrameNumber,
"timestampUs:", frame.timestampUs(), "timestampUs:", frame.timestampUs(),
"- rendering."); "- rendering.");

Loading…
Cancel
Save