shithub: openh264

Download patch

ref: 78650363b80920e45b68f61973257437ef150963
parent: 123b904f77552a23fd0282fe9635278033d3d5a3
author: ruil2 <ruil2@cisco.com>
date: Tue Jul 22 05:43:18 EDT 2014

add decoder return value

--- a/module/gmp-openh264.cpp
+++ b/module/gmp-openh264.cpp
@@ -608,13 +608,15 @@
       assert (false);
       break;
     }
-
+    DECODING_STATE dState = dsErrorFree;
     worker_thread_->Post (WrapTask (
                             this, &OpenH264VideoDecoder::Decode_w,
                             inputFrame,
                             missingFrames,
+                            dState,
                             renderTimeMs));
-
+    if (dState)
+      return GMPGenericErr;
     return GMPNoErr;
   }
 
@@ -633,6 +635,7 @@
  private:
   void Decode_w (GMPVideoEncodedFrame* inputFrame,
                  bool missingFrames,
+                 DECODING_STATE& dState,
                  int64_t renderTimeMs = -1) {
     GMPLOG (GL_DEBUG, "Frame decode on worker thread length = "
             << inputFrame->Size());
@@ -642,13 +645,13 @@
     memset (&decoded, 0, sizeof (decoded));
     unsigned char* data[3] = {nullptr, nullptr, nullptr};
 
-    int rv = decoder_->DecodeFrame2 (inputFrame->Buffer(),
+    dState = decoder_->DecodeFrame2 (inputFrame->Buffer(),
                                      inputFrame->Size(),
                                      data,
                                      &decoded);
 
-    if (rv) {
-      GMPLOG (GL_ERROR, "Decoding error rv=" << rv);
+    if (dState) {
+      GMPLOG (GL_ERROR, "Decoding error dState=" << dState);
     } else {
       valid = true;
     }