Home | History | Annotate | Download | only in drmmanager
      1 /*
      2  * Copyright (C) 2007 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 #include <drmmanager/DrmManager.h>
     17 #include <ustring.h>
     18 #include <ofstream.h>
     19 #include <sostream.h>
     20 #include <sistream.h>
     21 using namespace ustl;
     22 
     23 /**see DrmManager.h */
     24 DrmManager::DrmManager(istream * inRawData)
     25 {
     26     mDcfStream = NULL;
     27     if (inRawData != NULL)
     28     {
     29         mDcfStream = inRawData;
     30     }
     31 }
     32 
     33 /**see DrmManager.h */
     34 DrmManager::DrmManager(istream * inRawData, string mimeType)
     35 {
     36     mDcfStream = inRawData;
     37 }
     38 
     39 /**see DrmManager.h */
     40 int16_t DrmManager::getListOfDcfObjects(vector<DcfContainer*> **outDcfList)
     41 {
     42     /** call dcf functions to parse the dcf file*/
     43     if (NULL == mDcfStream)
     44     {
     45         return ERR_DCFSTREAM_NOT_INITIALIZED;
     46     }
     47     if (NULL == outDcfList)
     48     {
     49         return ERR_DCFSTREAM_NOT_INITIALIZED;
     50     }
     51     *outDcfList=&mDcfs;
     52     return DRM_OK;
     53 }
     54 
     55 /**see DrmManager.h */
     56 int16_t DrmManager::openDecryptedContent(DcfContainer *oneDcfObject,
     57                                          int16_t operationType,
     58                                          istream *outDecryptedData)
     59 {
     60     return 1;
     61 }
     62 
     63 /**see DrmManager.h */
     64 DrmManager::~DrmManager()
     65 {
     66 
     67 }
     68