blob: 56e4a29684fea0fd1a51d7287c7109a396841ae4 [file] [log] [blame]
// Copyright 2018 The Cobalt Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file contains the implementation of methods from
// starboard::player::filter::VideoDecoder for the VideoDecoder class that are
// the same for dynamically loaded and linked implementation for the ffmpeg
// library.
#include "starboard/shared/ffmpeg/ffmpeg_video_decoder.h"
namespace starboard {
namespace shared {
namespace starboard {
namespace player {
namespace filter {
// static
bool VideoDecoder::OutputModeSupported(SbPlayerOutputMode output_mode,
SbMediaVideoCodec codec,
SbDrmSystem drm_system) {
SB_UNREFERENCED_PARAMETER(codec);
SB_UNREFERENCED_PARAMETER(drm_system);
#if SB_HAS(BLITTER)
return output_mode == kSbPlayerOutputModePunchOut;
#endif
#if defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
// Starboard lib targets may not draw directly to the window, so punch through
// video is not made available.
return output_mode == kSbPlayerOutputModeDecodeToTexture;
#endif // defined(SB_FORCE_DECODE_TO_TEXTURE_ONLY)
if (output_mode == kSbPlayerOutputModePunchOut ||
output_mode == kSbPlayerOutputModeDecodeToTexture) {
return true;
}
return false;
}
} // namespace filter
} // namespace player
} // namespace starboard
} // namespace shared
} // namespace starboard