codes: Rename ComposeFrameHeader to ComposeFrame
These functions were composing the entire frame, not just the headers. Rename to more accurately describe them.
This commit is contained in:
parent
1994edfeb6
commit
c50f170597
|
@ -183,11 +183,11 @@ void Codec::Decode() {
|
|||
const auto& frame_data = [&]() {
|
||||
switch (current_codec) {
|
||||
case Tegra::NvdecCommon::VideoCodec::H264:
|
||||
return h264_decoder->ComposeFrameHeader(state, is_first_frame);
|
||||
return h264_decoder->ComposeFrame(state, is_first_frame);
|
||||
case Tegra::NvdecCommon::VideoCodec::VP8:
|
||||
return vp8_decoder->ComposeFrameHeader(state);
|
||||
return vp8_decoder->ComposeFrame(state);
|
||||
case Tegra::NvdecCommon::VideoCodec::VP9:
|
||||
vp9_decoder->ComposeFrameHeader(state);
|
||||
vp9_decoder->ComposeFrame(state);
|
||||
vp9_hidden_frame = vp9_decoder->WasFrameHidden();
|
||||
return vp9_decoder->GetFrameBytes();
|
||||
default:
|
||||
|
|
|
@ -45,7 +45,7 @@ H264::H264(GPU& gpu_) : gpu(gpu_) {}
|
|||
|
||||
H264::~H264() = default;
|
||||
|
||||
const std::vector<u8>& H264::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state,
|
||||
const std::vector<u8>& H264::ComposeFrame(const NvdecCommon::NvdecRegisters& state,
|
||||
bool is_first_frame) {
|
||||
H264DecoderContext context;
|
||||
gpu.MemoryManager().ReadBlock(state.picture_info_offset, &context, sizeof(H264DecoderContext));
|
||||
|
|
|
@ -75,9 +75,9 @@ public:
|
|||
explicit H264(GPU& gpu);
|
||||
~H264();
|
||||
|
||||
/// Compose the H264 header of the frame for FFmpeg decoding
|
||||
[[nodiscard]] const std::vector<u8>& ComposeFrameHeader(
|
||||
const NvdecCommon::NvdecRegisters& state, bool is_first_frame = false);
|
||||
/// Compose the H264 frame for FFmpeg decoding
|
||||
[[nodiscard]] const std::vector<u8>& ComposeFrame(const NvdecCommon::NvdecRegisters& state,
|
||||
bool is_first_frame = false);
|
||||
|
||||
private:
|
||||
std::vector<u8> frame;
|
||||
|
|
|
@ -14,7 +14,7 @@ VP8::VP8(GPU& gpu_) : gpu(gpu_) {}
|
|||
|
||||
VP8::~VP8() = default;
|
||||
|
||||
const std::vector<u8>& VP8::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state) {
|
||||
const std::vector<u8>& VP8::ComposeFrame(const NvdecCommon::NvdecRegisters& state) {
|
||||
VP8PictureInfo info;
|
||||
gpu.MemoryManager().ReadBlock(state.picture_info_offset, &info, sizeof(VP8PictureInfo));
|
||||
|
||||
|
|
|
@ -20,9 +20,8 @@ public:
|
|||
explicit VP8(GPU& gpu);
|
||||
~VP8();
|
||||
|
||||
/// Compose the VP8 header of the frame for FFmpeg decoding
|
||||
[[nodiscard]] const std::vector<u8>& ComposeFrameHeader(
|
||||
const NvdecCommon::NvdecRegisters& state);
|
||||
/// Compose the VP8 frame for FFmpeg decoding
|
||||
[[nodiscard]] const std::vector<u8>& ComposeFrame(const NvdecCommon::NvdecRegisters& state);
|
||||
|
||||
private:
|
||||
std::vector<u8> frame;
|
||||
|
|
|
@ -770,7 +770,7 @@ VpxBitStreamWriter VP9::ComposeUncompressedHeader() {
|
|||
return uncomp_writer;
|
||||
}
|
||||
|
||||
void VP9::ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state) {
|
||||
void VP9::ComposeFrame(const NvdecCommon::NvdecRegisters& state) {
|
||||
std::vector<u8> bitstream;
|
||||
{
|
||||
Vp9FrameContainer curr_frame = GetCurrentFrame(state);
|
||||
|
|
|
@ -118,13 +118,14 @@ public:
|
|||
|
||||
/// Composes the VP9 frame from the GPU state information.
|
||||
/// Based on the official VP9 spec documentation
|
||||
void ComposeFrameHeader(const NvdecCommon::NvdecRegisters& state);
|
||||
void ComposeFrame(const NvdecCommon::NvdecRegisters& state);
|
||||
|
||||
/// Returns true if the most recent frame was a hidden frame.
|
||||
[[nodiscard]] bool WasFrameHidden() const {
|
||||
return !current_frame_info.show_frame;
|
||||
}
|
||||
|
||||
/// Returns a const reference to the composed frame data.
|
||||
[[nodiscard]] const std::vector<u8>& GetFrameBytes() const {
|
||||
return frame;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue