blob: 6e3bd2dc3395b8b370c3e4730d0ca459f4c8591b [file] [log] [blame]
// Copyright 2016 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_REMOTING_REMOTING_INTERSTITIAL_UI_H_
#define MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_
#include "base/memory/ref_counted.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace gfx {
class Size;
}
namespace media {
class VideoFrame;
enum RemotingInterstitialType {
BETWEEN_SESSIONS, // Show background image only.
IN_SESSION, // Show MEDIA_REMOTING_CASTING_VIDEO_TEXT.
ENCRYPTED_MEDIA_FATAL_ERROR, // Show MEDIA_REMOTING_CAST_ERROR_TEXT.
};
// Render an interstitial frame--a combination of |image| in the background
// along with a text message describing what is going on--and return it in a
// VideoFrame. |image| may be scaled accordingly without changing its aspect
// ratio. When it has a different aspect ratio than |natural_size|, a scaled
// |background_image| will be centered in the frame. When |image| is empty, a
// blank black background will be used.
//
// Threading note: This *must* be called on the main thread, because it uses
// Skia's font rendering facility, which loads/caches fonts on the main thread.
// http://crbug.com/687473.
scoped_refptr<VideoFrame> RenderInterstitialFrame(
const SkBitmap& image,
const gfx::Size& natural_size,
RemotingInterstitialType type);
} // namespace media
#endif // MEDIA_REMOTING_REMOTING_INTERSTITIAL_UI_H_