diff --git a/cobalt/media/base/metrics_provider.cc b/cobalt/media/base/metrics_provider.cc
index 6ab3ced16594..7bc8896377dc 100644
--- a/cobalt/media/base/metrics_provider.cc
+++ b/cobalt/media/base/metrics_provider.cc
@@ -238,49 +238,6 @@ void MediaMetricsProvider::ReportActionLatencyUMA(
base::TimeDelta::FromMicroseconds(500),
base::TimeDelta::FromMilliseconds(50), 50);
break;
- case MediaAction::SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.BufferPoolAllocateOnDemand.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(5), 50);
- break;
- case MediaAction::SBMEDIA_GET_INIT_BUFFER_CAPACITY:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetInitBufferCapacity.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(5), 50);
- break;
- case MediaAction::SBMEDIA_GET_BUFFER_ALLOCATION_UNIT:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetBufferAllocationUnit.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(5), 50);
- break;
- case MediaAction::SBMEDIA_GET_AUDIO_BUFFER_BUDGET:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetAudioBufferBudget.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(20), 50);
- break;
- case MediaAction::SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetBufferGarbageCollectionDurationThreshold."
- "LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(20), 50);
- break;
- case MediaAction::SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetProgressiveBufferBudget.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(20), 50);
- break;
- case MediaAction::SBMEDIA_GET_VIDEO_BUFFER_BUDGET:
- UMA_HISTOGRAM_CUSTOM_MICROSECONDS_TIMES(
- "Cobalt.Media.SbMedia.GetVideoBufferBudget.LatencyTiming",
- action_duration, base::TimeDelta::FromMicroseconds(1),
- base::TimeDelta::FromMilliseconds(20), 50);
- break;
case MediaAction::UNKNOWN_ACTION:
default:
break;
diff --git a/cobalt/media/base/metrics_provider.h b/cobalt/media/base/metrics_provider.h
index e0e458296f0a..135b2601716f 100644
--- a/cobalt/media/base/metrics_provider.h
+++ b/cobalt/media/base/metrics_provider.h
@@ -59,13 +59,6 @@ enum class MediaAction : uint8_t {
SBDRM_GENERATE_SESSION_UPDATE_REQUEST,
SBDRM_UPDATE_SESSION,
SBDRM_CLOSE_SESSION,
- SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND,
- SBMEDIA_GET_INIT_BUFFER_CAPACITY,
- SBMEDIA_GET_BUFFER_ALLOCATION_UNIT,
- SBMEDIA_GET_AUDIO_BUFFER_BUDGET,
- SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD,
- SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET,
- SBMEDIA_GET_VIDEO_BUFFER_BUDGET,
};
class MediaMetricsProvider {
diff --git a/cobalt/media/base/metrics_provider_test.cc b/cobalt/media/base/metrics_provider_test.cc
index 648e3d9bd488..0037f02daa31 100644
--- a/cobalt/media/base/metrics_provider_test.cc
+++ b/cobalt/media/base/metrics_provider_test.cc
@@ -254,92 +254,6 @@ TEST_F(MediaMetricsProviderTest, SbDrmUpdateSession) {
std::string(kUmaPrefix) + "SbDrm.UpdateSession.LatencyTiming", 100, 1);
}
-TEST_F(MediaMetricsProviderTest, SbMediaIsBufferPoolAllocateOnDemand) {
- metrics_.StartTrackingAction(
- MediaAction::SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(
- MediaAction::SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) +
- "SbMedia.BufferPoolAllocateOnDemand.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest, SbMediaGetInitialBufferCapacity) {
- metrics_.StartTrackingAction(MediaAction::SBMEDIA_GET_INIT_BUFFER_CAPACITY);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(MediaAction::SBMEDIA_GET_INIT_BUFFER_CAPACITY);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) + "SbMedia.GetInitBufferCapacity.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest, SbMediaGetBufferAllocationUnit) {
- metrics_.StartTrackingAction(MediaAction::SBMEDIA_GET_BUFFER_ALLOCATION_UNIT);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(MediaAction::SBMEDIA_GET_BUFFER_ALLOCATION_UNIT);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) + "SbMedia.GetBufferAllocationUnit.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest, SbMediaGetAudioBufferBudget) {
- metrics_.StartTrackingAction(MediaAction::SBMEDIA_GET_AUDIO_BUFFER_BUDGET);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(MediaAction::SBMEDIA_GET_AUDIO_BUFFER_BUDGET);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) + "SbMedia.GetAudioBufferBudget.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest,
- SbMediaGetBufferGarbageCollectionDurationThreshold) {
- metrics_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) +
- "SbMedia.GetBufferGarbageCollectionDurationThreshold.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest, SbMediaGetProgressiveBufferBudget) {
- metrics_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) +
- "SbMedia.GetProgressiveBufferBudget.LatencyTiming",
- 570, 1);
-}
-
-TEST_F(MediaMetricsProviderTest, SbMediaGetVideoBufferBudget) {
- metrics_.StartTrackingAction(MediaAction::SBMEDIA_GET_VIDEO_BUFFER_BUDGET);
-
- clock_.Advance(base::TimeDelta::FromMicroseconds(570));
- metrics_.EndTrackingAction(MediaAction::SBMEDIA_GET_VIDEO_BUFFER_BUDGET);
-
- histogram_tester_.ExpectUniqueSample(
- std::string(kUmaPrefix) + "SbMedia.GetVideoBufferBudget.LatencyTiming",
- 570, 1);
-}
} // namespace
} // namespace media
diff --git a/cobalt/media/decoder_buffer_allocator.cc b/cobalt/media/decoder_buffer_allocator.cc
index 87f9759cc85b..6c91b45a3592 100644
--- a/cobalt/media/decoder_buffer_allocator.cc
+++ b/cobalt/media/decoder_buffer_allocator.cc
@@ -38,45 +38,11 @@ const size_t kSmallAllocationThreshold = 512;
} // namespace
-bool CreateSbMediaIsBufferPoolAllocateOnDemandWithHistogram(
- MediaMetricsProvider& media_metrics_provider) {
- media_metrics_provider.StartTrackingAction(
- MediaAction::SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND);
- auto is_memory_pool_allocated_on_demand =
- SbMediaIsBufferPoolAllocateOnDemand();
- media_metrics_provider.EndTrackingAction(
- MediaAction::SBMEDIA_BUFFER_POOL_ALLOCATE_ON_DEMAND);
- return is_memory_pool_allocated_on_demand;
-}
-
-int CreateSbMediaGetInitialBufferCapacityWithHistogram(
- MediaMetricsProvider& media_metrics_provider) {
- media_metrics_provider.StartTrackingAction(
- MediaAction::SBMEDIA_GET_INIT_BUFFER_CAPACITY);
- auto initial_capacity = SbMediaGetInitialBufferCapacity();
- media_metrics_provider.EndTrackingAction(
- MediaAction::SBMEDIA_GET_INIT_BUFFER_CAPACITY);
- return initial_capacity;
-}
-
-bool CreateSbMediaGetBufferAllocationUnitWithHistogram(
- MediaMetricsProvider& media_metrics_provider) {
- media_metrics_provider.StartTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_ALLOCATION_UNIT);
- auto allocation_unit = SbMediaGetBufferAllocationUnit();
- media_metrics_provider.EndTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_ALLOCATION_UNIT);
- return allocation_unit;
-}
-
DecoderBufferAllocator::DecoderBufferAllocator()
: is_memory_pool_allocated_on_demand_(
- CreateSbMediaIsBufferPoolAllocateOnDemandWithHistogram(
- media_metrics_provider_)),
- initial_capacity_(CreateSbMediaGetInitialBufferCapacityWithHistogram(
- media_metrics_provider_)),
- allocation_unit_(CreateSbMediaGetBufferAllocationUnitWithHistogram(
- media_metrics_provider_)) {
+ SbMediaIsBufferPoolAllocateOnDemand()),
+ initial_capacity_(SbMediaGetInitialBufferCapacity()),
+ allocation_unit_(SbMediaGetBufferAllocationUnit()) {
if (is_memory_pool_allocated_on_demand_) {
DLOG(INFO) << "Allocated media buffer pool on demand.";
Allocator::Set(this);
@@ -158,12 +124,7 @@ void DecoderBufferAllocator::Free(void* p, size_t size) {
}
int DecoderBufferAllocator::GetAudioBufferBudget() const {
- media_metrics_provider_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_AUDIO_BUFFER_BUDGET);
- int audio_buffer_budget = SbMediaGetAudioBufferBudget();
- media_metrics_provider_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_AUDIO_BUFFER_BUDGET);
- return audio_buffer_budget;
+ return SbMediaGetAudioBufferBudget();
}
int DecoderBufferAllocator::GetBufferAlignment() const {
@@ -180,39 +141,23 @@ int DecoderBufferAllocator::GetBufferPadding() const {
base::TimeDelta
DecoderBufferAllocator::GetBufferGarbageCollectionDurationThreshold() const {
- media_metrics_provider_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD);
- int64_t buffer_garbage_collection_duration_threshold =
- SbMediaGetBufferGarbageCollectionDurationThreshold();
- media_metrics_provider_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_BUFFER_GARBAGE_COLLECTION_DURATION_THRESHOLD);
return base::TimeDelta::FromMicroseconds(
- buffer_garbage_collection_duration_threshold);
+ SbMediaGetBufferGarbageCollectionDurationThreshold());
}
int DecoderBufferAllocator::GetProgressiveBufferBudget(
SbMediaVideoCodec codec, int resolution_width, int resolution_height,
int bits_per_pixel) const {
- media_metrics_provider_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET);
- int progressive_buffer_budget = SbMediaGetProgressiveBufferBudget(
- codec, resolution_width, resolution_height, bits_per_pixel);
- media_metrics_provider_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_PROGRESSIVE_BUFFER_BUDGET);
- return progressive_buffer_budget;
+ return SbMediaGetProgressiveBufferBudget(codec, resolution_width,
+ resolution_height, bits_per_pixel);
}
int DecoderBufferAllocator::GetVideoBufferBudget(SbMediaVideoCodec codec,
int resolution_width,
int resolution_height,
int bits_per_pixel) const {
- media_metrics_provider_.StartTrackingAction(
- MediaAction::SBMEDIA_GET_VIDEO_BUFFER_BUDGET);
- int video_buffer_budget = SbMediaGetVideoBufferBudget(
- codec, resolution_width, resolution_height, bits_per_pixel);
- media_metrics_provider_.EndTrackingAction(
- MediaAction::SBMEDIA_GET_VIDEO_BUFFER_BUDGET);
- return video_buffer_budget;
+ return SbMediaGetVideoBufferBudget(codec, resolution_width, resolution_height,
+ bits_per_pixel);
}
size_t DecoderBufferAllocator::GetAllocatedMemory() const {
diff --git a/cobalt/media/decoder_buffer_allocator.h b/cobalt/media/decoder_buffer_allocator.h
index fb7cc5611b69..da9877cce5ad 100644
--- a/cobalt/media/decoder_buffer_allocator.h
+++ b/cobalt/media/decoder_buffer_allocator.h
@@ -21,7 +21,6 @@
#include "base/compiler_specific.h"
#include "base/synchronization/lock.h"
#include "base/time/time.h"
-#include "cobalt/media/base/metrics_provider.h"
#include "cobalt/media/bidirectional_fit_reuse_allocator.h"
#include "cobalt/media/decoder_buffer_memory_info.h"
#include "cobalt/media/starboard_memory_allocator.h"
@@ -64,8 +63,6 @@ class DecoderBufferAllocator : public ::media::DecoderBuffer::Allocator,
private:
void EnsureReuseAllocatorIsCreated();
- mutable MediaMetricsProvider media_metrics_provider_;
-
const bool is_memory_pool_allocated_on_demand_;
const int initial_capacity_;
const int allocation_unit_;
diff --git a/tools/metrics/histograms/metadata/cobalt/histograms.xml b/tools/metrics/histograms/metadata/cobalt/histograms.xml
index d9b19fa2b4ba..b5b95018d693 100644
--- a/tools/metrics/histograms/metadata/cobalt/histograms.xml
+++ b/tools/metrics/histograms/metadata/cobalt/histograms.xml
@@ -320,72 +320,6 @@ Always run the pretty print utility on this file after editing:
Timing data for updating session of SbDrm.
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for allocating buffer pool on demand.
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for getting audio buffer budget.
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for getting buffer allocation unit.
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
-
- Timing data for getting buffer garbage collection duration threshold.
-
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for getting initial buffer capacity.
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for getting progressive buffer budget.
-
-
-
-
-
- borongchen@google.com
- cobalt-team@google.com
- Timing data for getting video buffer budget.
-
-