Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef MEDIA_FILTERS_WEBVTT_UTIL_H_ | |
| 6 #define MEDIA_FILTERS_WEBVTT_UTIL_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 namespace media { | |
| 11 | |
| 12 // Utility function to create side data item for decoder buffer. | |
| 13 template<typename T> | |
| 14 static void MakeSideData(T id_begin, T id_end, | |
| 15 T settings_begin, T settings_end, | |
| 16 std::vector<uint8>* side_data); | |
| 17 | |
| 18 } // namespace media | |
| 19 | |
| 20 template<typename T> | |
|
acolwell GONE FROM CHROMIUM
2013/10/29 21:14:19
nit: Do we really need a template here?
Matthew Heaney (Chromium)
2013/11/05 04:52:40
What is the alternative? In the ffmpeg demuxer ca
| |
| 21 inline void media::MakeSideData( | |
| 22 T id_begin, T id_end, | |
| 23 T settings_begin, T settings_end, | |
| 24 std::vector<uint8>* side_data) { | |
| 25 // The DecoderBuffer only supports a single side data item. In the case of | |
| 26 // a WebVTT cue, we can have potentially two side data items. In order to | |
| 27 // avoid disrupting DecoderBuffer any more than we need to, we copy both | |
| 28 // side data items onto a single one, and terminate each with a NUL marker. | |
| 29 side_data->clear(); | |
| 30 side_data->insert(side_data->end(), id_begin, id_end); | |
| 31 side_data->push_back(0); | |
| 32 side_data->insert(side_data->end(), settings_begin, settings_end); | |
| 33 side_data->push_back(0); | |
| 34 } | |
| 35 | |
| 36 #endif // MEDIA_FILTERS_WEBVTT_UTIL_H_ | |
| OLD | NEW |