Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: media/cast/logging/stats_event_subscriber.h

Issue 210303003: Cast: Remove LoggingStats in favor of event subscribers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
6 #define MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
7
8 #include "base/threading/thread_checker.h"
9 #include "media/cast/logging/logging_defines.h"
10 #include "media/cast/logging/raw_event_subscriber.h"
11
12 namespace media {
13 namespace cast {
14
15 // A RawEventSubscriber implementation that subscribes to events,
16 // and aggregates them into stats.
17 class StatsEventSubscriber : public RawEventSubscriber {
18 public:
19 StatsEventSubscriber(EventMediaType media_type);
20
21 virtual ~StatsEventSubscriber();
22
23 // RawReventSubscriber implementations.
24 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE;
25 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE;
26 virtual void OnReceiveGenericEvent(const GenericEvent& generic_event)
27 OVERRIDE;
28
29 // Assigns |frame_stats_map| with frame stats.
30 void GetFrameStats(FrameStatsMap* frame_stats_map) const;
31
32 // Assigns |packet_stats_map| with packet stats.
33 void GetPacketStats(PacketStatsMap* packet_stats_map) const;
34
35 // Assigns |generic_stats_map| with generic stats data.
36 void GetGenericStats(GenericStatsMap* generic_stats_map) const;
37
38 // Resets all stats maps in this object.
39 void Reset();
40
41 private:
42 EventMediaType event_media_type_;
43 FrameStatsMap frame_stats_;
44 PacketStatsMap packet_stats_;
45 GenericStatsMap generic_stats_;
46 base::ThreadChecker thread_checker_;
47 DISALLOW_COPY_AND_ASSIGN(StatsEventSubscriber);
48 };
49
50 } // namespace cast
51 } // namespace media
52
53 #endif // MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
OLDNEW
« no previous file with comments | « media/cast/logging/simple_event_subscriber_unittest.cc ('k') | media/cast/logging/stats_event_subscriber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698