Index: media/gpu/vp9_decoder.h |
diff --git a/media/gpu/vp9_decoder.h b/media/gpu/vp9_decoder.h |
index b262f14af95a7565113d3c47fcac7bb39625b147..d2264b595f42b6544bc85377cdc2d1b777e8ba75 100644 |
--- a/media/gpu/vp9_decoder.h |
+++ b/media/gpu/vp9_decoder.h |
@@ -11,6 +11,7 @@ |
#include <memory> |
#include <vector> |
+#include "base/callback_forward.h" |
#include "base/macros.h" |
#include "base/memory/ref_counted.h" |
#include "media/filters/vp9_parser.h" |
@@ -48,20 +49,22 @@ class MEDIA_GPU_EXPORT VP9Decoder : public AcceleratedVideoDecoder { |
// Submit decode for |pic| to be run in accelerator, taking as arguments |
// information contained in it, as well as current segmentation and loop |
- // filter state in |seg| and |lf|, respectively, and using pictures in |
- // |ref_pictures| for reference. |
+ // filter state in |segm_params| and |lf_params|, respectively, and using |
+ // pictures in |ref_pictures| for reference. |
+ // If done_cb_ is not null, it will be run once decode is done in hardware. |
// |
// Note that returning from this method does not mean that the decode |
// process is finished, but the caller may drop its references to |pic| |
- // and |ref_pictures| immediately, and the data in |seg| and |lf| does not |
- // need to remain valid after this method returns. |
+ // and |ref_pictures| immediately, and the data in |segm_params| and |
+ // |lf_params| does not need to remain valid after this method returns. |
// |
// Return true when successful, false otherwise. |
virtual bool SubmitDecode( |
const scoped_refptr<VP9Picture>& pic, |
- const Vp9SegmentationParams& seg, |
- const Vp9LoopFilterParams& lf, |
- const std::vector<scoped_refptr<VP9Picture>>& ref_pictures) = 0; |
+ const Vp9SegmentationParams& segm_params, |
+ const Vp9LoopFilterParams& lf_params, |
+ const std::vector<scoped_refptr<VP9Picture>>& ref_pictures, |
+ const base::Closure& done_cb) = 0; |
// Schedule output (display) of |pic|. |
// |
@@ -75,11 +78,21 @@ class MEDIA_GPU_EXPORT VP9Decoder : public AcceleratedVideoDecoder { |
// Return true when successful, false otherwise. |
virtual bool OutputPicture(const scoped_refptr<VP9Picture>& pic) = 0; |
+ // Return true if the accelerator requires the client to provide frame |
+ // context in order to decode. If so, the Vp9FrameHeader provided by the |
+ // client must contain a valid compressed header and frame context data. |
+ virtual bool IsFrameContextRequired() const = 0; |
+ |
+ // Set |frame_ctx| to the state after decoding |pic|, returning true on |
+ // success, false otherwise. |
+ virtual bool GetFrameContext(const scoped_refptr<VP9Picture>& pic, |
+ Vp9FrameContext* frame_ctx) = 0; |
+ |
private: |
DISALLOW_COPY_AND_ASSIGN(VP9Accelerator); |
}; |
- VP9Decoder(VP9Accelerator* accelerator); |
+ explicit VP9Decoder(VP9Accelerator* accelerator); |
~VP9Decoder() override; |
// AcceleratedVideoDecoder implementation. |
@@ -98,6 +111,12 @@ class MEDIA_GPU_EXPORT VP9Decoder : public AcceleratedVideoDecoder { |
// Return true on success, false otherwise. |
bool DecodeAndOutputPicture(scoped_refptr<VP9Picture> pic); |
+ // Get frame context state after decoding |pic| from the accelerator, and call |
+ // |context_refresh_cb| with the acquired state. |
+ void UpdateFrameContext( |
+ const scoped_refptr<VP9Picture>& pic, |
+ const base::Callback<void(const Vp9FrameContext&)>& context_refresh_cb); |
+ |
// Called on error, when decoding cannot continue. Sets state_ to kError and |
// releases current state. |
void SetError(); |
@@ -121,11 +140,11 @@ class MEDIA_GPU_EXPORT VP9Decoder : public AcceleratedVideoDecoder { |
// Current coded resolution. |
gfx::Size pic_size_; |
- Vp9Parser parser_; |
- |
// VP9Accelerator instance owned by the client. |
VP9Accelerator* accelerator_; |
+ Vp9Parser parser_; |
+ |
DISALLOW_COPY_AND_ASSIGN(VP9Decoder); |
}; |