diff options
author | Reynaldo H. Verdejo Pinochet <reynaldo.verdejo@collabora.co.uk> | 2011-03-10 13:00:31 +0100 |
---|---|---|
committer | Reynaldo H. Verdejo Pinochet <reynaldo.verdejo@collabora.co.uk> | 2011-03-18 18:54:06 +0100 |
commit | f650110a56a2428e17371550c587ec3624d8fd50 (patch) | |
tree | 4728e25cce24a27415bb8f3dccc47eb884f7a01e | |
parent | 0b4a2b53d3e81b23be3b13a06a80ac0f2a640580 (diff) |
Use surfaceflingersink.
-rwxr-xr-x | gstplayer/GstDriver.cpp | 24 | ||||
-rw-r--r-- | gstplayer/GstDriver.h | 1 |
2 files changed, 16 insertions, 9 deletions
diff --git a/gstplayer/GstDriver.cpp b/gstplayer/GstDriver.cpp index 66f370d..f7301d9 100755 --- a/gstplayer/GstDriver.cpp +++ b/gstplayer/GstDriver.cpp @@ -154,11 +154,11 @@ GstDriver::setup () g_source_attach (mBusWatch, mMainCtx); if (mparent) { - mVideoBin = gst_element_factory_make ("icbandroidvideosink", NULL); + mVideoBin = gst_element_factory_make ("surfaceflingersink", NULL); if (!mVideoBin) { - LOGE ("Can't create icbandroidvideosink"); + LOGE ("Can't create surfaceflingersink"); } - LOGV ("add icbandroidvideosink to playbin"); + LOGV ("add surfaceflingersink to playbin"); mAudioBin = gst_element_factory_make ("audioflingersink", NULL); if (!mAudioBin) { LOGE ("Can't create audioflingersink"); @@ -188,7 +188,6 @@ GstDriver::setup () mState = GSTDRIVER_STATE_INITIALIZED; } - void GstDriver::setDataSource (const char *url) { @@ -369,8 +368,8 @@ void GstDriver::setVideoSurface (const sp < ISurface > &surface) { LOGV ("set surface to videosink"); - g_object_set (G_OBJECT (mVideoBin), "surface", surface.get (), - (gchar *) NULL); + mSurface = surface; + g_object_set (G_OBJECT (mVideoBin), "surface", surface.get(), (gchar *) NULL); } bool @@ -441,6 +440,7 @@ GstDriver::start () case GSTDRIVER_STATE_ERROR: case GSTDRIVER_STATE_END: { + LOGD("We are in IDLE/INITIALIZED/STOPPPED/ERROR/END: %d", mState); GstPlayer *parent = (GstPlayer *) mparent; if (parent) { parent->sendEvent (MEDIA_ERROR, 0); @@ -451,6 +451,7 @@ GstDriver::start () case GSTDRIVER_STATE_COMPLETED: { + LOGD("We are in GSTDRIVER_STATE_COMPLETED"); gint64 duration, position; duration = getDuration (); position = getPosition (); @@ -462,14 +463,19 @@ GstDriver::start () case GSTDRIVER_STATE_PREPARED: case GSTDRIVER_STATE_STARTED: case GSTDRIVER_STATE_PAUSED: + LOGD("We are in PREPARED/STARTED/PAUSED: %d", mState); + /* FIXME, twi says NOT + HAVING THIS MAKES GENERATING THUMBNAILS DOGSLOW + no track means the sink is an AudioCache instance and the player is + being used to decode in memory + */ + if (mAudioOut->getTrack() == NULL) { - /* no track means the sink is an AudioCache instance and the player is - * being used to decode in memory - */ g_object_set (mAudioBin, "sync", FALSE, NULL); } else { g_object_set (mAudioBin, "sync", TRUE, NULL); } + mEos = false; gst_element_set_state (mPlaybin, GST_STATE_PLAYING); mState = GSTDRIVER_STATE_STARTED; diff --git a/gstplayer/GstDriver.h b/gstplayer/GstDriver.h index 67996b5..24a2680 100644 --- a/gstplayer/GstDriver.h +++ b/gstplayer/GstDriver.h @@ -161,6 +161,7 @@ namespace android static gpointer do_loop (GstDriver *ed); GThread* mMainThread; GSource* mBusWatch; + sp<ISurface> mSurface; }; }; // namespace android |