Remove Unused AsTextButtonBorder RTTI helper.
[chromium-blink-merge.git] / media / cast / logging / encoding_event_subscriber.h
blobe80061d32422fc8f45834f08ed410c88ebb35965
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.
5 #ifndef MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_
6 #define MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_
8 #include <map>
10 #include "base/memory/linked_ptr.h"
11 #include "base/threading/thread_checker.h"
12 #include "media/cast/logging/proto/raw_events.pb.h"
13 #include "media/cast/logging/raw_event_subscriber.h"
15 namespace media {
16 namespace cast {
18 typedef std::map<RtpTimestamp,
19 linked_ptr<media::cast::proto::AggregatedFrameEvent> >
20 FrameEventMap;
21 typedef std::map<RtpTimestamp,
22 linked_ptr<media::cast::proto::AggregatedPacketEvent> >
23 PacketEventMap;
24 typedef std::map<CastLoggingEvent,
25 linked_ptr<media::cast::proto::AggregatedGenericEvent> >
26 GenericEventMap;
28 // A RawEventSubscriber implementation that subscribes to events,
29 // encodes them in protocol buffer format, and aggregates them into a more
30 // compact structure.
31 // TODO(imcheng): Implement event filtering and windowing based on size.
32 class EncodingEventSubscriber : public RawEventSubscriber {
33 public:
34 EncodingEventSubscriber();
36 virtual ~EncodingEventSubscriber();
38 // RawReventSubscriber implementations.
39 virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE;
40 virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE;
41 virtual void OnReceiveGenericEvent(const GenericEvent& generic_event)
42 OVERRIDE;
44 // Assigns frame events received so far to |frame_events| and clears them
45 // from this object.
46 void GetFrameEventsAndReset(FrameEventMap* frame_events);
48 // Assigns packet events received so far to |packet_events| and clears them
49 // from this object.
50 void GetPacketEventsAndReset(PacketEventMap* packet_events);
52 // Assigns generic events received so far to |generic_events| and clears them
53 // from this object.
54 void GetGenericEventsAndReset(GenericEventMap* generic_events);
56 private:
57 FrameEventMap frame_event_map_;
58 PacketEventMap packet_event_map_;
59 GenericEventMap generic_event_map_;
61 // All functions must be called on the main thread.
62 base::ThreadChecker thread_checker_;
64 DISALLOW_COPY_AND_ASSIGN(EncodingEventSubscriber);
67 } // namespace cast
68 } // namespace media
70 #endif // MEDIA_CAST_LOGGING_ENCODING_EVENT_SUBSCRIBER_H_