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

Unified Diff: content/common/gpu/media/avda_return_on_failure.h

Issue 1313913003: Begin refactor of AVDA to support zero-copy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed unit test. Created 5 years, 3 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: content/common/gpu/media/avda_return_on_failure.h
diff --git a/content/common/gpu/media/avda_return_on_failure.h b/content/common/gpu/media/avda_return_on_failure.h
new file mode 100644
index 0000000000000000000000000000000000000000..7a9449675b73ad73353cf4bbfc372cca87981da5
--- /dev/null
+++ b/content/common/gpu/media/avda_return_on_failure.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_
+#define CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_
+
+#include "media/video/video_decode_accelerator.h"
+
+// Helper macros for dealing with failure. If |result| evaluates false, emit
+// |log| to ERROR, register |error| with the decoder, and return. This will
+// also transition to the error state, stopping further decoding.
+// This is meant to be used only within AndroidVideoDecoderBase and its
+// various subclasses. |provider| must support PostError.
watk 2015/09/09 00:36:01 Comment is out of date already :P
+#define RETURN_ON_FAILURE(provider, result, log, error) \
+ do { \
+ if (!(result)) { \
+ DLOG(ERROR) << log; \
+ provider->PostError(FROM_HERE, \
+ media::VideoDecodeAccelerator::error); \
+ return; \
+ } \
+ } while (0)
+
+#endif // CONTENT_COMMON_GPU_MEDIA_AVDA_RETURN_ON_FAILURE_H_

Powered by Google App Engine
This is Rietveld 408576698