OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ | 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ |
6 #define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ | 6 #define MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 43 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
44 const DecodeCB& decode_cb) final; | 44 const DecodeCB& decode_cb) final; |
45 void Reset(const base::Closure& closure) final; | 45 void Reset(const base::Closure& closure) final; |
46 bool NeedsBitstreamConversion() const final; | 46 bool NeedsBitstreamConversion() const final; |
47 bool CanReadWithoutStalling() const final; | 47 bool CanReadWithoutStalling() const final; |
48 int GetMaxDecodeRequests() const final; | 48 int GetMaxDecodeRequests() const final; |
49 | 49 |
50 // mojom::VideoDecoderClient implementation. | 50 // mojom::VideoDecoderClient implementation. |
51 void OnVideoFrameDecoded( | 51 void OnVideoFrameDecoded( |
52 const scoped_refptr<VideoFrame>& frame, | 52 const scoped_refptr<VideoFrame>& frame, |
| 53 bool can_read_without_stalling, |
53 const base::Optional<base::UnguessableToken>& release_token) final; | 54 const base::Optional<base::UnguessableToken>& release_token) final; |
54 | 55 |
55 private: | 56 private: |
56 void OnInitializeDone(bool status, | 57 void OnInitializeDone(bool status, |
57 bool needs_bitstream_conversion, | 58 bool needs_bitstream_conversion, |
58 int32_t max_decode_requests); | 59 int32_t max_decode_requests); |
59 void OnDecodeDone(uint64_t decode_id, DecodeStatus status); | 60 void OnDecodeDone(uint64_t decode_id, DecodeStatus status); |
60 void OnResetDone(); | 61 void OnResetDone(); |
61 | 62 |
62 void BindRemoteDecoder(); | 63 void BindRemoteDecoder(); |
(...skipping 20 matching lines...) Expand all Loading... |
83 base::Closure reset_cb_; | 84 base::Closure reset_cb_; |
84 | 85 |
85 mojom::VideoDecoderPtr remote_decoder_; | 86 mojom::VideoDecoderPtr remote_decoder_; |
86 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_; | 87 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_; |
87 bool remote_decoder_bound_ = false; | 88 bool remote_decoder_bound_ = false; |
88 bool has_connection_error_ = false; | 89 bool has_connection_error_ = false; |
89 mojo::AssociatedBinding<VideoDecoderClient> client_binding_; | 90 mojo::AssociatedBinding<VideoDecoderClient> client_binding_; |
90 | 91 |
91 bool initialized_ = false; | 92 bool initialized_ = false; |
92 bool needs_bitstream_conversion_ = false; | 93 bool needs_bitstream_conversion_ = false; |
| 94 bool can_read_without_stalling_ = true; |
93 int32_t max_decode_requests_ = 1; | 95 int32_t max_decode_requests_ = 1; |
94 | 96 |
95 base::WeakPtr<MojoVideoDecoder> weak_this_; | 97 base::WeakPtr<MojoVideoDecoder> weak_this_; |
96 base::WeakPtrFactory<MojoVideoDecoder> weak_factory_; | 98 base::WeakPtrFactory<MojoVideoDecoder> weak_factory_; |
97 | 99 |
98 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); | 100 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); |
99 }; | 101 }; |
100 | 102 |
101 } // namespace media | 103 } // namespace media |
102 | 104 |
103 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ | 105 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ |
OLD | NEW |