5 Replies Latest reply: Mar 24, 2011 11:08 AM by Zac Lam RSS

    CS5 SDK + AME CS4 = Crash from bad memorySuite

    Rallymax Community Member

      Hi all,

      I compiled the CS5 SDK_Exporter example and only changed one thing:

           1:     the build from x64 to x86     (because I'm on Win7 32bit with CS4 Production Premium)

       

           BTW the enviroment variable $(PREMSDKBUILDPATH) is set to points to

                C:\Program Files\Adobe\Adobe Premiere Pro CS4\Plug-ins\Common\SDK

       

      Then I started to debug the debug|x86 build and invoked it by running AME by setting the Debugging->Command argument to

       

                C:\Program Files\Adobe\Adobe Media Encoder CS4\Adobe Media Encoder.exe

       

      When I run it, add a video and then change the exporter to "SDK File" it then calls the exSDKBeginInstance( )

       

      prMALError exSDKBeginInstance (

      exportStdParms *stdParmsP,

      exExporterInstanceRec *instanceRecP)

      {

      prMALError result = malNoError;

      SPErr spError = kSPNoError;

      ExportSettings *mySettings;

      PrSDKMemoryManagerSuite *memorySuite;

       

      int exportSettingsSize = sizeof(ExportSettings);

      SPBasicSuite *spBasic = stdParmsP->getSPBasicSuite();

      if (spBasic != NULL)

      {

      spError = spBasic->AcquireSuite(

      kPrSDKMemoryManagerSuite,

      kPrSDKMemoryManagerSuiteVersion,

      const_cast<const void**>(reinterpret_cast<void**>(&memorySuite)));         <<<<<<------ THIS memoryStuite isn't set

       

      >>>>> THUS THE NEXT LINE CRASHES BECAUSE memorySuite==0

       

      mySettings = reinterpret_cast<ExportSettings *>(memorySuite->NewPtrClear(exportSettingsSize));

       

      Why is using the CS5 headers breaking the CS4 applications?

        • 1. Re: CS5 SDK + AME CS4 = Crash from bad memorySuite
          Zac Lam Adobe Employee

          Hi there,

           

          In this case, the Memory Manager Suite was revised for CS5, and the version number was bumped to 3.  kPrSDKMemoryManagerSuiteVersion is defined as 3, so when you try to acquire the suite using that version, it will succeed in CS5, but fail in CS4 because it didn't exist yet.  Version 2 should still be supported, so and exporter running in either CS4 or CS5 can acquire version 2, and use the PrSDKMemoryManagerSuiteV2 struct definitions instead.

           

          Regards,

           

          Zac

          • 2. Re: CS5 SDK + AME CS4 = Crash from bad memorySuite
            Rallymax Community Member

            Thx Zac,

             

            Can you put an #if/#else/#endif in the SDK_Exporter CS5 example then pls - actually all examples that use the v3 MemorySuite so that we don't hit this wall without knowing why.

             

            Btw, I went to the CS5 SDK to fix the slider with checkbox problem when using AME 4.x.x.x that I previously posted. Did I misunderstand your response coz I understood it to mean that using the CS5 SDK would fix the checkbox|slider display problem.

             

            'looking forward to clarification on that.

             

            Thx.

             

            e.

            • 3. Re: CS5 SDK + AME CS4 = Crash from bad memorySuite
              Zac Lam Adobe Employee

              Hi E,

               

              I'll add some notes to the documentation to explain more about suite versioning.

               

              The checkbox issue is fixed in CS5.  My suggestion was to try creating the presets in CS5, and use them in CS4, to see if that by any chance helps in CS4.  But looking at the code, I don't think that will work for CS4.  Sorry.

               

              Regards,

               

              Zac

              • 4. Re: CS5 SDK + AME CS4 = Crash from bad memorySuite
                Rallymax Community Member

                Hi Zac, et al.

                 

                I modified the API call to call "kPrSDKMemoryManagerSuiteVersion2" instead of "kPrSDKMemoryManagerSuiteVersion" when using SDK CS5 and it still errored.

                 

                I also tried using "kPrSDKMemoryManagerSuiteVersion1" (which started in the CS3) using the CS4 SDK and it didn't work either.

                 

                I couldn't see in the headers that the API to the MemorySuite had changed so I'm at a loss as to why I couldn't use v2 with the CS5 SDK or v1 with the CS4 SDK on AME CS4.

                CS4 with it's (native) v2 MemorySuite is running fine.

                 

                AME CS4 Exporter Plugin test chart

                 

                SDK Version UsedMemory Suite UsedPASS / FAIL
                CS4 (native MemorySuite=2)1FAIL
                CS4 (native MemorySuite=2)2PASS
                CS5 (native MemorySuite=3)2FAIL
                CS5 (native MemorySuite=3)3FAIL

                • 5. Re: CS5 SDK + AME CS4 = Crash from bad memorySuite
                  Zac Lam Adobe Employee

                  I just tried this using the SDK exporter sample from the CS5 SDK with AME CS4.  v2 works for me.  Here's the code:

                   

                  PrSDKMemoryManagerSuiteV2    *memorySuite;

                  SPBasicSuite            *spBasic            = stdParmsP->getSPBasicSuite();
                  if (spBasic != NULL)
                  {
                      spError = spBasic->AcquireSuite(
                          kPrSDKMemoryManagerSuite,
                          kPrSDKMemoryManagerSuiteVersion2,
                          const_cast<const void**>(reinterpret_cast<void**>(&memorySuite)));

                  }

                   

                  As mentioned before, v3 isn't going to work because it didn't exist yet in CS4.  I'm curious why v2 isn't working for you though.  But it doesn't seem to be a problem with the CS5 SDK itself.  What exact version of AME CS4 do you happen to be testing with?