* Copyright (C) 2008, The Android Open Source Project
* Copyright (C) 2008 HTC Inc.
*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * http://www.apache.org/licenses/LICENSE-2.0
*
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
* limitations under the License.
*/
mVideoNode = PvmfMediaInputNodeFactory::Create(cameraInput);
if (mVideoNode) {
// pass in the application supplied camera object
- if (mCamera == 0 ||
+ if (mCamera == 0 ||
(mCamera != 0 && cameraInput->SetCamera(mCamera) == PVMFSuccess)) {
mVideoInputMIO = cameraInput;
break;
OSCL_TRY(error, mAuthor->RemoveDataSource(*mVideoNode, ac));
OSCL_FIRST_CATCH_ANY(error, commandFailed(ac));
} else {
- FinishNonAsyncCommand(ac);
+ FinishNonAsyncCommand(ac);
}
}
}
if (mVideoEncoderConfig) {
mVideoEncoderConfig->removeRef();
- mVideoEncoderConfig = NULL;
+ mVideoEncoderConfig = NULL;
}
if (mAudioEncoderConfig) {
mAudioEncoderConfig->removeRef();
switch(s) {
case PVMFSuccess: s = android::OK; break;
case PVMFPending: *(char *)0 = 0; break; /* XXX assert */
- default: s = android::UNKNOWN_ERROR;
+ default:
+ LOGE("Command %d completed with error %d",ac->which, s);
+ // s = android::UNKNOWN_ERROR;
+ // FIXME: Similar to mediaplayer, set the return status to
+ // something android specific. For now, use PVMF
+ // return codes as is.
}
// Call the user's requested completion function
{
iLogger = PVLogger::GetLoggerObject("PVAuthorEngine");
iDoResetNodeContainers = false;
+ lastNodeCommandError = PVMFFailure;
}
////////////////////////////////////////////////////////////////////////////
return;
}
else
+ {
+ lastNodeCommandError = aResponse.GetCmdStatus();
SetPVAEState(PVAE_STATE_ERROR);
+ }
}
//RESET needs to be handled seperately, if the EngineState is ERROR, ignore all cmds till
//there are more pending commands, else send out commandComplete Failure
}
else
{
- CompleteEngineCommand(cmd, PVMFFailure); //Send Failure to this command, engine is in error state
+ CompleteEngineCommand(cmd, lastNodeCommandError); //Send Failure to this command, engine is in error state
return;
}
}
{
if (iState == PVAE_STATE_ERROR)
{
- CompleteEngineCommand(cmd, PVMFFailure);
+ CompleteEngineCommand(cmd, status);
}
else
{