Chromium Code Reviews| 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 CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_PIPELINE_DEVICE_PARAMS_H_ | 5 #ifndef CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_DEVICE_PARAMS_H_ |
| 6 #define CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_PIPELINE_DEVICE_PARAMS_H_ | 6 #define CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_DEVICE_PARAMS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "task_runner.h" |
| 9 | 9 |
| 10 namespace chromecast { | 10 namespace chromecast { |
| 11 namespace media { | 11 namespace media { |
| 12 | 12 |
| 13 class MediaPipelineDeviceParams { | 13 // Supplies creation parameters to platform-specific pipeline backend. |
| 14 public: | 14 struct MediaPipelineDeviceParams { |
| 15 enum MediaSyncType { | 15 enum MediaSyncType { |
| 16 // Default operation, synchronize playback using PTS with higher latency. | 16 // Default operation, synchronize playback using PTS with higher latency. |
| 17 kModeSyncPts = 0, | 17 kModeSyncPts = 0, |
| 18 // With this mode, synchronization is disabled and audio/video frames are | 18 // With this mode, synchronization is disabled and audio/video frames are |
| 19 // rendered "right away": | 19 // rendered "right away": |
| 20 // - for audio, frames are still rendered based on the sampling frequency | 20 // - for audio, frames are still rendered based on the sampling frequency |
| 21 // - for video, frames are rendered as soon as available at the output of | 21 // - for video, frames are rendered as soon as available at the output of |
| 22 // the video decoder. | 22 // the video decoder. |
| 23 // The assumption is that no B frames are used when synchronization is | 23 // The assumption is that no B frames are used when synchronization is |
| 24 // disabled, otherwise B frames would always be skipped. | 24 // disabled, otherwise B frames would always be skipped. |
| 25 kModeIgnorePts = 1, | 25 kModeIgnorePts = 1, |
| 26 // In addition to the constraints above, also do not wait for vsync. | 26 // In addition to the constraints above, also do not wait for vsync. |
| 27 kModeIgnorePtsAndVSync = 2, | 27 kModeIgnorePtsAndVSync = 2, |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 MediaPipelineDeviceParams(); | 30 MediaPipelineDeviceParams(TaskRunner* task_runner_in) |
| 31 ~MediaPipelineDeviceParams(); | 31 : sync_type(kModeSyncPts), task_runner(task_runner_in) {} |
| 32 | 32 |
| 33 MediaSyncType sync_type; | 33 MediaSyncType sync_type; |
|
byungchul
2015/07/29 20:32:23
const?
halliwell
2015/07/29 22:39:27
Done (and added another constructor).
| |
| 34 | |
| 35 // task_runner allows backend implementations to post tasks to the media | |
| 36 // thread. Since all calls from cast_shell into the backend are made on | |
| 37 // the media thread, this may simplify thread management and safety for | |
| 38 // some backends. | |
| 39 TaskRunner* const task_runner; | |
| 34 }; | 40 }; |
| 35 | 41 |
| 36 } // namespace media | 42 } // namespace media |
| 37 } // namespace chromecast | 43 } // namespace chromecast |
| 38 | 44 |
| 39 #endif // CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_PIPELINE_DEVICE_PARAMS_H_ | 45 #endif // CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_PIPELINE_DEVICE_PARAMS_H_ |
| OLD | NEW |