Commit 92229ecb authored by Bryan Clark's avatar Bryan Clark Committed by Commit Bot

Merge cast desktop media libraries into a single lib. Mixed audio/video

is enabled if the gn arg enable_video_with_mixed_audio is 'true'.

Bug: b/141625857
Test: Ran cast_shell locally
Change-Id: Ic61fa599cd6aa573b555df7ac25fab9358d61681
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874521Reviewed-by: default avatarKenneth MacKay <kmackay@chromium.org>
Commit-Queue: Bryan Clark <bryanclark@google.com>
Cr-Commit-Position: refs/heads/master@{#708423}
parent 4cd66186
......@@ -16,7 +16,6 @@ cast_source_set("desktop") {
"media_sink_desktop.h",
"video_decoder_desktop.cc",
"video_decoder_desktop.h",
"volume_control_desktop.cc",
]
deps = [
......@@ -25,17 +24,16 @@ cast_source_set("desktop") {
"//chromecast/public/media",
"//media",
]
}
cast_source_set("video_decoder_for_mixer") {
sources = [
"cast_media_shlib_video.cc",
]
deps = [
"//base",
"//chromecast/media/cma/backend:null_video",
"//chromecast/public",
"//chromecast/public/media",
]
if (enable_video_with_mixed_audio) {
deps += [
"//chromecast/media/cma/backend/alsa:volume_control",
"//chromecast/media/cma/backend:null_video",
"//chromecast/media/cma/backend:for_mixer_audio",
"//chromecast/media/cma/backend/video:av_sync_video",
]
} else {
sources += [
"volume_control_desktop.cc",
]
}
}
......@@ -4,7 +4,11 @@
#include <memory>
#if defined(ENABLE_VIDEO_WITH_MIXED_AUDIO)
#include "chromecast/media/cma/backend/media_pipeline_backend_for_mixer.h" // nogncheck
#else
#include "chromecast/media/cma/backend/desktop/media_pipeline_backend_desktop.h"
#endif
#include "chromecast/public/cast_media_shlib.h"
#include "chromecast/public/graphics_types.h"
#include "chromecast/public/media/media_capabilities_shlib.h"
......@@ -40,7 +44,11 @@ VideoPlane* CastMediaShlib::GetVideoPlane() {
MediaPipelineBackend* CastMediaShlib::CreateMediaPipelineBackend(
const MediaPipelineDeviceParams& params) {
#if defined(ENABLE_VIDEO_WITH_MIXED_AUDIO)
return new MediaPipelineBackendForMixer(params);
#else
return new MediaPipelineBackendDesktop();
#endif
}
double CastMediaShlib::GetMediaClockRate() {
......@@ -52,7 +60,10 @@ double CastMediaShlib::MediaClockRatePrecision() {
}
void CastMediaShlib::MediaClockRateRange(double* minimum_rate,
double* maximum_rate) {}
double* maximum_rate) {
*minimum_rate = 0.0;
*maximum_rate = 1.0;
}
bool CastMediaShlib::SetMediaClockRate(double new_rate) {
return false;
......
// 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.
#include <vector>
#include <string>
#include "base/no_destructor.h"
#include "chromecast/public/cast_media_shlib.h"
#include "chromecast/public/media/media_capabilities_shlib.h"
#include "chromecast/public/video_plane.h"
namespace chromecast {
namespace media {
class DesktopVideoPlane : public VideoPlane {
public:
~DesktopVideoPlane() override = default;
void SetGeometry(const RectF& display_rect, Transform transform) override {}
};
void CastMediaShlib::Initialize(const std::vector<std::string>& argv) {}
VideoPlane* CastMediaShlib::GetVideoPlane() {
static base::NoDestructor<DesktopVideoPlane> g_video_plane;
return g_video_plane.get();
}
bool MediaCapabilitiesShlib::IsSupportedVideoConfig(VideoCodec codec,
VideoProfile profile,
int level) {
return false;
}
} // namespace media
} // namespace chromecast
......@@ -55,12 +55,7 @@ cast_source_set("libcast_media_1.0_avsync") {
if (use_alsa) {
deps += [ "//chromecast/media/cma/backend/alsa:volume_control" ]
if (!is_cast_desktop_build) {
libs = [ "videodecoderformixer" ]
} else {
deps +=
[ "//chromecast/media/cma/backend/desktop:video_decoder_for_mixer" ]
}
libs = [ "videodecoderformixer" ]
}
if (is_fuchsia) {
......
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