• 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 /**
19  * @file pvmf_audio_encnode_extension.h
20  */
21 
22 #ifndef PVMF_AUDIO_ENCNODE_EXTENSION_H_INCLUDED
23 #define PVMF_AUDIO_ENCNODE_EXTENSION_H_INCLUDED
24 
25 #ifndef OSCL_BASE_H_INCLUDED
26 #include "oscl_base.h"
27 #endif
28 #ifndef OSCL_STRING_H_INCLUDED
29 #include "oscl_string.h"
30 #endif
31 #ifndef PV_UUID_H_INCLUDED
32 #include "pv_uuid.h"
33 #endif
34 #ifndef PV_INTERFACE_H_INCLUDED
35 #include "pv_interface.h"
36 #endif
37 
38 
39 // The AMR enc node interface was modified to audio enc node interface
40 //#define PVAMREncExtensionUUID PVUuid(0xd282cc91,0x54a6,0x4f36,0xbc,0x5b,0x2d,0xab,0xb4,0x40,0x69,0x26)
41 
42 #define PVAudioEncExtensionUUID PVUuid(0xd282cc91,0x54a6,0x4f36,0xbc,0x5b,0x2d,0xab,0xb4,0x40,0x69,0x27)
43 
44 typedef enum
45 {
46     GSM_AMR_4_75 = 0, // AMR NB bitrates i.e. modes start here
47     GSM_AMR_5_15,
48     GSM_AMR_5_90,
49     GSM_AMR_6_70,
50     GSM_AMR_7_40,
51     GSM_AMR_7_95,
52     GSM_AMR_10_2,
53     GSM_AMR_12_2,  // AMR NB bitrates end
54     GSM_AMR_6_60, // AMR WB bitrates start here
55     GSM_AMR_8_85,
56     GSM_AMR_12_65,
57     GSM_AMR_14_25,
58     GSM_AMR_15_85,
59     GSM_AMR_18_25,
60     GSM_AMR_19_85,
61     GSM_AMR_23_05,
62     GSM_AMR_23_85, // AMR WB bitrates end here
63     GSM_AMR_DTX,
64     GSM_AMR_N_MODES      /* number of (SPC) modes */
65 } PVMF_GSMAMR_Rate;
66 
67 
68 ////////////////////////////////////////////////////////////////////////////
69 class PVAudioEncExtensionInterface : public PVInterface
70 {
71     public:
72         /** Increment reference counter for this interface. */
73         virtual void addRef() = 0;
74 
75         /** Decrement reference counter for this interface. */
76         virtual void removeRef() = 0;
77 
78         /**
79          * Query for a pointer to an instance of the interface specified by the UUID.
80          *
81          * @param uuid UUID of the interface to be queried.
82          * @param iface Output parameter where a pointer to an instance of the requested
83          * interface is stored if the interface is supported.
84          * @return true if successful, else false.
85          */
86         virtual bool queryInterface(const PVUuid& uuid, PVInterface*& iface) = 0;
87 
88         /**
89          * Sets the bitrate of encoded output.
90          * @param aBitRate Bitrate in bits per second.
91          * @return PVMFSuccess if successful, else see PVMF return code.
92          */
93         virtual PVMFStatus SetOutputBitRate(uint32 aBitRate) = 0;
94 
95         /**
96          * Sets the number of channels of encoded output (default to source num channel).
97          * @param aNumChannel Number of channels.
98          * @return PVMFSuccess if successful, else see PVMF return code.
99          */
100         virtual PVMFStatus SetOutputNumChannel(uint32 aNumChannel) = 0;
101 
102         /**
103          * Sets the sampling of encoded output (default equal source sampling rate).
104          * @param aSamplingRate Sampling rate in Hz.
105          * @return PVMFSuccess if successful, else see PVMF return code.
106          */
107         virtual PVMFStatus SetOutputSamplingRate(uint32 aSamplingRate) = 0;
108 
109         //// From AMREncExtensionInterface
110         /**
111          * Sets the bitrate of encoded output.
112          * @param aBitRate Bitrate in bits per second.
113          * @return PVMFSuccess if successful, else see PVMF return code.
114          */
115         virtual PVMFStatus SetOutputBitRate(PVMF_GSMAMR_Rate aBitRate) = 0;
116 
117         /**
118          * Sets the maximum number of output frames per media buffer
119          * @param aNumOutputFrames, maximum number of output frames
120          * @return PVMFSuccess if successful, else see PVMF return code.
121          */
122         virtual PVMFStatus SetMaxNumOutputFramesPerBuffer(uint32 aNumOutputFrames) = 0;
123 };
124 
125 #endif // PVMF_AUDIO_ENCNODE_EXTENSION_H_INCLUDED
126 
127 
128 
129 
130 
131