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

Side by Side Diff: media/base/stream_parser_buffer.h

Issue 240123004: Simplify AudioSplicer logic which slots buffers before or after a splice point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « media/base/audio_splicer_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_BASE_STREAM_PARSER_BUFFER_H_ 5 #ifndef MEDIA_BASE_STREAM_PARSER_BUFFER_H_
6 #define MEDIA_BASE_STREAM_PARSER_BUFFER_H_ 6 #define MEDIA_BASE_STREAM_PARSER_BUFFER_H_
7 7
8 #include <deque> 8 #include <deque>
9 9
10 #include "media/base/decoder_buffer.h" 10 #include "media/base/decoder_buffer.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 Type type() const { return type_; } 47 Type type() const { return type_; }
48 48
49 // Gets the parser's track ID associated with this buffer. Value is 49 // Gets the parser's track ID associated with this buffer. Value is
50 // meaningless for EOS buffers. 50 // meaningless for EOS buffers.
51 TrackId track_id() const { return track_id_; } 51 TrackId track_id() const { return track_id_; }
52 52
53 // Converts this buffer to a splice buffer. |pre_splice_buffers| must not 53 // Converts this buffer to a splice buffer. |pre_splice_buffers| must not
54 // have any EOS buffers and must not have any nested splice buffers. 54 // have any EOS buffers and must not have any nested splice buffers.
55 // 55 //
56 // |pre_splice_buffers| will be deep copied and each copy's splice_timestamp() 56 // |pre_splice_buffers| will be deep copied and each copy's splice_timestamp()
57 // will be set to this buffer's splice_timestamp(). A copy of |this| will be 57 // will be set to this buffer's splice_timestamp(). A copy of |this|, with a
58 // added to the end of |splice_buffers_|. 58 // splice_timestamp() of kNoTimestamp(), will be added to the end of
59 // |splice_buffers_|.
59 // 60 //
60 // See the Audio Splice Frame Algorithm in the MSE specification for details. 61 // See the Audio Splice Frame Algorithm in the MSE specification for details.
61 typedef StreamParser::BufferQueue BufferQueue; 62 typedef StreamParser::BufferQueue BufferQueue;
62 void ConvertToSpliceBuffer(const BufferQueue& pre_splice_buffers); 63 void ConvertToSpliceBuffer(const BufferQueue& pre_splice_buffers);
63 const BufferQueue& get_splice_buffers() const { return splice_buffers_; } 64 const BufferQueue& get_splice_buffers() const { return splice_buffers_; }
64 65
65 private: 66 private:
66 StreamParserBuffer(const uint8* data, int data_size, 67 StreamParserBuffer(const uint8* data, int data_size,
67 const uint8* side_data, int side_data_size, 68 const uint8* side_data, int side_data_size,
68 bool is_keyframe, Type type, 69 bool is_keyframe, Type type,
69 TrackId track_id); 70 TrackId track_id);
70 virtual ~StreamParserBuffer(); 71 virtual ~StreamParserBuffer();
71 72
72 bool is_keyframe_; 73 bool is_keyframe_;
73 base::TimeDelta decode_timestamp_; 74 base::TimeDelta decode_timestamp_;
74 int config_id_; 75 int config_id_;
75 Type type_; 76 Type type_;
76 TrackId track_id_; 77 TrackId track_id_;
77 78
78 BufferQueue splice_buffers_; 79 BufferQueue splice_buffers_;
79 80
80 DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer); 81 DISALLOW_COPY_AND_ASSIGN(StreamParserBuffer);
81 }; 82 };
82 83
83 } // namespace media 84 } // namespace media
84 85
85 #endif // MEDIA_BASE_STREAM_PARSER_BUFFER_H_ 86 #endif // MEDIA_BASE_STREAM_PARSER_BUFFER_H_
OLDNEW
« no previous file with comments | « media/base/audio_splicer_unittest.cc ('k') | media/filters/audio_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698