videoplayback/videoplaybackviews/src/mpxvideoplaybackviewfiledetails.cpp
branchRCL_3
changeset 11 8970fbd719ec
parent 9 5294c000a26d
child 14 55fa1ec415c6
equal deleted inserted replaced
10:112a725ff2c2 11:8970fbd719ec
    13 *
    13 *
    14 * Description:  class for MPX Video File Details
    14 * Description:  class for MPX Video File Details
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 10 %
    18 // Version : %version: e003sa33#11 %
    19 
    19 
    20 
    20 
    21 //
    21 //
    22 //  INCLUDE FILES
    22 //  INCLUDE FILES
    23 //
    23 //
    24 #include <f32file.h>
    24 #include <f32file.h>
       
    25 #include <uri16.h>
    25 
    26 
    26 #include "mpxvideo_debug.h"
    27 #include "mpxvideo_debug.h"
    27 #include "mpxvideoplaybackviewfiledetails.h"
    28 #include "mpxvideoplaybackviewfiledetails.h"
    28 
    29 
    29 // ============================ MEMBER FUNCTIONS ===================================================
    30 // ============================ MEMBER FUNCTIONS ===================================================
   124     }
   125     }
   125 
   126 
   126     return fileName;
   127     return fileName;
   127 }
   128 }
   128 
   129 
       
   130 // -------------------------------------------------------------------------------------------------
       
   131 // CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL
       
   132 // -------------------------------------------------------------------------------------------------
       
   133 //
       
   134 EXPORT_C HBufC* CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()
       
   135 {
       
   136     MPX_ENTER_EXIT( _L( "CMPXVideoPlaybackViewFileDetails::GenerateFileTitleL()" ) );
       
   137 
       
   138     HBufC* fileTitle = NULL;
       
   139 
       
   140     if ( iTitle && iTitle->Length() )
       
   141     {
       
   142         //
       
   143         // use file title in metadata as title cotent directly
       
   144         //
       
   145         fileTitle = iTitle->AllocL();
       
   146     }
       
   147     else if ( ( EMPXVideoStreaming == iPlaybackMode || EMPXVideoLiveStreaming == iPlaybackMode ) &&
       
   148               iClipName && iClipName->Length() )
       
   149     {
       
   150         //
       
   151         //  parse file name in URL
       
   152         //
       
   153         TUriParser parser;
       
   154 
       
   155         if ( parser.Parse( iClipName->Des() ) == KErrNone )
       
   156         {
       
   157 
       
   158             MPX_DEBUG(
       
   159                 _L( "    streaming link: schema = %S, urihost = %S, uriPort = %S, uriPath = %S" ),
       
   160                 &( parser.Extract( EUriScheme ) ),
       
   161                 &( parser.Extract( EUriHost ) ),
       
   162                 &( parser.Extract( EUriPort ) ),
       
   163                 &( parser.Extract( EUriPath ) ) );
       
   164 
       
   165             HBufC* nameAndTail = NULL;
       
   166 
       
   167             MPX_TRAPD( err, nameAndTail = parser.GetFileNameL( EUriFileNameTail ) );
       
   168 
       
   169             if ( KErrNone == err && nameAndTail )
       
   170             {
       
   171                 CleanupStack::PushL( nameAndTail );
       
   172                 TInt extPos = nameAndTail->Des().LocateReverse( KExtDelimiter );
       
   173 
       
   174                 if ( extPos > 0 )
       
   175                 {
       
   176                     fileTitle = ( nameAndTail->Des().Left( extPos ) ).AllocL();
       
   177                 }
       
   178                 else
       
   179                 {
       
   180                     fileTitle = nameAndTail->Des().AllocL();
       
   181                 }
       
   182 
       
   183                 CleanupStack::PopAndDestroy( nameAndTail );
       
   184             }
       
   185         }
       
   186     }
       
   187 
       
   188     return fileTitle;
       
   189 }
       
   190 
   129 //  EOF
   191 //  EOF