Commit 5b72921d authored by Mina Almasry's avatar Mina Almasry Committed by Commit Bot

[Chromecast] Actually include cast_av_sync_backend_unittests in cast tests

This CL reverts this commit which actually removes building the
unittests. It also adds the unittests to cast_tests.

https://chromium-review.googlesource.com/c/chromium/src/+/1005027

Bug: 73746352
Test: unittests

Change-Id: I341649507f0440a62905f8eccd442215388130dd
Reviewed-on: https://chromium-review.googlesource.com/1007842
Commit-Queue: Mina Almasry <almasrymina@chromium.org>
Reviewed-by: default avatarLuke Halliwell <halliwell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550674}
parent 763d8cc7
......@@ -93,7 +93,10 @@ cast_test_group("cast_tests") {
}
if (is_linux || is_fuchsia) {
tests += [ "//chromecast/media/cma/backend:cast_audio_backend_unittests" ]
tests += [
"//chromecast/media/cma/backend:cast_audio_backend_unittests",
"//chromecast/media/cma/backend:cast_av_sync_backend_unittests",
]
}
if (!is_android) {
......
......@@ -47,12 +47,6 @@ cast_source_set("unittests") {
testonly = true
sources = [
"backend/audio_video_pipeline_device_unittest.cc",
# TODO(almasrymina): enable these tests.
# "backend/av_sync_unittest.cc",
# "backend/mock_audio_decoder_for_mixer.cc",
# "backend/mock_video_decoder_for_mixer.cc",
# "backend/video/av_sync_video.cc",
"base/balanced_media_task_runner_unittest.cc",
"base/buffering_controller_unittest.cc",
"base/buffering_frame_provider_unittest.cc",
......
......@@ -242,3 +242,26 @@ test("cast_audio_backend_unittests") {
deps += [ "fuchsia:unit_tests" ]
}
}
test("cast_av_sync_backend_unittests") {
testonly = true
sources = [
"av_sync_unittest.cc",
"mock_audio_decoder_for_mixer.cc",
"mock_audio_decoder_for_mixer.h",
"mock_video_decoder_for_mixer.cc",
"mock_video_decoder_for_mixer.h",
]
deps = [
":for_mixer_audio",
"//base",
"//base/test:run_all_unittests",
"//base/test:test_support",
"//chromecast/base",
"//chromecast/media/cma/backend/video:av_sync_video",
"//chromecast/public/media",
"//testing/gmock",
"//testing/gtest",
]
}
......@@ -221,6 +221,7 @@ int64_t MockVideoDecoderForMixer<CRN, CRD, CF>::GetAvSyncDriftTolerated() {
template class MockVideoDecoderForMixer<1, 1, 30>;
template class MockVideoDecoderForMixer<1, 1, 24>;
template class MockVideoDecoderForMixer<1, 1, 60>;
template class MockVideoDecoderForMixer<2, 1, 60>;
template class MockVideoDecoderForMixer<1, 2, 60>;
template class MockVideoDecoderForMixer<14, 10, 60>;
......
......@@ -6,17 +6,29 @@ import("//build/config/chromecast_build.gni")
import("//chromecast/chromecast.gni")
import("//media/media_options.gni")
cast_shared_library("libcast_media_1.0_avsync") {
cast_source_set("av_sync_video") {
sources = [
"av_sync_video.cc",
"av_sync_video.h",
]
deps = [
"//base",
"//chromecast/base",
"//chromecast/media/cma/backend:for_mixer_audio",
"//chromecast/public",
"//chromecast/public/media",
]
}
cast_shared_library("libcast_media_1.0_avsync") {
sources = [
"cast_media_shlib.cc",
]
deps = [
":av_sync_video",
"//chromecast/base:base",
"//chromecast/media/cma/backend:for_mixer_audio",
"//chromecast/media/cma/backend/alsa:cma_backend_support",
"//chromecast/public",
"//chromecast/public/media",
"//media",
]
......
......@@ -363,9 +363,9 @@ void AvSyncVideo::GatherPlaybackStatistics() {
<< " average_av_sync_difference="
<< average_av_sync_difference / 1000;
int64_t current_vpts;
int64_t current_apts;
double error;
int64_t current_vpts = 0;
int64_t current_apts = 0;
double error = 0.0;
video_pts_->EstimateY(current_time, &current_vpts, &error);
audio_pts_->EstimateY(current_time, &current_apts, &error);
......
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