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
3 // found in the LICENSE file.
5 #ifndef CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_DEVICE_PARAMS_H_
6 #define CHROMECAST_PUBLIC_MEDIA_MEDIA_PIPELINE_DEVICE_PARAMS_H_
8 #include "task_runner.h"
10 namespace chromecast
{
13 // Supplies creation parameters to platform-specific pipeline backend.
14 struct MediaPipelineDeviceParams
{
16 // Default operation, synchronize playback using PTS with higher latency.
18 // With this mode, synchronization is disabled and audio/video frames are
19 // rendered "right away":
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
23 // The assumption is that no B frames are used when synchronization is
24 // disabled, otherwise B frames would always be skipped.
26 // In addition to the constraints above, also do not wait for vsync.
27 kModeIgnorePtsAndVSync
= 2,
30 MediaPipelineDeviceParams(TaskRunner
* task_runner_in
)
31 : sync_type(kModeSyncPts
), task_runner(task_runner_in
) {}
33 MediaPipelineDeviceParams(MediaSyncType sync_type_in
,
34 TaskRunner
* task_runner_in
)
35 : sync_type(sync_type_in
), task_runner(task_runner_in
) {}
37 const MediaSyncType sync_type
;
39 // task_runner allows backend implementations to post tasks to the media
40 // thread. Since all calls from cast_shell into the backend are made on
41 // the media thread, this may simplify thread management and safety for
43 TaskRunner
* const task_runner
;
47 } // namespace chromecast
49 #endif // CHROMECAST_MEDIA_CMA_BACKEND_MEDIA_PIPELINE_DEVICE_PARAMS_H_