Chromium Code Reviews| Index: media/base/stream_parser.h |
| diff --git a/media/base/stream_parser.h b/media/base/stream_parser.h |
| index 39dbc34f928b6b321d533065b912472d08616dd0..282d617b439fb2eb42a1675c74eaad5a89dff9bb 100644 |
| --- a/media/base/stream_parser.h |
| +++ b/media/base/stream_parser.h |
| @@ -8,6 +8,7 @@ |
| #include <deque> |
| #include <map> |
| #include <string> |
| +#include <vector> |
| #include "base/callback_forward.h" |
| #include "base/memory/ref_counted.h" |
| @@ -107,7 +108,27 @@ class MEDIA_EXPORT StreamParser { |
| // Returns true if the parse succeeds. |
| virtual bool Parse(const uint8* buf, int size) = 0; |
| + // Appends to |merged_buffers| the provided buffers in decode-timestamp order. |
| + // Any previous contents of |merged_buffers| is assumed to have lower |
| + // decode timestamps versus the provided buffers. All provided buffer queues |
| + // are assumed to already be in decode-timestamp order. |
| + // Returns false if any of the provided audio/video/text buffers are found |
| + // to not be in decode timestamp order, or have a decode timestamp less than |
| + // the last buffer, if any, in |merged_buffers|. Partial results may exist |
| + // in |merged_buffers| in this case. Returns true on success. |
| + // No validation of media type within the various buffer queues is done here. |
| + // TODO(wolenetz/acolwell): Merge incrementally in parsers to eliminate |
| + // subtle issues with tie-breaking. See http://crbug.com/338484. |
| + static bool MergeBufferQueues(const BufferQueue& audio_buffers, |
| + const BufferQueue& video_buffers, |
| + const TextBufferQueueMap& text_buffers, |
| + BufferQueue* merged_buffers); |
|
xhwang
2014/01/29 08:04:50
put static function before non-static functions.
wolenetz
2014/02/05 02:49:53
Done (actually changed to non-member function per
|
| + |
| private: |
| + // Helper that does the bulk of the overloaded method, above. |
| + static bool MergeBufferQueues(std::vector<const BufferQueue*> buffer_queues, |
|
xhwang
2014/01/29 08:04:50
pass the vector by const-ref?
We usually don't li
wolenetz
2014/02/05 02:49:53
Done and done. And made it a non-member .cc-scoped
|
| + BufferQueue* merged_buffers); |
| + |
| DISALLOW_COPY_AND_ASSIGN(StreamParser); |
| }; |