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

Unified Diff: media/filters/vpx_video_decoder.cc

Issue 773053002: media: Add tracing around VPx decoding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/vpx_video_decoder.cc
diff --git a/media/filters/vpx_video_decoder.cc b/media/filters/vpx_video_decoder.cc
index bf7cc3cdaac32a2c1aa49c5f8d00d362a051ab9b..ffbbcd910eea60216351c3180791a44ef9df3a65 100644
--- a/media/filters/vpx_video_decoder.cc
+++ b/media/filters/vpx_video_decoder.cc
@@ -11,6 +11,7 @@
#include "base/bind.h"
#include "base/callback_helpers.h"
#include "base/command_line.h"
+#include "base/debug/trace_event.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/single_thread_task_runner.h"
@@ -361,17 +362,21 @@ void VpxVideoDecoder::DecodeBuffer(const scoped_refptr<DecoderBuffer>& buffer) {
bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
scoped_refptr<VideoFrame>* video_frame) {
+ TRACE_EVENT0("video", "VpxDecode");
fgalligan1 2014/12/03 18:29:56 Is this needed?
Tom Finegan 2014/12/03 18:51:39 This tracked the entire VpxDecode() call. Removed.
DCHECK(video_frame);
DCHECK(!buffer->end_of_stream());
// Pass |buffer| to libvpx.
int64 timestamp = buffer->timestamp().InMicroseconds();
void* user_priv = reinterpret_cast<void*>(&timestamp);
+
+ TRACE_EVENT_BEGIN0("video", "vpx_codec_decode");
fgalligan1 2014/12/03 18:29:56 Maybe add the timestamp so we could distinguish th
Tom Finegan 2014/12/03 18:51:39 Done.
vpx_codec_err_t status = vpx_codec_decode(vpx_codec_,
buffer->data(),
buffer->data_size(),
user_priv,
0);
+ TRACE_EVENT_END0("video", "vpx_codec_decode");
if (status != VPX_CODEC_OK) {
LOG(ERROR) << "vpx_codec_decode() failed, status=" << status;
return false;
@@ -379,7 +384,9 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
// Gets pointer to decoded data.
vpx_codec_iter_t iter = NULL;
+ TRACE_EVENT_BEGIN0("video", "vpx_codec_get_frame");
fgalligan1 2014/12/03 18:29:56 I think we can get rid of these. They should prett
Tom Finegan 2014/12/03 18:51:39 Done.
const vpx_image_t* vpx_image = vpx_codec_get_frame(vpx_codec_, &iter);
+ TRACE_EVENT_END0("video", "vpx_codec_get_frame");
if (!vpx_image) {
*video_frame = NULL;
return true;
@@ -400,11 +407,13 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
const uint64 side_data_id = base::NetToHost64(
*(reinterpret_cast<const uint64*>(buffer->side_data())));
if (side_data_id == 1) {
+ TRACE_EVENT_BEGIN0("video", "vpx_codec_decode_alpha");
status = vpx_codec_decode(vpx_codec_alpha_,
buffer->side_data() + 8,
buffer->side_data_size() - 8,
user_priv_alpha,
0);
+ TRACE_EVENT_END0("video", "vpx_codec_decode_alpha");
if (status != VPX_CODEC_OK) {
LOG(ERROR) << "vpx_codec_decode() failed on alpha, status=" << status;
@@ -413,7 +422,9 @@ bool VpxVideoDecoder::VpxDecode(const scoped_refptr<DecoderBuffer>& buffer,
// Gets pointer to decoded data.
vpx_codec_iter_t iter_alpha = NULL;
+ TRACE_EVENT_BEGIN0("video", "vpx_codec_get_frame_alpha");
vpx_image_alpha = vpx_codec_get_frame(vpx_codec_alpha_, &iter_alpha);
+ TRACE_EVENT_END0("video", "vpx_codec_get_frame_alpha");
if (!vpx_image_alpha) {
*video_frame = NULL;
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698