summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 17:09:18 +0000
committerfischman@chromium.org <fischman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-07-15 17:09:18 +0000
commitce2d72c6918e9707ef3dc9987369241108ed239f (patch)
treee6cd9b58cebe325676fae66b65921282c652b2ab /media
parente849792e6b65f2d495934633cc918dccfacdda5a (diff)
downloadchromium_src-ce2d72c6918e9707ef3dc9987369241108ed239f.zip
chromium_src-ce2d72c6918e9707ef3dc9987369241108ed239f.tar.gz
chromium_src-ce2d72c6918e9707ef3dc9987369241108ed239f.tar.bz2
Enable fire-and-forget Destroy of HW video decoder, and misc other improvements.
- Instead of requiring the client to wait for NotifyDestroyDone we do the asynchronous OMX teardown dance on the client's behalf. - Prettify/simplify error handling in OVDA for easier matching of errors to OMX_Core.h and to remove redundant information. - Enable previously-DISABLED_ early-teardown unittests! - Remove passing VideoDecoder_Dev object in PPP_VideoDecoder_Dev calls, because it was unnecssary, and because the ~VideoDecoder_Dev dtor is now not a no-op so we don't want to call it spuriously. - Remove accidentally re-added gpu_video_service_host.cc (originally removed in 92251, accidentally reintroduced by a bad rebase in 92383). BUG=none TEST=ovdatest passes (incl. early-teardown tests) and gles2 works (including reload and EOS handling, no crashes) Review URL: http://codereview.chromium.org/7361010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r--media/video/video_decode_accelerator.h22
1 files changed, 12 insertions, 10 deletions
diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h
index 85eef24..55d1ad1 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -161,10 +161,12 @@ enum VideoColorFormat {
// Video decoder interface.
// This interface is extended by the various components that ultimately
// implement the backend of PPB_VideoDecode_Dev.
-class VideoDecodeAccelerator {
+//
+// No thread-safety guarantees are implied by the use of RefCountedThreadSafe
+// below.
+class VideoDecodeAccelerator
+ : public base::RefCountedThreadSafe<VideoDecodeAccelerator> {
public:
- virtual ~VideoDecodeAccelerator();
-
// Enumeration of potential errors generated by the API.
// TODO(fischman): these errors are a bad match for both what OMX generates
// and for what the plugin wants. Overhaul this list with a more useful set.
@@ -226,9 +228,6 @@ class VideoDecodeAccelerator {
// Reset completion callback.
virtual void NotifyResetDone() = 0;
- // Destroy completion callback.
- virtual void NotifyDestroyDone() = 0;
-
// Callback to notify about decoding errors.
virtual void NotifyError(Error error) = 0;
};
@@ -279,11 +278,14 @@ class VideoDecodeAccelerator {
virtual void Reset() = 0;
// Destroys the decoder: all pending inputs are dropped immediately and the
- // component is freed, followed by NotifyDestroyDone being called on the
- // client. After this is called no other calls may be made on the decoder,
- // and after NotifyDestroyDone is called no callbacks will be made by the
- // decoder on the client.
+ // component is freed. This call may asynchornously free system resources,
+ // but its client-visible effects are synchronous. After this method returns
+ // no more callbacks will be made on the client.
virtual void Destroy() = 0;
+
+ protected:
+ friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>;
+ virtual ~VideoDecodeAccelerator();
};
} // namespace media