| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_RENDERERS_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_RENDERER_IMPL_H_ |
| 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_RENDERER_IMPL_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/cancelable_callback.h" | 11 #include "base/cancelable_callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
| 16 #include "base/time/clock.h" | 16 #include "base/time/clock.h" |
| 17 #include "base/time/default_tick_clock.h" | 17 #include "base/time/default_tick_clock.h" |
| 18 #include "base/time/time.h" | 18 #include "base/time/time.h" |
| 19 #include "media/base/buffering_state.h" | 19 #include "media/base/buffering_state.h" |
| 20 #include "media/base/decryptor.h" | 20 #include "media/base/decryptor.h" |
| 21 #include "media/base/demuxer_stream.h" | 21 #include "media/base/demuxer_stream.h" |
| 22 #include "media/base/media_export.h" | 22 #include "media/base/media_export.h" |
| 23 #include "media/base/pipeline_status.h" | 23 #include "media/base/pipeline_status.h" |
| 24 #include "media/base/renderer.h" | 24 #include "media/base/renderer.h" |
| 25 #include "ui/gfx/geometry/size.h" |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| 27 class SingleThreadTaskRunner; | 28 class SingleThreadTaskRunner; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace media { | 31 namespace media { |
| 31 | 32 |
| 32 class AudioRenderer; | 33 class AudioRenderer; |
| 33 class DemuxerStreamProvider; | 34 class DemuxerStreamProvider; |
| 34 class TimeSource; | 35 class TimeSource; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 void StartPlayback(); | 122 void StartPlayback(); |
| 122 | 123 |
| 123 // Callbacks executed when a renderer has ended. | 124 // Callbacks executed when a renderer has ended. |
| 124 void OnRendererEnded(DemuxerStream::Type type); | 125 void OnRendererEnded(DemuxerStream::Type type); |
| 125 bool PlaybackHasEnded() const; | 126 bool PlaybackHasEnded() const; |
| 126 void RunEndedCallbackIfNeeded(); | 127 void RunEndedCallbackIfNeeded(); |
| 127 | 128 |
| 128 // Callback executed when a runtime error happens. | 129 // Callback executed when a runtime error happens. |
| 129 void OnError(PipelineStatus error); | 130 void OnError(PipelineStatus error); |
| 130 void OnWaitingForDecryptionKey(); | 131 void OnWaitingForDecryptionKey(); |
| 132 void OnVideoNaturalSizeChange(const gfx::Size& size); |
| 133 void OnVideoOpacityChange(bool opaque); |
| 131 | 134 |
| 132 State state_; | 135 State state_; |
| 133 | 136 |
| 134 // Task runner used to execute pipeline tasks. | 137 // Task runner used to execute pipeline tasks. |
| 135 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 138 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 136 | 139 |
| 137 DemuxerStreamProvider* demuxer_stream_provider_; | 140 DemuxerStreamProvider* demuxer_stream_provider_; |
| 138 RendererClient* client_; | 141 RendererClient* client_; |
| 139 | 142 |
| 140 // Temporary callback used for Initialize() and Flush(). | 143 // Temporary callback used for Initialize() and Flush(). |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 180 |
| 178 base::WeakPtr<RendererImpl> weak_this_; | 181 base::WeakPtr<RendererImpl> weak_this_; |
| 179 base::WeakPtrFactory<RendererImpl> weak_factory_; | 182 base::WeakPtrFactory<RendererImpl> weak_factory_; |
| 180 | 183 |
| 181 DISALLOW_COPY_AND_ASSIGN(RendererImpl); | 184 DISALLOW_COPY_AND_ASSIGN(RendererImpl); |
| 182 }; | 185 }; |
| 183 | 186 |
| 184 } // namespace media | 187 } // namespace media |
| 185 | 188 |
| 186 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ | 189 #endif // MEDIA_RENDERERS_RENDERER_IMPL_H_ |
| OLD | NEW |