#ifndef MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
#define MEDIA_CAST_LOGGING_STATS_EVENT_SUBSCRIBER_H_
#include "base/threading/thread_checker.h"
#include "media/cast/logging/logging_defines.h"
#include "media/cast/logging/raw_event_subscriber.h"
namespace media {
namespace cast {
class StatsEventSubscriber : public RawEventSubscriber {
public:
StatsEventSubscriber(EventMediaType media_type);
virtual ~StatsEventSubscriber();
virtual void OnReceiveFrameEvent(const FrameEvent& frame_event) OVERRIDE;
virtual void OnReceivePacketEvent(const PacketEvent& packet_event) OVERRIDE;
virtual void OnReceiveGenericEvent(const GenericEvent& generic_event)
OVERRIDE;
void GetFrameStats(FrameStatsMap* frame_stats_map) const;
void GetPacketStats(PacketStatsMap* packet_stats_map) const;
void GetGenericStats(GenericStatsMap* generic_stats_map) const;
void Reset();
private:
EventMediaType event_media_type_;
FrameStatsMap frame_stats_;
PacketStatsMap packet_stats_;
GenericStatsMap generic_stats_;
base::ThreadChecker thread_checker_;
DISALLOW_COPY_AND_ASSIGN(StatsEventSubscriber);
};
}
}
#endif