Commit a5c91f7a authored by Nathaniel Steinbock's avatar Nathaniel Steinbock Committed by Commit Bot

[Chromecast] Move CmaBackend and MonotonicClock to media/api.

Merge-With: eureka-internal/372572
Bug: internal 150884605
Change-Id: I3ebfba162fda3a8e36c431420afb1d2054162672
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2096895Reviewed-by: default avatarYuchen Liu <yucliu@chromium.org>
Commit-Queue: Nate Steinbock <steinbock@google.com>
Cr-Commit-Position: refs/heads/master@{#750310}
parent d3ce83ab
......@@ -7,7 +7,9 @@ import("//chromecast/chromecast.gni")
cast_source_set("api") {
sources = [
"cast_audio_decoder.h",
"cma_backend.h",
"decoder_buffer_base.h",
"monotonic_clock.h",
]
public_deps = [
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_CMA_BACKEND_CMA_BACKEND_H_
#define CHROMECAST_MEDIA_CMA_BACKEND_CMA_BACKEND_H_
#ifndef CHROMECAST_MEDIA_API_CMA_BACKEND_H_
#define CHROMECAST_MEDIA_API_CMA_BACKEND_H_
#include <stdint.h>
......@@ -104,4 +104,4 @@ class CmaBackend {
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_CMA_BACKEND_CMA_BACKEND_H_
#endif // CHROMECAST_MEDIA_API_CMA_BACKEND_H_
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_API_MEDIA_PIPELINE_BACKEND_FACTORY_H_
#define CHROMECAST_MEDIA_API_MEDIA_PIPELINE_BACKEND_FACTORY_H_
#include <memory>
#include "chromecast/public/media/media_pipeline_device_params.h"
namespace chromecast {
namespace media {
class CmaBackend;
// This class creates media backends.
class MediaPipelineBackendFactory {
public:
virtual ~MediaPipelineBackendFactory();
// Creates a CMA backend. Must be called on the same thread as
// |media_task_runner_|.
virtual std::unique_ptr<CmaBackend> CreateCmaBackend(
const MediaPipelineDeviceParams& params) = 0;
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_API_MEDIA_PIPELINE_BACKEND_FACTORY_H_
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_API_MONOTONIC_CLOCK_H_
#define CHROMECAST_MEDIA_API_MONOTONIC_CLOCK_H_
#include <stdint.h>
namespace chromecast {
namespace media {
// Interface that provides the monotonic time.
class MonotonicClock {
public:
virtual ~MonotonicClock() = default;
// Returns the monotonic time in microseconds.
virtual int64_t Now() const = 0;
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_API_MONOTONIC_CLOCK_H_
......@@ -16,7 +16,7 @@
#include "chromecast/common/mojom/constants.mojom.h"
#include "chromecast/common/mojom/multiroom.mojom.h"
#include "chromecast/common/mojom/service_connector.mojom.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/test/mock_cma_backend.h"
#include "chromecast/media/cma/test/mock_cma_backend_factory.h"
#include "chromecast/media/cma/test/mock_multiroom_manager.h"
......
......@@ -19,11 +19,11 @@
#include "chromecast/common/mojom/constants.mojom.h"
#include "chromecast/common/mojom/multiroom.mojom.h"
#include "chromecast/common/mojom/service_connector.mojom.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/api/decoder_buffer_base.h"
#include "chromecast/media/audio/cast_audio_manager.h"
#include "chromecast/media/audio/cast_audio_mixer.h"
#include "chromecast/media/base/monotonic_clock.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/base/default_monotonic_clock.h"
#include "chromecast/media/cma/test/mock_cma_backend_factory.h"
#include "chromecast/media/cma/test/mock_multiroom_manager.h"
#include "chromecast/public/task_runner.h"
......
......@@ -13,7 +13,7 @@
#include "base/logging.h"
#include "base/synchronization/waitable_event.h"
#include "chromecast/base/task_runner_impl.h"
#include "chromecast/media/base/monotonic_clock.h"
#include "chromecast/media/base/default_monotonic_clock.h"
#include "chromecast/media/cma/backend/cma_backend_factory.h"
#include "chromecast/media/cma/base/decoder_buffer_adapter.h"
#include "chromecast/media/cma/base/decoder_config_adapter.h"
......
......@@ -17,7 +17,7 @@
#include "base/time/time.h"
#include "base/timer/timer.h"
#include "chromecast/common/mojom/multiroom.mojom.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "media/audio/audio_io.h"
#include "media/base/audio_parameters.h"
#include "media/base/audio_timestamp_helper.h"
......
......@@ -14,8 +14,8 @@
#include "base/memory/weak_ptr.h"
#include "base/sequence_checker.h"
#include "chromecast/base/task_runner_impl.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/audio/mixer_service/mixer_service.pb.h"
#include "chromecast/media/cma/backend/cma_backend.h"
namespace base {
class SequencedTaskRunner;
......
......@@ -125,12 +125,13 @@ cast_source_set("video_plane_controller") {
cast_source_set("monotonic_clock") {
sources = [
"monotonic_clock.cc",
"monotonic_clock.h",
"default_monotonic_clock.cc",
"default_monotonic_clock.h",
]
deps = [
":buildflags",
"//base",
"//chromecast/media/api:api",
]
}
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chromecast/media/base/monotonic_clock.h"
#include "chromecast/media/base/default_monotonic_clock.h"
#include <time.h>
......@@ -42,7 +42,7 @@ DefaultMonotonicClock::DefaultMonotonicClock() = default;
DefaultMonotonicClock::~DefaultMonotonicClock() = default;
int64_t DefaultMonotonicClock::Now() {
int64_t DefaultMonotonicClock::Now() const {
return MonotonicClockNow();
}
......
......@@ -2,11 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMECAST_MEDIA_BASE_MONOTONIC_CLOCK_H_
#define CHROMECAST_MEDIA_BASE_MONOTONIC_CLOCK_H_
#ifndef CHROMECAST_MEDIA_BASE_DEFAULT_MONOTONIC_CLOCK_H_
#define CHROMECAST_MEDIA_BASE_DEFAULT_MONOTONIC_CLOCK_H_
#include <stdint.h>
#include "chromecast/media/api/monotonic_clock.h"
namespace chromecast {
namespace media {
......@@ -17,14 +19,6 @@ namespace media {
// change whenever they feel like it upstream).
int64_t MonotonicClockNow();
// Interface that provides the monotonic time.
class MonotonicClock {
public:
virtual ~MonotonicClock() = default;
// Returns the monotonic time in microseconds.
virtual int64_t Now() = 0;
};
// Default implementation of MonotonicClock that uses MonotonicClockNow().
class DefaultMonotonicClock : public MonotonicClock {
public:
......@@ -32,10 +26,10 @@ class DefaultMonotonicClock : public MonotonicClock {
~DefaultMonotonicClock() override;
// MonotonicClock implementation:
int64_t Now() override;
int64_t Now() const override;
};
} // namespace media
} // namespace chromecast
#endif // CHROMECAST_MEDIA_BASE_MONOTONIC_CLOCK_H_
#endif // CHROMECAST_MEDIA_BASE_DEFAULT_MONOTONIC_CLOCK_H_
......@@ -18,7 +18,6 @@ cast_source_set("backend") {
"audio_decoder_software_wrapper.h",
"audio_decoder_wrapper.cc",
"audio_decoder_wrapper.h",
"cma_backend.h",
"cma_backend_factory.h",
"cma_backend_factory_impl.cc",
"cma_backend_factory_impl.h",
......
......@@ -20,7 +20,7 @@
#include "chromecast/media/audio/mixer_service/conversions.h"
#include "chromecast/media/audio/mixer_service/mixer_service.pb.h"
#include "chromecast/media/audio/mixer_service/mixer_socket.h"
#include "chromecast/media/base/monotonic_clock.h"
#include "chromecast/media/base/default_monotonic_clock.h"
#include "chromecast/media/cma/backend/media_pipeline_backend_for_mixer.h"
#include "chromecast/media/cma/base/decoder_buffer_adapter.h"
#include "chromecast/media/cma/base/decoder_config_adapter.h"
......
......@@ -9,8 +9,8 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/backend/audio_decoder_software_wrapper.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/cma/backend/media_pipeline_backend_manager.h"
#include "chromecast/public/media/media_pipeline_backend.h"
......
......@@ -4,7 +4,7 @@
#include "chromecast/media/cma/backend/cma_backend_factory_impl.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/backend/media_pipeline_backend_manager.h"
#include "chromecast/public/media/media_pipeline_device_params.h"
......
......@@ -12,7 +12,7 @@
#include "base/single_thread_task_runner.h"
#include "base/time/time.h"
#include "chromecast/base/task_runner_impl.h"
#include "chromecast/media/base/monotonic_clock.h"
#include "chromecast/media/base/default_monotonic_clock.h"
#include "chromecast/media/cma/backend/audio_decoder_for_mixer.h"
#include "chromecast/media/cma/backend/av_sync.h"
#include "chromecast/media/cma/backend/video_decoder_for_mixer.h"
......
......@@ -13,8 +13,8 @@
#include "base/time/time.h"
#include "chromecast/base/metrics/cast_metrics_helper.h"
#include "chromecast/chromecast_buildflags.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/backend/audio_decoder_wrapper.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/cma/backend/media_pipeline_backend_wrapper.h"
#include "chromecast/public/volume_control.h"
......
......@@ -12,8 +12,8 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "base/time/time.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/base/media_resource_tracker.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/public/media/media_pipeline_device_params.h"
namespace chromecast {
......
......@@ -9,7 +9,7 @@
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/public/media/decoder_config.h"
#include "chromecast/public/media/media_pipeline_backend.h"
......
......@@ -10,8 +10,6 @@
#include <memory>
#include "base/macros.h"
#include "base/memory/ref_counted.h"
#include "chromecast/media/api/decoder_buffer_base.h"
namespace media {
......
......@@ -9,7 +9,7 @@
#include <vector>
#include "base/macros.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/pipeline/av_pipeline_client.h"
#include "chromecast/media/cma/pipeline/av_pipeline_impl.h"
#include "chromecast/public/media/stream_id.h"
......
......@@ -17,7 +17,7 @@
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/pipeline/av_pipeline_client.h"
#include "chromecast/media/cma/pipeline/stream_decryptor.h"
#include "chromecast/public/media/cast_decrypt_config.h"
......
......@@ -16,8 +16,8 @@
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/default_tick_clock.h"
#include "chromecast/base/metrics/cast_metrics_helper.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cdm/cast_cdm_context.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/cma/base/buffering_controller.h"
#include "chromecast/media/cma/base/buffering_state.h"
#include "chromecast/media/cma/base/coded_frame_provider.h"
......
......@@ -14,7 +14,7 @@
#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/pipeline/load_type.h"
#include "chromecast/media/cma/pipeline/media_pipeline_client.h"
#include "media/base/time_delta_interpolator.h"
......
......@@ -9,7 +9,7 @@
#include <vector>
#include "base/macros.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/pipeline/av_pipeline_impl.h"
#include "chromecast/media/cma/pipeline/video_pipeline_client.h"
#include "chromecast/public/media/stream_id.h"
......
......@@ -8,8 +8,8 @@
#include <string>
#include "base/memory/ref_counted.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/api/decoder_buffer_base.h"
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/public/graphics_types.h"
#include "testing/gmock/include/gmock/gmock.h"
......
......@@ -7,7 +7,7 @@
#include <memory>
#include "chromecast/media/cma/backend/cma_backend.h"
#include "chromecast/media/api/cma_backend.h"
#include "chromecast/media/cma/backend/cma_backend_factory.h"
#include "chromecast/public/media/media_pipeline_device_params.h"
#include "testing/gmock/include/gmock/gmock.h"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment