Android 下的PVPlayer的实现
2010-09-10 01:08:00 来源:WEB开发网我们知道,MediaPlayerInterface接口是Android框架中承上启下的关键接口,Android下面几个播放器都是冲这个接口派生过来的,前面在写flac的时候已经基本看了一些关于OGG player的相关东西,但是那个只是音频,还没有涉及到视频,下面简单的介绍一下其中最复杂的PVPlayer
class PVPlayer : public MediaPlayerInterface
{
public:
PVPlayer();
virtual ~PVPlayer();
virtual status_t initCheck(); //1
virtual status_t setDataSource(const char *url);//2
virtual status_t setDataSource(int fd, int64_t offset, int64_t length);//2
virtual status_t setVideoSurface(const sp
virtual status_t prepare();//4
virtual status_t prepareAsync();//5
virtual status_t start();//5
virtual status_t stop();//6
virtual status_t pause();//6
virtual bool isPlaying();
virtual status_t seekTo(int msec);
virtual status_t getCurrentPosition(int *msec);
virtual status_t getDuration(int *msec);
virtual status_t reset();
virtual status_t setLooping(int loop);
virtual player_type playerType() { return PV_PLAYER; }
// make available to PlayerDriver
void sendEvent(int msg, int ext1=0, int ext2=0) { MediaPlayerBase::sendEvent(msg, ext1, ext2); }
private:
static void do_nothing(status_t s, void *cookie, bool cancelled) { }
static void run_init(status_t s, void *cookie, bool cancelled);
static void run_set_video_surface(status_t s, void *cookie, bool cancelled);
static void run_set_audio_output(status_t s, void *cookie, bool cancelled);
static void run_prepare(status_t s, void *cookie, bool cancelled);
PlayerDriver* mPlayerDriver;
char * mDataSourcePath;
bool mIsDataSourceSet;
sp
更多精彩
赞助商链接