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

Unified Diff: media/base/media_log.h

Issue 883403002: Parsing of encoded duration for unencrypted opus streams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor fix for log line. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/BUILD.gn ('k') | media/formats/webm/opus_packet_builder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/media_log.h
diff --git a/media/base/media_log.h b/media/base/media_log.h
index 1a76cbf5f01ed68e67479f523e4119bd365b3dc8..abeb42057fffbdf678bfba5236a9623b5f3e6a80 100644
--- a/media/base/media_log.h
+++ b/media/base/media_log.h
@@ -8,6 +8,7 @@
#include <sstream>
#include <string>
+#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "media/base/media_export.h"
@@ -36,6 +37,11 @@ class LogHelper {
#define MEDIA_LOG(log_cb) LogHelper(log_cb).stream()
+// Logs only while count < max. Increments count for each log. Use LAZY_STREAM
+// to avoid wasteful evaluation of subsequent stream arguments.
+#define LIMITED_MEDIA_LOG(log_cb, count, max) \
+ LAZY_STREAM(MEDIA_LOG(log_cb), (count) < (max) && ((count)++ || true))
+
class MEDIA_EXPORT MediaLog : public base::RefCountedThreadSafe<MediaLog> {
public:
// Convert various enums to strings.
« no previous file with comments | « media/BUILD.gn ('k') | media/formats/webm/opus_packet_builder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698