blob: 502918ec8af5f44555c5527eb6d95333100a32df [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <assert.h>
#include "decoder_core.h"
// This core is used for decoding all formats that aren't VP9 or HEVC, including
// MPEG-2 and h.264.
class Vdec1 : public DecoderCore {
Vdec1(Owner* owner) : owner_(owner) {}
~Vdec1() override {
// DecoderCore implementation.
[[nodiscard]] std::optional<InternalBuffer> LoadFirmwareToBuffer(const uint8_t* data,
uint32_t len) override;
[[nodiscard]] zx_status_t LoadFirmware(const uint8_t* data, uint32_t len) override;
[[nodiscard]] zx_status_t LoadFirmware(InternalBuffer& buffer) override;
void PowerOn() override;
void PowerOff() override;
void StartDecoding() override;
void StopDecoding() override;
void WaitForIdle() override;
void InitializeStreamInput(bool use_parser, uint32_t buffer_address,
uint32_t buffer_size) override;
void InitializeParserInput() override;
void InitializeDirectInput() override;
void UpdateWritePointer(uint32_t write_pointer) override;
uint32_t GetStreamInputOffset() override;
uint32_t GetReadOffset() override;
[[nodiscard]] zx_status_t InitializeInputContext(InputContext* context, bool is_secure) override;
zx_status_t SaveInputContext(InputContext* context) override;
zx_status_t RestoreInputContext(InputContext* context) override;
MmioRegisters* mmio() const { return owner_->mmio(); }
Owner* owner_;
bool powered_on_ = false;
bool decoding_started_ = false;