OSDN Git Service

RIO-7657: Report a more appropriate failure status via the author engine when underly...
authorPacketVideo CM <engbuild@pv.com>
Wed, 14 Oct 2009 05:40:34 +0000 (22:40 -0700)
committerPacketVideo CM <engbuild@pv.com>
Wed, 14 Oct 2009 05:40:34 +0000 (22:40 -0700)
android/author/authordriver.cpp
engines/2way/src/pv_2way_sdkinfo.h
engines/author/src/pv_author_sdkinfo.h
engines/author/src/pvauthorengine.cpp
engines/author/src/pvauthorengine.h
engines/player/src/pv_player_sdkinfo.h

index c51306d..16cf83a 100644 (file)
@@ -2,16 +2,16 @@
  * 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.
  */
 
@@ -332,7 +332,7 @@ void AuthorDriver::handleSetVideoSource(set_video_source_command *ac)
             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;
@@ -965,7 +965,7 @@ void AuthorDriver::handleRemoveVideoSource(author_command *ac)
         OSCL_TRY(error, mAuthor->RemoveDataSource(*mVideoNode, ac));
         OSCL_FIRST_CATCH_ANY(error, commandFailed(ac));
     } else {
-       FinishNonAsyncCommand(ac); 
+       FinishNonAsyncCommand(ac);
     }
 }
 
@@ -991,7 +991,7 @@ void AuthorDriver::removeConfigRefs(author_command *ac)
     }
     if (mVideoEncoderConfig) {
         mVideoEncoderConfig->removeRef();
-        mVideoEncoderConfig = NULL; 
+        mVideoEncoderConfig = NULL;
     }
     if (mAudioEncoderConfig) {
         mAudioEncoderConfig->removeRef();
@@ -1419,7 +1419,12 @@ void AuthorDriver::CommandCompleted(const PVCmdResponse& aResponse)
     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
index 5f0d573..9b16aa8 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PV2WAY_ENGINE_SDKINFO_LABEL "1005994"
+#define PV2WAY_ENGINE_SDKINFO_LABEL "1005999"
 #define PV2WAY_ENGINE_SDKINFO_DATE 0x20091007
 
 #endif //PV_2WAY_SDKINFO_H_INCLUDED
index 0552c5b..90effea 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1005994"
+#define PVAUTHOR_ENGINE_SDKINFO_LABEL "1005999"
 #define PVAUTHOR_ENGINE_SDKINFO_DATE 0x20091007
 
 #endif //PV_AUTHOR_SDKINFO_H_INCLUDED
index 22867e9..6e78aed 100644 (file)
@@ -103,6 +103,7 @@ PVAuthorEngine::PVAuthorEngine() :
 {
     iLogger = PVLogger::GetLoggerObject("PVAuthorEngine");
     iDoResetNodeContainers = false;
+    lastNodeCommandError = PVMFFailure;
 }
 
 ////////////////////////////////////////////////////////////////////////////
@@ -568,7 +569,10 @@ void PVAuthorEngine::NodeUtilCommandCompleted(const PVMFCmdResp& aResponse)
             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
@@ -580,7 +584,7 @@ void PVAuthorEngine::NodeUtilCommandCompleted(const PVMFCmdResp& aResponse)
         }
         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;
         }
     }
@@ -694,7 +698,7 @@ void PVAuthorEngine::NodeUtilCommandCompleted(const PVMFCmdResp& aResponse)
     {
         if (iState == PVAE_STATE_ERROR)
         {
-            CompleteEngineCommand(cmd, PVMFFailure);
+            CompleteEngineCommand(cmd, status);
         }
         else
         {
index 6962da7..dbac304 100644 (file)
@@ -385,6 +385,8 @@ class PVAuthorEngine
         PVMFTimebase_Tickcount iAuthorClockTimebase;
         PVMFMediaClock iAuthorClock;
         PVMFStatus SendAuthoringClockToDataSources(bool aReset = false);
+
+        PVMFStatus lastNodeCommandError;
 };
 
 
index e850bf7..f27cc65 100644 (file)
@@ -21,7 +21,7 @@
 // This header file is automatically generated at build-time
 // *** OFFICIAL RELEASE INFO -- Will not auto update
 
-#define PVPLAYER_ENGINE_SDKINFO_LABEL "1005994"
+#define PVPLAYER_ENGINE_SDKINFO_LABEL "1005999"
 #define PVPLAYER_ENGINE_SDKINFO_DATE 0x20091007
 
 #endif //PV_PLAYER_SDKINFO_H_INCLUDED