Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: webkit/glue/webmediaplayer_impl.cc

Issue 160076: BufferedDataSource to support server without range request support... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webmediaplayer_impl.cc
===================================================================
--- webkit/glue/webmediaplayer_impl.cc (revision 21893)
+++ webkit/glue/webmediaplayer_impl.cc (working copy)
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "googleurl/src/gurl.h"
+#include "media/base/media_format.h"
#include "media/filters/ffmpeg_audio_decoder.h"
#include "media/filters/ffmpeg_demuxer.h"
#include "media/filters/ffmpeg_video_decoder.h"
@@ -264,9 +265,7 @@
bool WebMediaPlayerImpl::hasVideo() const {
DCHECK(MessageLoop::current() == main_loop_);
- size_t width, height;
- pipeline_->GetVideoSize(&width, &height);
- return width != 0 && height != 0;
+ return pipeline_->IsRendered(media::mime_type::kMajorTypeVideo);
}
WebKit::WebSize WebMediaPlayerImpl::naturalSize() const {
@@ -317,14 +316,13 @@
float WebMediaPlayerImpl::maxTimeSeekable() const {
DCHECK(MessageLoop::current() == main_loop_);
- // TODO(scherkus): move this logic down into the pipeline.
- if (pipeline_->GetTotalBytes() == 0) {
+ // If we are performing streaming, we report that we cannot seek at all.
+ // We are using this flag to indicate if the data source supports seeking
+ // or not. We should be able to seek even if we are performing streaming.
+ // TODO(hclam): We need to update this when we have better caching.
+ if (pipeline_->IsStreaming())
return 0.0f;
- }
- double total_bytes = static_cast<double>(pipeline_->GetTotalBytes());
- double buffered_bytes = static_cast<double>(pipeline_->GetBufferedBytes());
- double duration = static_cast<double>(pipeline_->GetDuration().InSecondsF());
- return static_cast<float>(duration * (buffered_bytes / total_bytes));
+ return static_cast<float>(pipeline_->GetDuration().InSecondsF());
}
unsigned long long WebMediaPlayerImpl::bytesLoaded() const {
@@ -354,6 +352,23 @@
proxy_->Paint(canvas, rect);
}
+bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const {
+ // TODO(hclam): Implement this.
+ return false;
+}
+
+WebKit::WebMediaPlayer::MovieLoadType
+ WebMediaPlayerImpl::movieLoadType() const {
+ DCHECK(MessageLoop::current() == main_loop_);
+
+ // TODO(hclam): If the pipeline is performing streaming, we say that this is
+ // a live stream. But instead it should be a StoredStream if we have proper
+ // caching.
+ if (pipeline_->IsStreaming())
+ return WebKit::WebMediaPlayer::LiveStream;
+ return WebKit::WebMediaPlayer::Unknown;
+}
+
void WebMediaPlayerImpl::WillDestroyCurrentMessageLoop() {
Destroy();
main_loop_ = NULL;
« no previous file with comments | « webkit/glue/webmediaplayer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698