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

Unified Diff: media/filters/ffmpeg_glue.h

Issue 2846693002: Add UMA metrics for VideoCodec.MP4 and VideoCodec.WebM (Closed)
Patch Set: Add DCHECK(open_called_) Created 3 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 side-by-side diff with in-line comments
Download patch
Index: media/filters/ffmpeg_glue.h
diff --git a/media/filters/ffmpeg_glue.h b/media/filters/ffmpeg_glue.h
index 7d464eb37a67dce62a2c648f0b11046504ac8150..305f27b5219d320e654bd413efda7c34a9048acc 100644
--- a/media/filters/ffmpeg_glue.h
+++ b/media/filters/ffmpeg_glue.h
@@ -29,7 +29,9 @@
#include <memory>
+#include "base/logging.h"
#include "base/macros.h"
+#include "media/base/container_names.h"
#include "media/base/media_export.h"
#include "media/ffmpeg/ffmpeg_deleters.h"
@@ -71,11 +73,19 @@ class MEDIA_EXPORT FFmpegGlue {
// through the FFmpegURLProtocol provided during construction.
bool OpenContext();
AVFormatContext* format_context() { return format_context_; }
+ // Returns the container name.
+ // Note that it is only available after calling OpenContext.
+ container_names::MediaContainerName container() const {
+ DCHECK(open_called_);
+ return container_;
+ }
private:
- bool open_called_;
- AVFormatContext* format_context_;
+ bool open_called_ = false;
+ AVFormatContext* format_context_ = nullptr;
std::unique_ptr<AVIOContext, ScopedPtrAVFree> avio_context_;
+ container_names::MediaContainerName container_ =
+ container_names::CONTAINER_UNKNOWN;
DISALLOW_COPY_AND_ASSIGN(FFmpegGlue);
};

Powered by Google App Engine
This is Rietveld 408576698