Home | History | Annotate | Download | only in src
      1 /* ------------------------------------------------------------------
      2  * Copyright (C) 1998-2009 PacketVideo
      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
     13  * express or implied.
     14  * See the License for the specific language governing permissions
     15  * and limitations under the License.
     16  * -------------------------------------------------------------------
     17  */
     18 /*
     19 **
     20 ** Copyright 2009, The Android Open Source Project
     21 **
     22 ** Licensed under the Apache License, Version 2.0 (the "License");
     23 ** you may not use this file except in compliance with the License.
     24 ** You may obtain a copy of the License at
     25 **
     26 **     http://www.apache.org/licenses/LICENSE-2.0
     27 **
     28 ** Unless required by applicable law or agreed to in writing, software
     29 ** distributed under the License is distributed on an "AS IS" BASIS,
     30 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     31 ** See the License for the specific language governing permissions and
     32 ** limitations under the License.
     33 */
     34 
     35 #include "pvmf_return_codes.h"
     36 
     37 #ifdef CONSIDER
     38 #error "CONSIDER already defined!"
     39 #endif
     40 #define CONSIDER(val) case val: return #val
     41 
     42 OSCL_EXPORT_REF const char *PVMFStatusToString(const PVMFStatus status)
     43 {
     44     switch (status)
     45     {
     46             CONSIDER(PVMFSuccess);
     47             CONSIDER(PVMFPending);
     48             CONSIDER(PVMFNotSet);
     49             CONSIDER(PVMFFailure);
     50             CONSIDER(PVMFErrCancelled);
     51             CONSIDER(PVMFErrNoMemory);
     52             CONSIDER(PVMFErrNotSupported);
     53             CONSIDER(PVMFErrArgument);
     54             CONSIDER(PVMFErrBadHandle);
     55             CONSIDER(PVMFErrAlreadyExists);
     56             CONSIDER(PVMFErrBusy);
     57             CONSIDER(PVMFErrNotReady);
     58             CONSIDER(PVMFErrCorrupt);
     59             CONSIDER(PVMFErrTimeout);
     60             CONSIDER(PVMFErrOverflow);
     61             CONSIDER(PVMFErrUnderflow);
     62             CONSIDER(PVMFErrInvalidState);
     63             CONSIDER(PVMFErrNoResources);
     64             CONSIDER(PVMFErrResourceConfiguration);
     65             CONSIDER(PVMFErrResource);
     66             CONSIDER(PVMFErrProcessing);
     67             CONSIDER(PVMFErrPortProcessing);
     68             CONSIDER(PVMFErrAccessDenied);
     69             CONSIDER(PVMFErrLicenseRequired);
     70             CONSIDER(PVMFErrLicenseRequiredPreviewAvailable);
     71             CONSIDER(PVMFErrContentTooLarge);
     72             CONSIDER(PVMFErrMaxReached);
     73             CONSIDER(PVMFLowDiskSpace);
     74             CONSIDER(PVMFErrHTTPAuthenticationRequired);
     75             CONSIDER(PVMFInfoPortCreated);
     76             CONSIDER(PVMFInfoPortDeleted);
     77             CONSIDER(PVMFInfoPortConnected);
     78             CONSIDER(PVMFInfoPortDisconnected);
     79             CONSIDER(PVMFInfoOverflow);
     80             CONSIDER(PVMFInfoUnderflow);
     81             CONSIDER(PVMFInfoProcessingFailure);
     82             CONSIDER(PVMFInfoEndOfData);
     83             CONSIDER(PVMFInfoBufferCreated);
     84             CONSIDER(PVMFInfoBufferingStart);
     85             CONSIDER(PVMFInfoBufferingStatus);
     86             CONSIDER(PVMFInfoBufferingComplete);
     87             CONSIDER(PVMFInfoDataReady);
     88             CONSIDER(PVMFInfoPositionStatus);
     89             CONSIDER(PVMFInfoStateChanged);
     90             CONSIDER(PVMFInfoDataDiscarded);
     91             CONSIDER(PVMFInfoErrorHandlingStart);
     92             CONSIDER(PVMFInfoErrorHandlingComplete);
     93             CONSIDER(PVMFInfoRemoteSourceNotification);
     94             CONSIDER(PVMFInfoLicenseAcquisitionStarted);
     95             CONSIDER(PVMFInfoContentLength);
     96             CONSIDER(PVMFInfoContentTruncated);
     97             CONSIDER(PVMFInfoSourceFormatNotSupported);
     98             CONSIDER(PVMFInfoPlayListClipTransition);
     99             CONSIDER(PVMFInfoContentType);
    100             CONSIDER(PVMFInfoTrackDisable);
    101             CONSIDER(PVMFInfoUnexpectedData);
    102             CONSIDER(PVMFInfoSessionDisconnect);
    103             CONSIDER(PVMFInfoStartOfData);
    104             CONSIDER(PVMFInfoReportObserverRecieved);
    105             CONSIDER(PVMFInfoMetadataAvailable);
    106             CONSIDER(PVMFInfoDurationAvailable);
    107             CONSIDER(PVMFInfoChangePlaybackPositionNotSupported);
    108             CONSIDER(PVMFInfoPoorlyInterleavedContent);
    109             CONSIDER(PVMFInfoVideoTrackFallingBehind);
    110         default:
    111             return "UNKNOWN PVMFStatus";
    112     }
    113 }
    114 
    115 #undef CONSIDER
    116