• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef PVMF_RECOGNIZER_TYPES_H_INCLUDED
19 #define PVMF_RECOGNIZER_TYPES_H_INCLUDED
20 
21 #ifndef OSCL_BASE_H_INCLUDED
22 #include "oscl_base.h"
23 #endif
24 
25 #ifndef OSCL_VECTOR_H_INCLUDED
26 #include "oscl_vector.h"
27 #endif
28 
29 #ifndef OSCL_STRING_H_INCLUDED
30 #include "oscl_string.h"
31 #endif
32 
33 #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED
34 #include "oscl_string_containers.h"
35 #endif
36 
37 #ifndef PVMF_EVENT_HANDLING_H_INCLUDED
38 #include "pvmf_event_handling.h"
39 #endif
40 
41 
42 typedef Oscl_Vector<OSCL_HeapString<OsclMemAllocator>, OsclMemAllocator> PVMFRecognizerMIMEStringList;
43 
44 typedef enum _PVMFRecognizerConfidence
45 {
46     PVMFRecognizerConfidenceNotCertain,     // 100% sure not the format
47     PVMFRecognizerConfidenceNotPossible,    // Maybe not the format
48     PVMFRecognizerConfidenceUnknown,        // Not sure one way or the other
49     PVMFRecognizerConfidencePossible,       // Maybe the format
50     PVMFRecognizerConfidenceCertain         // 100% sure of the format
51 } PVMFRecognizerConfidence;
52 
53 
54 class PVMFRecognizerResult
55 {
56     public:
PVMFRecognizerResult()57         PVMFRecognizerResult()
58         {
59         };
60 
61         // Copy constructor for use in Oscl_Vector
PVMFRecognizerResult(const PVMFRecognizerResult & aSrc)62         PVMFRecognizerResult(const PVMFRecognizerResult& aSrc)
63         {
64             iRecognizedFormat = aSrc.iRecognizedFormat;
65             iRecognitionConfidence = aSrc.iRecognitionConfidence;
66             //  iRecognizerSubFormatList=aSrc.iRecognizerSubFormatList;
67         };
68 
~PVMFRecognizerResult()69         ~PVMFRecognizerResult()
70         {
71         };
72 
73         // The format of interest as a MIME string
74         OSCL_HeapString<OsclMemAllocator> iRecognizedFormat;
75         // The confidence level of recognition
76         PVMFRecognizerConfidence iRecognitionConfidence;
77         // If the format is a container format, the format of content within
78 //  Oscl_Vector<PVMFRecognizerResult, OsclMemAllocator> iRecognizerSubFormatList;
79 };
80 
81 
82 /**
83  * PVMFRecognizerCommmandHandler Class
84  *
85  * PVMFRecognizerCommmandHandler is the PVMF Recognizer observer class for notifying the
86  * status of asynchronous requests. The API provides a mechanism for the status of each
87  * command to be passed back along with context specific information where applicable.
88  * User of the recognizer registry must have a class derived from PVMFNodeCmdStatusObserver
89  * and implement the pure virtual function in order to receive event notifications from
90  * PVMF Recognizer Registry.
91  **/
92 class PVMFRecognizerCommmandHandler
93 {
94     public:
95         /**
96          * Handle an event that has been generated.
97          *
98          * @param aResponse
99          *        The response to a previously issued command
100          */
101         virtual void RecognizerCommandCompleted(const PVMFCmdResp& aResponse) = 0;
~PVMFRecognizerCommmandHandler()102         virtual ~PVMFRecognizerCommmandHandler() {}
103 };
104 
105 #endif // PVMF_RECOGNIZER_TYPES_H_INCLUDED
106 
107