| 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 "media/base/video_decoder.h" | 10 #include "media/base/video_decoder.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 const InitCB& init_cb, | 40 const InitCB& init_cb, |
| 41 const OutputCB& output_cb) final; | 41 const OutputCB& output_cb) final; |
| 42 void Decode(const scoped_refptr<DecoderBuffer>& buffer, | 42 void Decode(const scoped_refptr<DecoderBuffer>& buffer, |
| 43 const DecodeCB& decode_cb) final; | 43 const DecodeCB& decode_cb) final; |
| 44 void Reset(const base::Closure& closure) final; | 44 void Reset(const base::Closure& closure) final; |
| 45 bool NeedsBitstreamConversion() const final; | 45 bool NeedsBitstreamConversion() const final; |
| 46 bool CanReadWithoutStalling() const final; | 46 bool CanReadWithoutStalling() const final; |
| 47 int GetMaxDecodeRequests() const final; | 47 int GetMaxDecodeRequests() const final; |
| 48 | 48 |
| 49 // mojom::VideoDecoderClient implementation. | 49 // mojom::VideoDecoderClient implementation. |
| 50 void OnVideoFrameDecoded(mojom::VideoFramePtr frame) final; | 50 void OnVideoFrameDecoded(mojom::VideoFramePtr frame, |
| 51 const OnVideoFrameDecodedCallback& callback) final; |
| 51 | 52 |
| 52 private: | 53 private: |
| 53 void OnInitializeDone(bool status, | 54 void OnInitializeDone(bool status, |
| 54 bool needs_bitstream_conversion, | 55 bool needs_bitstream_conversion, |
| 55 int32_t max_decode_requests); | 56 int32_t max_decode_requests); |
| 56 void OnDecodeDone(uint64_t decode_id, DecodeStatus status); | 57 void OnDecodeDone(uint64_t decode_id, DecodeStatus status); |
| 57 void OnResetDone(); | 58 void OnResetDone(); |
| 58 | 59 |
| 59 void BindRemoteDecoder(); | 60 void BindRemoteDecoder(); |
| 61 void OnReleaseMailbox(const OnVideoFrameDecodedCallback& callback, |
| 62 const gpu::SyncToken& release_sync_token); |
| 60 | 63 |
| 61 // Cleans up callbacks and blocks future calls. | 64 // Cleans up callbacks and blocks future calls. |
| 62 void Stop(); | 65 void Stop(); |
| 63 | 66 |
| 64 // Task runner that the decoder runs on (media thread). | 67 // Task runner that the decoder runs on (media thread). |
| 65 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 68 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 66 | 69 |
| 67 // Used to pass the remote decoder from the constructor (on the main thread) | 70 // Used to pass the remote decoder from the constructor (on the main thread) |
| 68 // to Initialize() (on the media thread). | 71 // to Initialize() (on the media thread). |
| 69 mojom::VideoDecoderPtrInfo remote_decoder_info_; | 72 mojom::VideoDecoderPtrInfo remote_decoder_info_; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 85 bool initialized_ = false; | 88 bool initialized_ = false; |
| 86 bool needs_bitstream_conversion_ = false; | 89 bool needs_bitstream_conversion_ = false; |
| 87 int32_t max_decode_requests_ = 1; | 90 int32_t max_decode_requests_ = 1; |
| 88 | 91 |
| 89 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); | 92 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); |
| 90 }; | 93 }; |
| 91 | 94 |
| 92 } // namespace media | 95 } // namespace media |
| 93 | 96 |
| 94 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ | 97 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ |
| OLD | NEW |