| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_VIDEO_RENDERER_IMPL_H_ | 5 #ifndef MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
| 6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 6 #define MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Callback for |video_frame_stream_| initialization. | 89 // Callback for |video_frame_stream_| initialization. |
| 90 void OnVideoFrameStreamInitialized(bool success); | 90 void OnVideoFrameStreamInitialized(bool success); |
| 91 | 91 |
| 92 // Functions to notify certain events to the RendererClient. | 92 // Functions to notify certain events to the RendererClient. |
| 93 void OnPlaybackError(PipelineStatus error); | 93 void OnPlaybackError(PipelineStatus error); |
| 94 void OnPlaybackEnded(); | 94 void OnPlaybackEnded(); |
| 95 void OnStatisticsUpdate(const PipelineStatistics& stats); | 95 void OnStatisticsUpdate(const PipelineStatistics& stats); |
| 96 void OnBufferingStateChange(BufferingState state); | 96 void OnBufferingStateChange(BufferingState state); |
| 97 void OnWaitingForDecryptionKey(); | 97 void OnWaitingForDecryptionKey(); |
| 98 | 98 |
| 99 // Callback for |video_frame_stream_| to report statistics. |
| 100 void BytesDecoded(uint64_t bytes); |
| 101 |
| 99 // Callback for |video_frame_stream_| to deliver decoded video frames and | 102 // Callback for |video_frame_stream_| to deliver decoded video frames and |
| 100 // report video decoding status. If a frame is available the planes will be | 103 // report video decoding status. If a frame is available the planes will be |
| 101 // copied asynchronously and FrameReady will be called once finished copying. | 104 // copied asynchronously and FrameReady will be called once finished copying. |
| 102 void FrameReadyForCopyingToGpuMemoryBuffers( | 105 void FrameReadyForCopyingToGpuMemoryBuffers( |
| 103 VideoFrameStream::Status status, | 106 VideoFrameStream::Status status, |
| 104 const scoped_refptr<VideoFrame>& frame); | 107 const scoped_refptr<VideoFrame>& frame); |
| 105 | 108 |
| 106 // Callback for |video_frame_stream_| to deliver decoded video frames and | 109 // Callback for |video_frame_stream_| to deliver decoded video frames and |
| 107 // report video decoding status. | 110 // report video decoding status. |
| 108 void FrameReady(VideoFrameStream::Status status, | 111 void FrameReady(VideoFrameStream::Status status, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 249 |
| 247 BufferingState buffering_state_; | 250 BufferingState buffering_state_; |
| 248 | 251 |
| 249 // Playback operation callbacks. | 252 // Playback operation callbacks. |
| 250 PipelineStatusCB init_cb_; | 253 PipelineStatusCB init_cb_; |
| 251 base::Closure flush_cb_; | 254 base::Closure flush_cb_; |
| 252 TimeSource::WallClockTimeCB wall_clock_time_cb_; | 255 TimeSource::WallClockTimeCB wall_clock_time_cb_; |
| 253 | 256 |
| 254 base::TimeDelta start_timestamp_; | 257 base::TimeDelta start_timestamp_; |
| 255 | 258 |
| 256 // Keeps track of the number of frames decoded and dropped since the | 259 // Keeps track of the number of bytes/frames decoded and dropped since the |
| 257 // last call to |statistics_cb_|. These must be accessed under lock. | 260 // last call to |statistics_cb_|. These must be accessed under lock. |
| 261 uint64_t bytes_decoded_; |
| 258 int frames_decoded_; | 262 int frames_decoded_; |
| 259 int frames_dropped_; | 263 int frames_dropped_; |
| 260 | 264 |
| 261 std::unique_ptr<base::TickClock> tick_clock_; | 265 std::unique_ptr<base::TickClock> tick_clock_; |
| 262 | 266 |
| 263 // Algorithm for selecting which frame to render; manages frames and all | 267 // Algorithm for selecting which frame to render; manages frames and all |
| 264 // timing related information. | 268 // timing related information. |
| 265 std::unique_ptr<VideoRendererAlgorithm> algorithm_; | 269 std::unique_ptr<VideoRendererAlgorithm> algorithm_; |
| 266 | 270 |
| 267 // Indicates that Render() was called with |background_rendering| set to true, | 271 // Indicates that Render() was called with |background_rendering| set to true, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 292 // want to discard video frames that might be received after the stream has | 296 // want to discard video frames that might be received after the stream has |
| 293 // been reset. | 297 // been reset. |
| 294 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_; | 298 base::WeakPtrFactory<VideoRendererImpl> frame_callback_weak_factory_; |
| 295 | 299 |
| 296 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 300 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
| 297 }; | 301 }; |
| 298 | 302 |
| 299 } // namespace media | 303 } // namespace media |
| 300 | 304 |
| 301 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ | 305 #endif // MEDIA_RENDERERS_VIDEO_RENDERER_IMPL_H_ |
| OLD | NEW |