summaryrefslogtreecommitdiffstats
path: root/voip/jni/rtp/AudioCodec.h
diff options
context:
space:
mode:
authorChia-chi Yeh <chiachi@android.com>2010-08-06 14:12:05 +0800
committerChia-chi Yeh <chiachi@android.com>2010-08-06 14:12:05 +0800
commit4c5d28cee0537c83ff0e5bc0daaae78f68dfc7c8 (patch)
tree0c6b5c7973f57d56b6c55130356cae06f5c09954 /voip/jni/rtp/AudioCodec.h
parent1d62c7737c33f92e79f0a180b05969f52484e64c (diff)
downloadframeworks_base-4c5d28cee0537c83ff0e5bc0daaae78f68dfc7c8.zip
frameworks_base-4c5d28cee0537c83ff0e5bc0daaae78f68dfc7c8.tar.gz
frameworks_base-4c5d28cee0537c83ff0e5bc0daaae78f68dfc7c8.tar.bz2
RTP: move into frameworks.
Change-Id: Ic9c17b460448c746b21526ac10b647f281ae48e9
Diffstat (limited to 'voip/jni/rtp/AudioCodec.h')
-rw-r--r--voip/jni/rtp/AudioCodec.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/voip/jni/rtp/AudioCodec.h b/voip/jni/rtp/AudioCodec.h
new file mode 100644
index 0000000..797494c
--- /dev/null
+++ b/voip/jni/rtp/AudioCodec.h
@@ -0,0 +1,36 @@
+/*
+ * Copyrightm (C) 2010 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <stdint.h>
+
+#ifndef __AUDIO_CODEC_H__
+#define __AUDIO_CODEC_H__
+
+class AudioCodec
+{
+public:
+ virtual ~AudioCodec() {}
+ // Returns true if initialization succeeds.
+ virtual bool set(int sampleRate, int sampleCount) = 0;
+ // Returns the length of payload in bytes.
+ virtual int encode(void *payload, int16_t *samples) = 0;
+ // Returns the number of decoded samples.
+ virtual int decode(int16_t *samples, void *payload, int length) = 0;
+};
+
+AudioCodec *newAudioCodec(const char *codecName);
+
+#endif