videoplayback/videohelix/src/mpxvideodrmhelper.cpp
branchRCL_3
changeset 14 55fa1ec415c6
parent 6 7d91903f795f
equal deleted inserted replaced
12:7f2b2a65da29 14:55fa1ec415c6
    13 *
    13 *
    14 * Description:   This class handles the DRM functions for the playback plugin
    14 * Description:   This class handles the DRM functions for the playback plugin
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // Version : %version: 8 %
    18 
       
    19 // Version : %version: 9 %
    19 
    20 
    20 
    21 
    21 #include <caf/data.h>
    22 #include <caf/data.h>
    22 #include <caf/caftypes.h>
    23 #include <caf/caftypes.h>
    23 #include <caf/content.h>
    24 #include <caf/content.h>
   108     MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus() drmError = %d"), drmError);
   109     MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus() drmError = %d"), drmError);
   109 
   110 
   110     return drmError;
   111     return drmError;
   111 }
   112 }
   112 
   113 
   113 TBool CMpxVideoDrmHelper::IsTvOutAllowedL( RFile& aFile )
       
   114 {
       
   115     TBool tvOutAllowed = ETrue;
       
   116 
       
   117     if ( IsProtectedL( aFile ) )
       
   118     {
       
   119         ContentAccess::CContent* content = ContentAccess::CContent::NewLC( aFile );
       
   120 
       
   121         ContentAccess::CData* data = content->OpenContentL( ContentAccess::EPeek );
       
   122 
       
   123         TInt fileType;
       
   124 
       
   125         TInt error = data->GetAttribute( ContentAccess::EFileType, fileType );
       
   126 
       
   127         if ( error == KErrNone )
       
   128         {
       
   129             //
       
   130             //  TV-out is not allowed for DRM content other than OMA1 DRM
       
   131             //
       
   132             if ( fileType != ContentAccess::EOma1Dcf )
       
   133             {
       
   134                 tvOutAllowed = EFalse;
       
   135             }
       
   136         }
       
   137 
       
   138         delete data;
       
   139 
       
   140         CleanupStack::PopAndDestroy( content );
       
   141     }
       
   142 
       
   143     MPX_DEBUG(_L("CMpxVideoDrmHelper::IsTvOutAllowedL(%d)"), tvOutAllowed);
       
   144 
       
   145     return tvOutAllowed;
       
   146 }
       
   147 
       
   148 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   114 #ifdef SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   149 
   115 
   150 //  ------------------------------------------------------------------------------------------------
   116 //  ------------------------------------------------------------------------------------------------
   151 //    CMpxVideoDrmHelper::IsProtected64L()
   117 //    CMpxVideoDrmHelper::IsProtected64L()
   152 //  ------------------------------------------------------------------------------------------------
   118 //  ------------------------------------------------------------------------------------------------
   201     MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus64() drmError = %d"), drmError);
   167     MPX_DEBUG(_L("CMpxVideoDrmHelper::GetDrmRightsStatus64() drmError = %d"), drmError);
   202 
   168 
   203     return drmError;
   169     return drmError;
   204 }
   170 }
   205 
   171 
   206 //  ------------------------------------------------------------------------------------------------
       
   207 //    CMpxVideoDrmHelper::IsTvOutAllowed64L()
       
   208 //  ------------------------------------------------------------------------------------------------
       
   209 //
       
   210 TBool CMpxVideoDrmHelper::IsTvOutAllowed64L( RFile64& aFile )
       
   211 {
       
   212     TBool tvOutAllowed = ETrue;
       
   213 
       
   214     if ( IsProtected64L( aFile ) )
       
   215     {
       
   216         ContentAccess::CContent* content = ContentAccess::CContent::NewLC( aFile );
       
   217 
       
   218         ContentAccess::CData* data = content->OpenContentL( ContentAccess::EPeek );
       
   219 
       
   220         TInt fileType;
       
   221 
       
   222         TInt error = data->GetAttribute( ContentAccess::EFileType, fileType );
       
   223 
       
   224         if ( error == KErrNone )
       
   225         {
       
   226             //
       
   227             //  TV-out is not allowed for DRM content other than OMA1 DRM
       
   228             //
       
   229             if ( fileType != ContentAccess::EOma1Dcf )
       
   230             {
       
   231                 tvOutAllowed = EFalse;
       
   232             }
       
   233         }
       
   234 
       
   235         delete data;
       
   236 
       
   237         CleanupStack::PopAndDestroy( content );
       
   238     }
       
   239 
       
   240     MPX_DEBUG(_L("CMpxVideoDrmHelper::IsTvOutAllowed64L(%d)"), tvOutAllowed);
       
   241 
       
   242     return tvOutAllowed;
       
   243 }
       
   244 
       
   245 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   172 #endif // SYMBIAN_ENABLE_64_BIT_FILE_SERVER_API
   246 
   173 
   247 //  EOF
   174 //  EOF