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

Side by Side Diff: media/filters/h264_parser.h

Issue 246853005: Fix SPS/PPS insertion logic in MP4StreamParser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address CR comments Created 6 years, 8 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/formats/mp4/avc.h » ('j') | media/formats/mp4/avc.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This file contains an implementation of an H264 Annex-B video stream parser. 5 // This file contains an implementation of an H264 Annex-B video stream parser.
6 6
7 #ifndef MEDIA_FILTERS_H264_PARSER_H_ 7 #ifndef MEDIA_FILTERS_H264_PARSER_H_
8 #define MEDIA_FILTERS_H264_PARSER_H_ 8 #define MEDIA_FILTERS_H264_PARSER_H_
9 9
10 #include <sys/types.h> 10 #include <sys/types.h>
11 11
12 #include <map> 12 #include <map>
13 13
14 #include "base/basictypes.h" 14 #include "base/basictypes.h"
15 #include "media/base/media_export.h" 15 #include "media/base/media_export.h"
16 #include "media/filters/h264_bit_reader.h" 16 #include "media/filters/h264_bit_reader.h"
17 17
18 namespace media { 18 namespace media {
19 19
20 // For explanations of each struct and its members, see H.264 specification 20 // For explanations of each struct and its members, see H.264 specification
21 // at http://www.itu.int/rec/T-REC-H.264. 21 // at http://www.itu.int/rec/T-REC-H.264.
22 struct MEDIA_EXPORT H264NALU { 22 struct MEDIA_EXPORT H264NALU {
23 H264NALU(); 23 H264NALU();
24 24
25 enum Type { 25 enum Type {
26 kUnspecified = 0, 26 kUnspecified = 0,
27 kNonIDRSlice = 1, 27 kNonIDRSlice = 1,
28 kSliceDataA = 2,
29 kSliceDataB = 3,
30 kSliceDataC = 4,
28 kIDRSlice = 5, 31 kIDRSlice = 5,
29 kSEIMessage = 6, 32 kSEIMessage = 6,
30 kSPS = 7, 33 kSPS = 7,
31 kPPS = 8, 34 kPPS = 8,
32 kAUD = 9, 35 kAUD = 9,
33 kEOSeq = 10, 36 kEOSeq = 10,
34 kEOStream = 11, 37 kEOStream = 11,
38 kFiller = 12,
39 kSPSExt = 13,
40 kReserved14 = 14,
41 kReserved15 = 15,
42 kReserved16 = 16,
43 kReserved17 = 17,
44 kReserved18 = 18,
45 kCodedSliceAux = 19,
35 kCodedSliceExtension = 20, 46 kCodedSliceExtension = 20,
36 }; 47 };
37 48
38 // After (without) start code; we don't own the underlying memory 49 // After (without) start code; we don't own the underlying memory
39 // and a shallow copy should be made when copying this struct. 50 // and a shallow copy should be made when copying this struct.
40 const uint8* data; 51 const uint8* data;
41 off_t size; // From after start code to start code of next NALU (or EOS). 52 off_t size; // From after start code to start code of next NALU (or EOS).
42 53
43 int nal_ref_idc; 54 int nal_ref_idc;
44 int nal_unit_type; 55 int nal_unit_type;
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 typedef std::map<int, H264PPS*> PPSById; 401 typedef std::map<int, H264PPS*> PPSById;
391 SPSById active_SPSes_; 402 SPSById active_SPSes_;
392 PPSById active_PPSes_; 403 PPSById active_PPSes_;
393 404
394 DISALLOW_COPY_AND_ASSIGN(H264Parser); 405 DISALLOW_COPY_AND_ASSIGN(H264Parser);
395 }; 406 };
396 407
397 } // namespace media 408 } // namespace media
398 409
399 #endif // MEDIA_FILTERS_H264_PARSER_H_ 410 #endif // MEDIA_FILTERS_H264_PARSER_H_
OLDNEW
« no previous file with comments | « no previous file | media/formats/mp4/avc.h » ('j') | media/formats/mp4/avc.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698