From af7d8189f91c45ab919a6c9ac386b268c8d91168 Mon Sep 17 00:00:00 2001 From: John Grossman Date: Wed, 11 Jan 2012 12:23:42 -0800 Subject: Enhance Visualizer behavior in the case of mediaserver death. Bring the Visualizer class into line with the SDK documentation by returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when the Visualizer loses its binder connection to the mediaserver because of a mediaserver restart. Also add a new callback interface to allow clients to be asynchronously notified in the case of server death. Right now, the interface definition and the registration method are flagged as hidden pending API council review/approval. See http://b/issue?id=5717519 for details. Change-Id: Ic15856f27ed5a950a583ac11ca81f79bd7e9b1a0 Signed-off-by: John Grossman --- media/libmedia/Visualizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'media/libmedia/Visualizer.cpp') diff --git a/media/libmedia/Visualizer.cpp b/media/libmedia/Visualizer.cpp index 13b64e9..70f8c0c 100644 --- a/media/libmedia/Visualizer.cpp +++ b/media/libmedia/Visualizer.cpp @@ -168,7 +168,7 @@ status_t Visualizer::getWaveForm(uint8_t *waveform) uint32_t replySize = mCaptureSize; status = command(VISUALIZER_CMD_CAPTURE, 0, NULL, &replySize, waveform); ALOGV("getWaveForm() command returned %d", status); - if (replySize == 0) { + if ((status == NO_ERROR) && (replySize == 0)) { status = NOT_ENOUGH_DATA; } } else { -- cgit v1.1