1 // Copyright 2013 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_LOGGING_RAW_H_
6 #define MEDIA_CAST_LOGGING_LOGGING_RAW_H_
12 #include "base/basictypes.h"
13 #include "base/memory/linked_ptr.h"
14 #include "base/memory/weak_ptr.h"
15 #include "base/threading/non_thread_safe.h"
16 #include "base/time/tick_clock.h"
17 #include "media/cast/logging/logging_defines.h"
22 // This class is not thread safe, and should only be called from the main
24 class LoggingRaw : public base::NonThreadSafe,
25 public base::SupportsWeakPtr<LoggingRaw> {
27 explicit LoggingRaw(base::TickClock* clock);
30 // Inform of new event: three types of events: frame, packets and generic.
31 // Frame events can be inserted with different parameters.
32 void InsertFrameEvent(CastLoggingEvent event,
36 // Size - Inserting the size implies that this is an encoded frame.
37 void InsertFrameEventWithSize(CastLoggingEvent event,
42 // Render/playout delay
43 void InsertFrameEventWithDelay(CastLoggingEvent event,
46 base::TimeDelta delay);
48 // Insert a packet event.
49 void InsertPacketEvent(CastLoggingEvent event,
56 void InsertGenericEvent(CastLoggingEvent event, int value);
59 FrameRawMap GetFrameData() const;
60 PacketRawMap GetPacketData() const;
61 GenericRawMap GetGenericData() const;
64 // Reset all log data.
68 void InsertBaseFrameEvent(CastLoggingEvent event,
70 uint32 rtp_timestamp);
72 base::WeakPtrFactory<LoggingRaw> weak_factory_;
73 base::TickClock* const clock_; // Not owned by this class.
74 FrameRawMap frame_map_;
75 PacketRawMap packet_map_;
76 GenericRawMap generic_map_;
78 DISALLOW_COPY_AND_ASSIGN(LoggingRaw);
84 #endif // MEDIA_CAST_LOGGING_LOGGING_RAW_H_