OLD | NEW |
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> |
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 // To get a pointer to a given SPS/PPS structure, use GetSPS()/GetPPS(), | 379 // To get a pointer to a given SPS/PPS structure, use GetSPS()/GetPPS(), |
380 // passing the returned |*sps_id|/|*pps_id| as parameter. | 380 // passing the returned |*sps_id|/|*pps_id| as parameter. |
381 // TODO(posciak,fischman): consider replacing returning Result from Parse*() | 381 // TODO(posciak,fischman): consider replacing returning Result from Parse*() |
382 // methods with a scoped_ptr and adding an AtEOS() function to check for EOS | 382 // methods with a scoped_ptr and adding an AtEOS() function to check for EOS |
383 // if Parse*() return NULL. | 383 // if Parse*() return NULL. |
384 Result ParseSPS(int* sps_id); | 384 Result ParseSPS(int* sps_id); |
385 Result ParsePPS(int* pps_id); | 385 Result ParsePPS(int* pps_id); |
386 | 386 |
387 // Return a pointer to SPS/PPS with given |sps_id|/|pps_id| or NULL if not | 387 // Return a pointer to SPS/PPS with given |sps_id|/|pps_id| or NULL if not |
388 // present. | 388 // present. |
389 const H264SPS* GetSPS(int sps_id); | 389 const H264SPS* GetSPS(int sps_id) const; |
390 const H264PPS* GetPPS(int pps_id); | 390 const H264PPS* GetPPS(int pps_id) const; |
391 | 391 |
392 // Slice headers and SEI messages are not used across NALUs by the parser | 392 // Slice headers and SEI messages are not used across NALUs by the parser |
393 // and can be discarded after current NALU, so the parser does not store | 393 // and can be discarded after current NALU, so the parser does not store |
394 // them, nor does it manage their memory. | 394 // them, nor does it manage their memory. |
395 // The caller has to provide and manage it instead. | 395 // The caller has to provide and manage it instead. |
396 | 396 |
397 // Parse a slice header, returning it in |*shdr|. |*nalu| must be set to | 397 // Parse a slice header, returning it in |*shdr|. |*nalu| must be set to |
398 // the NALU returned from AdvanceToNextNALU() and corresponding to |*shdr|. | 398 // the NALU returned from AdvanceToNextNALU() and corresponding to |*shdr|. |
399 Result ParseSliceHeader(const H264NALU& nalu, H264SliceHeader* shdr); | 399 Result ParseSliceHeader(const H264NALU& nalu, H264SliceHeader* shdr); |
400 | 400 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 // Ranges of encrypted bytes in the buffer passed to | 464 // Ranges of encrypted bytes in the buffer passed to |
465 // SetEncryptedStream(). | 465 // SetEncryptedStream(). |
466 Ranges<const uint8*> encrypted_ranges_; | 466 Ranges<const uint8*> encrypted_ranges_; |
467 | 467 |
468 DISALLOW_COPY_AND_ASSIGN(H264Parser); | 468 DISALLOW_COPY_AND_ASSIGN(H264Parser); |
469 }; | 469 }; |
470 | 470 |
471 } // namespace media | 471 } // namespace media |
472 | 472 |
473 #endif // MEDIA_FILTERS_H264_PARSER_H_ | 473 #endif // MEDIA_FILTERS_H264_PARSER_H_ |
OLD | NEW |