summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-10-12 15:08:42 -0700
committerAndreas Huber <andih@google.com>2011-10-12 15:08:42 -0700
commit3e79eec74bc253c1b8e27cb9a815ae43b4849e68 (patch)
tree5fad58db45cecfc5bd3370f1b2d1733f28aac63b
parent7911553d968b6269cedb814f32e45c07fa4068f6 (diff)
downloadlibvideoeditor-3e79eec74bc253c1b8e27cb9a815ae43b4849e68.tar.gz
Remove RTSP support from libvideoeditor's PreviewPlayer...
Change-Id: I2032772037c1130736081cb62bd6ce8d1270e1b9
-rwxr-xr-xlvpp/PreviewPlayer.cpp1
-rw-r--r--lvpp/PreviewPlayerBase.cpp70
-rw-r--r--lvpp/PreviewPlayerBase.h10
3 files changed, 4 insertions, 77 deletions
diff --git a/lvpp/PreviewPlayer.cpp b/lvpp/PreviewPlayer.cpp
index 1330c7f..349e9c2 100755
--- a/lvpp/PreviewPlayer.cpp
+++ b/lvpp/PreviewPlayer.cpp
@@ -21,7 +21,6 @@
#include <dlfcn.h>
-#include "include/ARTSPController.h"
#include "PreviewPlayer.h"
#include "DummyAudioSource.h"
#include "DummyVideoSource.h"
diff --git a/lvpp/PreviewPlayerBase.cpp b/lvpp/PreviewPlayerBase.cpp
index 3f75fb9..aed26ef 100644
--- a/lvpp/PreviewPlayerBase.cpp
+++ b/lvpp/PreviewPlayerBase.cpp
@@ -22,7 +22,6 @@
#include <dlfcn.h>
-#include "include/ARTSPController.h"
#include "PreviewPlayerBase.h"
#include "AudioPlayerBase.h"
#include "include/SoftwareRenderer.h"
@@ -49,9 +48,6 @@
#include <gui/SurfaceTextureClient.h>
#include <surfaceflinger/ISurfaceComposer.h>
-#include <media/stagefright/foundation/ALooper.h>
-#include <media/stagefright/foundation/AMessage.h>
-
#include <cutils/properties.h>
#define USE_SURFACE_ALLOC 1
@@ -60,7 +56,6 @@ namespace android {
static int64_t kLowWaterMarkUs = 2000000ll; // 2secs
static int64_t kHighWaterMarkUs = 10000000ll; // 10secs
-static int64_t kHighWaterMarkRTSPUs = 4000000ll; // 4secs
static const size_t kLowWaterMarkBytes = 40000;
static const size_t kHighWaterMarkBytes = 200000;
@@ -429,9 +424,6 @@ void PreviewPlayerBase::reset_l() {
if (mConnectingDataSource != NULL) {
LOGI("interrupting the connection process");
mConnectingDataSource->disconnect();
- } else if (mConnectingRTSPController != NULL) {
- LOGI("interrupting the connection process");
- mConnectingRTSPController->disconnect();
}
if (mFlags & PREPARING_CONNECTED) {
@@ -471,11 +463,6 @@ void PreviewPlayerBase::reset_l() {
mVideoRenderer.clear();
- if (mRTSPController != NULL) {
- mRTSPController->disconnect();
- mRTSPController.clear();
- }
-
if (mVideoSource != NULL) {
shutdownVideoDecoder_l();
}
@@ -531,10 +518,7 @@ bool PreviewPlayerBase::getBitrate(int64_t *bitrate) {
bool PreviewPlayerBase::getCachedDuration_l(int64_t *durationUs, bool *eos) {
int64_t bitrate;
- if (mRTSPController != NULL) {
- *durationUs = mRTSPController->getQueueDurationUs(eos);
- return true;
- } else if (mCachedSource != NULL && getBitrate(&bitrate)) {
+ if (mCachedSource != NULL && getBitrate(&bitrate)) {
status_t finalStatus;
size_t cachedDataRemaining = mCachedSource->approxDataRemaining(&finalStatus);
*durationUs = cachedDataRemaining * 8000000ll / bitrate;
@@ -640,9 +624,6 @@ void PreviewPlayerBase::onBufferingUpdate() {
LOGV("cachedDurationUs = %.2f secs, eos=%d",
cachedDurationUs / 1E6, eos);
- int64_t highWaterMarkUs =
- (mRTSPController != NULL) ? kHighWaterMarkRTSPUs : kHighWaterMarkUs;
-
if ((mFlags & PLAYING) && !eos
&& (cachedDurationUs < kLowWaterMarkUs)) {
LOGI("cache is running low (%.2f secs) , pausing.",
@@ -651,7 +632,7 @@ void PreviewPlayerBase::onBufferingUpdate() {
pause_l();
ensureCacheIsFetching_l();
notifyListener_l(MEDIA_INFO, MEDIA_INFO_BUFFERING_START);
- } else if (eos || cachedDurationUs > highWaterMarkUs) {
+ } else if (eos || cachedDurationUs > kHighWaterMarkUs) {
if (mFlags & CACHE_UNDERRUN) {
LOGI("cache has filled up (%.2f secs), resuming.",
cachedDurationUs / 1E6);
@@ -1099,10 +1080,7 @@ status_t PreviewPlayerBase::getDuration(int64_t *durationUs) {
}
status_t PreviewPlayerBase::getPosition(int64_t *positionUs) {
- if (mRTSPController != NULL) {
- *positionUs = mRTSPController->getNormalPlayTimeUs();
- }
- else if (mSeeking != NO_SEEK) {
+ if (mSeeking != NO_SEEK) {
*positionUs = mSeekTimeUs;
} else if (mVideoSource != NULL
&& (mAudioPlayer == NULL || !(mFlags & VIDEO_AT_EOS))) {
@@ -1126,22 +1104,7 @@ status_t PreviewPlayerBase::seekTo(int64_t timeUs) {
return OK;
}
-// static
-void PreviewPlayerBase::OnRTSPSeekDoneWrapper(void *cookie) {
- static_cast<PreviewPlayerBase *>(cookie)->onRTSPSeekDone();
-}
-
-void PreviewPlayerBase::onRTSPSeekDone() {
- notifyListener_l(MEDIA_SEEK_COMPLETE);
- mSeekNotificationSent = true;
-}
-
status_t PreviewPlayerBase::seekTo_l(int64_t timeUs) {
- if (mRTSPController != NULL) {
- mRTSPController->seekAsync(timeUs, OnRTSPSeekDoneWrapper, this);
- return OK;
- }
-
if (mFlags & CACHE_UNDERRUN) {
mFlags &= ~CACHE_UNDERRUN;
play_l();
@@ -1510,7 +1473,6 @@ void PreviewPlayerBase::onVideoEvent() {
int64_t latenessUs = nowUs - timeUs;
if (latenessUs > 500000ll
- && mRTSPController == NULL
&& mAudioPlayer != NULL
&& mAudioPlayer->getMediaTimeMapping(
&realTimeUs, &mediaTimeUs)) {
@@ -1765,30 +1727,6 @@ status_t PreviewPlayerBase::finishSetDataSource_l() {
LOGI("Prepare cancelled while waiting for initial cache fill.");
return UNKNOWN_ERROR;
}
- } else if (!strncasecmp("rtsp://", mUri.string(), 7)) {
- if (mLooper == NULL) {
- mLooper = new ALooper;
- mLooper->setName("rtsp");
- mLooper->start();
- }
- mRTSPController = new ARTSPController(mLooper);
- mConnectingRTSPController = mRTSPController;
-
- mLock.unlock();
- status_t err = mRTSPController->connect(mUri.string());
- mLock.lock();
-
- mConnectingRTSPController.clear();
-
- LOGI("ARTSPController::connect returned %d", err);
-
- if (err != OK) {
- mRTSPController.clear();
- return err;
- }
-
- sp<MediaExtractor> extractor = mRTSPController.get();
- return setDataSource_l(extractor);
} else {
dataSource = DataSource::CreateFromURI(mUri.string(), &mUriHeaders);
}
@@ -1873,7 +1811,7 @@ void PreviewPlayerBase::onPrepareAsyncEvent() {
mFlags |= PREPARING_CONNECTED;
- if (mCachedSource != NULL || mRTSPController != NULL) {
+ if (mCachedSource != NULL) {
postBufferingEvent_l();
} else {
finishAsyncPrepare_l();
diff --git a/lvpp/PreviewPlayerBase.h b/lvpp/PreviewPlayerBase.h
index 954d8fc..bb5c3d3 100644
--- a/lvpp/PreviewPlayerBase.h
+++ b/lvpp/PreviewPlayerBase.h
@@ -39,9 +39,6 @@ struct MediaSource;
struct NuCachedSource2;
struct ISurfaceTexture;
-struct ALooper;
-struct ARTSPController;
-
class DrmManagerClinet;
class DecryptHandle;
@@ -215,10 +212,6 @@ private:
sp<HTTPBase> mConnectingDataSource;
sp<NuCachedSource2> mCachedSource;
- sp<ALooper> mLooper;
- sp<ARTSPController> mRTSPController;
- sp<ARTSPController> mConnectingRTSPController;
-
DrmManagerClient *mDrmManagerClient;
sp<DecryptHandle> mDecryptHandle;
@@ -266,9 +259,6 @@ private:
static bool ContinuePreparation(void *cookie);
- static void OnRTSPSeekDoneWrapper(void *cookie);
- void onRTSPSeekDone();
-
bool getBitrate(int64_t *bitrate);
void finishSeekIfNecessary(int64_t videoTimeUs);