Commit 551f23e6 authored by Xiaohan Wang's avatar Xiaohan Wang Committed by Commit Bot

media: Remove media/gpu/windows/return_on_failure.h

Instead, use media/base/win/mf_helpers.h.

Change-Id: Ia3c018928e6c1aab0357ace07c87dcc8d30a2126
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2068719
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: default avatarFrank Liberato <liberato@chromium.org>
Cr-Commit-Position: refs/heads/master@{#743776}
parent 5549bc81
......@@ -17,23 +17,12 @@ namespace media {
namespace mf {
#define RETURN_ON_FAILURE(success, log, ret) \
do { \
if (!(success)) { \
DLOG(ERROR) << log; \
return ret; \
} \
} while (0)
#define RETURN_ON_HR_FAILURE(hresult, log, ret) \
RETURN_ON_FAILURE(SUCCEEDED(hresult), \
log << ", HRESULT: 0x" << std::hex << hresult, ret);
// Macros that contain return statements can make code harder to read. Only use
// it when necessary, e.g. in places where we deal with a lot of Windows API
// these when necessary, e.g. in places where we deal with a lot of Windows API
// calls, for each of which we have to check the returned HRESULT.
// See discussion thread at:
// https://groups.google.com/a/chromium.org/d/msg/cxx/zw5Xmcs--S4/r7Fwb-TsCAAJ
#define RETURN_IF_FAILED(expr) \
do { \
HRESULT hresult = (expr); \
......@@ -43,6 +32,18 @@ namespace mf {
} \
} while (0)
#define RETURN_ON_FAILURE(success, log, ret) \
do { \
if (!(success)) { \
DLOG(ERROR) << log; \
return ret; \
} \
} while (0)
#define RETURN_ON_HR_FAILURE(hresult, log, ret) \
RETURN_ON_FAILURE(SUCCEEDED(hresult), \
log << ", HRESULT: 0x" << std::hex << hresult, ret);
// Creates a Media Foundation sample with one buffer of length |buffer_length|
// on a |align|-byte boundary. Alignment must be a perfect power of 2 or 0.
MF_INITIALIZER_EXPORT Microsoft::WRL::ComPtr<IMFSample>
......
......@@ -9,11 +9,11 @@
#include "base/memory/ptr_util.h"
#include "base/trace_event/trace_event.h"
#include "media/base/media_log.h"
#include "media/base/win/mf_helpers.h"
#include "media/cdm/cdm_proxy_context.h"
#include "media/gpu/h264_decoder.h"
#include "media/gpu/h264_dpb.h"
#include "media/gpu/windows/d3d11_picture_buffer.h"
#include "media/gpu/windows/return_on_failure.h"
#include "third_party/angle/include/EGL/egl.h"
#include "third_party/angle/include/EGL/eglext.h"
#include "ui/gfx/color_space.h"
......
......@@ -14,12 +14,12 @@
#include "gpu/command_buffer/service/texture_manager.h"
#include "media/base/video_frame.h"
#include "media/base/win/mf_helpers.h"
#include "media/gpu/h264_decoder.h"
#include "media/gpu/h264_dpb.h"
#include "media/gpu/windows/d3d11_com_defs.h"
#include "media/gpu/windows/d3d11_video_context_wrapper.h"
#include "media/gpu/windows/d3d11_video_decoder_client.h"
#include "media/gpu/windows/return_on_failure.h"
#include "media/video/picture.h"
#include "third_party/angle/include/EGL/egl.h"
#include "third_party/angle/include/EGL/eglext.h"
......
......@@ -14,7 +14,7 @@
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/texture_manager.h"
#include "media/base/media_log.h"
#include "media/gpu/windows/return_on_failure.h"
#include "media/base/win/mf_helpers.h"
#include "third_party/angle/include/EGL/egl.h"
#include "third_party/angle/include/EGL/eglext.h"
#include "ui/gfx/color_space.h"
......
......@@ -7,7 +7,7 @@
#include <memory>
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "media/gpu/windows/return_on_failure.h"
#include "media/base/win/mf_helpers.h"
#include "ui/gl/gl_image.h"
namespace media {
......
// Copyright 2017 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 MEDIA_GPU_WINDOWS_RETURN_ON_FAILURE_H_
#define MEDIA_GPU_WINDOWS_RETURN_ON_FAILURE_H_
#define RETURN_ON_FAILURE(result, log, ret) \
do { \
if (!(result)) { \
DLOG(ERROR) << log; \
return ret; \
} \
} while (0)
#endif // MEDIA_GPU_WINDOWS_RETURN_ON_FAILURE_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment