Skip to content

Commit

Permalink
oboe: Samsung does not use MMAP for Camcorder
Browse files Browse the repository at this point in the history
This is used by the QuirksManager.
  • Loading branch information
philburk committed Jun 17, 2020
1 parent a588899 commit 388b8c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/common/QuirksManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ int32_t QuirksManager::DeviceQuirks::clipBufferSize(AudioStream &stream,
return adjustedSize;
}

bool QuirksManager::DeviceQuirks::isAAudioMMapPossible(const AudioStreamBuilder &builder) {
bool QuirksManager::DeviceQuirks::isAAudioMMapPossible(const AudioStreamBuilder &builder) const {
bool isSampleRateCompatible =
builder.getSampleRate() == oboe::Unspecified
|| builder.getSampleRate() == kCommonNativeRate
Expand Down Expand Up @@ -88,6 +88,12 @@ class SamsungDeviceQuirks : public QuirksManager::DeviceQuirks {
return isExynos9810; // TODO We can make this version specific if it gets fixed.
}

bool isAAudioMMapPossible(const AudioStreamBuilder &builder) const override {
return DeviceQuirks::isAAudioMMapPossible(builder)
// Samsung says they use Legacy for Camcorder
&& builder.getInputPreset() != oboe::InputPreset::Camcorder;
}

private:
// Stay farther away from DSP position on Exynos devices.
static constexpr int32_t kBottomMarginExynos = 2;
Expand Down
2 changes: 1 addition & 1 deletion src/common/QuirksManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class QuirksManager {
return false;
}

bool isAAudioMMapPossible(const AudioStreamBuilder &builder);
virtual bool isAAudioMMapPossible(const AudioStreamBuilder &builder) const;

static constexpr int32_t kDefaultBottomMarginInBursts = 0;
static constexpr int32_t kDefaultTopMarginInBursts = 0;
Expand Down

0 comments on commit 388b8c3

Please sign in to comment.