shadPS4/src/core/libraries/videodec/videodec_impl.h
georgemoralis 7ab851592b
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled
Videocodec implementation (#1484)
* dummy videocodec

* filled videodec parameters

* vdec1 implementation

* clang format fix

* fixed codecType

* added crop offset info

* align output

* align all h/w

* some touchups

* small touch (last one)
2024-11-10 11:33:08 +02:00

38 lines
985 B
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <vector>
#include "videodec.h"
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavutil/imgutils.h>
#include <libswscale/swscale.h>
}
namespace Libraries::Videodec {
class VdecDecoder {
public:
VdecDecoder(const OrbisVideodecConfigInfo& pCfgInfoIn,
const OrbisVideodecResourceInfo& pRsrcInfoIn);
~VdecDecoder();
s32 Decode(const OrbisVideodecInputData& pInputDataIn,
OrbisVideodecFrameBuffer& pFrameBufferInOut,
OrbisVideodecPictureInfo& pPictureInfoOut);
s32 Flush(OrbisVideodecFrameBuffer& pFrameBufferInOut,
OrbisVideodecPictureInfo& pPictureInfoOut);
s32 Reset();
private:
AVFrame* ConvertNV12Frame(AVFrame& frame);
private:
AVCodecContext* mCodecContext = nullptr;
SwsContext* mSwsContext = nullptr;
};
} // namespace Libraries::Videodec