Componentize SkAudioPlayer

Relocate under modules/audioplayer and package as a standalone
component.

Change-Id: If9dc72bb0abe170049a514c9931186703a3c138a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/310058
Commit-Queue: Florin Malita <fmalita@google.com>
Reviewed-by: Mike Reed <reed@google.com>
This commit is contained in:
Florin Malita 2020-08-13 12:03:37 -04:00 committed by Skia Commit-Bot
parent 48bdf6ddb1
commit c9c4e2e9ef
9 changed files with 28 additions and 12 deletions

View File

@ -459,7 +459,6 @@ optional("fontmgr_mac_ct") {
# AppKit symbols NSFontWeightXXX may be dlsym'ed.
"AppKit.framework",
"ApplicationServices.framework",
"AVFoundation.framework",
]
}
@ -2505,7 +2504,6 @@ if (skia_enable_tools) {
test_app("viewer") {
is_shared_library = is_android
sources = [
"src/ports/SkAudioPlayer.cpp",
"tools/viewer/AnimTimer.h",
"tools/viewer/BisectSlide.cpp",
"tools/viewer/GMSlide.cpp",
@ -2539,6 +2537,7 @@ if (skia_enable_tools) {
":tool_utils",
":trace",
"experimental/skrive",
"modules/audioplayer",
"modules/particles",
"modules/skottie",
"modules/skottie:utils",
@ -2558,11 +2557,6 @@ if (skia_enable_tools) {
"//third_party/spirv-tools:spvtools_val",
]
}
if (is_mac) {
sources += [ "src/ports/SkAudioPlayer_mac.mm" ]
} else {
sources += [ "src/ports/SkAudioPlayer_none.cpp" ]
}
}
}

View File

@ -0,0 +1,19 @@
# Copyright 2020 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("../../gn/skia.gni")
component("audioplayer") {
public = [ "SkAudioPlayer.h" ]
sources = [ "SkAudioPlayer.cpp" ]
deps = [ "../..:skia" ]
if (is_mac) {
sources += [ "SkAudioPlayer_mac.mm" ]
frameworks = [ "AVFoundation.framework" ]
} else {
sources += [ "SkAudioPlayer_none.cpp" ]
}
}

View File

@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "include/ports/SkAudioPlayer.h"
#include "modules/audioplayer/SkAudioPlayer.h"
#include <algorithm>
#include <cmath>

View File

@ -6,7 +6,7 @@
*/
#include "include/core/SkData.h"
#include "include/ports/SkAudioPlayer.h"
#include "modules/audioplayer/SkAudioPlayer.h"
#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)

View File

@ -6,7 +6,7 @@
*/
#include "include/core/SkData.h"
#include "include/ports/SkAudioPlayer.h"
#include "modules/audioplayer/SkAudioPlayer.h"
std::unique_ptr<SkAudioPlayer> SkAudioPlayer::Make(sk_sp<SkData> src) {
return nullptr;

View File

@ -70,6 +70,9 @@ sk_sp<sksg::RenderNode> AnimationBuilder::attachAudioLayer(const skjson::ObjectV
layer_info->fInPoint,
layer_info->fOutPoint,
fFrameRate));
} else {
this->log(Logger::Level::kWarning, nullptr,
"Could not load audio asset '%s'.", name->begin());
}
}
}

View File

@ -7,7 +7,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/ports/SkAudioPlayer.h"
#include "modules/audioplayer/SkAudioPlayer.h"
#include "samplecode/Sample.h"
#include "src/core/SkUtils.h"
#include "tools/Resources.h"

View File

@ -12,7 +12,7 @@
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkTime.h"
#include "include/ports/SkAudioPlayer.h"
#include "modules/audioplayer/SkAudioPlayer.h"
#include "modules/skottie/include/Skottie.h"
#include "modules/skottie/utils/SkottieUtils.h"
#include "modules/skresources/include/SkResources.h"