aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/command_classes/codecs/h264.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-10-30 16:13:29 -0400
committerLioncash <mathew1800@gmail.com>2020-11-02 02:45:15 -0500
commit4f0f481f63d0d5587a6d6d319f9815de87ed79ec (patch)
treee35c6800340cec5f104e094a377c69ccc3dd101f /src/video_core/command_classes/codecs/h264.h
parent14a97d082e996a22ff8aa7b57c3ed6fe5912b9cf (diff)
nvdec: Make use of [[nodiscard]] where applicable
Prevents bugs from occurring where the results of a function are accidentally discarded
Diffstat (limited to 'src/video_core/command_classes/codecs/h264.h')
-rw-r--r--src/video_core/command_classes/codecs/h264.h10
1 files changed, 5 insertions, 5 deletions
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:
void WriteScalingList(const std::vector<u8>& list, s32 start, s32 count);
/// Return the bitstream as a vector.
- std::vector<u8>& GetByteArray();
- const std::vector<u8>& GetByteArray() const;
+ [[nodiscard]] std::vector<u8>& GetByteArray();
+ [[nodiscard]] const std::vector<u8>& GetByteArray() const;
private:
void WriteBits(s32 value, s32 bit_count);
void WriteExpGolombCodedInt(s32 value);
void WriteExpGolombCodedUInt(u32 value);
- s32 GetFreeBufferBits();
+ [[nodiscard]] s32 GetFreeBufferBits();
void Flush();
s32 buffer_size{8};
@@ -74,8 +74,8 @@ public:
~H264();
/// Compose the H264 header of the frame for FFmpeg decoding
- std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state,
- bool is_first_frame = false);
+ [[nodiscard]] const std::vector<u8>& ComposeFrameHeader(NvdecCommon::NvdecRegisters& state,
+ bool is_first_frame = false);
private:
struct H264ParameterSet {