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

Side by Side Diff: media/video/video_decode_accelerator.h

Issue 10749019: VideoDecodeAccelerator now SupportsWeakPtr instead of being RefCountedThreadSafe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 6 #define MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/memory/weak_ptr.h"
11 #include "media/base/bitstream_buffer.h" 12 #include "media/base/bitstream_buffer.h"
12 #include "media/base/video_decoder_config.h" 13 #include "media/base/video_decoder_config.h"
13 #include "media/video/picture.h" 14 #include "media/video/picture.h"
14 #include "ui/gfx/size.h" 15 #include "ui/gfx/size.h"
15 16
16 namespace media { 17 namespace media {
17 18
18 // Video decoder interface. 19 // Video decoder interface.
19 // This interface is extended by the various components that ultimately 20 // This interface is extended by the various components that ultimately
20 // implement the backend of PPB_VideoDecode_Dev. 21 // implement the backend of PPB_VideoDecode_Dev.
21 //
22 // No thread-safety guarantees are implied by the use of RefCountedThreadSafe
23 // below.
24 class MEDIA_EXPORT VideoDecodeAccelerator 22 class MEDIA_EXPORT VideoDecodeAccelerator
25 : public base::RefCountedThreadSafe<VideoDecodeAccelerator> { 23 : public base::SupportsWeakPtr<VideoDecodeAccelerator> {
26 public: 24 public:
25 virtual ~VideoDecodeAccelerator();
26
27 // Enumeration of potential errors generated by the API. 27 // Enumeration of potential errors generated by the API.
28 // Note: Keep these in sync with PP_VideoDecodeError_Dev. 28 // Note: Keep these in sync with PP_VideoDecodeError_Dev.
29 enum Error { 29 enum Error {
30 // An operation was attempted during an incompatible decoder state. 30 // An operation was attempted during an incompatible decoder state.
31 ILLEGAL_STATE = 1, 31 ILLEGAL_STATE = 1,
32 // Invalid argument was passed to an API method. 32 // Invalid argument was passed to an API method.
33 INVALID_ARGUMENT, 33 INVALID_ARGUMENT,
34 // Encoded input is unreadable. 34 // Encoded input is unreadable.
35 UNREADABLE_INPUT, 35 UNREADABLE_INPUT,
36 // A failure occurred at the browser layer or one of its dependencies. 36 // A failure occurred at the browser layer or one of its dependencies.
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // Resets the decoder: all pending inputs are dropped immediately and the 120 // Resets the decoder: all pending inputs are dropped immediately and the
121 // decoder returned to a state ready for further Decode()s, followed by 121 // decoder returned to a state ready for further Decode()s, followed by
122 // NotifyResetDone() being called on the client. Can be used to implement 122 // NotifyResetDone() being called on the client. Can be used to implement
123 // "seek". 123 // "seek".
124 virtual void Reset() = 0; 124 virtual void Reset() = 0;
125 125
126 // Destroys the decoder: all pending inputs are dropped immediately and the 126 // Destroys the decoder: all pending inputs are dropped immediately and the
127 // component is freed. This call may asynchornously free system resources, 127 // component is freed. This call may asynchornously free system resources,
128 // but its client-visible effects are synchronous. After this method returns 128 // but its client-visible effects are synchronous. After this method returns
129 // no more callbacks will be made on the client. 129 // no more callbacks will be made on the client.
130 virtual void Destroy() = 0; 130 // Because the client interface is synchronous but implementations may be
131 131 // asynchronous, the caller (who may own |this|) can pass ownership of the VDA
132 protected: 132 // *to* the VDA for hidden shenaniganary. |self| may be NULL if ownership
133 friend class base::RefCountedThreadSafe<VideoDecodeAccelerator>; 133 // doesn't need to transfer.
134 virtual ~VideoDecodeAccelerator(); 134 virtual void Destroy(scoped_ptr<VideoDecodeAccelerator> self) = 0;
135 }; 135 };
136 136
137 } // namespace media 137 } // namespace media
138 138
139 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_ 139 #endif // MEDIA_VIDEO_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698