IAAFMasterMob::CreateEssence return AAFRESULT

Developers
Salva
2010-11-16
2013-04-29
  •  Salva

    Salva - 2010-11-16

    Hi all,

    I´m writing my first application using AAF SDK 1.1.4

    The application is the ExportDV typical application. I don´t know what I´m doing badly, but the return of CreateEssence is AAFRESULT_CODEC_SEMANTIC_WARN.

    This is the easy code:

    char cFileName;
    convert(cFileName, sizeof(cFileName), L"C:\\Temp\\AAF\\salva.aaf");
    remove(cFileName);
    aafWChar pwFileName = L"C:\\Temp\\AAF\\salva.aaf";

    printf("Creating file %s\n", cFileName);
    aafProductIdentification_t ProductInfo;

    aafProductVersion_t ver = {1, 0, 0, 0, kAAFVersionBeta};
    ProductInfo.companyName = L"AAF";
    ProductInfo.productName = L"AAF SDK";
    ProductInfo.productVersion = &ver;
    ProductInfo.productVersionString = NULL;
    ProductInfo.productID = NIL_UID;
    ProductInfo.platform = NULL;

    IAAFFile* file;
    HRESULT hr = AAFFileOpenNewModify( pwFileName, 0,&ProductInfo, &file );
    if (hr != AAFRESULT_SUCCESS )
    return -1;

    IAAFHeader* header;
    hr = file->GetHeader( &header );

    IAAFDictionary* dictionary;
    hr = header->GetDictionary( &dictionary );

    IAAFMasterMob* masterMob;
    hr = dictionary->CreateInstance(AUID_AAFMasterMob, IID_IAAFMasterMob,
    reinterpret_cast<IUnknown**>(&masterMob) );

    hr = masterMob->Initialize();
    if (hr != AAFRESULT_SUCCESS )
    return -1;

    IAAFMob* mob;
    hr = masterMob->QueryInterface(IID_IAAFMob,
    reinterpret_cast<void**>(&mob) );

    hr = header->AddMob( mob );

    hr = mob->SetName( L"Hello World" );

    IAAFSmartPointer<IAAFDataDef> pictureDef;
    hr = dictionary->LookupDataDef(DDEF_Picture, &pictureDef);

    aafRational_t editRate = {25, 1};
    aafRational_t sampleRate = {25, 1};
    IAAFEssenceAccess* pEssenceAccess = NULL;

    hr = masterMob->CreateEssence(1,
    pictureDef,
    kAAFCodecCDCI,
    editRate,
    sampleRate,
    kAAFCompressionDisable,
    NULL,
    ContainerAAF,
    &pEssenceAccess);

    I´m working under Microsoft Visual C++ 2008, v.9.0.21022.8
    Can anyone say me what i´m doing wrong?

    Thanks

    Salva

     
  •  Salva

    Salva - 2010-11-17

    If I do the CreateEssence call like this,

    hr = masterMob->CreateEssence (1,
                                                                   pictureDef,
                                                                   kAAFCodecJPEG,
                                                                   editRate,
                                                                   sampleRate,
                                                                   kAAFCompressionEnable,
                                                                   NULL,
                                                                   ContainerAAF,
                                                                   &pEssenceAccess);

    hr = 0x80120167 ( AAFRESULT_NOT_INITIALIZED )

    What object isn´t initialized?? the code is like previous post, only change the createessence call.

    Please, I am stopped in this point, can anyone say me anything about this??

     
  • Phil Tudor

    Phil Tudor - 2010-11-17

    Hi Salva,

    It may be something else, but are you calling the plugin manager to load the codecs in your program?

    Use:
    AAFGetPluginManager() to get a pointer to…
    IAAFPluginManager
    Call RegisterSharedPlugins().
    The SDK will look for a directory called “aafext” in the same directory where the COM library was loaded.
    It will load all libraries found in “aafext”

    You'll find this in any of the example programs so see more details.

    Phil

     
  •  Salva

    Salva - 2010-11-18

    Hi Phil

    My first problem was with codecs, the result to call createessence was AAFRESULT_CODEC_INVALID, and yes although I do the PluginManager calls, I don´t have rigth the location. I solved this, and then my problem is like I have detailed in previous posts.

    Thanks a lot for you help Phil.

    Any other idea??

    Salva

     
  •  Salva

    Salva - 2010-11-18

    sorry .. i´m going to solve mistakes in verbal times that can lead to confusion

    … and yes although I did the PluginManager calls, I didn´t have rigth the location. I solved this, and then my problem is like I have detailed in previous posts…

    hr = 0x80120167 ( AAFRESULT_NOT_INITIALIZED )  if I use kAAFCodecJPEG      or
    hr = 0x801201A4 (AAFRESULT_CODEC_SEMANTIC_WARN) if I use kAAFCodecCDCI

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks