blob: e2d6af45336dcf693f896f86df416156fa7b981b [file] [log] [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "media/gpu/v4l2/v4l2_stateful_video_decoder.h"
#include "base/memory/ptr_util.h"
#include "media/base/media_log.h"
#include "media/gpu/macros.h"
namespace media {
// static
std::unique_ptr<VideoDecoderMixin> V4L2StatefulVideoDecoder::Create(
std::unique_ptr<MediaLog> media_log,
scoped_refptr<base::SequencedTaskRunner> task_runner,
base::WeakPtr<VideoDecoderMixin::Client> client) {
DCHECK(task_runner->RunsTasksInCurrentSequence());
DCHECK(client);
return base::WrapUnique<VideoDecoderMixin>(new V4L2StatefulVideoDecoder(
std::move(media_log), std::move(task_runner), std::move(client)));
}
// static
absl::optional<SupportedVideoDecoderConfigs>
V4L2StatefulVideoDecoder::GetSupportedConfigs() {
NOTIMPLEMENTED();
return absl::nullopt;
}
void V4L2StatefulVideoDecoder::Initialize(const VideoDecoderConfig& config,
bool /*low_delay*/,
CdmContext* cdm_context,
InitCB init_cb,
const OutputCB& output_cb,
const WaitingCB& /*waiting_cb*/) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(config.IsValidConfig());
DVLOGF(1) << config.AsHumanReadableString();
NOTIMPLEMENTED();
}
void V4L2StatefulVideoDecoder::Decode(scoped_refptr<DecoderBuffer> buffer,
DecodeCB decode_cb) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOGF(3) << buffer->AsHumanReadableString(/*verbose=*/false);
NOTIMPLEMENTED();
}
void V4L2StatefulVideoDecoder::Reset(base::OnceClosure closure) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOGF(2);
NOTIMPLEMENTED();
}
bool V4L2StatefulVideoDecoder::NeedsBitstreamConversion() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED() << "Our only owner VideoDecoderPipeline never calls here";
return false;
}
bool V4L2StatefulVideoDecoder::CanReadWithoutStalling() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED() << "Our only owner VideoDecoderPipeline never calls here";
return true;
}
int V4L2StatefulVideoDecoder::GetMaxDecodeRequests() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED() << "Our only owner VideoDecoderPipeline never calls here";
return 4;
}
VideoDecoderType V4L2StatefulVideoDecoder::GetDecoderType() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED() << "Our only owner VideoDecoderPipeline never calls here";
return VideoDecoderType::kV4L2;
}
bool V4L2StatefulVideoDecoder::IsPlatformDecoder() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTREACHED() << "Our only owner VideoDecoderPipeline never calls here";
return true;
}
void V4L2StatefulVideoDecoder::ApplyResolutionChange() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOGF(2);
NOTIMPLEMENTED();
}
size_t V4L2StatefulVideoDecoder::GetMaxOutputFramePoolSize() const {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTIMPLEMENTED();
return 0;
}
void V4L2StatefulVideoDecoder::SetDmaIncoherentV4L2(bool incoherent) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
NOTIMPLEMENTED();
}
V4L2StatefulVideoDecoder::V4L2StatefulVideoDecoder(
std::unique_ptr<MediaLog> media_log,
scoped_refptr<base::SequencedTaskRunner> task_runner,
base::WeakPtr<VideoDecoderMixin::Client> client)
: VideoDecoderMixin(std::move(media_log),
std::move(task_runner),
std::move(client)) {
DCHECK(task_runner->RunsTasksInCurrentSequence());
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOGF(1);
}
V4L2StatefulVideoDecoder::~V4L2StatefulVideoDecoder() {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DVLOGF(1);
}
} // namespace media