Why does MediaPlayer show so much Verbose log on android?
Asked Answered
V

0

12

I'm using MediaPlayer to show SplashVideo and the log is suspiciously filled with verbose message. It's not an error but still it is not a normal behavior .

    Uri video = Uri.parse("android.resource://" + getPackageName() + "/"
            + R.raw.logo_vid);
    videoHolder.setVideoURI(video);
    videoHolder.setOnCompletionListener(new OnCompletionListener() {
        public void onCompletion(MediaPlayer mp) {
            jumpMain();

        }
    });
    videoHolder.start();
}

and this is the log...

08-01 12:52:16.045: V/MediaPlayer(12402): setListener
08-01 12:52:16.045: I/MediaPlayer(12402): path is null
08-01 12:52:16.045: V/MediaPlayer-JNI(12402): setDataSourceFD: fd 43
08-01 12:52:16.045: V/MediaPlayer(12402): setDataSource(43, 1088, 407705)
08-01 12:52:16.085: V/MediaPlayer(12402): setVideoSurfaceTexture
08-01 12:52:16.085: V/MediaPlayer-JNI(12402): setAudioStreamType: 3
08-01 12:52:16.085: V/MediaPlayer(12402): MediaPlayer::setAudioStreamType
08-01 12:52:16.085: V/MediaPlayer(12402): setVideoSurfaceTexture
08-01 12:52:16.085: V/MediaPlayer(12402): prepareAsync
08-01 12:52:16.265: V/MediaPlayer(12402): message received msg=5, ext1=360, ext2=480
08-01 12:52:16.265: V/MediaPlayer(12402): New video size 360 x 480
08-01 12:52:16.265: V/MediaPlayer(12402): callback application
08-01 12:52:16.265: V/MediaPlayer(12402): back from callback
08-01 12:52:16.265: V/MediaPlayer(12402): getVideoWidth
08-01 12:52:16.265: V/MediaPlayer-JNI(12402): getVideoWidth: 360
08-01 12:52:16.265: V/MediaPlayer(12402): getVideoHeight
08-01 12:52:16.265: V/MediaPlayer-JNI(12402): getVideoHeight: 480
08-01 12:52:16.265: V/MediaPlayer(12402): message received msg=1, ext1=0, ext2=0
08-01 12:52:16.265: V/MediaPlayer(12402): prepared
08-01 12:52:16.265: V/MediaPlayer(12402): callback application
08-01 12:52:16.265: V/MediaPlayer(12402): back from callback
08-01 12:52:16.305: D/MediaPlayer(12402): getMetadata
08-01 12:52:16.305: V/MediaPlayer(12402): getVideoWidth
08-01 12:52:16.305: V/MediaPlayer-JNI(12402): getVideoWidth: 360
08-01 12:52:16.305: V/MediaPlayer(12402): getVideoHeight
08-01 12:52:16.305: V/MediaPlayer-JNI(12402): getVideoHeight: 480
08-01 12:52:16.305: I/MediaPlayer(12402): sendBroadcast android.media.IMediaPlayer.videoexist
08-01 12:52:16.305: V/MediaPlayer-JNI(12402): start
08-01 12:52:16.305: V/MediaPlayer(12402): start
08-01 12:52:20.285: V/MediaPlayer(12402): message received msg=2, ext1=0, ext2=0
08-01 12:52:20.285: V/MediaPlayer(12402): playback complete
08-01 12:52:20.285: V/MediaPlayer(12402): callback application
08-01 12:52:20.285: V/MediaPlayer(12402): back from callback
08-01 12:52:24.060: V/MediaPlayer-JNI(12402): reset
08-01 12:52:24.060: V/MediaPlayer(12402): reset
08-01 12:52:24.105: V/MediaPlayer-JNI(12402): release
08-01 12:52:24.105: V/MediaPlayer(12402): setListener
08-01 12:52:24.105: V/MediaPlayer(12402): disconnect
08-01 12:52:24.105: V/MediaPlayer(12402): destructor
08-01 12:52:24.105: W/SurfaceView(12402): CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false
08-01 12:52:24.105: V/MediaPlayer(12402): disconnect

As I wrote its working but I wonder if I'm doing it right

Vanpelt answered 1/8, 2013 at 10:4 Comment(4)
You could just hide the logs using the solution described here: https://mcmap.net/q/264573/-how-to-filter-out-a-tagname-in-eclipse-logcat-viewer/450534Insoluble
because MediaPlayer is pretty complex to get right :-) . Plus that is the definition of VerboseRm
thanks , i konw i can hide it but i gut to ask myself why certain method shows amount of logs like my entire application ? i guees what i want to know is if this code is the best way to play video , maybe there is cleaner way .Vanpelt
A bug report has been filled, it is a really annoying behavior indeed : code.google.com/p/android/issues/detail?id=67557Hum

© 2022 - 2024 — McMap. All rights reserved.