MediaPlayer_to_android.h revision 68d56b8ebaf60184a3aef988e3d2b09ed8b88c05
1/* 2 * Copyright (C) 2010 The Android Open Source Project 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 express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17/************************************************************************************************** 18 * Player lifecycle 19 ****************************/ 20 21extern XAresult android_Player_create(CMediaPlayer *mp); 22 23extern XAresult android_Player_realize(CMediaPlayer *mp, SLboolean async); 24 25extern XAresult android_Player_destroy(CMediaPlayer *mp); 26 27 28/************************************************************************************************** 29 * Configuration 30 ****************************/ 31/** 32 * pre-conditions: avp != NULL, surface != NULL 33 */ 34extern XAresult android_Player_setVideoSurface(android::GenericMediaPlayer *avp, void* surface); 35 36/************************************************************************************************** 37 * Playback control and events 38 ****************************/ 39/** 40 * pre-condition: avp != NULL 41 */ 42extern XAresult android_Player_setPlayState(android::GenericPlayer *avp, SLuint32 playState, 43 AndroidObject_state* pObjState); 44 45 46 47/************************************************************************************************** 48 * Buffer Queue events 49 ****************************/ 50 51/************************************************************************************************** 52 * Android Buffer Queue 53 ****************************/ 54 55/* must be called with a lock on mp->mThis */ 56extern void android_Player_androidBufferQueue_registerCallback_l(CMediaPlayer *mp); 57/* must be called with a lock on mp->mThis */ 58extern void android_Player_androidBufferQueue_enqueue_l(CMediaPlayer *mp, 59 SLuint32 bufferId, SLuint32 length, SLAbufferQueueEvent event, void *pData); 60