Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: webrtc/common_video/h264/h264_bitstream_parser.h

Issue 2471973003: Allow H264 bitstream parser to fail gracefully (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/common_video/h264/h264_bitstream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/common_video/h264/h264_bitstream_parser.h
diff --git a/webrtc/common_video/h264/h264_bitstream_parser.h b/webrtc/common_video/h264/h264_bitstream_parser.h
index 0b84e4023417c67e226aad74f90ac237ae82066b..aa0155239a0eced499b928a82f106dfb0406cd35 100644
--- a/webrtc/common_video/h264/h264_bitstream_parser.h
+++ b/webrtc/common_video/h264/h264_bitstream_parser.h
@@ -31,6 +31,12 @@ namespace webrtc {
// bitstreams.
class H264BitstreamParser {
public:
+ enum Result {
+ kOk,
+ kInvalidStream,
+ kUnsupportedStream,
+ };
+
H264BitstreamParser();
virtual ~H264BitstreamParser();
@@ -42,9 +48,9 @@ class H264BitstreamParser {
protected:
void ParseSlice(const uint8_t* slice, size_t length);
- bool ParseNonParameterSetNalu(const uint8_t* source,
- size_t source_length,
- uint8_t nalu_type);
+ Result ParseNonParameterSetNalu(const uint8_t* source,
+ size_t source_length,
+ uint8_t nalu_type);
// SPS/PPS state, updated when parsing new SPS/PPS, used to parse slices.
rtc::Optional<SpsParser::SpsState> sps_;
« no previous file with comments | « no previous file | webrtc/common_video/h264/h264_bitstream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698