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

Unified Diff: media/formats/mp2t/es_parser_h264.h

Issue 497203004: Mpeg2 TS parser: Es parsing using an ES byte queue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add DCHECKs. Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/formats/mp2t/es_parser_adts.cc ('k') | media/formats/mp2t/es_parser_h264.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp2t/es_parser_h264.h
diff --git a/media/formats/mp2t/es_parser_h264.h b/media/formats/mp2t/es_parser_h264.h
index df09c88689f17b050c9ae3adaa1e68bab951afb0..dd9184d14207e8399248364b3efbeef30dfe9180 100644
--- a/media/formats/mp2t/es_parser_h264.h
+++ b/media/formats/mp2t/es_parser_h264.h
@@ -27,10 +27,14 @@ class OffsetByteQueue;
namespace media {
namespace mp2t {
-// Remark:
-// In this h264 parser, frame splitting is based on AUD nals.
+// A few remarks:
+// - In this h264 parser, frame splitting is based on AUD nals.
// Mpeg2 TS spec: "2.14 Carriage of Rec. ITU-T H.264 | ISO/IEC 14496-10 video"
// "Each AVC access unit shall contain an access unit delimiter NAL Unit;"
+// - PES packets do not necessarily map to an H264 access unit although the HLS
+// recommendation is to use one PES for each access unit. In this parser,
+// we handle the general case and do not make any assumption about the access
+// unit organization within PES packets.
//
class MEDIA_EXPORT EsParserH264 : public EsParser {
public:
@@ -41,17 +45,12 @@ class MEDIA_EXPORT EsParserH264 : public EsParser {
virtual ~EsParserH264();
// EsParser implementation.
- virtual bool Parse(const uint8* buf, int size,
- base::TimeDelta pts,
- DecodeTimestamp dts) OVERRIDE;
virtual void Flush() OVERRIDE;
- virtual void Reset() OVERRIDE;
private:
- struct TimingDesc {
- DecodeTimestamp dts;
- base::TimeDelta pts;
- };
+ // EsParser implementation.
+ virtual bool ParseFromEsQueue() OVERRIDE;
+ virtual void ResetInternal() OVERRIDE;
// Find the AUD located at or after |*stream_pos|.
// Return true if an AUD is found.
@@ -60,10 +59,6 @@ class MEDIA_EXPORT EsParserH264 : public EsParser {
// of the start code parser.
bool FindAUD(int64* stream_pos);
- // Resumes the H264 ES parsing.
- // Return true if successful.
- bool ParseInternal();
-
// Emit a frame whose position in the ES queue starts at |access_unit_pos|.
// Returns true if successful, false if no PTS is available for the frame.
bool EmitFrame(int64 access_unit_pos, int access_unit_size,
@@ -75,10 +70,6 @@ class MEDIA_EXPORT EsParserH264 : public EsParser {
EsAdapterVideo es_adapter_;
- // Bytes of the ES stream that have not been emitted yet.
- scoped_ptr<media::OffsetByteQueue> es_queue_;
- std::list<std::pair<int64, TimingDesc> > timing_desc_list_;
-
// H264 parser state.
// - |current_access_unit_pos_| is pointing to an annexB syncword
// representing the first NALU of an H264 access unit.
« no previous file with comments | « media/formats/mp2t/es_parser_adts.cc ('k') | media/formats/mp2t/es_parser_h264.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698