5 Replies Latest reply on May 6, 2010 11:11 PM by Kengo Mikoshiba

    [CS5] Which of the argument of xSDKExport is correct?

    Kengo Mikoshiba

      Hi,

       

      CS5r1 SDK with Premiere CS5 trial version

       

      There are definition of the xSDKExport as follows.
      Which is correct?


      (a) Headers/PrSDKExport.h
      typedef PREMPLUGENTRY (* ExportEntryFunc)(csSDK_int32 selector, exportStdParms *stdparms, void* param1, void* param2);

       

      (b) Projects/SDK_Exporter/SDK_Exporter.cpp
      DllExport PREMPLUGENTRY xSDKExport (
          int             selector,
          exportStdParms  *stdParmsP,
          long            param1,
          long            param2)


      I seem that (a) is correct.
      But, the xSDKExport of the plug-in is not called by host in the case of (a). (32bit/64bit both)


      Regards,
      Kengo Mikoshiba.

        • 1. Re: [CS5] Which of the argument of xSDKExport is correct?
          Rallymax

          In my thinking it HAS to be "void *" because the params are pointers to different structures depending on the selector.

          I think one of the CS3 SDK examples had "long" as well - I seem to remember changing it to "void *".

           

          It matters because sizeof( void * ) will be "long" on 32bit machines and "long long" on 64bit machines. Thus if you try to keep it as "long" it will truncate the size if used on 64bit machines. If the compiler is any good, and it's compiling for a 64bit target it should give you an error. For 32bit it should be a warning (since long is actually "signed long" and thus is only 31bits of the possible 32bit address.

           

          Anyhow, from what Zac's said, all CS5 is 64bit only so the correct type must be "void *" not "long".

           

          Regards,

           

          Rallymax.

          • 2. Re: [CS5] Which of the argument of xSDKExport is correct?
            Kengo Mikoshiba Level 1

            Hi Rallymax-san,

             

            I was not correcting the argument of the extern declaration of the header file of my plug-in.
            The plug-in did not operate because the declaration and the definition were the disagreements.
            I had completely forgotten the extern declaration.
            It was my mistake. I am sorry.

             

            I think that you should correct "SDK_Exporter" and "RTPlayback" sample program.

            Regards,

            Kengo Mikoshiba.

            • 3. Re: [CS5] Which of the argument of xSDKExport is correct?
              Rallymax Level 2

              >I think that you should correct "SDK_Exporter" and "RTPlayback" sample program.

               

              Yes, I agree. I lost quite some time until I could work out that I had mixed the void* and the long in my exporter based on the example. In my case it was worse because I had cast "param1" to the structure and thus disabled the compiler from warning me about the type mismatch.

               

              I'm glad we have this forum to help each other!

               

              R.

              • 4. Re: [CS5] Which of the argument of xSDKExport is correct?
                Zac Lam Adobe Employee

                Hi Kengo-san,

                 

                > I think that you should correct "SDK_Exporter" and "RTPlayback" sample  program.

                 

                Thanks for the feedback.  I'll correct it for the next SDK release.  Yes, there still remains some conversions that need be done in the sample projects, to get rid of long type usage.

                 

                Hi Rallymax,

                 

                > I'm glad we have this forum to help each other!

                 

                Glad this SDK forum is proving to be of help!  Thanks for supporting it!

                • 5. Re: [CS5] Which of the argument of xSDKExport is correct?
                  Kengo Mikoshiba Level 1

                  Hi Zac-san,

                   

                  I found another mistake.

                   

                  SDK_Exporter_Params.cpp

                   

                  line 488

                  x    for (int i = 0; i < sizeof (PARs[0]); i++)
                  o    for (int i = 0; i < sizeof(PARs) / sizeof (PARs[0]); i++)

                   

                  Regards,

                  Kengo Mikoshiba.