MediaPlayer_to_android.h revision 70c49ae2867094072a4365423417ea452bf82231
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#include <surfaceflinger/Surface.h> 18#include <gui/ISurfaceTexture.h> 19 20/************************************************************************************************** 21 * Player lifecycle 22 ****************************/ 23extern XAresult android_Player_checkSourceSink(CMediaPlayer *mp); 24 25extern XAresult android_Player_create(CMediaPlayer *mp); 26 27extern XAresult android_Player_realize(CMediaPlayer *mp, SLboolean async); 28 29extern XAresult android_Player_destroy(CMediaPlayer *mp); 30 31 32/************************************************************************************************** 33 * Configuration 34 ****************************/ 35/** 36 * pre-conditions: avp != NULL, surface != 0 37 */ 38extern XAresult android_Player_setVideoSurface(android::GenericMediaPlayer *avp, 39 const android::sp<android::Surface> &surface); 40 41/** 42 * pre-conditions: avp != NULL, surfaceTexture != 0 43 */ 44extern XAresult android_Player_setVideoSurfaceTexture(android::GenericMediaPlayer *avp, 45 const android::sp<android::ISurfaceTexture> &surfaceTexture); 46 47extern XAresult android_Player_getDuration(IPlay *pPlayItf, SLmillisecond *pDurMsec); 48 49/************************************************************************************************** 50 * Playback control and events 51 ****************************/ 52/** 53 * pre-condition: avp != NULL 54 */ 55extern XAresult android_Player_setPlayState(android::GenericPlayer *avp, SLuint32 playState, 56 AndroidObject_state* pObjState); 57 58 59 60/************************************************************************************************** 61 * Buffer Queue events 62 ****************************/ 63 64/************************************************************************************************** 65 * Android Buffer Queue 66 ****************************/ 67 68/* must be called with a lock on mp->mThis */ 69extern void android_Player_androidBufferQueue_registerCallback_l(CMediaPlayer *mp); 70/* must be called with a lock on mp->mThis */ 71extern void android_Player_androidBufferQueue_onRefilled_l(CMediaPlayer *mp); 72