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

Side by Side Diff: media/webm/webm_stream_parser.h

Issue 10803019: Chrome-side implementation of media source timestamp offset (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef MEDIA_WEBM_WEBM_STREAM_PARSER_H_ 5 #ifndef MEDIA_WEBM_WEBM_STREAM_PARSER_H_
6 #define MEDIA_WEBM_WEBM_STREAM_PARSER_H_ 6 #define MEDIA_WEBM_WEBM_STREAM_PARSER_H_
7 7
8 #include "base/callback_forward.h" 8 #include "base/callback_forward.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "media/base/audio_decoder_config.h" 10 #include "media/base/audio_decoder_config.h"
(...skipping 11 matching lines...) Expand all
22 virtual ~WebMStreamParser(); 22 virtual ~WebMStreamParser();
23 23
24 // StreamParser implementation. 24 // StreamParser implementation.
25 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb, 25 virtual void Init(const InitCB& init_cb, const NewConfigCB& config_cb,
26 const NewBuffersCB& audio_cb, 26 const NewBuffersCB& audio_cb,
27 const NewBuffersCB& video_cb, 27 const NewBuffersCB& video_cb,
28 const NeedKeyCB& need_key_cb, 28 const NeedKeyCB& need_key_cb,
29 const NewMediaSegmentCB& new_segment_cb) OVERRIDE; 29 const NewMediaSegmentCB& new_segment_cb) OVERRIDE;
30 virtual void Flush() OVERRIDE; 30 virtual void Flush() OVERRIDE;
31 virtual bool Parse(const uint8* buf, int size) OVERRIDE; 31 virtual bool Parse(const uint8* buf, int size) OVERRIDE;
32 virtual void SetTimestampOffset(base::TimeDelta offset) OVERRIDE;
33 virtual void ClearTimestampOffset() OVERRIDE;
32 34
33 private: 35 private:
34 enum State { 36 enum State {
35 kWaitingForInit, 37 kWaitingForInit,
36 kParsingHeaders, 38 kParsingHeaders,
37 kParsingClusters, 39 kParsingClusters,
38 kError 40 kError
39 }; 41 };
40 42
41 void ChangeState(State new_state); 43 void ChangeState(State new_state);
(...skipping 25 matching lines...) Expand all
67 NeedKeyCB need_key_cb_; 69 NeedKeyCB need_key_cb_;
68 NewMediaSegmentCB new_segment_cb_; 70 NewMediaSegmentCB new_segment_cb_;
69 71
70 // True if a new cluster id has been seen, but no audio or video buffers have 72 // True if a new cluster id has been seen, but no audio or video buffers have
71 // been parsed yet. 73 // been parsed yet.
72 bool waiting_for_buffers_; 74 bool waiting_for_buffers_;
73 75
74 scoped_ptr<WebMClusterParser> cluster_parser_; 76 scoped_ptr<WebMClusterParser> cluster_parser_;
75 ByteQueue byte_queue_; 77 ByteQueue byte_queue_;
76 78
79 base::TimeDelta timestamp_offset_;
80
77 DISALLOW_COPY_AND_ASSIGN(WebMStreamParser); 81 DISALLOW_COPY_AND_ASSIGN(WebMStreamParser);
78 }; 82 };
79 83
80 } // namespace media 84 } // namespace media
81 85
82 #endif // MEDIA_WEBM_WEBM_STREAM_PARSER_H_ 86 #endif // MEDIA_WEBM_WEBM_STREAM_PARSER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698