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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) final; |
51 | 51 |
52 private: | 52 private: |
53 void OnInitializeDone(bool status); | 53 void OnInitializeDone(bool status); |
54 void OnDecodeDone(mojom::DecodeStatus status); | 54 void OnDecodeDone(DecodeStatus status); |
55 void OnResetDone(); | 55 void OnResetDone(); |
56 | 56 |
57 void BindRemoteDecoder(); | 57 void BindRemoteDecoder(); |
58 void OnConnectionError(); | 58 void OnConnectionError(); |
59 | 59 |
60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 60 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
61 GpuVideoAcceleratorFactories* gpu_factories_; | 61 GpuVideoAcceleratorFactories* gpu_factories_; |
62 | 62 |
63 // Used to pass the remote decoder from the constructor (on the main thread) | 63 // Used to pass the remote decoder from the constructor (on the main thread) |
64 // to Initialize() (on the media thread). | 64 // to Initialize() (on the media thread). |
65 mojom::VideoDecoderPtrInfo remote_decoder_info_; | 65 mojom::VideoDecoderPtrInfo remote_decoder_info_; |
66 | 66 |
67 InitCB init_cb_; | 67 InitCB init_cb_; |
68 OutputCB output_cb_; | 68 OutputCB output_cb_; |
69 DecodeCB decode_cb_; | 69 DecodeCB decode_cb_; |
70 base::Closure reset_cb_; | 70 base::Closure reset_cb_; |
71 | 71 |
72 mojom::VideoDecoderPtr remote_decoder_; | 72 mojom::VideoDecoderPtr remote_decoder_; |
73 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_; | 73 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_; |
74 bool remote_decoder_bound_ = false; | 74 bool remote_decoder_bound_ = false; |
75 bool has_connection_error_ = false; | 75 bool has_connection_error_ = false; |
76 mojo::AssociatedBinding<VideoDecoderClient> client_binding_; | 76 mojo::AssociatedBinding<VideoDecoderClient> client_binding_; |
77 | 77 |
78 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); | 78 DISALLOW_COPY_AND_ASSIGN(MojoVideoDecoder); |
79 }; | 79 }; |
80 | 80 |
81 } // namespace media | 81 } // namespace media |
82 | 82 |
83 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ | 83 #endif // MEDIA_MOJO_CLIENTS_MOJO_VIDEO_DECODER_H_ |
OLD | NEW |