diff options
| -rw-r--r-- | src/video_core/command_classes/codecs/codec.h | 6 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/h264.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/h264.h | 10 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/vp9.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/vp9.h | 2 | ||||
| -rw-r--r-- | src/video_core/command_classes/codecs/vp9_types.h | 5 | ||||
| -rw-r--r-- | src/video_core/command_classes/nvdec.h | 4 |
7 files changed, 16 insertions, 16 deletions
diff --git a/src/video_core/command_classes/codecs/codec.h b/src/video_core/command_classes/codecs/codec.h index cb67094f6..5bbe6a332 100644 --- a/src/video_core/command_classes/codecs/codec.h +++ b/src/video_core/command_classes/codecs/codec.h | |||
| @@ -42,11 +42,11 @@ public: | |||
| 42 | void Decode(); | 42 | void Decode(); |
| 43 | 43 | ||
| 44 | /// Returns most recently decoded frame | 44 | /// Returns most recently decoded frame |
| 45 | AVFrame* GetCurrentFrame(); | 45 | [[nodiscard]] AVFrame* GetCurrentFrame(); |
| 46 | const AVFrame* GetCurrentFrame() const; | 46 | [[nodiscard]] const AVFrame* GetCurrentFrame() const; |
| 47 | 47 | ||
| 48 | /// Returns the value of current_codec | 48 | /// Returns the value of current_codec |
| 49 | NvdecCommon::VideoCodec GetCurrentCodec() const; | 49 | [[nodiscard]] NvdecCommon::VideoCodec GetCurrentCodec() const; |
| 50 | 50 | ||
| 51 | private: | 51 | private: |
| 52 | bool initialized{}; | 52 | bool initialized{}; |
diff --git a/src/video_core/command_classes/codecs/h264.cpp b/src/video_core/command_classes/codecs/h264.cpp index 549a40f52..33e063e20 100644 --- a/src/video_core/command_classes/codecs/h264.cpp +++ b/src/video_core/command_classes/codecs/h264.cpp | |||
| @@ -43,7 +43,8 @@ H264::H264(GPU& gpu_) : gpu(gpu_) {} | |||
| 43 | 43 | ||
| 44 | H264::~H264() = default; | 44 | H264::~H264() = default; |
| 45 | 45 | ||
| 46 | std::vector<u8>& H264::ComposeFrameHeader(NvdecCommon::NvdecRegisters& state, bool is_first_frame) { | 46 | const std::vector<u8>& H264::ComposeFrameHeader(NvdecCommon::NvdecRegisters& state, |
| 47 | bool is_first_frame) { | ||
| 47 | H264DecoderContext context{}; | 48 | H264DecoderContext context{}; |
| 48 | gpu.MemoryManager().ReadBlock(state.picture_info_offset, &context, sizeof(H264DecoderContext)); | 49 | gpu.MemoryManager().ReadBlock(state.picture_info_offset, &context, sizeof(H264DecoderContext)); |
| 49 | 50 | ||
diff --git a/src/video_core/command_classes/codecs/h264.h b/src/video_core/command_classes/codecs/h264.h index f2292fd2f..273449495 100644 --- a/src/video_core/command_classes/codecs/h264.h +++ b/src/video_core/command_classes/codecs/h264.h | |||
| @@ -51,14 +51,14 @@ public: | |||
| 51 | void WriteScalingList(const std::vector<u8>& list, s32 start, s32 count); | 51 | void WriteScalingList(const std::vector<u8>& list, s32 start, s32 count); |
| 52 | 52 | ||
| 53 | /// Return the bitstream as a vector. | 53 | /// Return the bitstream as a vector. |
| 54 | std::vector<u8>& GetByteArray(); | 54 | [[nodiscard]] std::vector<u8>& GetByteArray(); |
| 55 | const std::vector<u8>& GetByteArray() const; | 55 | [[nodiscard]] const std::vector<u8>& GetByteArray() const; |
| 56 | 56 | ||
| 57 | private: | 57 | private: |
| 58 | void WriteBits(s32 value, s32 bit_count); | 58 | void WriteBits(s32 value, s32 bit_count); |
| 59 | void WriteExpGolombCodedInt(s32 value); | 59 | void WriteExpGolombCodedInt(s32 value); |
| 60 | void WriteExpGolombCodedUInt(u32 value); | 60 | void WriteExpGolombCodedUInt(u32 value); |
| 61 | s32 GetFreeBufferBits(); | 61 | [[nodiscard]] s32 GetFreeBufferBits(); |
| 62 | void Flush(); | 62 | void Flush(); |
| 63 | 63 | ||
| 64 | s32 buffer_size{8}; | 64 | s32 buffer_size{8}; |
| @@ -74,8 +74,8 @@ public: | |||
| 74 | ~H264(); | 74 | ~H264(); |
| 75 | 75 | ||
| 76 | /// Compose the H264 header of the frame for FFmpeg decoding | 76 | /// Compose the H264 header of the frame for FFmpeg decoding |
| 77 | std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state, | 77 | [[nodiscard]] const std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state, |
| 78 | bool is_first_frame = false); | 78 | bool is_first_frame = false); |
| 79 | 79 | ||
| 80 | private: | 80 | private: |
| 81 | struct H264ParameterSet { | 81 | struct H264ParameterSet { |
diff --git a/src/video_core/command_classes/codecs/vp9.cpp b/src/video_core/command_classes/codecs/vp9.cpp index 42520f856..ab44fdc9e 100644 --- a/src/video_core/command_classes/codecs/vp9.cpp +++ b/src/video_core/command_classes/codecs/vp9.cpp | |||
| @@ -854,7 +854,7 @@ VpxBitStreamWriter VP9::ComposeUncompressedHeader() { | |||
| 854 | return uncomp_writer; | 854 | return uncomp_writer; |
| 855 | } | 855 | } |
| 856 | 856 | ||
| 857 | std::vector<u8>& VP9::ComposeFrameHeader(NvdecCommon::NvdecRegisters& state) { | 857 | const std::vector<u8>& VP9::ComposeFrameHeader(NvdecCommon::NvdecRegisters& state) { |
| 858 | std::vector<u8> bitstream; | 858 | std::vector<u8> bitstream; |
| 859 | { | 859 | { |
| 860 | Vp9FrameContainer curr_frame = GetCurrentFrame(state); | 860 | Vp9FrameContainer curr_frame = GetCurrentFrame(state); |
diff --git a/src/video_core/command_classes/codecs/vp9.h b/src/video_core/command_classes/codecs/vp9.h index 05c9682fa..e2504512c 100644 --- a/src/video_core/command_classes/codecs/vp9.h +++ b/src/video_core/command_classes/codecs/vp9.h | |||
| @@ -119,7 +119,7 @@ public: | |||
| 119 | 119 | ||
| 120 | /// Composes the VP9 frame from the GPU state information. Based on the official VP9 spec | 120 | /// Composes the VP9 frame from the GPU state information. Based on the official VP9 spec |
| 121 | /// documentation | 121 | /// documentation |
| 122 | std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state); | 122 | [[nodiscard]] const std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state); |
| 123 | 123 | ||
| 124 | /// Returns true if the most recent frame was a hidden frame. | 124 | /// Returns true if the most recent frame was a hidden frame. |
| 125 | [[nodiscard]] bool WasFrameHidden() const { | 125 | [[nodiscard]] bool WasFrameHidden() const { |
diff --git a/src/video_core/command_classes/codecs/vp9_types.h b/src/video_core/command_classes/codecs/vp9_types.h index a50acf6e8..4f0b05d22 100644 --- a/src/video_core/command_classes/codecs/vp9_types.h +++ b/src/video_core/command_classes/codecs/vp9_types.h | |||
| @@ -231,9 +231,8 @@ struct PictureInfo { | |||
| 231 | u32 surface_params{}; | 231 | u32 surface_params{}; |
| 232 | INSERT_PADDING_WORDS(3); | 232 | INSERT_PADDING_WORDS(3); |
| 233 | 233 | ||
| 234 | Vp9PictureInfo Convert() const { | 234 | [[nodiscard]] Vp9PictureInfo Convert() const { |
| 235 | 235 | return { | |
| 236 | return Vp9PictureInfo{ | ||
| 237 | .is_key_frame = (vp9_flags & FrameFlags::IsKeyFrame) != 0, | 236 | .is_key_frame = (vp9_flags & FrameFlags::IsKeyFrame) != 0, |
| 238 | .intra_only = (vp9_flags & FrameFlags::IntraOnly) != 0, | 237 | .intra_only = (vp9_flags & FrameFlags::IntraOnly) != 0, |
| 239 | .last_frame_was_key = (vp9_flags & FrameFlags::LastFrameIsKeyFrame) != 0, | 238 | .last_frame_was_key = (vp9_flags & FrameFlags::LastFrameIsKeyFrame) != 0, |
diff --git a/src/video_core/command_classes/nvdec.h b/src/video_core/command_classes/nvdec.h index af14f9857..eec4443f9 100644 --- a/src/video_core/command_classes/nvdec.h +++ b/src/video_core/command_classes/nvdec.h | |||
| @@ -26,8 +26,8 @@ public: | |||
| 26 | void ProcessMethod(Method method, const std::vector<u32>& arguments); | 26 | void ProcessMethod(Method method, const std::vector<u32>& arguments); |
| 27 | 27 | ||
| 28 | /// Return most recently decoded frame | 28 | /// Return most recently decoded frame |
| 29 | AVFrame* GetFrame(); | 29 | [[nodiscard]] AVFrame* GetFrame(); |
| 30 | const AVFrame* GetFrame() const; | 30 | [[nodiscard]] const AVFrame* GetFrame() const; |
| 31 | 31 | ||
| 32 | private: | 32 | private: |
| 33 | /// Invoke codec to decode a frame | 33 | /// Invoke codec to decode a frame |