blob: d2030d41491520e220b400ab7a13bac86ca482a6 [file] [log] [blame]
// Copyright 2014 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 COBALT_MEDIA_FORMATS_MP4_RCHECK_H_
#define COBALT_MEDIA_FORMATS_MP4_RCHECK_H_
#include "base/logging.h"
#include "cobalt/media/base/media_log.h"
#define RCHECK_MEDIA_LOGGED(condition, log_cb, msg) \
do { \
if (!(condition)) { \
DLOG(ERROR) << "Failure while parsing MP4: " #condition; \
MEDIA_LOG(ERROR, log_cb) << "Failure parsing MP4: " << (msg); \
return false; \
} \
} while (0)
// TODO(wolenetz,chcunningham): Where appropriate, replace usage of this macro
// in favor of RCHECK_MEDIA_LOGGED. See https://crbug.com/487410.
#define RCHECK(condition) \
do { \
if (!(condition)) { \
DLOG(ERROR) << "Failure while parsing MP4: " #condition; \
return false; \
} \
} while (0)
#endif // COBALT_MEDIA_FORMATS_MP4_RCHECK_H_