summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-07 09:13:43 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-07 09:13:43 +0000
commitdc3d36bd9b9e3404817f70ccdb40443b9f78a32b (patch)
tree4b53671b146a5403e595981cb933541b134a8956 /media
parent006c702afa7b1525aa548e4f61d44b70bacfaf96 (diff)
downloadchromium_src-dc3d36bd9b9e3404817f70ccdb40443b9f78a32b.zip
chromium_src-dc3d36bd9b9e3404817f70ccdb40443b9f78a32b.tar.gz
chromium_src-dc3d36bd9b9e3404817f70ccdb40443b9f78a32b.tar.bz2
Revert of Revert of Merge VideoDecodeAcceleratorImpl with VideoDecodeAccelerator (https://codereview.chromium.org/319323002/)
Reason for revert: Relanding since the failure appears to be unrelated. Original issue's description: > Revert of Merge VideoDecodeAcceleratorImpl with VideoDecodeAccelerator (https://codereview.chromium.org/317083003/) > > Reason for revert: > Speculative revert to fix content_unittest failures in http://build.chromium.org/p/chromium.linux/builders/Android%20Tests%20%28dbg%29/builds/20807 > > Original issue's description: > > Merge VideoDecodeAcceleratorImpl with VideoDecodeAccelerator > > > > This moves the single method CanDecodeOnIOThread on > > VideoDecodeAcceleratorImpl to VideoDecodeAccelerator. The > > implementations that were subclasses of VideoDecodeAcceleratorImpl now > > get an override for CanDecodeOnIOThread that returns false. > > > > TEST=linux desktop build > > BUG=380884 > > > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275621 > > TBR=scherkus@chromium.org,fischman@chromium.org,spang@chromium.org > NOTREECHECKS=true > NOTRY=true > BUG=380884 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275636 TBR=scherkus@chromium.org,fischman@chromium.org,spang@chromium.org NOTREECHECKS=true NOTRY=true BUG=380884 Review URL: https://codereview.chromium.org/318243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/mock_video_decode_accelerator.h1
-rw-r--r--media/video/video_decode_accelerator.cc8
-rw-r--r--media/video/video_decode_accelerator.h11
3 files changed, 20 insertions, 0 deletions
diff --git a/media/video/mock_video_decode_accelerator.h b/media/video/mock_video_decode_accelerator.h
index 4568ab6..f8bb6da 100644
--- a/media/video/mock_video_decode_accelerator.h
+++ b/media/video/mock_video_decode_accelerator.h
@@ -32,6 +32,7 @@ class MockVideoDecodeAccelerator : public VideoDecodeAccelerator {
MOCK_METHOD0(Flush, void());
MOCK_METHOD0(Reset, void());
MOCK_METHOD0(Destroy, void());
+ MOCK_METHOD0(CanDecodeOnIOThread, bool());
private:
void DeleteThis();
diff --git a/media/video/video_decode_accelerator.cc b/media/video/video_decode_accelerator.cc
index 142dab3..a72912c 100644
--- a/media/video/video_decode_accelerator.cc
+++ b/media/video/video_decode_accelerator.cc
@@ -4,12 +4,20 @@
#include "media/video/video_decode_accelerator.h"
+#include "base/logging.h"
+
namespace media {
VideoDecodeAccelerator::~VideoDecodeAccelerator() {}
+bool VideoDecodeAccelerator::CanDecodeOnIOThread() {
+ // GPU process subclasses must override this.
+ LOG(FATAL) << "This should only get called in the GPU process";
+ return false; // not reached
}
+} // namespace media
+
namespace base {
void DefaultDeleter<media::VideoDecodeAccelerator>::operator()(
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 7025a51..4df3b1c 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -132,6 +132,17 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
// unconditionally, so make sure to drop all pointers to it!
virtual void Destroy() = 0;
+ // GPU PROCESS ONLY. Implementations of this interface in the
+ // content/common/gpu/media should implement this, and implementations in
+ // other processes should not override the default implementation.
+ // Returns true if VDA::Decode and VDA::Client callbacks can run on the IO
+ // thread. Otherwise they will run on the GPU child thread. The purpose of
+ // running Decode on the IO thread is to reduce decode latency. Note Decode
+ // should return as soon as possible and not block on the IO thread. Also,
+ // PictureReady should be run on the child thread if a picture is delivered
+ // the first time so it can be cleared.
+ virtual bool CanDecodeOnIOThread();
+
protected:
// Do not delete directly; use Destroy() or own it with a scoped_ptr, which
// will Destroy() it properly by default.