diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-01-09 17:51:23 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-01-09 17:51:23 -0800 |
commit | b798689749c64baba81f02e10cf2157c747d6b46 (patch) | |
tree | da394a395ddb1a6cf69193314846b03fe47a397e /include/media | |
parent | f013e1afd1e68af5e3b868c26a653bbfb39538f8 (diff) | |
download | frameworks_base-b798689749c64baba81f02e10cf2157c747d6b46.zip frameworks_base-b798689749c64baba81f02e10cf2157c747d6b46.tar.gz frameworks_base-b798689749c64baba81f02e10cf2157c747d6b46.tar.bz2 |
auto import from //branches/cupcake/...@125939
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/JetPlayer.h | 101 | ||||
-rw-r--r-- | include/media/ToneGenerator.h | 1 | ||||
-rw-r--r-- | include/media/mediametadataretriever.h | 5 |
3 files changed, 107 insertions, 0 deletions
diff --git a/include/media/JetPlayer.h b/include/media/JetPlayer.h new file mode 100644 index 0000000..4268170 --- /dev/null +++ b/include/media/JetPlayer.h @@ -0,0 +1,101 @@ +/* + * Copyright (C) 2008 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. + */ + +#ifndef JETPLAYER_H_ +#define JETPLAYER_H_ + +#include <utils/threads.h> +#include <nativehelper/jni.h> + +#include <libsonivox/jet.h> +#include <libsonivox/eas_types.h> +#include "AudioTrack.h" + + +namespace android { + +typedef void (*jetevent_callback)(int eventType, int val1, int val2, void *cookie); + +class JetPlayer { + +public: + + static const int JET_USERID_UPDATE = 1; + static const int JET_NUMQUEUEDSEGMENT_UPDATE = 2; + static const int JET_PAUSE_UPDATE = 3; + + JetPlayer(jobject javaJetPlayer, + int maxTracks = 32, + int trackBufferSize = 1200); + ~JetPlayer(); + int init(); + int release(); + + int openFile(const char* url); + int closeFile(); + int play(); + int pause(); + int queueSegment(int segmentNum, int libNum, int repeatCount, int transpose, + EAS_U32 muteFlags, EAS_U8 userID); + int setMuteFlags(EAS_U32 muteFlags, bool sync); + int setMuteFlag(int trackNum, bool muteFlag, bool sync); + int triggerClip(int clipId); + + void setEventCallback(jetevent_callback callback); + + int getMaxTracks() { return mMaxTracks; }; + + +private: + static int renderThread(void*); + int render(); + void fireEventOnStatusChange(); + + JetPlayer() {} // no default constructor + void dump(); + void dumpJetStatus(S_JET_STATUS* pJetStatus); + + jetevent_callback mEventCallback; + + jobject mJavaJetPlayerRef; + Mutex mMutex; // mutex to sync the render and playback thread with the JET calls + pid_t mTid; + Condition mCondition; + volatile bool mRender; + bool mPaused; + + EAS_STATE mState; + int* mMemFailedVar; + + int mMaxTracks; // max number of MIDI tracks, usually 32 + EAS_DATA_HANDLE mEasData; + EAS_FILE_LOCATOR mEasJetFileLoc; + EAS_PCM* mAudioBuffer;// EAS renders the MIDI data into this buffer, + AudioTrack* mAudioTrack; // and we play it in this audio track + int mTrackBufferSize; + S_JET_STATUS mJetStatus; + S_JET_STATUS mPreviousJetStatus; + + char mJetFilePath[256]; + + +}; // end class JetPlayer + +} // end namespace android + + + +#endif /*JETPLAYER_H_*/ diff --git a/include/media/ToneGenerator.h b/include/media/ToneGenerator.h index da1489f..0ddfb8e 100644 --- a/include/media/ToneGenerator.h +++ b/include/media/ToneGenerator.h @@ -134,6 +134,7 @@ private: Condition mWaitCbkCond; // condition enabling interface to wait for audio callback completion after a change is requested float mVolume; // Volume applied to audio track int mStreamType; // Audio stream used for output + int mProcessSize; // Size of audio blocks generated at a time by audioCallback() (in PCM frames). bool initAudioTrack(); static void audioCallback(int event, void* user, void *info); diff --git a/include/media/mediametadataretriever.h b/include/media/mediametadataretriever.h index 05cba30..f2719d3 100644 --- a/include/media/mediametadataretriever.h +++ b/include/media/mediametadataretriever.h @@ -47,6 +47,11 @@ enum { METADATA_KEY_RATING = 13, METADATA_KEY_COMMENT = 14, METADATA_KEY_COPYRIGHT = 15, + METADATA_KEY_BIT_RATE = 16, + METADATA_KEY_FRAME_RATE = 17, + METADATA_KEY_VIDEO_FORMAT = 18, + METADATA_KEY_VIDEO_HEIGHT = 19, + METADATA_KEY_VIDEO_WIDTH = 20, // Add more here... }; |