gstreamer_core/gst/helpfile.cpp
branchRCL_3
changeset 30 7e817e7e631c
parent 29 567bb019e3e3
equal deleted inserted replaced
29:567bb019e3e3 30:7e817e7e631c
    23 #include "helpfile.h" 
    23 #include "helpfile.h" 
    24 #include <f32file.h>
    24 #include <f32file.h>
    25 #include <e32std.h> 
    25 #include <e32std.h> 
    26 #include <pls.h> // For emulator WSD API 
    26 #include <pls.h> // For emulator WSD API 
    27 #include <glib.h>
    27 #include <glib.h>
    28 #include <config.h>
       
    29 #include <stdlib.h> 
       
    30 
    28 
    31 extern "C" char* libgstreamer_get_dll_path(char* dllName)
    29 extern "C" char* libgstreamer_get_dll_path(char* dllName)
    32 {
    30 {
    33     char* dllFullPath = NULL;
    31     TUint ch = TUint('A');
       
    32     char* fullPath = dllName;
       
    33     #ifdef __WINSCW__ 
       
    34     char* dllPath = "z:\\sys\\bin\\plugins";
       
    35     fullPath = g_strjoin ("\\", dllPath,dllName, NULL);
       
    36     #else
       
    37     char* dllPath = "sys\\bin";
       
    38     
       
    39     char* filename;
       
    40     TInt i; 
    34     RFs fs;
    41     RFs fs;
    35     CDir* directory=NULL;
    42     TDriveList driveList;
       
    43     //err = fs.Connect();
    36     if( !(fs.Connect()) )
    44     if( !(fs.Connect()) )
    37     {
    45     {
    38         TFindFile findFile(fs);
    46         //err = fs.DriveList(driveList);
    39         TFileName file;
    47         if( !(fs.DriveList(driveList)) )
    40         TPtrC8 filename;
       
    41         filename.Set( reinterpret_cast<TUint8*>( dllName ) );
       
    42         file.Copy( filename );
       
    43         if( ! findFile.FindWildByDir(file,KResFileNamePath,directory) )
       
    44         {
    48         {
    45             TBuf8<KMaxFileName> fileName;
    49             for( i = 0; i< KMaxDrives; i++ )
    46             fileName.Copy( findFile.File() );
    50             {
    47             TInt length = fileName.Size() + 1;
    51             
    48             dllFullPath = (char*)malloc( length );
    52                 if( driveList[i] != 0 )
    49             memcpy( dllFullPath, fileName.PtrZ(), length );
    53                 {
    50             delete directory;
    54                     char temp[3];
       
    55                     temp[0]= char(ch);
       
    56                     temp[1]= ':';
       
    57                     temp[2]= '\0';
       
    58                     
       
    59                     filename = g_strjoin ("\\", temp,dllPath,dllName, NULL);
       
    60                     if (g_file_test (filename, G_FILE_TEST_EXISTS))
       
    61                     {
       
    62                         fullPath = filename;
       
    63                         break;
       
    64                     }
       
    65                 }
       
    66                 ch++;
       
    67             }
    51         }
    68         }
    52         fs.Close();
    69         fs.Close();
    53     }
    70     }
    54     return dllFullPath;
    71     #endif
       
    72     return fullPath;
    55 }
    73 }
    56 
    74