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_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
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/timer/timer.h" | 15 #include "base/timer/timer.h" |
16 #include "media/base/buffering_state.h" | 16 #include "media/base/buffering_state.h" |
17 #include "media/base/pipeline_status.h" | 17 #include "media/base/pipeline_status.h" |
18 #include "media/mojo/interfaces/renderer.mojom.h" | 18 #include "media/mojo/interfaces/renderer.mojom.h" |
19 #include "mojo/public/cpp/bindings/strong_binding.h" | 19 #include "mojo/public/cpp/bindings/strong_binding.h" |
20 | 20 |
| 21 namespace gfx { |
| 22 class Size; |
| 23 } // namespace gfx |
| 24 |
21 namespace media { | 25 namespace media { |
22 | 26 |
23 class DemuxerStreamProviderShim; | 27 class DemuxerStreamProviderShim; |
24 class MediaKeys; | 28 class MediaKeys; |
25 class MojoCdmServiceContext; | 29 class MojoCdmServiceContext; |
26 class Renderer; | 30 class Renderer; |
27 | 31 |
28 // An interfaces::Renderer implementation that use a media::Renderer to render | 32 // An interfaces::Renderer implementation that use a media::Renderer to render |
29 // media streams. | 33 // media streams. |
30 class MojoRendererService : interfaces::Renderer { | 34 class MojoRendererService : interfaces::Renderer { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // if the media time has changed since the last update. If |force| is true, | 76 // if the media time has changed since the last update. If |force| is true, |
73 // the client is notified even if the time is unchanged. | 77 // the client is notified even if the time is unchanged. |
74 void UpdateMediaTime(bool force); | 78 void UpdateMediaTime(bool force); |
75 void CancelPeriodicMediaTimeUpdates(); | 79 void CancelPeriodicMediaTimeUpdates(); |
76 void SchedulePeriodicMediaTimeUpdates(); | 80 void SchedulePeriodicMediaTimeUpdates(); |
77 | 81 |
78 // Callback executed by audio renderer when buffering state changes. | 82 // Callback executed by audio renderer when buffering state changes. |
79 // TODO(tim): Need old and new. | 83 // TODO(tim): Need old and new. |
80 void OnBufferingStateChanged(BufferingState new_buffering_state); | 84 void OnBufferingStateChanged(BufferingState new_buffering_state); |
81 | 85 |
| 86 // Callback executed by video renderer when video natural size changes. |
| 87 void OnNaturalSizeChanged(const gfx::Size& size); |
| 88 |
82 // Callback executed when a renderer has ended. | 89 // Callback executed when a renderer has ended. |
83 void OnRendererEnded(); | 90 void OnRendererEnded(); |
84 | 91 |
85 // Callback executed when a runtime error happens. | 92 // Callback executed when a runtime error happens. |
86 void OnError(PipelineStatus error); | 93 void OnError(PipelineStatus error); |
87 | 94 |
88 // Callback executed once Flush() completes. | 95 // Callback executed once Flush() completes. |
89 void OnFlushCompleted(const mojo::Closure& callback); | 96 void OnFlushCompleted(const mojo::Closure& callback); |
90 | 97 |
91 // Callback executed once SetCdm() completes. | 98 // Callback executed once SetCdm() completes. |
(...skipping 25 matching lines...) Expand all Loading... |
117 | 124 |
118 base::WeakPtr<MojoRendererService> weak_this_; | 125 base::WeakPtr<MojoRendererService> weak_this_; |
119 base::WeakPtrFactory<MojoRendererService> weak_factory_; | 126 base::WeakPtrFactory<MojoRendererService> weak_factory_; |
120 | 127 |
121 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); | 128 DISALLOW_COPY_AND_ASSIGN(MojoRendererService); |
122 }; | 129 }; |
123 | 130 |
124 } // namespace media | 131 } // namespace media |
125 | 132 |
126 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ | 133 #endif // MEDIA_MOJO_SERVICES_MOJO_RENDERER_SERVICE_H_ |
OLD | NEW |